Texas Instruments TMS320 User Manual page 275

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Device Ready
SIO_select makes two calls to Dxx_ready for each Dxx device. The first call
is used to register sem with the device, and the second call (with sem =
NULL) is used to un-register sem.
Each Dxx_ready function holds on to sem in its device-specific object (for
example, objptr->ready = sem). When an I/O operation completes (that is, a
buffer has been filled or emptied), and objptr->ready is not NULL, SEM_post
is called to post objptr->ready.
If at least one device is ready, or if SIO_select was called with timeout equal
to 0, SIO_select does not block; otherwise, SIO_select pends on the ready
semaphore until at least one device is ready, or until the time-out has expired.
Consider the case where a device becomes ready before a time-out occurs.
The ready semaphore is posted by whichever device becomes ready first.
SIO_select then calls Dxx_ready again for each device, this time with sem =
NULL. This has two effects. First, any additional Dxx device that becomes
ready will not post the ready semaphore. This prevents devices from posting
to a semaphore that no longer exists, since the ready semaphore is
maintained in the local memory of SIO_select. Second, by polling each
device a second time, SIO_select can determine which devices have become
ready since the first call to Dxx_ready, and set the corresponding bits for
those devices in the ready mask.
Streaming I/O and Device Drivers
7-45

Advertisement

Table of Contents
loading

Table of Contents