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.

4.8. INTERRUPT MANAGEMENT FUNCTIONS 187<br />

If a method is provided for performing some kind of operation in an interrupt handler to have it detected<br />

as task-independent portion, that method must be indicated for each implementation.<br />

Whether the TA HLNG or TA ASM attribute is designated, upon entry into an interrupt handler, the<br />

logical space at the time the interrupt occurred is retained. No processing takes place upon return from<br />

the interrupt handler for restoring the logical space to its state at the time the interrupt was raised.<br />

Switching logical spaces inside the interrupt handler is not prohibited, but the OS is not aware of the<br />

effects of logical space switching.<br />

Even if a system call is invoked from an interrupt handler and this causes the task in RUN state up to<br />

that time to go to another state, with a different task going to RUN state, dispatching (task switching)<br />

does not occur while the interrupt handler is running. Completion of execution by the interrupt handler<br />

has precedence even if dispatching is necessary; only when the interrupt handler terminates does the<br />

dispatch take place. In other words, a dispatch request occurring while an interrupt handler is running is<br />

not processed immediately, but is delayed until the interrupt handler terminates. This is called delayed<br />

dispatching.<br />

An interrupt handler runs as a task-independent portion. As such, it is not possible to call in an<br />

interrupt handler a system call that can enter WAIT state, or one that is intended for the invoking task.<br />

When pk dint = NULL is set, a previously defined interrupt handler is canceled. When the handler for<br />

an interrupt is canceled, the default handler defined by T-Monitor is used.<br />

It is possible to redefine an interrupt handler for an interrupt number already having a defined handler.<br />

It is not necessary first to cancel the definition for that number. Defining a new handler for a dintno<br />

already having an interrupt handler defined does not return error.<br />

[Additional Notes]<br />

The various specifications governing the TA ASM attribute are mainly concerned with achieving an interrupt<br />

hook. For example, when an exception is raised due to illegal address access, ordinarily an<br />

interrupt handler defined in a higher-level program detects this and performs the error processing; but<br />

in the case of debugging, in place of error processing by a higher-level program, a T-Monitor interrupt<br />

handler does the processing and starts a debugger. In this case the interrupt handler defined by the<br />

higher-level program hooks the T-Monitor interrupt handler. After that, depending on the situation,<br />

either interrupt handling is passed off to T-Monitor or the other program does the processing on its<br />

own.<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!