SIO_create
2-390
struct SIO_Attrs { /* stream attributes */
Int nbufs; /* number of buffers */
Int segid; /* buffer segment ID */
size_t align; /* buffer alignment */
Bool flush; /* TRUE->don't block in DEV_idle */
Uns model; /* SIO_STANDARD,SIO_ISSUERECLAIM */
Uns timeout; /* passed to DEV_reclaim */
SIO_Callback *callback;
/* initialize callback in DEV_Obj */
} SIO_Attrs;
❏
nbufs.
Specifies the number of buffers allocated by the stream in the
SIO_STANDARD usage model, or the number of buffers to prepare
for in the SIO_ISSUERECLAIM usage model. The default value of
nbufs is 2. In the SIO_ISSUERECLAIM usage model, nbufs is the
maximum number of buffers that can be outstanding (that is, issued
but not reclaimed) at any point in time.
❏
segid.
Specifies the memory segment for stream buffers. Use the
memory segment names defined in the configuration. The default
value is 0, meaning that buffers are to be allocated from the
"Segment for DSP/BIOS objects" property in the MEM Manager
Properties.
❏
align.
Specifies the memory alignment for stream buffers. The
default value is 0, meaning that no alignment is needed.
❏
flush.
Indicates the desired behavior for an output stream when it is
deleted. If flush is TRUE, a call to SIO_delete causes the stream to
discard all pending data and return without blocking. If flush is
FALSE, a call to SIO_delete causes the stream to block until all
pending data has been processed. The default value is FALSE.
❏
model.
Indicates the usage model that is to be used with this stream.
The two usage models are SIO_ISSUERECLAIM and
SIO_STANDARD. The default usage model is SIO_STANDARD.
❏
timeout.
Specifies the length of time the device driver waits for I/O
completion before returning an error (for example,
SYS_ETIMEOUT). timeout is usually passed as a parameter to
SEM_pend by the device driver. The default is SYS_FOREVER
which indicates that the driver waits forever. If timeout is
SYS_FOREVER, the task remains suspended until a buffer is
available to be returned by the stream. The timeout attribute applies
to the I/O operations SIO_get, SIO_put, and SIO_reclaim. If timeout
is 0, the I/O operation returns immediately. If the timeout expires
before a buffer is available to be returned, the I/O operation returns
the value of (-1 * SYS_ETIMEOUT). Otherwise the I/O operation
returns the number of valid MADUs in the buffer, or -1 multiplied by
an error code.