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