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> i_return<br />

i_return Provides an exit from an interrupt service routine.<br />

This call accepts no parameters and cannot be called from a high-level language.<br />

Description<br />

Target<br />

This pSOS+ service entry provides and establishes a standard exit convention for all<br />

Interrupt Service Routines (ISRs). It is available for all processors supported by<br />

<strong>pSO<strong>System</strong></strong>. For efficiency reasons, i_return() is different from other system calls<br />

in that it uses a separate, private entry into the pSOS+ kernel. The method of<br />

executing an i_return() depends on the processor and is explained in “Method of<br />

Executing an i_return()” under “Target.”<br />

The i_return() call is used to integrate ISR level processing within pSOS+. The<br />

i_return() call detects when all nested ISRs have exited and control is about to be<br />

passed back to task level execution. At this transition point, it assesses any task<br />

execution state changes that may have taken place during ISR processing, and then<br />

passes control to the appropriate task.<br />

Any ISR that makes system calls that may affect the ready state of a task, must<br />

conclude with an i_return() system call. For those processors which supply an<br />

i_enter() call, i_return() should precede the pSOS+ service calls. Any ISR<br />

which contains an i_enter() must conclude with an i_return(). i_return()<br />

does not accept any input parameters, and it never returns to the caller.<br />

Before it exits, an ISR must restore CPU registers to their state prior to the<br />

interrupt. Processor-specific code examples of ISRs are provided in “Restoring CPU<br />

Registers Prior to Exiting the ISR” under “Target.”<br />

Method of Executing an i_return()<br />

The method of executing an i_return() is processor-specific:<br />

PPC<br />

960<br />

On PowerPC processors, i_return()’s entry point is located at offset<br />

0x58 from the beginning of the pSOS+ kernel code. It is executed by<br />

either a branch (b) or call (bl) instruction.<br />

On 960 processors, i_return() is executed by a calls 13 instruction.<br />

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

1

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

Saved successfully!

Ooh no, something went wrong!