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_create pSOS+ <strong>System</strong> <strong>Calls</strong><br />

Target<br />

flags Specifies the task’s attributes. flags is formed by OR-ing the<br />

following symbolic constants (one from each pair), which are defined<br />

in . For instance, to specify that a task is global, you place<br />

the symbolic constant T_GLOBAL in flags. To specify that the task is<br />

global and uses the FPU processor, you place both T_GLOBAL and<br />

T_FPU in flags, using the following syntax:<br />

T_GLOBAL | T_FPU<br />

T_GLOBAL /<br />

T_LOCAL<br />

T_FPU /<br />

T_NOFPU<br />

Using sstack and ustack<br />

Makes the task global: external tasks on other nodes<br />

can address it / restricts the task to the local node.<br />

The T_GLOBAL attribute is ignored by the singleprocessor<br />

kernel.<br />

Informs the pSOS+ kernel that the task uses /does<br />

not use the FPU coprocessor (see “Using the T_FPU<br />

Flag” under “Target.”)<br />

tid Points to the variable where t_create() stores the task ID assigned<br />

to the task.<br />

On most processors, a task can execute only in supervisor mode. Thus, a task can<br />

have only a supervisor stack. On these processors ustack is added to sstack to<br />

create a supervisor stack of the combined sizes. Exceptions to this usage are shown<br />

below.<br />

68K<br />

CF<br />

PPC<br />

On 68K processors, a task can execute in either user mode or supervisor<br />

mode. A user stack is not needed if the task never executes in the user<br />

mode, in which case ustack should be set to 0. If the task starts in the<br />

user mode, then ustack must be greater than 20 bytes. The supervisor/<br />

user mode is set in the t_start() system call.<br />

On ColdFire and PowerPC processors, a task can execute in either user<br />

mode or supervisor mode, but there are not separately defined stacks<br />

depending on this mode. t_create() simply adds sstack and ustack<br />

together and allocates a stack of that resultant size.<br />

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