1 .\" $NetBSD: isr_add.9,v 1.8 2003/04/16 13:35:37 wiz Exp $
3 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE
22 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nm isr_add_autovect ,
36 .Nm isr_add_vectored ,
38 .Nd establish interrupt handler
42 typedef int (*isr_func_t)(void *);
45 .Fn isr_add_autovect "isr_func_t fun" "void *arg" "int level"
47 .Fn isr_add_vectored "isr_func_t fun" "void *arg" "int pri" "int vec"
49 .Fn isr_add_custom "int level" "void *fun"
53 functions establish interrupt handlers into the system interrupt dispatch table
54 and are typically called from device drivers during the autoconfiguration
57 There are two types of interrupts in the Motorola 68000 architecture,
58 which differ in the way that an interrupt request is mapped to a dispatch
59 function within the interrupt vector table.
61 When the CPU detects an asserted signal on one of its interrupt request lines,
62 it suspends normal instruction execution and begins an interrupt acknowledge
63 cycle on the system bus.
64 During this cycle the interrupting device directs how the CPU is to dispatch
65 its interrupt request.
67 If the interrupting device is integrated tightly with the system bus,
68 it provides an 8-bit interrupt vector number to the CPU and a
71 This vector number points to a vector entry within the interrupt
72 vector table to which instruction execution is immediately transfered.
74 If the interrupting device cannot provide a vector number,
75 it asserts a specialized bus line and an
78 The vector number to use is determined by adding the interrupt priority
81 .Pq typically Li 18 hexadecimal .
83 .Bl -tag -width isr_add_autovec
84 .It Fn isr_add_autovect
87 to the list of interrupt handlers to be called during an autovectored interrupt
92 is passed to the function as its first argument.
93 .It Fn isr_add_vectored
96 to the list of interrupt handlers to be called during a vectored interrupts of
99 at dispatch vector number
103 is passed to the function as its first argument.
104 .It Fn isr_add_custom
107 as the interrupt handler for vector
109 The autovector base number is automatically added to
113 is called directly as the dispatch handler and must handle all of the specifics
114 of saving the processor state and returning from a processor exception.
115 These requirements generally dictate that
117 be written in assembler.
120 .Pa sys/arch/sun3/sun3/isr.c
122 MC68030 User's Manual, Third edition, MC68030UM/AD Rev 2, Motorola Inc.
124 There is no way to remove a handler once it has been added.