Re: fcp handling
Brought to you by:
aeb,
bencollins
From: Andreas B. <and...@mu...> - 2000-04-11 00:10:10
|
On Wed, Apr 05, 2000 at 06:40:59PM +0200, Manfred Weihs wrote: > Andreas Bombe wrote: > > [concerning the buffers which are handed over to the iso- or fcp-handlers] > > The buffer is only overwritten on a raw1394_loop_iterate() call which > > then calls the handlers. After a handler ends, the corresponding data > > is invalid (the handler must process the data immediately or save it > > somewhere else if it really has to store plain data). Therefore there > > won't be problems with correct usage. > > Is the data really invalid, when the handler ends, or does it stay valid > until the next call of raw1394_loop_iterate()? Currently it stays valid for that time. > Imagine an application > which processes data that arrives on an isochannel; and everytime, when > its buffer is empty, it does (one or more) raw1394_loop_iterate() until > the iso_handler is executed. Does the handler really have to copy the > data to a separate buffer, or would it be sufficient to store the > address of the (internal) buffer in a (global) variable? The premise is > - of course - that raw1394_loop_iterates (on that particular raw-handle) > is only done, when we need a new iso-packet. Hm, probably. But my original idea was that the handler directly processes the data (and therefore creates processed data at another place anyway). > > In the future the address given to an iso or FCP handler might not > > even exist anymore since I intend to implement kernel-to-user memory > > mapping at some point in the future and the page containing the data > > could be unmapped immediately after use. > > I think, that has no effet to my question above, isn't it? Instead of overwriting the buffer the buffer pointed to will be either replaced with another page or unmapped entirely (giving a segfault if it is accessed). This unmapping or replacing wouldn't happen until the next iterate call, probably, saving a syscall after the handler finished. OTOH the page containing the data could be physically locked down for a long time then if the app doesn't do iterate calls often enough. I'm not yet decided, but I think it could make some sense to have data valid until the next iterate call. -- Andreas E. Bombe <and...@mu...> DSA key 0x04880A44 http://home.pages.de/~andreas.bombe/ http://linux1394.sourceforge.net/ |