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.

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

Target<br />

Startup Values<br />

At the start of the task, the CPU registers and the stack are initialized in such a way<br />

that if the outermost function of the task exits by mistake, an illegal error address<br />

results. The contents of the original registers and stack are platform-specific:<br />

960<br />

PPC<br />

ARM<br />

x86<br />

Return Value<br />

On 960 processors, the return address (RIP) on the stack is<br />

0xDEADDEAD.<br />

On PowerPC and ARM processors, the return address in register LR is<br />

0xDEADDEAD.<br />

On x86 processors, the return address on the stack is 0xFFFFFFFF.<br />

A restarted task can receive up to four long words of input arguments. To facilitate<br />

retrieval of these arguments, they are passed to the task as if it is invoked as a highlevel<br />

language procedure or function. For example, if a C task nice has three input<br />

arguments, it can be declared as follows:<br />

nice (unsigned long a, unsigned long b, unsigned long c);<br />

where targs[0]is passed to a, targs[1]to b, and targs[2] to c. In this case,<br />

targs[3]is irrelevant and does not need the calling task to load it.<br />

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

1-150 <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!