]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
8f6c56a5 | 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. |
1c79356b | 3 | * |
8f6c56a5 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
1c79356b | 5 | * |
8f6c56a5 A |
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. The rights granted to you under the License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
14 | * | |
15 | * Please obtain a copy of the License at | |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
17 | * | |
18 | * The Original Code and all software distributed under the License are | |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
23 | * Please see the License for the specific language governing rights and | |
8ad349bb | 24 | * limitations under the License. |
8f6c56a5 A |
25 | * |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | |
1c79356b A |
27 | */ |
28 | /* | |
29 | * @OSF_COPYRIGHT@ | |
30 | */ | |
31 | /* | |
32 | * Mach Operating System | |
33 | * Copyright (c) 1991,1990 Carnegie Mellon University | |
34 | * All Rights Reserved. | |
35 | * | |
36 | * Permission to use, copy, modify and distribute this software and its | |
37 | * documentation is hereby granted, provided that both the copyright | |
38 | * notice and this permission notice appear in all copies of the | |
39 | * software, derivative works or modified versions, and any portions | |
40 | * thereof, and that both notices appear in supporting documentation. | |
41 | * | |
42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
45 | * | |
46 | * Carnegie Mellon requests users of this software to return to | |
47 | * | |
48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
49 | * School of Computer Science | |
50 | * Carnegie Mellon University | |
51 | * Pittsburgh PA 15213-3890 | |
52 | * | |
53 | * any improvements or extensions that they make and grant Carnegie Mellon | |
54 | * the rights to redistribute these changes. | |
55 | */ | |
56 | /* | |
57 | */ | |
58 | #include <i386/asm.h> | |
59 | #include <assym.s> | |
60 | #include <mach_kdb.h> | |
61 | ||
62 | /* | |
63 | * Interrupt descriptor table and code vectors for it. | |
64 | */ | |
65 | #define IDT_BASE_ENTRY(vec,seg,type) \ | |
66 | .data ;\ | |
8f6c56a5 | 67 | .long vec ;\ |
1c79356b A |
68 | .word seg ;\ |
69 | .byte 0 ;\ | |
70 | .byte type ;\ | |
71 | .text | |
72 | ||
73 | #define IDT_ENTRY(vec,type) IDT_BASE_ENTRY(vec,KERNEL_CS,type) | |
74 | ||
75 | /* | |
76 | * No error code. Clear error code and push trap number. | |
77 | */ | |
78 | #define EXCEPTION(n,name) \ | |
8f6c56a5 | 79 | IDT_ENTRY(EXT(name),K_TRAP_GATE);\ |
1c79356b A |
80 | Entry(name) ;\ |
81 | pushl $0 ;\ | |
82 | pushl $(n) ;\ | |
8f6c56a5 | 83 | jmp EXT(alltraps) |
1c79356b A |
84 | |
85 | /* | |
86 | * Interrupt from user. Clear error code and push trap number. | |
87 | */ | |
88 | #define EXCEP_USR(n,name) \ | |
8f6c56a5 | 89 | IDT_ENTRY(EXT(name),U_TRAP_GATE);\ |
1c79356b A |
90 | Entry(name) ;\ |
91 | pushl $0 ;\ | |
92 | pushl $(n) ;\ | |
8f6c56a5 | 93 | jmp EXT(alltraps) |
1c79356b A |
94 | |
95 | /* | |
96 | * Special interrupt code. | |
97 | */ | |
98 | #define EXCEP_SPC(n,name) \ | |
8f6c56a5 A |
99 | IDT_ENTRY(EXT(name),K_TRAP_GATE) |
100 | ||
1c79356b A |
101 | /* |
102 | * Special interrupt code from user. | |
103 | */ | |
104 | #define EXCEP_SPC_USR(n,name) \ | |
8f6c56a5 | 105 | IDT_ENTRY(EXT(name),U_TRAP_GATE) |
1c79356b A |
106 | |
107 | /* | |
108 | * Extra-special interrupt code. Note that no offset may be | |
109 | * specified in a task gate descriptor, so name is ignored. | |
110 | */ | |
111 | #define EXCEP_TASK(n,name) \ | |
8f6c56a5 | 112 | IDT_BASE_ENTRY(0,DEBUG_TSS,K_TASK_GATE) |
1c79356b A |
113 | |
114 | /* | |
115 | * Error code has been pushed. Push trap number. | |
116 | */ | |
117 | #define EXCEP_ERR(n,name) \ | |
8f6c56a5 | 118 | IDT_ENTRY(EXT(name),K_TRAP_GATE);\ |
1c79356b A |
119 | Entry(name) ;\ |
120 | pushl $(n) ;\ | |
8f6c56a5 | 121 | jmp EXT(alltraps) |
1c79356b A |
122 | |
123 | /* | |
124 | * Interrupt. | |
125 | */ | |
126 | #define INTERRUPT(n) \ | |
8f6c56a5 A |
127 | IDT_ENTRY(0f,K_INTR_GATE) ;\ |
128 | 0: ;\ | |
129 | pushl %eax ;\ | |
130 | movl $(n),%eax ;\ | |
131 | jmp EXT(all_intrs) | |
1c79356b A |
132 | |
133 | .data | |
8f6c56a5 | 134 | Entry(idt) |
1c79356b A |
135 | .text |
136 | ||
137 | EXCEPTION(0x00,t_zero_div) | |
8f6c56a5 | 138 | EXCEP_SPC(0x01,t_debug) |
1c79356b A |
139 | INTERRUPT(0x02) /* NMI */ |
140 | EXCEP_USR(0x03,t_int3) | |
141 | EXCEP_USR(0x04,t_into) | |
142 | EXCEP_USR(0x05,t_bounds) | |
143 | EXCEPTION(0x06,t_invop) | |
144 | EXCEPTION(0x07,t_nofpu) | |
145 | #if MACH_KDB | |
146 | EXCEP_TASK(0x08,db_task_dbl_fault) | |
147 | #else | |
8f6c56a5 | 148 | EXCEPTION(0x08,a_dbl_fault) |
1c79356b A |
149 | #endif |
150 | EXCEPTION(0x09,a_fpu_over) | |
151 | EXCEPTION(0x0a,a_inv_tss) | |
8f6c56a5 | 152 | EXCEP_SPC(0x0b,t_segnp) |
1c79356b A |
153 | #if MACH_KDB |
154 | EXCEP_TASK(0x0c,db_task_stk_fault) | |
155 | #else | |
156 | EXCEP_ERR(0x0c,t_stack_fault) | |
157 | #endif | |
8f6c56a5 A |
158 | EXCEP_SPC(0x0d,t_gen_prot) |
159 | EXCEP_SPC(0x0e,t_page_fault) | |
1c79356b A |
160 | EXCEPTION(0x0f,t_trap_0f) |
161 | EXCEPTION(0x10,t_fpu_err) | |
162 | EXCEPTION(0x11,t_trap_11) | |
8f6c56a5 A |
163 | EXCEPTION(0x12,t_trap_12) |
164 | EXCEPTION(0x13,t_trap_13) | |
1c79356b A |
165 | EXCEPTION(0x14,t_trap_14) |
166 | EXCEPTION(0x15,t_trap_15) | |
167 | EXCEPTION(0x16,t_trap_16) | |
168 | EXCEPTION(0x17,t_trap_17) | |
169 | EXCEPTION(0x18,t_trap_18) | |
170 | EXCEPTION(0x19,t_trap_19) | |
171 | EXCEPTION(0x1a,t_trap_1a) | |
172 | EXCEPTION(0x1b,t_trap_1b) | |
173 | EXCEPTION(0x1c,t_trap_1c) | |
174 | EXCEPTION(0x1d,t_trap_1d) | |
175 | EXCEPTION(0x1e,t_trap_1e) | |
176 | EXCEPTION(0x1f,t_trap_1f) | |
177 | ||
178 | INTERRUPT(0x20) | |
179 | INTERRUPT(0x21) | |
180 | INTERRUPT(0x22) | |
181 | INTERRUPT(0x23) | |
182 | INTERRUPT(0x24) | |
183 | INTERRUPT(0x25) | |
184 | INTERRUPT(0x26) | |
185 | INTERRUPT(0x27) | |
186 | INTERRUPT(0x28) | |
187 | INTERRUPT(0x29) | |
188 | INTERRUPT(0x2a) | |
189 | INTERRUPT(0x2b) | |
190 | INTERRUPT(0x2c) | |
191 | INTERRUPT(0x2d) | |
192 | INTERRUPT(0x2e) | |
193 | INTERRUPT(0x2f) | |
194 | ||
195 | INTERRUPT(0x30) | |
196 | INTERRUPT(0x31) | |
197 | INTERRUPT(0x32) | |
198 | INTERRUPT(0x33) | |
199 | INTERRUPT(0x34) | |
200 | INTERRUPT(0x35) | |
201 | INTERRUPT(0x36) | |
202 | INTERRUPT(0x37) | |
203 | INTERRUPT(0x38) | |
204 | INTERRUPT(0x39) | |
205 | INTERRUPT(0x3a) | |
206 | INTERRUPT(0x3b) | |
207 | INTERRUPT(0x3c) | |
208 | INTERRUPT(0x3d) | |
209 | INTERRUPT(0x3e) | |
210 | INTERRUPT(0x3f) | |
211 | ||
212 | INTERRUPT(0x40) | |
213 | INTERRUPT(0x41) | |
214 | INTERRUPT(0x42) | |
215 | INTERRUPT(0x43) | |
216 | INTERRUPT(0x44) | |
217 | INTERRUPT(0x45) | |
218 | INTERRUPT(0x46) | |
219 | INTERRUPT(0x47) | |
220 | INTERRUPT(0x48) | |
221 | INTERRUPT(0x49) | |
222 | INTERRUPT(0x4a) | |
223 | INTERRUPT(0x4b) | |
224 | INTERRUPT(0x4c) | |
225 | INTERRUPT(0x4d) | |
226 | INTERRUPT(0x4e) | |
227 | INTERRUPT(0x4f) | |
228 | ||
229 | INTERRUPT(0x50) | |
230 | INTERRUPT(0x51) | |
231 | INTERRUPT(0x52) | |
232 | INTERRUPT(0x53) | |
233 | INTERRUPT(0x54) | |
234 | INTERRUPT(0x55) | |
235 | INTERRUPT(0x56) | |
236 | INTERRUPT(0x57) | |
237 | INTERRUPT(0x58) | |
238 | INTERRUPT(0x59) | |
239 | INTERRUPT(0x5a) | |
240 | INTERRUPT(0x5b) | |
241 | INTERRUPT(0x5c) | |
242 | INTERRUPT(0x5d) | |
243 | INTERRUPT(0x5e) | |
244 | INTERRUPT(0x5f) | |
245 | ||
246 | INTERRUPT(0x60) | |
247 | INTERRUPT(0x61) | |
248 | INTERRUPT(0x62) | |
249 | INTERRUPT(0x63) | |
250 | INTERRUPT(0x64) | |
251 | INTERRUPT(0x65) | |
252 | INTERRUPT(0x66) | |
253 | INTERRUPT(0x67) | |
254 | INTERRUPT(0x68) | |
255 | INTERRUPT(0x69) | |
256 | INTERRUPT(0x6a) | |
257 | INTERRUPT(0x6b) | |
258 | INTERRUPT(0x6c) | |
259 | INTERRUPT(0x6d) | |
260 | INTERRUPT(0x6e) | |
261 | INTERRUPT(0x6f) | |
262 | ||
263 | INTERRUPT(0x70) | |
264 | INTERRUPT(0x71) | |
265 | INTERRUPT(0x72) | |
266 | INTERRUPT(0x73) | |
267 | INTERRUPT(0x74) | |
268 | INTERRUPT(0x75) | |
269 | INTERRUPT(0x76) | |
270 | INTERRUPT(0x77) | |
271 | INTERRUPT(0x78) | |
272 | INTERRUPT(0x79) | |
273 | INTERRUPT(0x7a) | |
274 | INTERRUPT(0x7b) | |
275 | INTERRUPT(0x7c) | |
276 | INTERRUPT(0x7d) | |
277 | INTERRUPT(0x7e) | |
278 | INTERRUPT(0x7f) | |
279 | ||
8f6c56a5 A |
280 | EXCEP_SPC_USR(0x80,syscall_int80) |
281 | INTERRUPT(0x81) | |
282 | INTERRUPT(0x82) | |
283 | INTERRUPT(0x83) | |
1c79356b A |
284 | INTERRUPT(0x84) |
285 | INTERRUPT(0x85) | |
286 | INTERRUPT(0x86) | |
287 | INTERRUPT(0x87) | |
288 | INTERRUPT(0x88) | |
289 | INTERRUPT(0x89) | |
290 | INTERRUPT(0x8a) | |
291 | INTERRUPT(0x8b) | |
292 | INTERRUPT(0x8c) | |
293 | INTERRUPT(0x8d) | |
294 | INTERRUPT(0x8e) | |
295 | INTERRUPT(0x8f) | |
296 | ||
297 | INTERRUPT(0x90) | |
298 | INTERRUPT(0x91) | |
299 | INTERRUPT(0x92) | |
300 | INTERRUPT(0x93) | |
301 | INTERRUPT(0x94) | |
302 | INTERRUPT(0x95) | |
303 | INTERRUPT(0x96) | |
304 | INTERRUPT(0x97) | |
305 | INTERRUPT(0x98) | |
306 | INTERRUPT(0x99) | |
307 | INTERRUPT(0x9a) | |
308 | INTERRUPT(0x9b) | |
309 | INTERRUPT(0x9c) | |
310 | INTERRUPT(0x9d) | |
311 | INTERRUPT(0x9e) | |
312 | INTERRUPT(0x9f) | |
313 | ||
314 | INTERRUPT(0xa0) | |
315 | INTERRUPT(0xa1) | |
316 | INTERRUPT(0xa2) | |
317 | INTERRUPT(0xa3) | |
318 | INTERRUPT(0xa4) | |
319 | INTERRUPT(0xa5) | |
320 | INTERRUPT(0xa6) | |
321 | INTERRUPT(0xa7) | |
322 | INTERRUPT(0xa8) | |
323 | INTERRUPT(0xa9) | |
324 | INTERRUPT(0xaa) | |
325 | INTERRUPT(0xab) | |
326 | INTERRUPT(0xac) | |
327 | INTERRUPT(0xad) | |
328 | INTERRUPT(0xae) | |
329 | INTERRUPT(0xaf) | |
330 | ||
331 | INTERRUPT(0xb0) | |
332 | INTERRUPT(0xb1) | |
333 | INTERRUPT(0xb2) | |
334 | INTERRUPT(0xb3) | |
335 | INTERRUPT(0xb4) | |
336 | INTERRUPT(0xb5) | |
337 | INTERRUPT(0xb6) | |
338 | INTERRUPT(0xb7) | |
339 | INTERRUPT(0xb8) | |
340 | INTERRUPT(0xb9) | |
341 | INTERRUPT(0xba) | |
342 | INTERRUPT(0xbb) | |
343 | INTERRUPT(0xbc) | |
344 | INTERRUPT(0xbd) | |
345 | INTERRUPT(0xbe) | |
346 | INTERRUPT(0xbf) | |
347 | ||
348 | INTERRUPT(0xc0) | |
349 | INTERRUPT(0xc1) | |
350 | INTERRUPT(0xc2) | |
351 | INTERRUPT(0xc3) | |
352 | INTERRUPT(0xc4) | |
353 | INTERRUPT(0xc5) | |
354 | INTERRUPT(0xc6) | |
355 | INTERRUPT(0xc7) | |
356 | INTERRUPT(0xc8) | |
357 | INTERRUPT(0xc9) | |
358 | INTERRUPT(0xca) | |
359 | INTERRUPT(0xcb) | |
360 | INTERRUPT(0xcc) | |
361 | INTERRUPT(0xcd) | |
362 | INTERRUPT(0xce) | |
363 | INTERRUPT(0xcf) | |
364 | ||
365 | INTERRUPT(0xd0) | |
366 | INTERRUPT(0xd1) | |
367 | INTERRUPT(0xd2) | |
368 | INTERRUPT(0xd3) | |
369 | INTERRUPT(0xd4) | |
370 | INTERRUPT(0xd5) | |
371 | INTERRUPT(0xd6) | |
372 | INTERRUPT(0xd7) | |
373 | INTERRUPT(0xd8) | |
374 | INTERRUPT(0xd9) | |
375 | INTERRUPT(0xda) | |
376 | INTERRUPT(0xdb) | |
377 | INTERRUPT(0xdc) | |
378 | INTERRUPT(0xdd) | |
379 | INTERRUPT(0xde) | |
380 | INTERRUPT(0xdf) | |
381 | ||
382 | INTERRUPT(0xe0) | |
383 | INTERRUPT(0xe1) | |
384 | INTERRUPT(0xe2) | |
385 | INTERRUPT(0xe3) | |
386 | INTERRUPT(0xe4) | |
387 | INTERRUPT(0xe5) | |
388 | INTERRUPT(0xe6) | |
389 | INTERRUPT(0xe7) | |
390 | INTERRUPT(0xe8) | |
391 | INTERRUPT(0xe9) | |
392 | INTERRUPT(0xea) | |
393 | INTERRUPT(0xeb) | |
394 | INTERRUPT(0xec) | |
395 | INTERRUPT(0xed) | |
396 | INTERRUPT(0xee) | |
397 | INTERRUPT(0xef) | |
398 | ||
399 | INTERRUPT(0xf0) | |
400 | INTERRUPT(0xf1) | |
401 | INTERRUPT(0xf2) | |
402 | INTERRUPT(0xf3) | |
403 | INTERRUPT(0xf4) | |
404 | INTERRUPT(0xf5) | |
405 | INTERRUPT(0xf6) | |
406 | INTERRUPT(0xf7) | |
407 | INTERRUPT(0xf8) | |
408 | INTERRUPT(0xf9) | |
409 | INTERRUPT(0xfa) | |
410 | INTERRUPT(0xfb) | |
411 | INTERRUPT(0xfc) | |
412 | INTERRUPT(0xfd) | |
413 | INTERRUPT(0xfe) | |
414 | EXCEPTION(0xff,t_preempt) | |
415 |