typedef int (*isr_func_t)(void *);
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
)
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
).
)
fun
to the list of interrupt handlers to be called during an autovectored interrupt
of priority
level
.
The pointer
arg
is passed to the function as its first argument.
)
fun
to the list of interrupt handlers to be called during a vectored interrupts of
priority
pri
at dispatch vector number
vec
.
The pointer
arg
is passed to the function as its first argument.
)
fun
as the interrupt handler for vector
level
.
The autovector base number is automatically added to
level
.
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.
sys/arch/sun3/sun3/isr.c