06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ev_send pSOS+ <strong>System</strong> <strong>Calls</strong><br />

ev_send Sends events to a task.<br />

#include <br />

unsigned long ev_send(<br />

unsigned long tid, /* target task identifier */<br />

unsigned long events /* bit-encoded events */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

This system call sends events to a task. If the target task is not waiting for events,<br />

the newly sent events are simply made pending. If the task is waiting for events, and<br />

the wait condition is fully satisfied as a result of the new events, then the task is<br />

unblocked and readied for execution. Otherwise, the task continues to wait. In<br />

either case, any of the events sent that do not match those waited on are always left<br />

pending.<br />

Each task has 32 events, which are encoded bit-wise in a single long word. Bits 31<br />

through 16 are for internal system use, and bits 15 through 0 are for user-specific<br />

purposes. ev_send() can send up to 32 different events at one time.<br />

Events are neither queued nor counted. For example, if three identical events are<br />

sent to a task before it issues a wait for that event, the three events have the same<br />

effect as one event.<br />

tid Specifies the task identifier of the target task.<br />

events Contains a list of bit-encoded events.<br />

This system call returns 0 on success, or an error code on failure.<br />

1-30 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!