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.

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

Return Value<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 />

User and Supervisor Modes<br />

You use the symbolic constants T_USER and T_SUPV on each processor as follows:<br />

960<br />

x86<br />

Interrupt Control<br />

On 960 and x86 processors, a task can execute only in supervisor<br />

mode. In , for these processors, the symbols T_SUPV and<br />

T_USER are defined as:<br />

#define T_SUPV 0<br />

#define T_USER 0<br />

for the sole purpose of compatibility with platforms that support both<br />

user and supervisor modes.<br />

Interrupt control means that while a task is executing, hardware interrupts are<br />

disabled. On some processors, you can disable all interrupts at or below a certain<br />

interrupt level and enable all interrupts above that level. On other processors you<br />

can simply specify that all interrupts are either enabled or disabled. Details are<br />

provided below:<br />

PPC<br />

x86<br />

MIPS<br />

ARM<br />

On PowerPC, x86, MIPS, and ARM processors, you can simply enable or<br />

disable all hardware interrupts. You do this by placing either T_ISR or<br />

T_NOISR in the mode argument.<br />

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

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