spe_event_wait

NAME

spe_event_wait - Wait for SPE events.

SYNOPSIS

#include <libspe2.h>

int spe_event_wait(spe_event_handler_ptr_t evhandler, spe_event_unit_t *events, int max_events, int timeout);

evhandler A valid pointer to the SPE event handler.
events The pointer to the memory area where the events will be stored. The 'events' member will contain the event bit field indicating the actual event received, and the 'spe' member will contain pointer to the SPE context that generated the event.

For the specification of spe_event_unit_t, see spe_event_handler_register.

max_events Maximum number of 'events' to receive. The call will return if at least one event has been received or if it times out.
timeout Timeout in milliseconds. -1 means 'infinite'. 0 means that the call should not wait but return immediately with as many events as are currently available up to a maximum of max_events.

RETURN VALUE

On success, the number of SPE events received. If 0 (zero) is returned, no SPE event was received because the request timed out.

EXIT STATUS

On error, -1 is returned and errno is set to indicate the error.

Possible errors include:

ESRCH The specified SPE event handler is invalid.
EINVAL Error in parameters.
EFAULT A runtime error of the underlying OS service occurred.

SEE ALSO

spe_event_handler_register(3); spe_event_handler_deregister(3); spe_out_intr_mbox_read(3); spe_out_intr_mbox_status(3); spe_in_mbox_write(3); spe_mfcio_tag_status_read(3); spe_stop_info_read(3)