30.12.2013 Views

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

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.

46 CHAPTER 4. T-KERNEL/OS FUNCTIONS<br />

tk set reg<br />

Set Task Registers<br />

[C Language Interface]<br />

ER ercd = tk_set_reg ( ID tskid, T_REGS *pk_regs, T_EIT *pk_eit, T_CREGS *pk_cregs ) ;<br />

[Parameters]<br />

ID tskid Task ID<br />

T REGS pk regs General registers<br />

T EIT pk eit Registers saved when EIT occurs<br />

T CREGS pk cregs Control registers<br />

The contents of T REGS, T EIT, and T CREGS are defined for each CPU and implementation.<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

E OBJ<br />

E CTX<br />

E PAR<br />

Normal completion<br />

Invalid ID number (tskid is invalid or cannot be used)<br />

Object does not exist (the task designated in tskid does not exist)<br />

Invalid object state (called for the invoking task)<br />

Context error (called from task-independent portion)<br />

Invalid register value (implementation-dependent)<br />

[Description]<br />

Sets the current register contents of the task designated in tskid.<br />

If NULL is set in pk regs, pk eit, or pk cregs, the corresponding registers are not referenced.<br />

The set register values are not necessarily the values while the task portion is executing. The OS is not<br />

aware of the effects of register value changes. It is possible, however, that some registers or register bits<br />

cannot be changed if the OS does not allow such changes (implementation-dependent).<br />

If this system call is issued for the invoking task, error code E OBJ is returned.<br />

Copyright c○ 2002, 2003 by T-Engine Forum<br />

T-<strong>Kernel</strong> <strong>1.B0.02</strong>

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

Saved successfully!

Ooh no, something went wrong!