td_hoc_int

De.ne Interrupt Handler Hook Routine

[C Language Interface]

ER ercd = td_hok_int ( TD_HINT *hint ) ;

[Parameters]

TD_HINT hint Hook routine definition information

hint detail:

FP enter Hook routine before calling handler

FP leave Hook routine after calling handler

[Return Parameters]

ER ercd Error code

[Description]

Sets hook routines before and after an interrupt handler is called. Hook routine setting cannot be done independently for di.erent exception or interrupt factors. One pair of hook routines is set in common for all exception and interrupt factors.

Setting hint to NULL cancels the hook routines.

The hook routines are called as task-independent portion (part of the interrupt handler). Accordingly, the hook routines can call only those system calls that can be invoked from a task-independent portion.

Note that hook routines can be set only for interrupt handlers defined by tk_def_int with the TA_HLNG attribute. A TA_ASM attribute interrupt handler cannot be hooked by a hook routine. Hooking of a TA_ASM attribute interrupt handler is possible only by directly manipulating the exception/interrupt vector table. The actual methods are implementation-dependent.

void enter( UINT dintno )

void leave( UINT dintno )

dintno Interrupt definition number

The parameters passed to enter() and leave() are the same as those passed to the exception/interrupt handler. Depending on the implementation, information other than dintno may also be passed. A hook routine is called as follows from a high-level language support routine.


enter(dintno);
inthdr(dintno); /* exception/interrupt handler */
leave(dintno);

enter() is called in interrupts disabled state, and interrupts must not be enabled. Since leave() assumes the status on return from inthdr(), the interrupts disabled or enabled status is indeterminate.

enter() can obtain only the same information as that obtainable by inthdr(). Information that cannot be obtained by inthdr() cannot be obtained by enter(). The information that can be obtained by enter() and inthdr() is guaranteed by the speci.cation to include dintno, but other information is implementation-dependent. Note that since interrupts disabled state and other states may change while leave() is running, leave() does not necessarily obtain the same information as that obtained by enter() or inthdr().

Comments