Coma FW-C2800 User's Guide Page 258

  • Download
  • Add to my manuals
  • Print
  • Page
    / 276
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 257
Real-Time I/O
Streaming I/O and Device Drivers 7-39
Note that objptr->sync is a counting semaphore and that tasks do not always
block here. The value of objptr->sync represents the number of available
frames on the fromdevice queue.
7.13.2 DEV_ISSUERECLAIM Streaming Model
In the DEV_ISSUERECLAIM streaming model, SIO_issue is used to send
buffers to a stream. To accomplish this, SIO_issue first places the frame on
the device->todevice queue. It then calls Dxx_issue which starts the I/O and
returns.
Dxx_issue calls a low-level hardware function to initialize I/O.
SIO_reclaim is used to retrieve buffers from the stream. This is done by
calling Dxx_reclaim, which blocks until a frame is available on the
device->fromdevice queue. This blocking is accomplished by calling
SEM_pend on the device semaphore objptr->sync, just as for Dxx_issue.
When the device HWI (ISR in Figure 7-10 and Figure 7-11) posts to
objptr->sync, Dxx_reclaim is unblocked, and returns to SIO_reclaim.
SIO_reclaim then gets the frame from the device->fromdevice queue and
returns the buffer. This sequence is shown in Figure 7-10 and Figure 7-11.
Figure 7-10. Placing a Data Buffer to a Stream
Figure 7-11. Retrieving Buffers from a Stream
SIO_issue(outstream,bufp,nbytes,arg)
SIO_reclaim(outstream,&bufp,parg,timeout)
1) Put full bufp on
todevice queue
2) Call Dxx_issue()
1) Call Dxx_reclaim()
2) Get empty bufp from
fromdevice queue
1) Get next buffer from todevice
queue and make "visible" to ISR,
2) If first "issue," enable interrupts
Pend on semaphore until anempty
buffer is available on fromdevice
queue
Application
SIO_module
Dxx_module
SIO_issue(outstream,bufp,nbytes,arg)
SIO_reclaim(outstream,&bufp,parg,timeout)
1) Put empty bufp on
todevice queue
2) Call Dxx_issue()
1) Call Dxx_reclaim()
2) Get full bufp from
fromdevice queue
1) Get next buffer from todevice
queue and make "visible" to ISR,
2) If first "issue," enable interrupts
Pend on semaphore until a full
buffer is available on fromdevice
queue
Application SIO_module
Dxx_module
Page view 257
1 2 ... 253 254 255 256 257 258 259 260 261 262 263 ... 275 276

Comments to this Manuals

No comments