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.

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

tk def tex<br />

Define Task Exception Handler<br />

[C Language Interface]<br />

ER ercd = tk_def_tex ( ID tskid, T_DTEX *pk_dtex ) ;<br />

[Parameters]<br />

ID tskid Task ID<br />

T DTEX* pk dtex Task exception handler definition information<br />

pk dtex detail:<br />

ATR texatr Task exception handler attributes<br />

FP texhdr Task exception handler address<br />

(Other implementation-dependent parameters may be added beyond this point.)<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK<br />

E NOMEM<br />

E ID<br />

E NOEXS<br />

E OBJ<br />

E RSATR<br />

E PAR<br />

Normal completion<br />

Insufficient memory (memory for control block cannot be allocated)<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 (the task designated in tskid runs at protection level 0 (TA RNG0))<br />

Reserved attribute (texatr is invalid or cannot be used)<br />

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

[Description]<br />

Defines a task exception handler for the task designated in tskid. Only one task exception handler can<br />

be defined per task; if one is already defined, the last-defined handler is valid. Setting pk dtex = NULL<br />

cancels a definition.<br />

Defining or canceling a task exception handler clears pending task exception requests and disables all<br />

task exceptions.<br />

The parameter texatr indicates system attributes in is low bits and implementation-dependent attributes<br />

in its high bits. The texatr system attributes are not assigned in the present version, and<br />

system attributes are not used.<br />

A task exception handler takes the following form.<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!