[LWIP]
[reactos.git] / boot / freeldr / freeldr / arch / amd64 / i386idt.S
1 /*
2 * FreeLoader
3 * Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 .text
21 .code16
22
23 #define ASM
24 #include <arch.h>
25
26
27 .p2align 2 /* force 4-byte alignment */
28 EXTERN(i386idt)
29 /* Exception 0 - Divide By Zero */
30 .word i386DivideByZero /* Offset 0 - 15 */
31 .word 0x0008 /* Selector */
32 .word 0x8e00 /* Flags, Zero Byte */
33 .word 0x0000 /* Offset 16 - 31 */
34
35 /* Exception 1 - Debug Exception */
36 .word i386DebugException /* Offset 0 - 15 */
37 .word 0x0008 /* Selector */
38 .word 0x8e00 /* Zero byte, flags */
39 .word 0x0000 /* Offset 16 - 31 */
40
41 /* Exception 2 - NMI */
42 .word i386NMIException /* Offset 0 - 15 */
43 .word 0x0008 /* Selector */
44 .word 0x8e00 /* Zero byte, flags */
45 .word 0x0000 /* Offset 16 - 31 */
46
47 /* Exception 3 - Breakpoint (INT 3) */
48 .word i386Breakpoint /* Offset 0 - 15 */
49 .word 0x0008 /* Selector */
50 .word 0x8e00 /* Zero byte, flags */
51 .word 0x0000 /* Offset 16 - 31 */
52
53 /* Exception 4 - Overflow (INTO with EFLAGS[OF] set) */
54 .word i386Overflow /* Offset 0 - 15 */
55 .word 0x0008 /* Selector */
56 .word 0x8e00 /* Zero byte, flags */
57 .word 0x0000 /* Offset 16 - 31 */
58
59 /* Exception 5 - Bound Exception */
60 .word i386BoundException /* Offset 0 - 15 */
61 .word 0x0008 /* Selector */
62 .word 0x8e00 /* Zero byte, flags */
63 .word 0x0000 /* Offset 16 - 31 */
64
65 /* Exception 6 - Invalid Opcode */
66 .word i386InvalidOpcode /* Offset 0 - 15 */
67 .word 0x0008 /* Selector */
68 .word 0x8e00 /* Zero byte, flags */
69 .word 0x0000 /* Offset 16 - 31 */
70
71 /* Exception 7 - FPU Not Available */
72 .word i386FPUNotAvailable /* Offset 0 - 15 */
73 .word 0x0008 /* Selector */
74 .word 0x8e00 /* Zero byte, flags */
75 .word 0x0000 /* Offset 16 - 31 */
76
77 /* Exception 8 - Double Fault */
78 .word i386DoubleFault /* Offset 0 - 15 */
79 .word 0x0008 /* Selector */
80 .word 0x8e00 /* Zero byte, flags */
81 .word 0x0000 /* Offset 16 - 31 */
82
83 /* Exception 9 - Coprocessor Segment Overrun */
84 .word i386CoprocessorSegment /* Offset 0 - 15 */
85 .word 0x0008 /* Selector */
86 .word 0x8e00 /* Zero byte, flags */
87 .word 0x0000 /* Offset 16 - 31 */
88
89 /* Exception 10 (0x0A) - Invalid TSS */
90 .word i386InvalidTSS /* Offset 0 - 15 */
91 .word 0x0008 /* Selector */
92 .word 0x8e00 /* Zero byte, flags */
93 .word 0x0000 /* Offset 16 - 31 */
94
95 /* Exception 11 (0x0B) - Segment Not Present */
96 .word i386SegmentNotPresent /* Offset 0 - 15 */
97 .word 0x0008 /* Selector */
98 .word 0x8e00 /* Zero byte, flags */
99 .word 0x0000 /* Offset 16 - 31 */
100
101 /* Exception 12 (0x0C) - Stack Exception */
102 .word i386StackException /* Offset 0 - 15 */
103 .word 0x0008 /* Selector */
104 .word 0x8e00 /* Zero byte, flags */
105 .word 0x0000 /* Offset 16 - 31 */
106
107 /* Exception 13 (0x0D) - General Protection Fault */
108 .word i386GeneralProtectionFault /* Offset 0 - 15 */
109 .word 0x0008 /* Selector */
110 .word 0x8e00 /* Zero byte, flags */
111 .word 0x0000 /* Offset 16 - 31 */
112
113 /* Exception 14 (0x0E) - Page Fault */
114 .word i386PageFault /* Offset 0 - 15 */
115 .word 0x0008 /* Selector */
116 .word 0x8e00 /* Zero byte, flags */
117 .word 0x0000 /* Offset 16 - 31 */
118
119 /* Exception 15 (0x0F) - Reserved */
120 .word 0x0000 /* Offset 0 - 15 */
121 .word 0x0000 /* Selector */
122 .word 0x0000 /* Zero byte, flags */
123 .word 0x0000 /* Offset 16 - 31 */
124
125 /* Exception 16 (0x10) - Coprocessor Error */
126 .word i386CoprocessorError /* Offset 0 - 15 */
127 .word 0x0008 /* Selector */
128 .word 0x8e00 /* Zero byte, flags */
129 .word 0x0000 /* Offset 16 - 31 */
130
131 /* Exception 17 (0x11) - Alignment Check */
132 .word i386AlignmentCheck /* Offset 0 - 15 */
133 .word 0x0008 /* Selector */
134 .word 0x8e00 /* Zero byte, flags */
135 .word 0x0000 /* Offset 16 - 31 */
136
137 /* Exception 18 (0x12) - Machine Check */
138 .word i386MachineCheck /* Offset 0 - 15 */
139 .word 0x0008 /* Selector */
140 .word 0x8e00 /* Zero byte, flags */
141 .word 0x0000 /* Offset 16 - 31 */
142
143 /* Exception 19 (0x13) - Reserved */
144 .word 0x0000 /* Offset 0 - 15 */
145 .word 0x0000 /* Selector */
146 .word 0x0000 /* Zero byte, flags */
147 .word 0x0000 /* Offset 16 - 31 */
148
149 /* Exception 20 (0x14) - Reserved */
150 .word 0x0000 /* Offset 0 - 15 */
151 .word 0x0000 /* Selector */
152 .word 0x0000 /* Zero byte, flags */
153 .word 0x0000 /* Offset 16 - 31 */
154
155 /* Exception 21 (0x15) - Reserved */
156 .word 0x0000 /* Offset 0 - 15 */
157 .word 0x0000 /* Selector */
158 .word 0x0000 /* Zero byte, flags */
159 .word 0x0000 /* Offset 16 - 31 */
160
161 /* Exception 22 (0x16) - Reserved */
162 .word 0x0000 /* Offset 0 - 15 */
163 .word 0x0000 /* Selector */
164 .word 0x0000 /* Zero byte, flags */
165 .word 0x0000 /* Offset 16 - 31 */
166
167 /* Exception 23 (0x17) - Reserved */
168 .word 0x0000 /* Offset 0 - 15 */
169 .word 0x0000 /* Selector */
170 .word 0x0000 /* Zero byte, flags */
171 .word 0x0000 /* Offset 16 - 31 */
172
173 /* Exception 24 (0x18) - Reserved */
174 .word 0x0000 /* Offset 0 - 15 */
175 .word 0x0000 /* Selector */
176 .word 0x0000 /* Zero byte, flags */
177 .word 0x0000 /* Offset 16 - 31 */
178
179 /* Exception 25 (0x19) - Reserved */
180 .word 0x0000 /* Offset 0 - 15 */
181 .word 0x0000 /* Selector */
182 .word 0x0000 /* Zero byte, flags */
183 .word 0x0000 /* Offset 16 - 31 */
184
185 /* Exception 26 (0x1A) - Reserved */
186 .word 0x0000 /* Offset 0 - 15 */
187 .word 0x0000 /* Selector */
188 .word 0x0000 /* Zero byte, flags */
189 .word 0x0000 /* Offset 16 - 31 */
190
191 /* Exception 27 (0x1B) - Reserved */
192 .word 0x0000 /* Offset 0 - 15 */
193 .word 0x0000 /* Selector */
194 .word 0x0000 /* Zero byte, flags */
195 .word 0x0000 /* Offset 16 - 31 */
196
197 /* Exception 28 (0x1C) - Reserved */
198 .word 0x0000 /* Offset 0 - 15 */
199 .word 0x0000 /* Selector */
200 .word 0x0000 /* Zero byte, flags */
201 .word 0x0000 /* Offset 16 - 31 */
202
203 /* Exception 29 (0x1D) - Reserved */
204 .word 0x0000 /* Offset 0 - 15 */
205 .word 0x0000 /* Selector */
206 .word 0x0000 /* Zero byte, flags */
207 .word 0x0000 /* Offset 16 - 31 */
208
209 /* Exception 30 (0x1E) - Reserved */
210 .word 0x0000 /* Offset 0 - 15 */
211 .word 0x0000 /* Selector */
212 .word 0x0000 /* Zero byte, flags */
213 .word 0x0000 /* Offset 16 - 31 */
214
215 /* Exception 31 (0x1F) - Reserved */
216 .word 0x0000 /* Offset 0 - 15 */
217 .word 0x0000 /* Selector */
218 .word 0x0000 /* Zero byte, flags */
219 .word 0x0000 /* Offset 16 - 31 */
220
221 /* IDT table pointer */
222 EXTERN(i386idtptr)
223 .word (i386idtptr-i386idt) /* Limit */
224 .long i386idt /* Base Address */