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

t_setpri Gets and optionally changes a task’s priority.<br />

#include <br />

unsigned long t_setpri(<br />

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

unsigned long newprio, /* new priority */<br />

unsigned long *oldprio /* previous priority */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

This system call enables the calling task to obtain and optionally modify either its<br />

own or another task's scheduling (software) priority. The previous priority is<br />

returned.<br />

tid Specifies the selected task for the priority change. If tid<br />

equals 0, the calling task is the target.<br />

newprio Specifies the task's new priority. newprio must be between<br />

0 and 255 (see Note 3). If newprio is 0, the task's priority is<br />

not changed. This allows a read of a task's priority without<br />

changing its priority.<br />

oldprio Points to the variable where t_setpri() stores the task’s<br />

previous priority.<br />

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

Hex Mnemonic Description<br />

0x05 ERR_OBJDEL The task was already deleted.<br />

0x06 ERR_OBJID tid is incorrect: failed validity check.<br />

0x07 ERR_OBJTYPE Object type doesn’t match object ID;<br />

failed validity check.<br />

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