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.

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

t_getreg Gets a task’s notepad register.<br />

#include <br />

unsigned long t_getreg(<br />

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

unsigned long regnum, /* register number */<br />

unsigned long *reg_value /* register contents */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

This system call enables the caller to obtain the contents of a task's notepad<br />

register. Each task has 16 such software registers, held in the task's TCB. The<br />

purpose of these registers is to furnish every task with a set of named, permanent<br />

variables. Eight of these registers are reserved for system use. Eight are free to be<br />

used for application specific purposes.<br />

tid Specifies the task ID of the task whose notepad register will<br />

be read. If tid equals 0, then the calling task reads its own<br />

notepad register.<br />

regnum Specifies the register number. Registers numbered 0<br />

through 7 are for application use, and registers 8 through 15<br />

are reserved for system purposes.<br />

reg_value Points to the variable where t_getreg() stores the<br />

register’s contents.<br />

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

Hex Mnemonic Description<br />

0x05 ERR_OBJDEL Task has been deleted.<br />

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

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

1

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

Saved successfully!

Ooh no, something went wrong!