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 33<br />

tk ext tsk<br />

Exit Task<br />

[C Language Interface]<br />

void tk_ext_tsk ( ) ;<br />

[Parameters]<br />

None<br />

[Return Parameters]<br />

Does not return to the context issuing the system call.<br />

[Error Codes]<br />

The following error can be detected; but since this system call does not return to the context issuing<br />

the system call even when error is detected, an error code cannot be passed directly in a system call<br />

return parameter. The behavior in case an error occurs is implementation-dependent.<br />

E CTX<br />

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

[Description]<br />

Exits the invoking task normally and changes its state to DORMANT state.<br />

[Additional Notes]<br />

When a task terminates by tk ext tsk, the resources acquired by the task up to that time (memory<br />

blocks, semaphores, etc.) are not automatically freed. The user is responsible for releasing such resources<br />

before the task exits.<br />

tk ext tsk is a system call that does not return to the context from which it was called. Even if an<br />

error code is returned when an error of some kind is detected, normally no error checking is performed<br />

in the context from which the system call was invoked, leaving the possibility that the program will<br />

hang. For this reason these system calls do not return even if error is detected.<br />

As a rule, the task priority and other information included in the TCB is reset when the task returns<br />

to DORMANT state. If, for example, the task priority is changed by tk chg pri and later terminated<br />

by tk ext tsk, the task priority reverts to the startup priority (itskpri) designated when the task was<br />

started. It does not keep the task priority in effect at the time tk ext tsk was executed.<br />

System calls that do not return to the calling context are those named tk ret ??? or tk ext ???<br />

(tk exd ???).<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!