Specifications
Software Interface 39
3.3.1.1 Buffer Structure
Figure 3-3 shows the structure of each buffer in the command and
message rings.
Figure 3–3 Buffer Structure
Flag
The flag field in the buffer determines whether the sender or the receiver
owns the buffer. When the host initializes the shared memory, all of the
buffers are marked as owned by the sender. A sender passes data to a
receiver as follows:
1. Waits until enough buffers are available to send the data, starting
with the buffer at the load pointer.
2. Copies data into the data area of the buffers.
3. Sets the used field in the buffers.
4. Changes ownership of the buffers to the receiver by changing the
owner bit in the flag field. The sender should change ownership of
the buffers in last-to-first order. (The last buffer to change ownership
should be the buffer at the load pointer.)
The receiver gets the data from the sender as follows:
1. Waits until the owner bit in the flag field at the unload pointer
indicates receiver ownership.
2. Copies the data out of the data area of the buffers.
3. Returns ownership of the buffers to the sender by changing the owner
bit in the flag field. The receiver should change ownership of the
buffers in last-to-first order.