spe_mfcio_tag_status_read - Check the completion of DMA requests.
#include <libspe2.h>
int spe_mfcio_tag_status_read(spe_context_ptr_t spe, unsigned int mask, unsigned int behavior, unsigned int *tag_status)
Parameters | |
spe | Specifies the SPE context for which DMA completion status is to be checked. |
mask | Specifies which DMA requests should be taken into account. |
behavior | Specifies the behavior of the operation. |
tag_status | Result: the current tag status for tags specified by mask is returned. |
The spe_mfcio_tag_status_read function is used to check the completion of DMA requests. The optional mask parameter is used to restrict the check to specific tag groups. A mask of value '0' indicates that all current DMA requests should be taken into account. The behavior field specifies completion of any of the members of the specified tag groups, or completion of all members of the specified tag groups.
The non-blocking reading of the tag status by specifying SPE_TAG_IMMEDIATE is especially advantageous when combining with SPE event handling. Note that after receiving a tag group completion event, the tag status has to be read before another DMA is started on the same SPE.
On success, 0 (zero) is returned.
On error, -1 is returned and errno is set to indicate the error.
Possible errors include:
ESRCH | The specified SPE context is invalid. |
ENOTSUP | The usage of a non-zero mask parameter is not supported by this implementation of the library or underlying OS. |
EINVAL | The specified behavior or the specified pointer to a space for the result is invalid. |
The value of the behavior parameter can be one of:
Value | Description |
SPE_TAG_ALL | The function blocks execution until all DMA commands in the tag groups enabled by the mask parameter have no outstanding DMAs in the proxy command queue of the SPE context specified by spe. The masked tag status is returned. |
SPE_TAG_ANY | The function blocks execution until any DMA commands in the tag groups enabled by the mask parameter have no outstanding DMAs in the proxy command queue of the SPE context specified by spe. The masked tag status is returned. |
SPE_TAG_IMMEDIATE | The function returns the tag status for the tag groups specified by the mask parameter for the proxy command queue of the SPE context specified by the spe. |
Value | Description |
0 (zero) | Indicates that all current DMA requests should be taken into account. This takes into account only those DMAs started using libspe library calls, because the library and operating system have no way to know about DMA initiated by applications using direct problem state access. |
A non-zero value | A non-zero value must be specified according to the Cell Broadband Engine Architecture, Version 1.0, section 8.4.3. |