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.

280 CHAPTER 6. T-KERNEL/DS FUNCTIONS<br />

td hoc int<br />

Define Interrupt Handler Hook Routine<br />

[C Language Interface]<br />

ER ercd = td_hok_int ( TD_HINT *hint ) ;<br />

[Parameters]<br />

TD HINT hint Hook routine definition information<br />

hint detail:<br />

FP enter Hook routine before calling handler<br />

FP leave Hook routine after calling handler<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Description]<br />

Sets hook routines before and after an interrupt handler is called. Hook routine setting cannot be done<br />

independently for different exception or interrupt factors. One pair of hook routines is set in common<br />

for all exception and interrupt factors.<br />

Setting hint to NULL cancels the hook routines.<br />

The hook routines are called as task-independent portion (part of the interrupt handler). Accordingly,<br />

the hook routines can call only those system calls that can be invoked from a task-independent portion.<br />

Note that hook routines can be set only for interrupt handlers defined by tk def int with the TA HLNG<br />

attribute. A TA ASM attribute interrupt handler cannot be hooked by a hook routine. Hooking of a<br />

TA ASM attribute interrupt handler is possible only by directly manipulating the exception/interrupt<br />

vector table. The actual methods are implementation-dependent.<br />

void enter( UINT dintno )<br />

void leave( UINT dintno )<br />

dintno Interrupt definition number<br />

The parameters passed to enter() and leave() are the same as those passed to the exception/interrupt<br />

handler. Depending on the implementation, information other than dintno may also be passed. A hook<br />

routine is called as follows from a high-level language support routine.<br />

enter(dintno);<br />

inthdr(dintno); /* exception/interrupt handler */<br />

leave(dintno);<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!