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

t_create Creates a task.<br />

#include <br />

unsigned long t_create(<br />

char name[4], /* task name */<br />

unsigned long prio, /* task priority */<br />

unsigned long sstack, /* task supervisor stack size */<br />

unsigned long ustack, /* task user stack size */<br />

unsigned long flags, /* task attributes */<br />

unsigned long *tid /* task identifier */<br />

)<br />

Description<br />

Arguments<br />

This service call enables a task to create a new task. t_create() allocates to the<br />

new task a Task Control Block (TCB) and a memory segment for its stack(s). The<br />

task stack sizes and scheduling priority are established with this call. t_create()<br />

leaves the new task in a dormant state; the t_start() call must be used to place<br />

the task into the ready state for execution.<br />

name Specifies the user-assigned name of the task.<br />

prio Specifies the task's initial priority within the range 1 - 239, with 239<br />

the highest and 1 the lowest.<br />

Priority level 0 is reserved for the pSOS+ daemon task IDLE. Priority<br />

levels 240 - 255 are reserved for a variety of high priority <strong>pSO<strong>System</strong></strong><br />

daemon tasks. While t_create() will allow creation of a task at<br />

these priorities, there should never be a need to do so.<br />

sstack Specifies the task's supervisor stack size in bytes (see “Supervisor<br />

Stack Size” under “Target.”) t_create() internally calls<br />

rn_getseg() to allocate a segment from Region 0 to hold the task’s<br />

stack and the user stack, if any.<br />

ustack Specifies the task's user stack. ustack may be 0 if the task executes<br />

only in supervisor mode (see “Using sstack and ustack” under<br />

“Target”).<br />

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

1

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

Saved successfully!

Ooh no, something went wrong!