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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.3. TASK EXCEPTION HANDLING FUNCTIONS 73<br />

tk ras tex<br />

Raise Task Exception<br />

[C Language Interface]<br />

ER ercd = tk_ras_tex ( ID tskid, INT texcd ) ;<br />

[Parameters]<br />

ID tskid Task ID<br />

INT texcd Task exception code (0 to 31)<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 PAR<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 or no task exception<br />

handler is defined)<br />

Invalid object state (called for a task in DORMANT state)<br />

Parameter error (texcd is invalid or cannot be used)<br />

Context error (issued from task-independent portion or in dispatch disabled state)<br />

[Description]<br />

Raises the task exception designated in texcd for the task designated in tskid.<br />

If a task exception handler is already running in the task designated in tskid, the newly raised task<br />

exception is made pending. If an exception is pending, a break function is not executed even if the<br />

target task is executing an extended SVC. In the case of texcd = 0, however, exceptions are not made<br />

pending even if the target task is executing an exception handler. If the target task is running a task<br />

exception handler for an exception of task exception codes 1 to 31, the task exception is accepted; and if<br />

an extended SVC is executing, a break function is called. If the target task is running a task exception<br />

handler for an exception of task exception code 0, task exceptions are ignored.<br />

The invoking task can be designated by setting tskid = TSK SELF = 0.<br />

If this system call is issued from a task-independent portion, error code E CTX is returned.<br />

[Additional Notes]<br />

If the target task is executing an extended SVC, the break handler or the extended SVC runs in the<br />

context that called tk ras tex. In such a case tk ras tex does not return control until the break<br />

function processing ends. Task exceptions raised in the task that called tk ras tex while the break<br />

function is running are held until the break function ends.<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!