]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/trap.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
29 * Mach Operating System
30 * Copyright (c) 1991,1990 Carnegie Mellon University
31 * All Rights Reserved.
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
43 * Carnegie Mellon requests users of this software to return to
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
60 * Hardware trap vectors for i386.
62 #define T_DIVIDE_ERROR 0
64 #define T_NMI 2 /* non-maskable interrupt */
65 #define T_INT3 3 /* int 3 instruction */
66 #define T_OVERFLOW 4 /* overflow test */
67 #define T_OUT_OF_BOUNDS 5 /* bounds check */
68 #define T_INVALID_OPCODE 6 /* invalid op code */
69 #define T_NO_FPU 7 /* no floating point */
70 #define T_DOUBLE_FAULT 8 /* double fault */
73 #define T_SEGMENT_NOT_PRESENT 11
74 #define T_STACK_FAULT 12
75 #define T_GENERAL_PROTECTION 13
76 #define T_PAGE_FAULT 14
78 #define T_FLOATING_POINT_ERROR 16
79 #define T_WATCHPOINT 17
82 #define TRAP_NAMES "divide error", "debug trap", "NMI", "breakpoint", \
83 "overflow", "bounds check", "invalid opcode", \
84 "no coprocessor", "double fault", "coprocessor overrun", \
85 "invalid TSS", "segment not present", "stack bounds", \
86 "general protection", "page fault", "(reserved)", \
87 "coprocessor error", "watchpoint"
90 * Page-fault trap codes.
92 #define T_PF_PROT 0x1 /* protection violation */
93 #define T_PF_WRITE 0x2 /* write access */
94 #define T_PF_USER 0x4 /* from user state */
96 #if !defined(ASSEMBLER) && defined(MACH_KERNEL)
98 #include <i386/thread.h>
100 extern void i386_exception(
105 extern void thread_exception_return(void);
107 extern boolean_t
kernel_trap(
108 struct i386_saved_state
*regs
);
110 extern void panic_trap(
111 struct i386_saved_state
*regs
);
113 extern void user_trap(
114 struct i386_saved_state
*regs
);
116 extern void i386_astintr(int preemption
);
118 #endif /* !ASSEMBLER && MACH_KERNEL */
120 #endif /* _I386_TRAP_H_ */