2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
27 * Mach Operating System
28 * Copyright (c) 1991,1990 Carnegie Mellon University
29 * All Rights Reserved.
31 * Permission to use, copy, modify and distribute this software and its
32 * documentation is hereby granted, provided that both the copyright
33 * notice and this permission notice appear in all copies of the
34 * software, derivative works or modified versions, and any portions
35 * thereof, and that both notices appear in supporting documentation.
37 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
38 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
39 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
41 * Carnegie Mellon requests users of this software to return to
43 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
44 * School of Computer Science
45 * Carnegie Mellon University
46 * Pittsburgh PA 15213-3890
48 * any improvements or extensions that they make and grant Carnegie Mellon
49 * the rights to redistribute these changes.
58 * Interrupt descriptor table and code vectors for it.
60 #define IDT_BASE_ENTRY(vec,seg,type) \
68 #define IDT_ENTRY(vec,type) IDT_BASE_ENTRY(vec,KERNEL_CS,type)
71 * No error code. Clear error code and push trap number.
73 #define EXCEPTION(n,name) \
74 IDT_ENTRY(EXT(name),K_TRAP_GATE);\
81 * Interrupt from user. Clear error code and push trap number.
83 #define EXCEP_USR(n,name) \
84 IDT_ENTRY(EXT(name),U_TRAP_GATE);\
91 * Special interrupt code.
93 #define EXCEP_SPC(n,name) \
94 IDT_ENTRY(EXT(name),K_TRAP_GATE)
97 * Special interrupt code from user.
99 #define EXCEP_SPC_USR(n,name) \
100 IDT_ENTRY(EXT(name),U_TRAP_GATE)
103 * Extra-special interrupt code. Note that no offset may be
104 * specified in a task gate descriptor, so name is ignored.
106 #define EXCEP_TASK(n,name) \
107 IDT_BASE_ENTRY(0,DEBUG_TSS,K_TASK_GATE)
110 * Error code has been pushed. Push trap number.
112 #define EXCEP_ERR(n,name) \
113 IDT_ENTRY(EXT(name),K_TRAP_GATE);\
121 #define INTERRUPT(n) \
122 IDT_ENTRY(0f,K_INTR_GATE) ;\
132 EXCEPTION(0x00,t_zero_div)
133 EXCEP_SPC(0x01,t_debug)
134 INTERRUPT(0x02) /* NMI */
135 EXCEP_USR(0x03,t_int3)
136 EXCEP_USR(0x04,t_into)
137 EXCEP_USR(0x05,t_bounds)
138 EXCEPTION(0x06,t_invop)
139 EXCEPTION(0x07,t_nofpu)
141 EXCEP_TASK(0x08,db_task_dbl_fault)
143 EXCEPTION(0x08,a_dbl_fault)
145 EXCEPTION(0x09,a_fpu_over)
146 EXCEPTION(0x0a,a_inv_tss)
147 EXCEP_SPC(0x0b,t_segnp)
149 EXCEP_TASK(0x0c,db_task_stk_fault)
151 EXCEP_ERR(0x0c,t_stack_fault)
153 EXCEP_SPC(0x0d,t_gen_prot)
154 EXCEP_SPC(0x0e,t_page_fault)
155 EXCEPTION(0x0f,t_trap_0f)
156 EXCEPTION(0x10,t_fpu_err)
157 EXCEPTION(0x11,t_trap_11)
158 EXCEPTION(0x12,t_trap_12)
159 EXCEPTION(0x13,t_trap_13)
160 EXCEPTION(0x14,t_trap_14)
161 EXCEPTION(0x15,t_trap_15)
162 EXCEPTION(0x16,t_trap_16)
163 EXCEPTION(0x17,t_trap_17)
164 EXCEPTION(0x18,t_trap_18)
165 EXCEPTION(0x19,t_trap_19)
166 EXCEPTION(0x1a,t_trap_1a)
167 EXCEPTION(0x1b,t_trap_1b)
168 EXCEPTION(0x1c,t_trap_1c)
169 EXCEPTION(0x1d,t_trap_1d)
170 EXCEPTION(0x1e,t_trap_1e)
171 EXCEPTION(0x1f,t_trap_1f)
275 EXCEP_SPC_USR(0x80,syscall_int80)
409 EXCEPTION(0xff,t_preempt)