blob: cdff3d934d6a7094bf6d5c105c09e059ccb36822 [file] [log] [blame]
wdenk2262cfe2002-11-18 00:14:45 +00001/*
Graeme Russ564a9982009-11-24 20:04:18 +11002 * (C) Copyright 2008
3 * Graeme Russ, graeme.russ@gmail.com.
4 *
wdenk2262cfe2002-11-18 00:14:45 +00005 * (C) Copyright 2002
6 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
7 *
Graeme Russ433ff2b2010-04-24 00:05:38 +10008 * Portions of this file are derived from the Linux kernel source
9 * Copyright (C) 1991, 1992 Linus Torvalds
10 *
wdenk2262cfe2002-11-18 00:14:45 +000011 * See file CREDITS for list of people who contributed to this
12 * project.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 */
29
30#include <common.h>
Graeme Russ9933d602008-12-07 10:29:01 +110031#include <asm/interrupt.h>
Graeme Russca56a4c2011-02-12 15:11:28 +110032#include <asm/io.h>
wdenk2262cfe2002-11-18 00:14:45 +000033
Graeme Russ564a9982009-11-24 20:04:18 +110034#define DECLARE_INTERRUPT(x) \
35 ".globl irq_"#x"\n" \
Graeme Russ0fc1b492009-11-24 20:04:19 +110036 ".hidden irq_"#x"\n" \
37 ".type irq_"#x", @function\n" \
Graeme Russ564a9982009-11-24 20:04:18 +110038 "irq_"#x":\n" \
Graeme Russ564a9982009-11-24 20:04:18 +110039 "pushl $"#x"\n" \
40 "jmp irq_common_entry\n"
wdenk2262cfe2002-11-18 00:14:45 +000041
Graeme Russ433ff2b2010-04-24 00:05:38 +100042/*
43 * Volatile isn't enough to prevent the compiler from reordering the
44 * read/write functions for the control registers and messing everything up.
45 * A memory clobber would solve the problem, but would prevent reordering of
46 * all loads stores around it, which can hurt performance. Solution is to
47 * use a variable and mimic reads and writes to it to enforce serialization
48 */
49static unsigned long __force_order;
50
51static inline unsigned long read_cr0(void)
52{
53 unsigned long val;
54 asm volatile("mov %%cr0,%0\n\t" : "=r" (val), "=m" (__force_order));
55 return val;
56}
57
58static inline unsigned long read_cr2(void)
59{
60 unsigned long val;
61 asm volatile("mov %%cr2,%0\n\t" : "=r" (val), "=m" (__force_order));
62 return val;
63}
64
65static inline unsigned long read_cr3(void)
66{
67 unsigned long val;
68 asm volatile("mov %%cr3,%0\n\t" : "=r" (val), "=m" (__force_order));
69 return val;
70}
71
72static inline unsigned long read_cr4(void)
73{
74 unsigned long val;
75 asm volatile("mov %%cr4,%0\n\t" : "=r" (val), "=m" (__force_order));
76 return val;
77}
78
79static inline unsigned long get_debugreg(int regno)
80{
81 unsigned long val = 0; /* Damn you, gcc! */
82
83 switch (regno) {
84 case 0:
85 asm("mov %%db0, %0" :"=r" (val));
86 break;
87 case 1:
88 asm("mov %%db1, %0" :"=r" (val));
89 break;
90 case 2:
91 asm("mov %%db2, %0" :"=r" (val));
92 break;
93 case 3:
94 asm("mov %%db3, %0" :"=r" (val));
95 break;
96 case 6:
97 asm("mov %%db6, %0" :"=r" (val));
98 break;
99 case 7:
100 asm("mov %%db7, %0" :"=r" (val));
101 break;
102 default:
103 val = 0;
104 }
105 return val;
106}
107
Graeme Russ7228efa2010-10-07 20:03:23 +1100108void dump_regs(struct irq_regs *regs)
Graeme Russ433ff2b2010-04-24 00:05:38 +1000109{
110 unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
111 unsigned long d0, d1, d2, d3, d6, d7;
Graeme Russca56a4c2011-02-12 15:11:28 +1100112 unsigned long sp;
Graeme Russ433ff2b2010-04-24 00:05:38 +1000113
114 printf("EIP: %04x:[<%08lx>] EFLAGS: %08lx\n",
115 (u16)regs->xcs, regs->eip, regs->eflags);
116
117 printf("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
118 regs->eax, regs->ebx, regs->ecx, regs->edx);
119 printf("ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n",
120 regs->esi, regs->edi, regs->ebp, regs->esp);
121 printf(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n",
122 (u16)regs->xds, (u16)regs->xes, (u16)regs->xfs, (u16)regs->xgs, (u16)regs->xss);
123
124 cr0 = read_cr0();
125 cr2 = read_cr2();
126 cr3 = read_cr3();
127 cr4 = read_cr4();
128
129 printf("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n",
130 cr0, cr2, cr3, cr4);
131
132 d0 = get_debugreg(0);
133 d1 = get_debugreg(1);
134 d2 = get_debugreg(2);
135 d3 = get_debugreg(3);
136
137 printf("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n",
138 d0, d1, d2, d3);
139
140 d6 = get_debugreg(6);
141 d7 = get_debugreg(7);
142 printf("DR6: %08lx DR7: %08lx\n",
143 d6, d7);
Graeme Russca56a4c2011-02-12 15:11:28 +1100144
145 printf("Stack:\n");
146 sp = regs->esp;
147
148 sp += 64;
149
150 while (sp > (regs->esp - 16)) {
151 if (sp == regs->esp)
152 printf("--->");
153 else
154 printf(" ");
155 printf("0x%8.8lx : 0x%8.8lx\n", sp, (ulong)readl(sp));
156 sp -= 4;
157 }
Graeme Russ433ff2b2010-04-24 00:05:38 +1000158}
159
wdenk2262cfe2002-11-18 00:14:45 +0000160struct idt_entry {
161 u16 base_low;
162 u16 selector;
163 u8 res;
164 u8 access;
165 u16 base_high;
166} __attribute__ ((packed));
167
Graeme Russ564a9982009-11-24 20:04:18 +1100168struct desc_ptr {
169 unsigned short size;
170 unsigned long address;
171 unsigned short segment;
172} __attribute__((packed));
wdenk2262cfe2002-11-18 00:14:45 +0000173
174struct idt_entry idt[256];
175
Graeme Russ564a9982009-11-24 20:04:18 +1100176struct desc_ptr idt_ptr;
wdenk2262cfe2002-11-18 00:14:45 +0000177
Graeme Russ564a9982009-11-24 20:04:18 +1100178static inline void load_idt(const struct desc_ptr *dtr)
179{
180 asm volatile("cs lidt %0"::"m" (*dtr));
181}
wdenk2262cfe2002-11-18 00:14:45 +0000182
Graeme Russabf0cd32009-02-24 21:13:40 +1100183void set_vector(u8 intnum, void *routine)
wdenk2262cfe2002-11-18 00:14:45 +0000184{
Graeme Russ1c409bc2009-11-24 20:04:21 +1100185 idt[intnum].base_high = (u16)((u32)(routine) >> 16);
186 idt[intnum].base_low = (u16)((u32)(routine) & 0xffff);
wdenk2262cfe2002-11-18 00:14:45 +0000187}
188
Graeme Russ564a9982009-11-24 20:04:18 +1100189void irq_0(void);
190void irq_1(void);
wdenk2262cfe2002-11-18 00:14:45 +0000191
Graeme Russabf0cd32009-02-24 21:13:40 +1100192int cpu_init_interrupts(void)
wdenk2262cfe2002-11-18 00:14:45 +0000193{
194 int i;
wdenk8bde7f72003-06-27 21:31:46 +0000195
Graeme Russ564a9982009-11-24 20:04:18 +1100196 int irq_entry_size = irq_1 - irq_0;
197 void *irq_entry = (void *)irq_0;
198
wdenk2262cfe2002-11-18 00:14:45 +0000199 /* Just in case... */
200 disable_interrupts();
wdenk8bde7f72003-06-27 21:31:46 +0000201
wdenk2262cfe2002-11-18 00:14:45 +0000202 /* Setup the IDT */
wdenk8bde7f72003-06-27 21:31:46 +0000203 for (i=0;i<256;i++) {
wdenk2262cfe2002-11-18 00:14:45 +0000204 idt[i].access = 0x8e;
wdenk8bde7f72003-06-27 21:31:46 +0000205 idt[i].res = 0;
206 idt[i].selector = 0x10;
Graeme Russ564a9982009-11-24 20:04:18 +1100207 set_vector(i, irq_entry);
208 irq_entry += irq_entry_size;
wdenk8bde7f72003-06-27 21:31:46 +0000209 }
210
Graeme Russ564a9982009-11-24 20:04:18 +1100211 idt_ptr.size = 256 * 8;
212 idt_ptr.address = (unsigned long) idt;
213 idt_ptr.segment = 0x18;
214
215 load_idt(&idt_ptr);
wdenk8bde7f72003-06-27 21:31:46 +0000216
wdenk2262cfe2002-11-18 00:14:45 +0000217 /* It is now safe to enable interrupts */
wdenk8bde7f72003-06-27 21:31:46 +0000218 enable_interrupts();
219
wdenk2262cfe2002-11-18 00:14:45 +0000220 return 0;
221}
222
Graeme Russ564a9982009-11-24 20:04:18 +1100223void __do_irq(int irq)
224{
225 printf("Unhandled IRQ : %d\n", irq);
226}
227void do_irq(int irq) __attribute__((weak, alias("__do_irq")));
228
wdenk2262cfe2002-11-18 00:14:45 +0000229void enable_interrupts(void)
230{
231 asm("sti\n");
232}
233
234int disable_interrupts(void)
235{
236 long flags;
wdenk8bde7f72003-06-27 21:31:46 +0000237
wdenk2262cfe2002-11-18 00:14:45 +0000238 asm volatile ("pushfl ; popl %0 ; cli\n" : "=g" (flags) : );
wdenk8bde7f72003-06-27 21:31:46 +0000239
wdenk2262cfe2002-11-18 00:14:45 +0000240 return (flags&0x200); /* IE flags is bit 9 */
241}
Graeme Russ564a9982009-11-24 20:04:18 +1100242
243/* IRQ Low-Level Service Routine */
Graeme Russ7228efa2010-10-07 20:03:23 +1100244void irq_llsr(struct irq_regs *regs)
Graeme Russ564a9982009-11-24 20:04:18 +1100245{
246 /*
247 * For detailed description of each exception, refer to:
248 * Intel® 64 and IA-32 Architectures Software Developer's Manual
249 * Volume 1: Basic Architecture
250 * Order Number: 253665-029US, November 2008
251 * Table 6-1. Exceptions and Interrupts
252 */
Graeme Russ7228efa2010-10-07 20:03:23 +1100253 switch (regs->irq_id) {
Graeme Russ564a9982009-11-24 20:04:18 +1100254 case 0x00:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000255 printf("Divide Error (Division by zero)\n");
256 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100257 while(1);
258 break;
259 case 0x01:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000260 printf("Debug Interrupt (Single step)\n");
261 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100262 break;
263 case 0x02:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000264 printf("NMI Interrupt\n");
265 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100266 break;
267 case 0x03:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000268 printf("Breakpoint\n");
269 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100270 break;
271 case 0x04:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000272 printf("Overflow\n");
273 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100274 while(1);
275 break;
276 case 0x05:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000277 printf("BOUND Range Exceeded\n");
278 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100279 while(1);
280 break;
281 case 0x06:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000282 printf("Invalid Opcode (UnDefined Opcode)\n");
283 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100284 while(1);
285 break;
286 case 0x07:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000287 printf("Device Not Available (No Math Coprocessor)\n");
288 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100289 while(1);
290 break;
291 case 0x08:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000292 printf("Double fault\n");
293 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100294 while(1);
295 break;
296 case 0x09:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000297 printf("Co-processor segment overrun\n");
298 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100299 while(1);
300 break;
301 case 0x0a:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000302 printf("Invalid TSS\n");
303 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100304 break;
305 case 0x0b:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000306 printf("Segment Not Present\n");
307 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100308 while(1);
309 break;
310 case 0x0c:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000311 printf("Stack Segment Fault\n");
312 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100313 while(1);
314 break;
315 case 0x0d:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000316 printf("General Protection\n");
317 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100318 break;
319 case 0x0e:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000320 printf("Page fault\n");
321 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100322 while(1);
323 break;
324 case 0x0f:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000325 printf("Floating-Point Error (Math Fault)\n");
326 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100327 break;
328 case 0x10:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000329 printf("Alignment check\n");
330 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100331 break;
332 case 0x11:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000333 printf("Machine Check\n");
334 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100335 break;
336 case 0x12:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000337 printf("SIMD Floating-Point Exception\n");
338 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100339 break;
340 case 0x13:
341 case 0x14:
342 case 0x15:
343 case 0x16:
344 case 0x17:
345 case 0x18:
346 case 0x19:
347 case 0x1a:
348 case 0x1b:
349 case 0x1c:
350 case 0x1d:
351 case 0x1e:
352 case 0x1f:
Graeme Russ433ff2b2010-04-24 00:05:38 +1000353 printf("Reserved Exception\n");
354 dump_regs(regs);
Graeme Russ564a9982009-11-24 20:04:18 +1100355 break;
356
357 default:
358 /* Hardware or User IRQ */
Graeme Russ7228efa2010-10-07 20:03:23 +1100359 do_irq(regs->irq_id);
Graeme Russ564a9982009-11-24 20:04:18 +1100360 }
361}
362
363/*
364 * OK - This looks really horrible, but it serves a purpose - It helps create
365 * fully relocatable code.
366 * - The call to irq_llsr will be a relative jump
367 * - The IRQ entries will be guaranteed to be in order
Graeme Russ433ff2b2010-04-24 00:05:38 +1000368 * Interrupt entries are now very small (a push and a jump) but they are
369 * now slower (all registers pushed on stack which provides complete
370 * crash dumps in the low level handlers
Graeme Russ7228efa2010-10-07 20:03:23 +1100371 *
372 * Interrupt Entry Point:
373 * - Interrupt has caused eflags, CS and EIP to be pushed
374 * - Interrupt Vector Handler has pushed orig_eax
375 * - pt_regs.esp needs to be adjusted by 40 bytes:
376 * 12 bytes pushed by CPU (EFLAGSF, CS, EIP)
377 * 4 bytes pushed by vector handler (irq_id)
378 * 24 bytes pushed before SP (SS, GS, FS, ES, DS, EAX)
379 * NOTE: Only longs are pushed on/popped off the stack!
Graeme Russ564a9982009-11-24 20:04:18 +1100380 */
381asm(".globl irq_common_entry\n" \
Graeme Russ0fc1b492009-11-24 20:04:19 +1100382 ".hidden irq_common_entry\n" \
383 ".type irq_common_entry, @function\n" \
Graeme Russ564a9982009-11-24 20:04:18 +1100384 "irq_common_entry:\n" \
Graeme Russ433ff2b2010-04-24 00:05:38 +1000385 "cld\n" \
Graeme Russ7228efa2010-10-07 20:03:23 +1100386 "pushl %ss\n" \
Graeme Russ433ff2b2010-04-24 00:05:38 +1000387 "pushl %gs\n" \
388 "pushl %fs\n" \
389 "pushl %es\n" \
390 "pushl %ds\n" \
391 "pushl %eax\n" \
Graeme Russ7228efa2010-10-07 20:03:23 +1100392 "movl %esp, %eax\n" \
393 "addl $40, %eax\n" \
394 "pushl %eax\n" \
Graeme Russ433ff2b2010-04-24 00:05:38 +1000395 "pushl %ebp\n" \
396 "pushl %edi\n" \
397 "pushl %esi\n" \
398 "pushl %edx\n" \
399 "pushl %ecx\n" \
400 "pushl %ebx\n" \
401 "mov %esp, %eax\n" \
Graeme Russ564a9982009-11-24 20:04:18 +1100402 "call irq_llsr\n" \
Graeme Russ433ff2b2010-04-24 00:05:38 +1000403 "popl %ebx\n" \
404 "popl %ecx\n" \
405 "popl %edx\n" \
406 "popl %esi\n" \
407 "popl %edi\n" \
408 "popl %ebp\n" \
409 "popl %eax\n" \
Graeme Russ7228efa2010-10-07 20:03:23 +1100410 "popl %eax\n" \
Graeme Russ433ff2b2010-04-24 00:05:38 +1000411 "popl %ds\n" \
412 "popl %es\n" \
413 "popl %fs\n" \
414 "popl %gs\n" \
Graeme Russ7228efa2010-10-07 20:03:23 +1100415 "popl %ss\n" \
Graeme Russ433ff2b2010-04-24 00:05:38 +1000416 "add $4, %esp\n" \
Graeme Russ564a9982009-11-24 20:04:18 +1100417 "iret\n" \
418 DECLARE_INTERRUPT(0) \
419 DECLARE_INTERRUPT(1) \
420 DECLARE_INTERRUPT(2) \
421 DECLARE_INTERRUPT(3) \
422 DECLARE_INTERRUPT(4) \
423 DECLARE_INTERRUPT(5) \
424 DECLARE_INTERRUPT(6) \
425 DECLARE_INTERRUPT(7) \
426 DECLARE_INTERRUPT(8) \
427 DECLARE_INTERRUPT(9) \
428 DECLARE_INTERRUPT(10) \
429 DECLARE_INTERRUPT(11) \
430 DECLARE_INTERRUPT(12) \
431 DECLARE_INTERRUPT(13) \
432 DECLARE_INTERRUPT(14) \
433 DECLARE_INTERRUPT(15) \
434 DECLARE_INTERRUPT(16) \
435 DECLARE_INTERRUPT(17) \
436 DECLARE_INTERRUPT(18) \
437 DECLARE_INTERRUPT(19) \
438 DECLARE_INTERRUPT(20) \
439 DECLARE_INTERRUPT(21) \
440 DECLARE_INTERRUPT(22) \
441 DECLARE_INTERRUPT(23) \
442 DECLARE_INTERRUPT(24) \
443 DECLARE_INTERRUPT(25) \
444 DECLARE_INTERRUPT(26) \
445 DECLARE_INTERRUPT(27) \
446 DECLARE_INTERRUPT(28) \
447 DECLARE_INTERRUPT(29) \
448 DECLARE_INTERRUPT(30) \
449 DECLARE_INTERRUPT(31) \
450 DECLARE_INTERRUPT(32) \
451 DECLARE_INTERRUPT(33) \
452 DECLARE_INTERRUPT(34) \
453 DECLARE_INTERRUPT(35) \
454 DECLARE_INTERRUPT(36) \
455 DECLARE_INTERRUPT(37) \
456 DECLARE_INTERRUPT(38) \
457 DECLARE_INTERRUPT(39) \
458 DECLARE_INTERRUPT(40) \
459 DECLARE_INTERRUPT(41) \
460 DECLARE_INTERRUPT(42) \
461 DECLARE_INTERRUPT(43) \
462 DECLARE_INTERRUPT(44) \
463 DECLARE_INTERRUPT(45) \
464 DECLARE_INTERRUPT(46) \
465 DECLARE_INTERRUPT(47) \
466 DECLARE_INTERRUPT(48) \
467 DECLARE_INTERRUPT(49) \
468 DECLARE_INTERRUPT(50) \
469 DECLARE_INTERRUPT(51) \
470 DECLARE_INTERRUPT(52) \
471 DECLARE_INTERRUPT(53) \
472 DECLARE_INTERRUPT(54) \
473 DECLARE_INTERRUPT(55) \
474 DECLARE_INTERRUPT(56) \
475 DECLARE_INTERRUPT(57) \
476 DECLARE_INTERRUPT(58) \
477 DECLARE_INTERRUPT(59) \
478 DECLARE_INTERRUPT(60) \
479 DECLARE_INTERRUPT(61) \
480 DECLARE_INTERRUPT(62) \
481 DECLARE_INTERRUPT(63) \
482 DECLARE_INTERRUPT(64) \
483 DECLARE_INTERRUPT(65) \
484 DECLARE_INTERRUPT(66) \
485 DECLARE_INTERRUPT(67) \
486 DECLARE_INTERRUPT(68) \
487 DECLARE_INTERRUPT(69) \
488 DECLARE_INTERRUPT(70) \
489 DECLARE_INTERRUPT(71) \
490 DECLARE_INTERRUPT(72) \
491 DECLARE_INTERRUPT(73) \
492 DECLARE_INTERRUPT(74) \
493 DECLARE_INTERRUPT(75) \
494 DECLARE_INTERRUPT(76) \
495 DECLARE_INTERRUPT(77) \
496 DECLARE_INTERRUPT(78) \
497 DECLARE_INTERRUPT(79) \
498 DECLARE_INTERRUPT(80) \
499 DECLARE_INTERRUPT(81) \
500 DECLARE_INTERRUPT(82) \
501 DECLARE_INTERRUPT(83) \
502 DECLARE_INTERRUPT(84) \
503 DECLARE_INTERRUPT(85) \
504 DECLARE_INTERRUPT(86) \
505 DECLARE_INTERRUPT(87) \
506 DECLARE_INTERRUPT(88) \
507 DECLARE_INTERRUPT(89) \
508 DECLARE_INTERRUPT(90) \
509 DECLARE_INTERRUPT(91) \
510 DECLARE_INTERRUPT(92) \
511 DECLARE_INTERRUPT(93) \
512 DECLARE_INTERRUPT(94) \
513 DECLARE_INTERRUPT(95) \
514 DECLARE_INTERRUPT(97) \
515 DECLARE_INTERRUPT(96) \
516 DECLARE_INTERRUPT(98) \
517 DECLARE_INTERRUPT(99) \
518 DECLARE_INTERRUPT(100) \
519 DECLARE_INTERRUPT(101) \
520 DECLARE_INTERRUPT(102) \
521 DECLARE_INTERRUPT(103) \
522 DECLARE_INTERRUPT(104) \
523 DECLARE_INTERRUPT(105) \
524 DECLARE_INTERRUPT(106) \
525 DECLARE_INTERRUPT(107) \
526 DECLARE_INTERRUPT(108) \
527 DECLARE_INTERRUPT(109) \
528 DECLARE_INTERRUPT(110) \
529 DECLARE_INTERRUPT(111) \
530 DECLARE_INTERRUPT(112) \
531 DECLARE_INTERRUPT(113) \
532 DECLARE_INTERRUPT(114) \
533 DECLARE_INTERRUPT(115) \
534 DECLARE_INTERRUPT(116) \
535 DECLARE_INTERRUPT(117) \
536 DECLARE_INTERRUPT(118) \
537 DECLARE_INTERRUPT(119) \
538 DECLARE_INTERRUPT(120) \
539 DECLARE_INTERRUPT(121) \
540 DECLARE_INTERRUPT(122) \
541 DECLARE_INTERRUPT(123) \
542 DECLARE_INTERRUPT(124) \
543 DECLARE_INTERRUPT(125) \
544 DECLARE_INTERRUPT(126) \
545 DECLARE_INTERRUPT(127) \
546 DECLARE_INTERRUPT(128) \
547 DECLARE_INTERRUPT(129) \
548 DECLARE_INTERRUPT(130) \
549 DECLARE_INTERRUPT(131) \
550 DECLARE_INTERRUPT(132) \
551 DECLARE_INTERRUPT(133) \
552 DECLARE_INTERRUPT(134) \
553 DECLARE_INTERRUPT(135) \
554 DECLARE_INTERRUPT(136) \
555 DECLARE_INTERRUPT(137) \
556 DECLARE_INTERRUPT(138) \
557 DECLARE_INTERRUPT(139) \
558 DECLARE_INTERRUPT(140) \
559 DECLARE_INTERRUPT(141) \
560 DECLARE_INTERRUPT(142) \
561 DECLARE_INTERRUPT(143) \
562 DECLARE_INTERRUPT(144) \
563 DECLARE_INTERRUPT(145) \
564 DECLARE_INTERRUPT(146) \
565 DECLARE_INTERRUPT(147) \
566 DECLARE_INTERRUPT(148) \
567 DECLARE_INTERRUPT(149) \
568 DECLARE_INTERRUPT(150) \
569 DECLARE_INTERRUPT(151) \
570 DECLARE_INTERRUPT(152) \
571 DECLARE_INTERRUPT(153) \
572 DECLARE_INTERRUPT(154) \
573 DECLARE_INTERRUPT(155) \
574 DECLARE_INTERRUPT(156) \
575 DECLARE_INTERRUPT(157) \
576 DECLARE_INTERRUPT(158) \
577 DECLARE_INTERRUPT(159) \
578 DECLARE_INTERRUPT(160) \
579 DECLARE_INTERRUPT(161) \
580 DECLARE_INTERRUPT(162) \
581 DECLARE_INTERRUPT(163) \
582 DECLARE_INTERRUPT(164) \
583 DECLARE_INTERRUPT(165) \
584 DECLARE_INTERRUPT(166) \
585 DECLARE_INTERRUPT(167) \
586 DECLARE_INTERRUPT(168) \
587 DECLARE_INTERRUPT(169) \
588 DECLARE_INTERRUPT(170) \
589 DECLARE_INTERRUPT(171) \
590 DECLARE_INTERRUPT(172) \
591 DECLARE_INTERRUPT(173) \
592 DECLARE_INTERRUPT(174) \
593 DECLARE_INTERRUPT(175) \
594 DECLARE_INTERRUPT(176) \
595 DECLARE_INTERRUPT(177) \
596 DECLARE_INTERRUPT(178) \
597 DECLARE_INTERRUPT(179) \
598 DECLARE_INTERRUPT(180) \
599 DECLARE_INTERRUPT(181) \
600 DECLARE_INTERRUPT(182) \
601 DECLARE_INTERRUPT(183) \
602 DECLARE_INTERRUPT(184) \
603 DECLARE_INTERRUPT(185) \
604 DECLARE_INTERRUPT(186) \
605 DECLARE_INTERRUPT(187) \
606 DECLARE_INTERRUPT(188) \
607 DECLARE_INTERRUPT(189) \
608 DECLARE_INTERRUPT(190) \
609 DECLARE_INTERRUPT(191) \
610 DECLARE_INTERRUPT(192) \
611 DECLARE_INTERRUPT(193) \
612 DECLARE_INTERRUPT(194) \
613 DECLARE_INTERRUPT(195) \
614 DECLARE_INTERRUPT(196) \
615 DECLARE_INTERRUPT(197) \
616 DECLARE_INTERRUPT(198) \
617 DECLARE_INTERRUPT(199) \
618 DECLARE_INTERRUPT(200) \
619 DECLARE_INTERRUPT(201) \
620 DECLARE_INTERRUPT(202) \
621 DECLARE_INTERRUPT(203) \
622 DECLARE_INTERRUPT(204) \
623 DECLARE_INTERRUPT(205) \
624 DECLARE_INTERRUPT(206) \
625 DECLARE_INTERRUPT(207) \
626 DECLARE_INTERRUPT(208) \
627 DECLARE_INTERRUPT(209) \
628 DECLARE_INTERRUPT(210) \
629 DECLARE_INTERRUPT(211) \
630 DECLARE_INTERRUPT(212) \
631 DECLARE_INTERRUPT(213) \
632 DECLARE_INTERRUPT(214) \
633 DECLARE_INTERRUPT(215) \
634 DECLARE_INTERRUPT(216) \
635 DECLARE_INTERRUPT(217) \
636 DECLARE_INTERRUPT(218) \
637 DECLARE_INTERRUPT(219) \
638 DECLARE_INTERRUPT(220) \
639 DECLARE_INTERRUPT(221) \
640 DECLARE_INTERRUPT(222) \
641 DECLARE_INTERRUPT(223) \
642 DECLARE_INTERRUPT(224) \
643 DECLARE_INTERRUPT(225) \
644 DECLARE_INTERRUPT(226) \
645 DECLARE_INTERRUPT(227) \
646 DECLARE_INTERRUPT(228) \
647 DECLARE_INTERRUPT(229) \
648 DECLARE_INTERRUPT(230) \
649 DECLARE_INTERRUPT(231) \
650 DECLARE_INTERRUPT(232) \
651 DECLARE_INTERRUPT(233) \
652 DECLARE_INTERRUPT(234) \
653 DECLARE_INTERRUPT(235) \
654 DECLARE_INTERRUPT(236) \
655 DECLARE_INTERRUPT(237) \
656 DECLARE_INTERRUPT(238) \
657 DECLARE_INTERRUPT(239) \
658 DECLARE_INTERRUPT(240) \
659 DECLARE_INTERRUPT(241) \
660 DECLARE_INTERRUPT(242) \
661 DECLARE_INTERRUPT(243) \
662 DECLARE_INTERRUPT(244) \
663 DECLARE_INTERRUPT(245) \
664 DECLARE_INTERRUPT(246) \
665 DECLARE_INTERRUPT(247) \
666 DECLARE_INTERRUPT(248) \
667 DECLARE_INTERRUPT(249) \
668 DECLARE_INTERRUPT(250) \
669 DECLARE_INTERRUPT(251) \
670 DECLARE_INTERRUPT(252) \
671 DECLARE_INTERRUPT(253) \
672 DECLARE_INTERRUPT(254) \
673 DECLARE_INTERRUPT(255));