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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.8. INTERRUPT MANAGEMENT FUNCTIONS 185<br />

tk def int<br />

Define Interrupt Handler<br />

[C Language Interface]<br />

ER ercd = tk_def_int ( UINT dintno, T_DINT *pk_dint ) ;<br />

[Parameters]<br />

UINT dintno Interrupt definition number<br />

T DINT* pk dint Packet of interrupt handler definition information<br />

pk dint detail:<br />

ATR intatr Interrupt handler attributes<br />

FP inthdr Interrupt 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 RSATR<br />

E PAR<br />

Normal completion<br />

Insufficient memory (memory for control block cannot be allocated)<br />

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

Parameter error (dintno, pk dint, or inthdr is invalid or cannot be used)<br />

[Description]<br />

Defines an interrupt handler for interrupt definition number dintno, and enables use of the interrupt<br />

handler. Here “interrupts” include both external interrupts from a device and CPU exceptions.<br />

This system call maps the interrupt definition number indicated in dintno to the interrupt handler<br />

address and attributes.<br />

The specific significance of dintno is defined separately for each implementation, but generally it means<br />

an interrupt vector number.<br />

intatr indicates system attributes in its low bits, with the high bits used for implementation-dependent<br />

attributes. The system attributes part of intatr is designated in the following format.<br />

intatr := (TA_ASM || TA_HLNG)<br />

TA ASM<br />

TA HLNG<br />

The handler is written in assembly language<br />

The handler is written in high-level language<br />

#define TA_ASM 0x00000000 /* assembly program */<br />

#define TA_HLNG 0x00000001 /* high-level language program */<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!