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.

4.1. TASK MANAGEMENT FUNCTIONS 45<br />

tk get reg<br />

Get Task Registers<br />

[C Language Interface]<br />

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

[Parameters]<br />

ID tskid Task ID<br />

[Return Parameters]<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 />

ER ercd Error code<br />

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

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

E OBJ<br />

E CTX<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 />

[Description]<br />

Gets 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 referenced register values are not necessarily the values at the time the task portion was executing.<br />

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

[Additional Notes]<br />

In principle, all registers in the task context can be referenced. This includes not only physical CPU<br />

registers but also those treated by the OS as virtual registers.<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!