blob: 043a8d432d1b6063472b4da92f5c5caa9f6de756 [file] [log] [blame]
wdenk591dda52002-11-18 00:14:45 +00001/*
Graeme Russ45fc1d82011-04-13 19:43:26 +10002 * (C) Copyright 2008-2011
3 * Graeme Russ, <graeme.russ@gmail.com>
Graeme Russd11b0852009-11-24 20:04:18 +11004 *
wdenk591dda52002-11-18 00:14:45 +00005 * (C) Copyright 2002
Albert ARIBAUD60fbc8d2011-08-04 18:45:45 +02006 * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
wdenk591dda52002-11-18 00:14:45 +00007 *
Graeme Russc39acb42010-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 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +020011 * SPDX-License-Identifier: GPL-2.0+
wdenk591dda52002-11-18 00:14:45 +000012 */
13
14#include <common.h>
Stefan Reinauer2acf8482012-12-02 04:49:50 +000015#include <asm/cache.h>
16#include <asm/control_regs.h>
Graeme Russ0c8c62e2008-12-07 10:29:01 +110017#include <asm/interrupt.h>
Graeme Russ68699802011-02-12 15:11:28 +110018#include <asm/io.h>
Graeme Russ93efcb22011-02-12 15:11:32 +110019#include <asm/processor-flags.h>
Graeme Russfdee8b12011-11-08 02:33:13 +000020#include <linux/compiler.h>
Vadim Bendebury6ab02582012-12-03 13:59:20 +000021#include <asm/msr.h>
22#include <asm/u-boot-x86.h>
Bin Mengcb9d9cb2014-11-20 16:11:16 +080023#include <asm/i8259.h>
wdenk591dda52002-11-18 00:14:45 +000024
Simon Glassbb6306c2013-04-17 16:13:33 +000025DECLARE_GLOBAL_DATA_PTR;
26
Graeme Russd11b0852009-11-24 20:04:18 +110027#define DECLARE_INTERRUPT(x) \
28 ".globl irq_"#x"\n" \
Graeme Russ1aafcc92009-11-24 20:04:19 +110029 ".hidden irq_"#x"\n" \
30 ".type irq_"#x", @function\n" \
Graeme Russd11b0852009-11-24 20:04:18 +110031 "irq_"#x":\n" \
Graeme Russd11b0852009-11-24 20:04:18 +110032 "pushl $"#x"\n" \
33 "jmp irq_common_entry\n"
wdenk591dda52002-11-18 00:14:45 +000034
Simon Glass83374332014-11-06 13:20:08 -070035static void dump_regs(struct irq_regs *regs)
Graeme Russc39acb42010-04-24 00:05:38 +100036{
Bin Meng9ff054b2015-07-10 10:38:32 +080037 unsigned long cs, eip, eflags;
Graeme Russc39acb42010-04-24 00:05:38 +100038 unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
39 unsigned long d0, d1, d2, d3, d6, d7;
Graeme Russ68699802011-02-12 15:11:28 +110040 unsigned long sp;
Graeme Russc39acb42010-04-24 00:05:38 +100041
Bin Meng9ff054b2015-07-10 10:38:32 +080042 /*
43 * Some exceptions cause an error code to be saved on the current stack
44 * after the EIP value. We should extract CS/EIP/EFLAGS from different
45 * position on the stack based on the exception number.
46 */
47 switch (regs->irq_id) {
48 case EXC_DF:
49 case EXC_TS:
50 case EXC_NP:
51 case EXC_SS:
52 case EXC_GP:
53 case EXC_PF:
54 case EXC_AC:
55 cs = regs->context.ctx2.xcs;
56 eip = regs->context.ctx2.eip;
57 eflags = regs->context.ctx2.eflags;
58 /* We should fix up the ESP due to error code */
59 regs->esp += 4;
60 break;
61 default:
62 cs = regs->context.ctx1.xcs;
63 eip = regs->context.ctx1.eip;
64 eflags = regs->context.ctx1.eflags;
65 break;
66 }
67
Graeme Russc39acb42010-04-24 00:05:38 +100068 printf("EIP: %04x:[<%08lx>] EFLAGS: %08lx\n",
Bin Meng9ff054b2015-07-10 10:38:32 +080069 (u16)cs, eip, eflags);
Graeme Russc39acb42010-04-24 00:05:38 +100070
71 printf("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
72 regs->eax, regs->ebx, regs->ecx, regs->edx);
73 printf("ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n",
74 regs->esi, regs->edi, regs->ebp, regs->esp);
75 printf(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n",
Graeme Russfdee8b12011-11-08 02:33:13 +000076 (u16)regs->xds, (u16)regs->xes, (u16)regs->xfs,
77 (u16)regs->xgs, (u16)regs->xss);
Graeme Russc39acb42010-04-24 00:05:38 +100078
79 cr0 = read_cr0();
80 cr2 = read_cr2();
81 cr3 = read_cr3();
82 cr4 = read_cr4();
83
84 printf("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n",
85 cr0, cr2, cr3, cr4);
86
87 d0 = get_debugreg(0);
88 d1 = get_debugreg(1);
89 d2 = get_debugreg(2);
90 d3 = get_debugreg(3);
91
92 printf("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n",
93 d0, d1, d2, d3);
94
95 d6 = get_debugreg(6);
96 d7 = get_debugreg(7);
97 printf("DR6: %08lx DR7: %08lx\n",
98 d6, d7);
Graeme Russ68699802011-02-12 15:11:28 +110099
100 printf("Stack:\n");
101 sp = regs->esp;
102
103 sp += 64;
104
105 while (sp > (regs->esp - 16)) {
106 if (sp == regs->esp)
107 printf("--->");
108 else
109 printf(" ");
110 printf("0x%8.8lx : 0x%8.8lx\n", sp, (ulong)readl(sp));
111 sp -= 4;
112 }
Graeme Russc39acb42010-04-24 00:05:38 +1000113}
114
wdenk591dda52002-11-18 00:14:45 +0000115struct idt_entry {
116 u16 base_low;
117 u16 selector;
118 u8 res;
119 u8 access;
120 u16 base_high;
Graeme Russfdee8b12011-11-08 02:33:13 +0000121} __packed;
wdenk591dda52002-11-18 00:14:45 +0000122
Graeme Russd11b0852009-11-24 20:04:18 +1100123struct desc_ptr {
124 unsigned short size;
125 unsigned long address;
126 unsigned short segment;
Graeme Russfdee8b12011-11-08 02:33:13 +0000127} __packed;
wdenk591dda52002-11-18 00:14:45 +0000128
Graeme Russaf3f2c82011-12-19 14:26:18 +1100129struct idt_entry idt[256] __aligned(16);
wdenk591dda52002-11-18 00:14:45 +0000130
Graeme Russd11b0852009-11-24 20:04:18 +1100131struct desc_ptr idt_ptr;
wdenk591dda52002-11-18 00:14:45 +0000132
Graeme Russd11b0852009-11-24 20:04:18 +1100133static inline void load_idt(const struct desc_ptr *dtr)
134{
Graeme Russfdee8b12011-11-08 02:33:13 +0000135 asm volatile("cs lidt %0" : : "m" (*dtr));
Graeme Russd11b0852009-11-24 20:04:18 +1100136}
wdenk591dda52002-11-18 00:14:45 +0000137
Graeme Russ77290ee2009-02-24 21:13:40 +1100138void set_vector(u8 intnum, void *routine)
wdenk591dda52002-11-18 00:14:45 +0000139{
Graeme Russ078395c2009-11-24 20:04:21 +1100140 idt[intnum].base_high = (u16)((u32)(routine) >> 16);
141 idt[intnum].base_low = (u16)((u32)(routine) & 0xffff);
wdenk591dda52002-11-18 00:14:45 +0000142}
143
Graeme Russfdee8b12011-11-08 02:33:13 +0000144/*
145 * Ideally these would be defined static to avoid a checkpatch warning, but
146 * the compiler cannot see them in the inline asm and complains that they
147 * aren't defined
148 */
Graeme Russd11b0852009-11-24 20:04:18 +1100149void irq_0(void);
150void irq_1(void);
wdenk591dda52002-11-18 00:14:45 +0000151
Graeme Russ77290ee2009-02-24 21:13:40 +1100152int cpu_init_interrupts(void)
wdenk591dda52002-11-18 00:14:45 +0000153{
154 int i;
wdenk57b2d802003-06-27 21:31:46 +0000155
Graeme Russd11b0852009-11-24 20:04:18 +1100156 int irq_entry_size = irq_1 - irq_0;
157 void *irq_entry = (void *)irq_0;
158
wdenk591dda52002-11-18 00:14:45 +0000159 /* Setup the IDT */
Graeme Russfdee8b12011-11-08 02:33:13 +0000160 for (i = 0; i < 256; i++) {
wdenk591dda52002-11-18 00:14:45 +0000161 idt[i].access = 0x8e;
wdenk57b2d802003-06-27 21:31:46 +0000162 idt[i].res = 0;
163 idt[i].selector = 0x10;
Graeme Russd11b0852009-11-24 20:04:18 +1100164 set_vector(i, irq_entry);
165 irq_entry += irq_entry_size;
wdenk57b2d802003-06-27 21:31:46 +0000166 }
167
Graeme Russd11b0852009-11-24 20:04:18 +1100168 idt_ptr.size = 256 * 8;
169 idt_ptr.address = (unsigned long) idt;
170 idt_ptr.segment = 0x18;
171
172 load_idt(&idt_ptr);
wdenk57b2d802003-06-27 21:31:46 +0000173
wdenk591dda52002-11-18 00:14:45 +0000174 return 0;
175}
176
Simon Glass98d7e982015-04-28 20:25:16 -0600177void *x86_get_idt(void)
178{
179 return &idt_ptr;
180}
181
Graeme Russd11b0852009-11-24 20:04:18 +1100182void __do_irq(int irq)
183{
184 printf("Unhandled IRQ : %d\n", irq);
185}
186void do_irq(int irq) __attribute__((weak, alias("__do_irq")));
187
wdenk591dda52002-11-18 00:14:45 +0000188void enable_interrupts(void)
189{
190 asm("sti\n");
191}
192
193int disable_interrupts(void)
194{
195 long flags;
wdenk57b2d802003-06-27 21:31:46 +0000196
wdenk591dda52002-11-18 00:14:45 +0000197 asm volatile ("pushfl ; popl %0 ; cli\n" : "=g" (flags) : );
wdenk57b2d802003-06-27 21:31:46 +0000198
Graeme Russfdee8b12011-11-08 02:33:13 +0000199 return flags & X86_EFLAGS_IF;
wdenk591dda52002-11-18 00:14:45 +0000200}
Graeme Russd11b0852009-11-24 20:04:18 +1100201
Bin Mengcb9d9cb2014-11-20 16:11:16 +0800202int interrupt_init(void)
203{
204 /* Just in case... */
205 disable_interrupts();
206
207#ifdef CONFIG_SYS_PCAT_INTERRUPTS
208 /* Initialize the master/slave i8259 pic */
209 i8259_init();
210#endif
211
212 /* Initialize core interrupt and exception functionality of CPU */
213 cpu_init_interrupts();
214
215 /* It is now safe to enable interrupts */
216 enable_interrupts();
217
218 return 0;
219}
220
Graeme Russd11b0852009-11-24 20:04:18 +1100221/* IRQ Low-Level Service Routine */
Graeme Russ43261532010-10-07 20:03:23 +1100222void irq_llsr(struct irq_regs *regs)
Graeme Russd11b0852009-11-24 20:04:18 +1100223{
224 /*
225 * For detailed description of each exception, refer to:
Albert ARIBAUD60fbc8d2011-08-04 18:45:45 +0200226 * Intel® 64 and IA-32 Architectures Software Developer's Manual
Graeme Russd11b0852009-11-24 20:04:18 +1100227 * Volume 1: Basic Architecture
228 * Order Number: 253665-029US, November 2008
229 * Table 6-1. Exceptions and Interrupts
230 */
Graeme Russ43261532010-10-07 20:03:23 +1100231 switch (regs->irq_id) {
Graeme Russd11b0852009-11-24 20:04:18 +1100232 case 0x00:
Graeme Russc39acb42010-04-24 00:05:38 +1000233 printf("Divide Error (Division by zero)\n");
234 dump_regs(regs);
Graeme Russ5e0e2872011-11-08 02:33:12 +0000235 hang();
Graeme Russd11b0852009-11-24 20:04:18 +1100236 break;
237 case 0x01:
Graeme Russc39acb42010-04-24 00:05:38 +1000238 printf("Debug Interrupt (Single step)\n");
239 dump_regs(regs);
Graeme Russd11b0852009-11-24 20:04:18 +1100240 break;
241 case 0x02:
Graeme Russc39acb42010-04-24 00:05:38 +1000242 printf("NMI Interrupt\n");
243 dump_regs(regs);
Graeme Russd11b0852009-11-24 20:04:18 +1100244 break;
245 case 0x03:
Graeme Russc39acb42010-04-24 00:05:38 +1000246 printf("Breakpoint\n");
247 dump_regs(regs);
Graeme Russd11b0852009-11-24 20:04:18 +1100248 break;
249 case 0x04:
Graeme Russc39acb42010-04-24 00:05:38 +1000250 printf("Overflow\n");
251 dump_regs(regs);
Graeme Russ5e0e2872011-11-08 02:33:12 +0000252 hang();
Graeme Russd11b0852009-11-24 20:04:18 +1100253 break;
254 case 0x05:
Graeme Russc39acb42010-04-24 00:05:38 +1000255 printf("BOUND Range Exceeded\n");
256 dump_regs(regs);
Graeme Russ5e0e2872011-11-08 02:33:12 +0000257 hang();
Graeme Russd11b0852009-11-24 20:04:18 +1100258 break;
259 case 0x06:
Graeme Russc39acb42010-04-24 00:05:38 +1000260 printf("Invalid Opcode (UnDefined Opcode)\n");
261 dump_regs(regs);
Graeme Russ5e0e2872011-11-08 02:33:12 +0000262 hang();
Graeme Russd11b0852009-11-24 20:04:18 +1100263 break;
264 case 0x07:
Graeme Russc39acb42010-04-24 00:05:38 +1000265 printf("Device Not Available (No Math Coprocessor)\n");
266 dump_regs(regs);
Graeme Russ5e0e2872011-11-08 02:33:12 +0000267 hang();
Graeme Russd11b0852009-11-24 20:04:18 +1100268 break;
269 case 0x08:
Graeme Russc39acb42010-04-24 00:05:38 +1000270 printf("Double fault\n");
271 dump_regs(regs);
Graeme Russ5e0e2872011-11-08 02:33:12 +0000272 hang();
Graeme Russd11b0852009-11-24 20:04:18 +1100273 break;
274 case 0x09:
Graeme Russc39acb42010-04-24 00:05:38 +1000275 printf("Co-processor segment overrun\n");
276 dump_regs(regs);
Graeme Russ5e0e2872011-11-08 02:33:12 +0000277 hang();
Graeme Russd11b0852009-11-24 20:04:18 +1100278 break;
279 case 0x0a:
Graeme Russc39acb42010-04-24 00:05:38 +1000280 printf("Invalid TSS\n");
281 dump_regs(regs);
Graeme Russd11b0852009-11-24 20:04:18 +1100282 break;
283 case 0x0b:
Graeme Russc39acb42010-04-24 00:05:38 +1000284 printf("Segment Not Present\n");
285 dump_regs(regs);
Graeme Russ5e0e2872011-11-08 02:33:12 +0000286 hang();
Graeme Russd11b0852009-11-24 20:04:18 +1100287 break;
288 case 0x0c:
Graeme Russc39acb42010-04-24 00:05:38 +1000289 printf("Stack Segment Fault\n");
290 dump_regs(regs);
Graeme Russ5e0e2872011-11-08 02:33:12 +0000291 hang();
Graeme Russd11b0852009-11-24 20:04:18 +1100292 break;
293 case 0x0d:
Graeme Russc39acb42010-04-24 00:05:38 +1000294 printf("General Protection\n");
295 dump_regs(regs);
Graeme Russd11b0852009-11-24 20:04:18 +1100296 break;
297 case 0x0e:
Graeme Russc39acb42010-04-24 00:05:38 +1000298 printf("Page fault\n");
299 dump_regs(regs);
Graeme Russ5e0e2872011-11-08 02:33:12 +0000300 hang();
Graeme Russd11b0852009-11-24 20:04:18 +1100301 break;
302 case 0x0f:
Graeme Russc39acb42010-04-24 00:05:38 +1000303 printf("Floating-Point Error (Math Fault)\n");
304 dump_regs(regs);
Graeme Russd11b0852009-11-24 20:04:18 +1100305 break;
306 case 0x10:
Graeme Russc39acb42010-04-24 00:05:38 +1000307 printf("Alignment check\n");
308 dump_regs(regs);
Graeme Russd11b0852009-11-24 20:04:18 +1100309 break;
310 case 0x11:
Graeme Russc39acb42010-04-24 00:05:38 +1000311 printf("Machine Check\n");
312 dump_regs(regs);
Graeme Russd11b0852009-11-24 20:04:18 +1100313 break;
314 case 0x12:
Graeme Russc39acb42010-04-24 00:05:38 +1000315 printf("SIMD Floating-Point Exception\n");
316 dump_regs(regs);
Graeme Russd11b0852009-11-24 20:04:18 +1100317 break;
318 case 0x13:
319 case 0x14:
320 case 0x15:
321 case 0x16:
322 case 0x17:
323 case 0x18:
324 case 0x19:
325 case 0x1a:
326 case 0x1b:
327 case 0x1c:
328 case 0x1d:
329 case 0x1e:
330 case 0x1f:
Graeme Russc39acb42010-04-24 00:05:38 +1000331 printf("Reserved Exception\n");
332 dump_regs(regs);
Graeme Russd11b0852009-11-24 20:04:18 +1100333 break;
334
335 default:
336 /* Hardware or User IRQ */
Graeme Russ43261532010-10-07 20:03:23 +1100337 do_irq(regs->irq_id);
Graeme Russd11b0852009-11-24 20:04:18 +1100338 }
339}
340
341/*
342 * OK - This looks really horrible, but it serves a purpose - It helps create
343 * fully relocatable code.
344 * - The call to irq_llsr will be a relative jump
345 * - The IRQ entries will be guaranteed to be in order
Graeme Russc39acb42010-04-24 00:05:38 +1000346 * Interrupt entries are now very small (a push and a jump) but they are
347 * now slower (all registers pushed on stack which provides complete
348 * crash dumps in the low level handlers
Graeme Russ43261532010-10-07 20:03:23 +1100349 *
350 * Interrupt Entry Point:
351 * - Interrupt has caused eflags, CS and EIP to be pushed
352 * - Interrupt Vector Handler has pushed orig_eax
353 * - pt_regs.esp needs to be adjusted by 40 bytes:
354 * 12 bytes pushed by CPU (EFLAGSF, CS, EIP)
355 * 4 bytes pushed by vector handler (irq_id)
356 * 24 bytes pushed before SP (SS, GS, FS, ES, DS, EAX)
357 * NOTE: Only longs are pushed on/popped off the stack!
Graeme Russd11b0852009-11-24 20:04:18 +1100358 */
359asm(".globl irq_common_entry\n" \
Graeme Russ1aafcc92009-11-24 20:04:19 +1100360 ".hidden irq_common_entry\n" \
361 ".type irq_common_entry, @function\n" \
Graeme Russd11b0852009-11-24 20:04:18 +1100362 "irq_common_entry:\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000363 "cld\n" \
Graeme Russ43261532010-10-07 20:03:23 +1100364 "pushl %ss\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000365 "pushl %gs\n" \
366 "pushl %fs\n" \
367 "pushl %es\n" \
368 "pushl %ds\n" \
369 "pushl %eax\n" \
Graeme Russ43261532010-10-07 20:03:23 +1100370 "movl %esp, %eax\n" \
371 "addl $40, %eax\n" \
372 "pushl %eax\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000373 "pushl %ebp\n" \
374 "pushl %edi\n" \
375 "pushl %esi\n" \
376 "pushl %edx\n" \
377 "pushl %ecx\n" \
378 "pushl %ebx\n" \
379 "mov %esp, %eax\n" \
Graeme Russd11b0852009-11-24 20:04:18 +1100380 "call irq_llsr\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000381 "popl %ebx\n" \
382 "popl %ecx\n" \
383 "popl %edx\n" \
384 "popl %esi\n" \
385 "popl %edi\n" \
386 "popl %ebp\n" \
387 "popl %eax\n" \
Graeme Russ43261532010-10-07 20:03:23 +1100388 "popl %eax\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000389 "popl %ds\n" \
390 "popl %es\n" \
391 "popl %fs\n" \
392 "popl %gs\n" \
Graeme Russ43261532010-10-07 20:03:23 +1100393 "popl %ss\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000394 "add $4, %esp\n" \
Graeme Russd11b0852009-11-24 20:04:18 +1100395 "iret\n" \
396 DECLARE_INTERRUPT(0) \
397 DECLARE_INTERRUPT(1) \
398 DECLARE_INTERRUPT(2) \
399 DECLARE_INTERRUPT(3) \
400 DECLARE_INTERRUPT(4) \
401 DECLARE_INTERRUPT(5) \
402 DECLARE_INTERRUPT(6) \
403 DECLARE_INTERRUPT(7) \
404 DECLARE_INTERRUPT(8) \
405 DECLARE_INTERRUPT(9) \
406 DECLARE_INTERRUPT(10) \
407 DECLARE_INTERRUPT(11) \
408 DECLARE_INTERRUPT(12) \
409 DECLARE_INTERRUPT(13) \
410 DECLARE_INTERRUPT(14) \
411 DECLARE_INTERRUPT(15) \
412 DECLARE_INTERRUPT(16) \
413 DECLARE_INTERRUPT(17) \
414 DECLARE_INTERRUPT(18) \
415 DECLARE_INTERRUPT(19) \
416 DECLARE_INTERRUPT(20) \
417 DECLARE_INTERRUPT(21) \
418 DECLARE_INTERRUPT(22) \
419 DECLARE_INTERRUPT(23) \
420 DECLARE_INTERRUPT(24) \
421 DECLARE_INTERRUPT(25) \
422 DECLARE_INTERRUPT(26) \
423 DECLARE_INTERRUPT(27) \
424 DECLARE_INTERRUPT(28) \
425 DECLARE_INTERRUPT(29) \
426 DECLARE_INTERRUPT(30) \
427 DECLARE_INTERRUPT(31) \
428 DECLARE_INTERRUPT(32) \
429 DECLARE_INTERRUPT(33) \
430 DECLARE_INTERRUPT(34) \
431 DECLARE_INTERRUPT(35) \
432 DECLARE_INTERRUPT(36) \
433 DECLARE_INTERRUPT(37) \
434 DECLARE_INTERRUPT(38) \
435 DECLARE_INTERRUPT(39) \
436 DECLARE_INTERRUPT(40) \
437 DECLARE_INTERRUPT(41) \
438 DECLARE_INTERRUPT(42) \
439 DECLARE_INTERRUPT(43) \
440 DECLARE_INTERRUPT(44) \
441 DECLARE_INTERRUPT(45) \
442 DECLARE_INTERRUPT(46) \
443 DECLARE_INTERRUPT(47) \
444 DECLARE_INTERRUPT(48) \
445 DECLARE_INTERRUPT(49) \
446 DECLARE_INTERRUPT(50) \
447 DECLARE_INTERRUPT(51) \
448 DECLARE_INTERRUPT(52) \
449 DECLARE_INTERRUPT(53) \
450 DECLARE_INTERRUPT(54) \
451 DECLARE_INTERRUPT(55) \
452 DECLARE_INTERRUPT(56) \
453 DECLARE_INTERRUPT(57) \
454 DECLARE_INTERRUPT(58) \
455 DECLARE_INTERRUPT(59) \
456 DECLARE_INTERRUPT(60) \
457 DECLARE_INTERRUPT(61) \
458 DECLARE_INTERRUPT(62) \
459 DECLARE_INTERRUPT(63) \
460 DECLARE_INTERRUPT(64) \
461 DECLARE_INTERRUPT(65) \
462 DECLARE_INTERRUPT(66) \
463 DECLARE_INTERRUPT(67) \
464 DECLARE_INTERRUPT(68) \
465 DECLARE_INTERRUPT(69) \
466 DECLARE_INTERRUPT(70) \
467 DECLARE_INTERRUPT(71) \
468 DECLARE_INTERRUPT(72) \
469 DECLARE_INTERRUPT(73) \
470 DECLARE_INTERRUPT(74) \
471 DECLARE_INTERRUPT(75) \
472 DECLARE_INTERRUPT(76) \
473 DECLARE_INTERRUPT(77) \
474 DECLARE_INTERRUPT(78) \
475 DECLARE_INTERRUPT(79) \
476 DECLARE_INTERRUPT(80) \
477 DECLARE_INTERRUPT(81) \
478 DECLARE_INTERRUPT(82) \
479 DECLARE_INTERRUPT(83) \
480 DECLARE_INTERRUPT(84) \
481 DECLARE_INTERRUPT(85) \
482 DECLARE_INTERRUPT(86) \
483 DECLARE_INTERRUPT(87) \
484 DECLARE_INTERRUPT(88) \
485 DECLARE_INTERRUPT(89) \
486 DECLARE_INTERRUPT(90) \
487 DECLARE_INTERRUPT(91) \
488 DECLARE_INTERRUPT(92) \
489 DECLARE_INTERRUPT(93) \
490 DECLARE_INTERRUPT(94) \
491 DECLARE_INTERRUPT(95) \
492 DECLARE_INTERRUPT(97) \
493 DECLARE_INTERRUPT(96) \
494 DECLARE_INTERRUPT(98) \
495 DECLARE_INTERRUPT(99) \
496 DECLARE_INTERRUPT(100) \
497 DECLARE_INTERRUPT(101) \
498 DECLARE_INTERRUPT(102) \
499 DECLARE_INTERRUPT(103) \
500 DECLARE_INTERRUPT(104) \
501 DECLARE_INTERRUPT(105) \
502 DECLARE_INTERRUPT(106) \
503 DECLARE_INTERRUPT(107) \
504 DECLARE_INTERRUPT(108) \
505 DECLARE_INTERRUPT(109) \
506 DECLARE_INTERRUPT(110) \
507 DECLARE_INTERRUPT(111) \
508 DECLARE_INTERRUPT(112) \
509 DECLARE_INTERRUPT(113) \
510 DECLARE_INTERRUPT(114) \
511 DECLARE_INTERRUPT(115) \
512 DECLARE_INTERRUPT(116) \
513 DECLARE_INTERRUPT(117) \
514 DECLARE_INTERRUPT(118) \
515 DECLARE_INTERRUPT(119) \
516 DECLARE_INTERRUPT(120) \
517 DECLARE_INTERRUPT(121) \
518 DECLARE_INTERRUPT(122) \
519 DECLARE_INTERRUPT(123) \
520 DECLARE_INTERRUPT(124) \
521 DECLARE_INTERRUPT(125) \
522 DECLARE_INTERRUPT(126) \
523 DECLARE_INTERRUPT(127) \
524 DECLARE_INTERRUPT(128) \
525 DECLARE_INTERRUPT(129) \
526 DECLARE_INTERRUPT(130) \
527 DECLARE_INTERRUPT(131) \
528 DECLARE_INTERRUPT(132) \
529 DECLARE_INTERRUPT(133) \
530 DECLARE_INTERRUPT(134) \
531 DECLARE_INTERRUPT(135) \
532 DECLARE_INTERRUPT(136) \
533 DECLARE_INTERRUPT(137) \
534 DECLARE_INTERRUPT(138) \
535 DECLARE_INTERRUPT(139) \
536 DECLARE_INTERRUPT(140) \
537 DECLARE_INTERRUPT(141) \
538 DECLARE_INTERRUPT(142) \
539 DECLARE_INTERRUPT(143) \
540 DECLARE_INTERRUPT(144) \
541 DECLARE_INTERRUPT(145) \
542 DECLARE_INTERRUPT(146) \
543 DECLARE_INTERRUPT(147) \
544 DECLARE_INTERRUPT(148) \
545 DECLARE_INTERRUPT(149) \
546 DECLARE_INTERRUPT(150) \
547 DECLARE_INTERRUPT(151) \
548 DECLARE_INTERRUPT(152) \
549 DECLARE_INTERRUPT(153) \
550 DECLARE_INTERRUPT(154) \
551 DECLARE_INTERRUPT(155) \
552 DECLARE_INTERRUPT(156) \
553 DECLARE_INTERRUPT(157) \
554 DECLARE_INTERRUPT(158) \
555 DECLARE_INTERRUPT(159) \
556 DECLARE_INTERRUPT(160) \
557 DECLARE_INTERRUPT(161) \
558 DECLARE_INTERRUPT(162) \
559 DECLARE_INTERRUPT(163) \
560 DECLARE_INTERRUPT(164) \
561 DECLARE_INTERRUPT(165) \
562 DECLARE_INTERRUPT(166) \
563 DECLARE_INTERRUPT(167) \
564 DECLARE_INTERRUPT(168) \
565 DECLARE_INTERRUPT(169) \
566 DECLARE_INTERRUPT(170) \
567 DECLARE_INTERRUPT(171) \
568 DECLARE_INTERRUPT(172) \
569 DECLARE_INTERRUPT(173) \
570 DECLARE_INTERRUPT(174) \
571 DECLARE_INTERRUPT(175) \
572 DECLARE_INTERRUPT(176) \
573 DECLARE_INTERRUPT(177) \
574 DECLARE_INTERRUPT(178) \
575 DECLARE_INTERRUPT(179) \
576 DECLARE_INTERRUPT(180) \
577 DECLARE_INTERRUPT(181) \
578 DECLARE_INTERRUPT(182) \
579 DECLARE_INTERRUPT(183) \
580 DECLARE_INTERRUPT(184) \
581 DECLARE_INTERRUPT(185) \
582 DECLARE_INTERRUPT(186) \
583 DECLARE_INTERRUPT(187) \
584 DECLARE_INTERRUPT(188) \
585 DECLARE_INTERRUPT(189) \
586 DECLARE_INTERRUPT(190) \
587 DECLARE_INTERRUPT(191) \
588 DECLARE_INTERRUPT(192) \
589 DECLARE_INTERRUPT(193) \
590 DECLARE_INTERRUPT(194) \
591 DECLARE_INTERRUPT(195) \
592 DECLARE_INTERRUPT(196) \
593 DECLARE_INTERRUPT(197) \
594 DECLARE_INTERRUPT(198) \
595 DECLARE_INTERRUPT(199) \
596 DECLARE_INTERRUPT(200) \
597 DECLARE_INTERRUPT(201) \
598 DECLARE_INTERRUPT(202) \
599 DECLARE_INTERRUPT(203) \
600 DECLARE_INTERRUPT(204) \
601 DECLARE_INTERRUPT(205) \
602 DECLARE_INTERRUPT(206) \
603 DECLARE_INTERRUPT(207) \
604 DECLARE_INTERRUPT(208) \
605 DECLARE_INTERRUPT(209) \
606 DECLARE_INTERRUPT(210) \
607 DECLARE_INTERRUPT(211) \
608 DECLARE_INTERRUPT(212) \
609 DECLARE_INTERRUPT(213) \
610 DECLARE_INTERRUPT(214) \
611 DECLARE_INTERRUPT(215) \
612 DECLARE_INTERRUPT(216) \
613 DECLARE_INTERRUPT(217) \
614 DECLARE_INTERRUPT(218) \
615 DECLARE_INTERRUPT(219) \
616 DECLARE_INTERRUPT(220) \
617 DECLARE_INTERRUPT(221) \
618 DECLARE_INTERRUPT(222) \
619 DECLARE_INTERRUPT(223) \
620 DECLARE_INTERRUPT(224) \
621 DECLARE_INTERRUPT(225) \
622 DECLARE_INTERRUPT(226) \
623 DECLARE_INTERRUPT(227) \
624 DECLARE_INTERRUPT(228) \
625 DECLARE_INTERRUPT(229) \
626 DECLARE_INTERRUPT(230) \
627 DECLARE_INTERRUPT(231) \
628 DECLARE_INTERRUPT(232) \
629 DECLARE_INTERRUPT(233) \
630 DECLARE_INTERRUPT(234) \
631 DECLARE_INTERRUPT(235) \
632 DECLARE_INTERRUPT(236) \
633 DECLARE_INTERRUPT(237) \
634 DECLARE_INTERRUPT(238) \
635 DECLARE_INTERRUPT(239) \
636 DECLARE_INTERRUPT(240) \
637 DECLARE_INTERRUPT(241) \
638 DECLARE_INTERRUPT(242) \
639 DECLARE_INTERRUPT(243) \
640 DECLARE_INTERRUPT(244) \
641 DECLARE_INTERRUPT(245) \
642 DECLARE_INTERRUPT(246) \
643 DECLARE_INTERRUPT(247) \
644 DECLARE_INTERRUPT(248) \
645 DECLARE_INTERRUPT(249) \
646 DECLARE_INTERRUPT(250) \
647 DECLARE_INTERRUPT(251) \
648 DECLARE_INTERRUPT(252) \
649 DECLARE_INTERRUPT(253) \
650 DECLARE_INTERRUPT(254) \
651 DECLARE_INTERRUPT(255));