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.

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

tk end tex<br />

End Task Exception Handler<br />

[C Language Interface]<br />

INT texcd = tk_end_tex ( BOOL enatex ) ;<br />

[Parameters]<br />

BOOL enatex Task exception handler calling enabled flag<br />

[Return Parameters]<br />

INT texcd Raised exception code<br />

or Error Code<br />

[Error Codes]<br />

E OK Normal completion<br />

E CTX Context error (called for other than a task exception handler or task exception code 0<br />

(detection is implementation-dependent))<br />

[Description]<br />

Ends a task exception handler and enables the new task exception handler. If there are pending task<br />

exceptions, the highest-priority task exception code among them is passed in the return code. If there<br />

are no pending task exceptions, 0 is returned.<br />

If enatex = FALSE and there are pending task exception, calling the new task exception handler is not<br />

allowed. In this case, the exception handler designated in return code texcd is in running state upon<br />

return from tk end tex. If there are no pending task exceptions, calling the new task exception handler<br />

is allowed.<br />

If enatex = TRUE, calling the new task exception handler is allowed regardless of whether there are<br />

pending task exceptions. Even if there are pending task exceptions, the task exception handler is in<br />

terminated status.<br />

There is no way of ending a task exception handler other than by calling tk end tex. A task exception<br />

handler continues executing from the time it is started until tk end tex is called. Even if return is<br />

made from a task exception handler without calling tk end tex, the task exception handler will still be<br />

running at the point of return. Similarly, even if longjmp is used to get out of a task exception handler<br />

without calling tk end tex, the task exception handler will still be running at the jump destination.<br />

Calling tk end tex while task exceptions are pending results in a new task exception being accepted.<br />

At this time even when tk end tex is called from an extended SVC handler, a break function cannot be<br />

called for that extended SVC handler. If extended SVC calls are nested, then when the extended SVC<br />

nesting goes down one level, the break function corresponding to the extended SVC return destination<br />

can be called. Calling of a task exception handler takes place upon return to the task portion. The<br />

tk end tex system call cannot be issued in the case of task exception code 0, since the task exception<br />

handler cannot be ended. The behavior when tk end tex is called for a handler of task exception code<br />

0 is undefined (implementation-dependent).<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!