06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

as_send Sends asynchronous signals to a task.<br />

#include <br />

unsigned long as_send(<br />

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

unsigned long signals /* bit-encoded signal list */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

This system call sends asynchronous signals to a task. The purpose of these signals<br />

is to force a task to break from its normal flow of execution and execute its<br />

Asynchronous Signal Routine (ASR).<br />

Asynchronous signals are like software interrupts, with ASRs taking on the role of<br />

ISRs. Unlike an interrupt, which is serviced almost immediately, an asynchronous<br />

signal does not immediately affect the state of the task. An as_send() call is<br />

serviced only when the task is next dispatched to run (and that depends on the<br />

state of the task and its priority).<br />

Each task has 32 signals. These signals are encoded bit-wise in a single long word.<br />

Bits 31 through 16 are reserved for internal system use, and bits 15 through 0 are<br />

available for user-specific purposes.<br />

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

signals are sent to a task before its ASR has a chance to execute, the three signals<br />

have the same effect as one.<br />

tid Specifies the task to receive the signals.<br />

signals Contains the bit-encoded signals.<br />

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

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 1-9<br />

1

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

Saved successfully!

Ooh no, something went wrong!