Texas Instruments TMS320 User Manual page 238

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

Advertisement

Stream I/O—Reading and Writing Streams
Example 7-4. Implementing the Issue/Reclaim Streaming Model
7.3.1
Buffer Exchange
7-8
Int SIO_issue(stream, pbuf, nbytes, arg)
SIO_Handle
Ptr
Uns
Arg
Int SIO_reclaim(stream, bufp, parg)
SIO_Handle
Ptr
Arg
If no buffer is available, the stream will block the task until the buffer becomes
available or the stream's timeout has elapsed.
At a basic level, the most obvious difference between the standard and
Issue/Reclaim models is that the Issue/Reclaim model separates the
notification of a buffer's arrival (SIO_issue) and the waiting for a buffer to
become available (SIO_reclaim). So, an SIO_issue/SIO_reclaim pair
provides the same buffer exchange as calling SIO_get or SIO_put.
The Issue/Reclaim streaming model provides greater flexibility by allowing
the stream client to control the number of outstanding buffers at runtime. A
client can send multiple buffers to a stream, without blocking, by using
SIO_issue. The buffers are returned, at the client's request, by calling
SIO_reclaim. This allows the client to choose how deep to buffer a device and
when to block and wait for a buffer.
The Issue/Reclaim streaming model also provides greater determinism in
buffer management by guaranteeing that the client's buffers are returned in
the order that they were issued. This allows a client to use memory from any
source for streaming. For example, if a DSP/BIOS task receives a large
buffer, that task can pass the buffer to the stream in small pieces—simply by
advancing a pointer through the larger buffer and calling SIO_issue for each
piece. This works because each piece of the buffer is guaranteed to come
back in the same order it was sent.
An important part of the streaming model in DSP/BIOS is buffer exchange. To
provide efficient I/O operations with a low amount of overhead, DSP/BIOS
avoids copying data from one place to another during certain I/O operations.
Instead, DSP/BIOS uses SIO_get, SIO_put, SIO_issue, and SIO_reclaim to
move buffer pointers to and from the device. Figure 7-3 shows a conceptual
view of how SIO_get works.
stream;
pbuf;
nbytes;
arg;
stream;
*bufp;
*parg;

Advertisement

Table of Contents
loading

Table of Contents