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.

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

as_return Returns from an asynchronous signal routine (ASR).<br />

#include <br />

unsigned long as_return();<br />

Description<br />

Target<br />

This system call must be used by a task's ASR to exit and return to the original flow<br />

of execution of the task. The purpose of this call is to enable the pSOS+ kernel to<br />

restore the task to its state before the ASR. as_return() cannot be called except<br />

from an ASR.<br />

This call is analogous to the i_return() call, which enables an Interrupt Service<br />

Routine (ISR) to return to the interrupted flow of execution properly.<br />

Restoring CPU Registers<br />

An ASR is responsible for restoring CPU registers to their previous state before<br />

exiting via as_return(). The exact way in which this happens varies from<br />

processor to processor. On most processors, the ASR is written in assembly<br />

language, so you the programmer must take care to restore the registers. On<br />

PowerPC processors, an ASR can be written in C, and the pSOS+ kernel restores the<br />

registers. Processor-specific information on restoring registers prior to<br />

as_return() is provided below:<br />

68K<br />

960<br />

x86<br />

On 68K processors, an ASR is responsible for saving and restoring all<br />

CPU registers it uses, including stack pointers. The one exception to<br />

this rule is the register D0.L, which is restored by the pSOS+ kernel. On<br />

68K processors, an ASR can be written only in assembly language.<br />

On 960 processors, an ASR is responsible for saving and restoring all<br />

CPU registers it uses, including stack pointers. The one exception to<br />

this rule is the register g0, which is restored by the pSOS+ kernel. On<br />

960 processors, an ASR can be written only in assembly language.<br />

On x86 processors, an ASR is responsible for saving and restoring all<br />

CPU registers it uses, including stack pointers. The one exception to<br />

this rule is the register EAX, which is restored by the pSOS+ kernel. On<br />

x86 processors, an ASR can be written only in assembly language.<br />

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

1

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

Saved successfully!

Ooh no, something went wrong!