ISR_ADD(9) | Kernel Developer's Manual (sun3) | ISR_ADD(9) |
isr_add
, isr_add_autovect
,
isr_add_vectored
,
isr_add_custom
—
#include <sun3/autoconf.h>
typedef int (*isr_func_t)(void *);
isr_add_autovect
(isr_func_t
fun, void *arg,
int level);
void
isr_add_vectored
(isr_func_t
fun, void *arg,
int pri,
int vec);
void
isr_add_custom
(int
level, void
*fun);
isr_add
functions establish interrupt handlers into
the system interrupt dispatch table and are typically called from device
drivers during the autoconfiguration process.
There are two types of interrupts in the Motorola 68000 architecture, which differ in the way that an interrupt request is mapped to a dispatch function within the interrupt vector table.
When the CPU detects an asserted signal on one of its interrupt request lines, it suspends normal instruction execution and begins an interrupt acknowledge cycle on the system bus. During this cycle the interrupting device directs how the CPU is to dispatch its interrupt request.
If the interrupting device is integrated tightly with the system bus, it provides an 8-bit interrupt vector number to the CPU and a vectored interrupt occurs. This vector number points to a vector entry within the interrupt vector table to which instruction execution is immediately transfered.
If the interrupting device cannot provide a vector number, it
asserts a specialized bus line and an autovectored
interrupt occurs. The vector number to use is determined by adding the
interrupt priority (0–6) to an autovector base (typically
18 hexadecimal
).
isr_add_autovect
()isr_add_vectored
()isr_add_custom
()fun is called directly as the dispatch handler and must handle all of the specifics of saving the processor state and returning from a processor exception. These requirements generally dictate that fun be written in assembler.
May 21, 1997 | NetBSD 9.0 |