Dxx_ready
Application Program Interface
2-77
Important Note:
This API will no longer be supported in the next major
release of DSP/BIOS. We recommend that you use the IOM driver
interface instead. See the
DSP/BIOS Driver Developer’s Guide
(SPRU616). This API is still supported in DSP/BIOS 5.32 and will be
supported in any patch releases or minor enhancements to DSP/BIOS
5.32.
C Interface
Syntax
status = Dxx_ready(device, sem);
Parameters
DEV_Handle device;
/* device handle */
SEM_Handle sem;
/* semaphore to post when ready */
Return Value
Bool
status;
/* TRUE if device is ready */
Description
Dxx_ready is called by SIO_select and SIO_ready to determine if the
device is ready for an I/O operation. In this context, ready means a call
that retrieves a buffer from a device does not block. If a frame exists,
Dxx_ready returns TRUE, indicating that the next SIO_get, SIO_put, or
SIO_reclaim operation on the device does not cause the calling task to
block. If there are no frames available, Dxx_ready returns FALSE. This
informs the calling task that a call to SIO_get, SIO_put, or SIO_reclaim
for that device would result in blocking.
Dxx_ready registers the device’s ready semaphore with the SIO_select
semaphore sem. In cases where SIO_select calls Dxx_ready for each of
several devices, each device registers its own ready semaphore with the
unique SIO_select semaphore. The first device that becomes ready calls
SEM_post on the semaphore.
SIO_select calls Dxx_ready twice; the second time, sem = NULL. This
results in each device’s ready semaphore being set to NULL. This
information is needed by the Dxx HWI that normally calls SEM_post on
the device’s ready semaphore when I/O is completed; if the device ready
semaphore is NULL, the semaphore should not be posted.
SIO_ready calls Dxx_ready with sem = NULL. This is equivalent to the
second Dxx_ready call made by SIO_select, and the underlying device
driver should just return status without registering a semaphore.
See Also
Dxx_ready
Check if device is ready for I/O