blob: 4c7e9ea2151e26573d321c23f3301cde892a751a [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
wdenk591dda52002-11-18 00:14:45 +00002/*
Graeme Russ45fc1d82011-04-13 19:43:26 +10003 * (C) Copyright 2008-2011
4 * Graeme Russ, <graeme.russ@gmail.com>
Graeme Russd11b0852009-11-24 20:04:18 +11005 *
wdenk591dda52002-11-18 00:14:45 +00006 * (C) Copyright 2002
Albert ARIBAUD60fbc8d2011-08-04 18:45:45 +02007 * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
wdenk591dda52002-11-18 00:14:45 +00008 *
Graeme Russc39acb42010-04-24 00:05:38 +10009 * Portions of this file are derived from the Linux kernel source
10 * Copyright (C) 1991, 1992 Linus Torvalds
wdenk591dda52002-11-18 00:14:45 +000011 */
12
13#include <common.h>
Simon Glass754f55e2016-01-19 21:32:26 -070014#include <dm.h>
Heinrich Schuchardt954108d2019-08-25 19:55:12 +020015#include <efi_loader.h>
Simon Glassf11478f2019-12-28 10:45:07 -070016#include <hang.h>
Simon Glassda25eff2019-12-28 10:44:56 -070017#include <init.h>
Simon Glass21bb12a2020-02-06 09:54:58 -070018#include <irq.h>
Simon Glass9b61c7c2019-11-14 12:57:41 -070019#include <irq_func.h>
Stefan Reinauer2acf8482012-12-02 04:49:50 +000020#include <asm/control_regs.h>
Bin Mengd538c362016-05-22 01:45:33 -070021#include <asm/i8259.h>
Graeme Russ0c8c62e2008-12-07 10:29:01 +110022#include <asm/interrupt.h>
Graeme Russ68699802011-02-12 15:11:28 +110023#include <asm/io.h>
Bin Mengd538c362016-05-22 01:45:33 -070024#include <asm/lapic.h>
Bin Mengd538c362016-05-22 01:45:33 -070025#include <asm/processor-flags.h>
wdenk591dda52002-11-18 00:14:45 +000026
Simon Glassbb6306c2013-04-17 16:13:33 +000027DECLARE_GLOBAL_DATA_PTR;
28
Graeme Russd11b0852009-11-24 20:04:18 +110029#define DECLARE_INTERRUPT(x) \
30 ".globl irq_"#x"\n" \
Graeme Russ1aafcc92009-11-24 20:04:19 +110031 ".hidden irq_"#x"\n" \
32 ".type irq_"#x", @function\n" \
Graeme Russd11b0852009-11-24 20:04:18 +110033 "irq_"#x":\n" \
Graeme Russd11b0852009-11-24 20:04:18 +110034 "pushl $"#x"\n" \
J. Tang6c0712a2017-02-09 21:54:13 -050035 "jmp.d32 irq_common_entry\n"
wdenk591dda52002-11-18 00:14:45 +000036
Bin Mengfdebed82015-07-10 10:51:23 +080037static char *exceptions[] = {
38 "Divide Error",
39 "Debug",
40 "NMI Interrupt",
41 "Breakpoint",
42 "Overflow",
43 "BOUND Range Exceeded",
44 "Invalid Opcode (Undefined Opcode)",
Vagrant Cascadian973c0992019-05-03 14:28:37 -080045 "Device Not Available (No Math Coprocessor)",
Bin Mengfdebed82015-07-10 10:51:23 +080046 "Double Fault",
47 "Coprocessor Segment Overrun",
48 "Invalid TSS",
49 "Segment Not Present",
50 "Stack Segment Fault",
Simon Glassc4b9ef82015-07-31 09:31:32 -060051 "General Protection",
Bin Mengfdebed82015-07-10 10:51:23 +080052 "Page Fault",
53 "Reserved",
54 "x87 FPU Floating-Point Error",
55 "Alignment Check",
56 "Machine Check",
57 "SIMD Floating-Point Exception",
58 "Virtualization Exception",
59 "Reserved",
60 "Reserved",
61 "Reserved",
62 "Reserved",
63 "Reserved",
64 "Reserved",
65 "Reserved",
66 "Reserved",
67 "Reserved",
68 "Reserved",
69 "Reserved"
70};
71
Heinrich Schuchardt954108d2019-08-25 19:55:12 +020072/**
73 * show_efi_loaded_images() - show loaded UEFI images
74 *
75 * List all loaded UEFI images.
76 *
77 * @eip: instruction pointer
78 */
79static void show_efi_loaded_images(uintptr_t eip)
80{
81 efi_print_image_infos((void *)eip);
82}
83
Simon Glass83374332014-11-06 13:20:08 -070084static void dump_regs(struct irq_regs *regs)
Graeme Russc39acb42010-04-24 00:05:38 +100085{
Bin Meng9ff054b2015-07-10 10:38:32 +080086 unsigned long cs, eip, eflags;
Graeme Russc39acb42010-04-24 00:05:38 +100087 unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
88 unsigned long d0, d1, d2, d3, d6, d7;
Graeme Russ68699802011-02-12 15:11:28 +110089 unsigned long sp;
Graeme Russc39acb42010-04-24 00:05:38 +100090
Bin Meng9ff054b2015-07-10 10:38:32 +080091 /*
92 * Some exceptions cause an error code to be saved on the current stack
93 * after the EIP value. We should extract CS/EIP/EFLAGS from different
94 * position on the stack based on the exception number.
95 */
96 switch (regs->irq_id) {
97 case EXC_DF:
98 case EXC_TS:
99 case EXC_NP:
100 case EXC_SS:
101 case EXC_GP:
102 case EXC_PF:
103 case EXC_AC:
104 cs = regs->context.ctx2.xcs;
105 eip = regs->context.ctx2.eip;
106 eflags = regs->context.ctx2.eflags;
107 /* We should fix up the ESP due to error code */
108 regs->esp += 4;
109 break;
110 default:
111 cs = regs->context.ctx1.xcs;
112 eip = regs->context.ctx1.eip;
113 eflags = regs->context.ctx1.eflags;
114 break;
115 }
116
Graeme Russc39acb42010-04-24 00:05:38 +1000117 printf("EIP: %04x:[<%08lx>] EFLAGS: %08lx\n",
Bin Meng9ff054b2015-07-10 10:38:32 +0800118 (u16)cs, eip, eflags);
Simon Glass79dd4342015-08-10 22:02:54 -0600119 if (gd->flags & GD_FLG_RELOC)
120 printf("Original EIP :[<%08lx>]\n", eip - gd->reloc_off);
Graeme Russc39acb42010-04-24 00:05:38 +1000121
122 printf("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
123 regs->eax, regs->ebx, regs->ecx, regs->edx);
124 printf("ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n",
125 regs->esi, regs->edi, regs->ebp, regs->esp);
126 printf(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n",
Graeme Russfdee8b12011-11-08 02:33:13 +0000127 (u16)regs->xds, (u16)regs->xes, (u16)regs->xfs,
128 (u16)regs->xgs, (u16)regs->xss);
Graeme Russc39acb42010-04-24 00:05:38 +1000129
130 cr0 = read_cr0();
131 cr2 = read_cr2();
132 cr3 = read_cr3();
133 cr4 = read_cr4();
134
135 printf("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n",
136 cr0, cr2, cr3, cr4);
137
138 d0 = get_debugreg(0);
139 d1 = get_debugreg(1);
140 d2 = get_debugreg(2);
141 d3 = get_debugreg(3);
142
143 printf("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n",
144 d0, d1, d2, d3);
145
146 d6 = get_debugreg(6);
147 d7 = get_debugreg(7);
148 printf("DR6: %08lx DR7: %08lx\n",
149 d6, d7);
Graeme Russ68699802011-02-12 15:11:28 +1100150
151 printf("Stack:\n");
152 sp = regs->esp;
153
154 sp += 64;
155
156 while (sp > (regs->esp - 16)) {
157 if (sp == regs->esp)
158 printf("--->");
159 else
160 printf(" ");
161 printf("0x%8.8lx : 0x%8.8lx\n", sp, (ulong)readl(sp));
162 sp -= 4;
163 }
Heinrich Schuchardt954108d2019-08-25 19:55:12 +0200164 show_efi_loaded_images(eip);
Graeme Russc39acb42010-04-24 00:05:38 +1000165}
166
Bin Mengfdebed82015-07-10 10:51:23 +0800167static void do_exception(struct irq_regs *regs)
168{
169 printf("%s\n", exceptions[regs->irq_id]);
170 dump_regs(regs);
171 hang();
172}
173
wdenk591dda52002-11-18 00:14:45 +0000174struct idt_entry {
175 u16 base_low;
176 u16 selector;
177 u8 res;
178 u8 access;
179 u16 base_high;
Graeme Russfdee8b12011-11-08 02:33:13 +0000180} __packed;
wdenk591dda52002-11-18 00:14:45 +0000181
Graeme Russd11b0852009-11-24 20:04:18 +1100182struct desc_ptr {
183 unsigned short size;
184 unsigned long address;
Graeme Russfdee8b12011-11-08 02:33:13 +0000185} __packed;
wdenk591dda52002-11-18 00:14:45 +0000186
Graeme Russaf3f2c82011-12-19 14:26:18 +1100187struct idt_entry idt[256] __aligned(16);
wdenk591dda52002-11-18 00:14:45 +0000188
Graeme Russd11b0852009-11-24 20:04:18 +1100189struct desc_ptr idt_ptr;
wdenk591dda52002-11-18 00:14:45 +0000190
Graeme Russd11b0852009-11-24 20:04:18 +1100191static inline void load_idt(const struct desc_ptr *dtr)
192{
Graeme Russfdee8b12011-11-08 02:33:13 +0000193 asm volatile("cs lidt %0" : : "m" (*dtr));
Graeme Russd11b0852009-11-24 20:04:18 +1100194}
wdenk591dda52002-11-18 00:14:45 +0000195
Graeme Russ77290ee2009-02-24 21:13:40 +1100196void set_vector(u8 intnum, void *routine)
wdenk591dda52002-11-18 00:14:45 +0000197{
Simon Glassb58770f2016-09-25 21:33:25 -0600198 idt[intnum].base_high = (u16)((ulong)(routine) >> 16);
199 idt[intnum].base_low = (u16)((ulong)(routine) & 0xffff);
wdenk591dda52002-11-18 00:14:45 +0000200}
201
Graeme Russfdee8b12011-11-08 02:33:13 +0000202/*
203 * Ideally these would be defined static to avoid a checkpatch warning, but
204 * the compiler cannot see them in the inline asm and complains that they
205 * aren't defined
206 */
Graeme Russd11b0852009-11-24 20:04:18 +1100207void irq_0(void);
208void irq_1(void);
wdenk591dda52002-11-18 00:14:45 +0000209
Graeme Russ77290ee2009-02-24 21:13:40 +1100210int cpu_init_interrupts(void)
wdenk591dda52002-11-18 00:14:45 +0000211{
212 int i;
wdenk57b2d802003-06-27 21:31:46 +0000213
Graeme Russd11b0852009-11-24 20:04:18 +1100214 int irq_entry_size = irq_1 - irq_0;
215 void *irq_entry = (void *)irq_0;
216
wdenk591dda52002-11-18 00:14:45 +0000217 /* Setup the IDT */
Graeme Russfdee8b12011-11-08 02:33:13 +0000218 for (i = 0; i < 256; i++) {
wdenk591dda52002-11-18 00:14:45 +0000219 idt[i].access = 0x8e;
wdenk57b2d802003-06-27 21:31:46 +0000220 idt[i].res = 0;
Simon Glassc4b9ef82015-07-31 09:31:32 -0600221 idt[i].selector = X86_GDT_ENTRY_32BIT_CS * X86_GDT_ENTRY_SIZE;
Graeme Russd11b0852009-11-24 20:04:18 +1100222 set_vector(i, irq_entry);
223 irq_entry += irq_entry_size;
wdenk57b2d802003-06-27 21:31:46 +0000224 }
225
Simon Glassc4b9ef82015-07-31 09:31:32 -0600226 idt_ptr.size = 256 * 8 - 1;
Graeme Russd11b0852009-11-24 20:04:18 +1100227 idt_ptr.address = (unsigned long) idt;
Graeme Russd11b0852009-11-24 20:04:18 +1100228
229 load_idt(&idt_ptr);
wdenk57b2d802003-06-27 21:31:46 +0000230
wdenk591dda52002-11-18 00:14:45 +0000231 return 0;
232}
233
Simon Glass98d7e982015-04-28 20:25:16 -0600234void *x86_get_idt(void)
235{
236 return &idt_ptr;
237}
238
Graeme Russd11b0852009-11-24 20:04:18 +1100239void __do_irq(int irq)
240{
241 printf("Unhandled IRQ : %d\n", irq);
242}
243void do_irq(int irq) __attribute__((weak, alias("__do_irq")));
244
wdenk591dda52002-11-18 00:14:45 +0000245void enable_interrupts(void)
246{
247 asm("sti\n");
248}
249
250int disable_interrupts(void)
251{
252 long flags;
wdenk57b2d802003-06-27 21:31:46 +0000253
Simon Glass1560a632017-01-16 07:04:00 -0700254#if CONFIG_IS_ENABLED(X86_64)
Simon Glass87086d52016-09-25 21:33:23 -0600255 asm volatile ("pushfq ; popq %0 ; cli\n" : "=g" (flags) : );
256#else
wdenk591dda52002-11-18 00:14:45 +0000257 asm volatile ("pushfl ; popl %0 ; cli\n" : "=g" (flags) : );
Simon Glass87086d52016-09-25 21:33:23 -0600258#endif
Graeme Russfdee8b12011-11-08 02:33:13 +0000259 return flags & X86_EFLAGS_IF;
wdenk591dda52002-11-18 00:14:45 +0000260}
Graeme Russd11b0852009-11-24 20:04:18 +1100261
Bin Mengcb9d9cb2014-11-20 16:11:16 +0800262int interrupt_init(void)
263{
Simon Glass754f55e2016-01-19 21:32:26 -0700264 struct udevice *dev;
265 int ret;
266
267 /* Try to set up the interrupt router, but don't require one */
Simon Glass21bb12a2020-02-06 09:54:58 -0700268 ret = irq_first_device_type(X86_IRQT_BASE, &dev);
Simon Glass754f55e2016-01-19 21:32:26 -0700269 if (ret && ret != -ENODEV)
270 return ret;
271
Ben Stoltzab76a472015-08-04 12:33:46 -0600272 /*
273 * When running as an EFI application we are not in control of
274 * interrupts and should leave them alone.
275 */
276#ifndef CONFIG_EFI_APP
Bin Mengcb9d9cb2014-11-20 16:11:16 +0800277 /* Just in case... */
278 disable_interrupts();
279
Bin Mengb29a08c2015-10-22 19:13:30 -0700280#ifdef CONFIG_I8259_PIC
Bin Mengcb9d9cb2014-11-20 16:11:16 +0800281 /* Initialize the master/slave i8259 pic */
282 i8259_init();
283#endif
284
Hannes Schmelzerd18df3c2018-11-18 23:19:43 +0100285#ifdef CONFIG_APIC
Bin Mengd538c362016-05-22 01:45:33 -0700286 lapic_setup();
Hannes Schmelzerd18df3c2018-11-18 23:19:43 +0100287#endif
Bin Mengd538c362016-05-22 01:45:33 -0700288
Bin Mengcb9d9cb2014-11-20 16:11:16 +0800289 /* Initialize core interrupt and exception functionality of CPU */
290 cpu_init_interrupts();
291
Simon Glass2b6d80b2015-08-04 12:34:00 -0600292 /*
293 * It is now safe to enable interrupts.
294 *
295 * TODO(sjg@chromium.org): But we don't handle these correctly when
296 * booted from EFI.
297 */
298 if (ll_boot_init())
299 enable_interrupts();
Ben Stoltzab76a472015-08-04 12:33:46 -0600300#endif
Bin Mengcb9d9cb2014-11-20 16:11:16 +0800301
302 return 0;
303}
304
Graeme Russd11b0852009-11-24 20:04:18 +1100305/* IRQ Low-Level Service Routine */
Graeme Russ43261532010-10-07 20:03:23 +1100306void irq_llsr(struct irq_regs *regs)
Graeme Russd11b0852009-11-24 20:04:18 +1100307{
308 /*
309 * For detailed description of each exception, refer to:
Albert ARIBAUD60fbc8d2011-08-04 18:45:45 +0200310 * Intel® 64 and IA-32 Architectures Software Developer's Manual
Graeme Russd11b0852009-11-24 20:04:18 +1100311 * Volume 1: Basic Architecture
312 * Order Number: 253665-029US, November 2008
313 * Table 6-1. Exceptions and Interrupts
314 */
Bin Mengfdebed82015-07-10 10:51:23 +0800315 if (regs->irq_id < 32) {
316 /* Architecture defined exception */
317 do_exception(regs);
318 } else {
Graeme Russd11b0852009-11-24 20:04:18 +1100319 /* Hardware or User IRQ */
Graeme Russ43261532010-10-07 20:03:23 +1100320 do_irq(regs->irq_id);
Graeme Russd11b0852009-11-24 20:04:18 +1100321 }
322}
323
324/*
325 * OK - This looks really horrible, but it serves a purpose - It helps create
326 * fully relocatable code.
327 * - The call to irq_llsr will be a relative jump
328 * - The IRQ entries will be guaranteed to be in order
Graeme Russc39acb42010-04-24 00:05:38 +1000329 * Interrupt entries are now very small (a push and a jump) but they are
330 * now slower (all registers pushed on stack which provides complete
331 * crash dumps in the low level handlers
Graeme Russ43261532010-10-07 20:03:23 +1100332 *
333 * Interrupt Entry Point:
334 * - Interrupt has caused eflags, CS and EIP to be pushed
335 * - Interrupt Vector Handler has pushed orig_eax
336 * - pt_regs.esp needs to be adjusted by 40 bytes:
337 * 12 bytes pushed by CPU (EFLAGSF, CS, EIP)
338 * 4 bytes pushed by vector handler (irq_id)
339 * 24 bytes pushed before SP (SS, GS, FS, ES, DS, EAX)
340 * NOTE: Only longs are pushed on/popped off the stack!
Graeme Russd11b0852009-11-24 20:04:18 +1100341 */
342asm(".globl irq_common_entry\n" \
Graeme Russ1aafcc92009-11-24 20:04:19 +1100343 ".hidden irq_common_entry\n" \
344 ".type irq_common_entry, @function\n" \
Graeme Russd11b0852009-11-24 20:04:18 +1100345 "irq_common_entry:\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000346 "cld\n" \
Graeme Russ43261532010-10-07 20:03:23 +1100347 "pushl %ss\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000348 "pushl %gs\n" \
349 "pushl %fs\n" \
350 "pushl %es\n" \
351 "pushl %ds\n" \
352 "pushl %eax\n" \
Graeme Russ43261532010-10-07 20:03:23 +1100353 "movl %esp, %eax\n" \
354 "addl $40, %eax\n" \
355 "pushl %eax\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000356 "pushl %ebp\n" \
357 "pushl %edi\n" \
358 "pushl %esi\n" \
359 "pushl %edx\n" \
360 "pushl %ecx\n" \
361 "pushl %ebx\n" \
362 "mov %esp, %eax\n" \
Graeme Russd11b0852009-11-24 20:04:18 +1100363 "call irq_llsr\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000364 "popl %ebx\n" \
365 "popl %ecx\n" \
366 "popl %edx\n" \
367 "popl %esi\n" \
368 "popl %edi\n" \
369 "popl %ebp\n" \
370 "popl %eax\n" \
Graeme Russ43261532010-10-07 20:03:23 +1100371 "popl %eax\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000372 "popl %ds\n" \
373 "popl %es\n" \
374 "popl %fs\n" \
375 "popl %gs\n" \
Graeme Russ43261532010-10-07 20:03:23 +1100376 "popl %ss\n" \
Graeme Russc39acb42010-04-24 00:05:38 +1000377 "add $4, %esp\n" \
Graeme Russd11b0852009-11-24 20:04:18 +1100378 "iret\n" \
379 DECLARE_INTERRUPT(0) \
380 DECLARE_INTERRUPT(1) \
381 DECLARE_INTERRUPT(2) \
382 DECLARE_INTERRUPT(3) \
383 DECLARE_INTERRUPT(4) \
384 DECLARE_INTERRUPT(5) \
385 DECLARE_INTERRUPT(6) \
386 DECLARE_INTERRUPT(7) \
387 DECLARE_INTERRUPT(8) \
388 DECLARE_INTERRUPT(9) \
389 DECLARE_INTERRUPT(10) \
390 DECLARE_INTERRUPT(11) \
391 DECLARE_INTERRUPT(12) \
392 DECLARE_INTERRUPT(13) \
393 DECLARE_INTERRUPT(14) \
394 DECLARE_INTERRUPT(15) \
395 DECLARE_INTERRUPT(16) \
396 DECLARE_INTERRUPT(17) \
397 DECLARE_INTERRUPT(18) \
398 DECLARE_INTERRUPT(19) \
399 DECLARE_INTERRUPT(20) \
400 DECLARE_INTERRUPT(21) \
401 DECLARE_INTERRUPT(22) \
402 DECLARE_INTERRUPT(23) \
403 DECLARE_INTERRUPT(24) \
404 DECLARE_INTERRUPT(25) \
405 DECLARE_INTERRUPT(26) \
406 DECLARE_INTERRUPT(27) \
407 DECLARE_INTERRUPT(28) \
408 DECLARE_INTERRUPT(29) \
409 DECLARE_INTERRUPT(30) \
410 DECLARE_INTERRUPT(31) \
411 DECLARE_INTERRUPT(32) \
412 DECLARE_INTERRUPT(33) \
413 DECLARE_INTERRUPT(34) \
414 DECLARE_INTERRUPT(35) \
415 DECLARE_INTERRUPT(36) \
416 DECLARE_INTERRUPT(37) \
417 DECLARE_INTERRUPT(38) \
418 DECLARE_INTERRUPT(39) \
419 DECLARE_INTERRUPT(40) \
420 DECLARE_INTERRUPT(41) \
421 DECLARE_INTERRUPT(42) \
422 DECLARE_INTERRUPT(43) \
423 DECLARE_INTERRUPT(44) \
424 DECLARE_INTERRUPT(45) \
425 DECLARE_INTERRUPT(46) \
426 DECLARE_INTERRUPT(47) \
427 DECLARE_INTERRUPT(48) \
428 DECLARE_INTERRUPT(49) \
429 DECLARE_INTERRUPT(50) \
430 DECLARE_INTERRUPT(51) \
431 DECLARE_INTERRUPT(52) \
432 DECLARE_INTERRUPT(53) \
433 DECLARE_INTERRUPT(54) \
434 DECLARE_INTERRUPT(55) \
435 DECLARE_INTERRUPT(56) \
436 DECLARE_INTERRUPT(57) \
437 DECLARE_INTERRUPT(58) \
438 DECLARE_INTERRUPT(59) \
439 DECLARE_INTERRUPT(60) \
440 DECLARE_INTERRUPT(61) \
441 DECLARE_INTERRUPT(62) \
442 DECLARE_INTERRUPT(63) \
443 DECLARE_INTERRUPT(64) \
444 DECLARE_INTERRUPT(65) \
445 DECLARE_INTERRUPT(66) \
446 DECLARE_INTERRUPT(67) \
447 DECLARE_INTERRUPT(68) \
448 DECLARE_INTERRUPT(69) \
449 DECLARE_INTERRUPT(70) \
450 DECLARE_INTERRUPT(71) \
451 DECLARE_INTERRUPT(72) \
452 DECLARE_INTERRUPT(73) \
453 DECLARE_INTERRUPT(74) \
454 DECLARE_INTERRUPT(75) \
455 DECLARE_INTERRUPT(76) \
456 DECLARE_INTERRUPT(77) \
457 DECLARE_INTERRUPT(78) \
458 DECLARE_INTERRUPT(79) \
459 DECLARE_INTERRUPT(80) \
460 DECLARE_INTERRUPT(81) \
461 DECLARE_INTERRUPT(82) \
462 DECLARE_INTERRUPT(83) \
463 DECLARE_INTERRUPT(84) \
464 DECLARE_INTERRUPT(85) \
465 DECLARE_INTERRUPT(86) \
466 DECLARE_INTERRUPT(87) \
467 DECLARE_INTERRUPT(88) \
468 DECLARE_INTERRUPT(89) \
469 DECLARE_INTERRUPT(90) \
470 DECLARE_INTERRUPT(91) \
471 DECLARE_INTERRUPT(92) \
472 DECLARE_INTERRUPT(93) \
473 DECLARE_INTERRUPT(94) \
474 DECLARE_INTERRUPT(95) \
475 DECLARE_INTERRUPT(97) \
476 DECLARE_INTERRUPT(96) \
477 DECLARE_INTERRUPT(98) \
478 DECLARE_INTERRUPT(99) \
479 DECLARE_INTERRUPT(100) \
480 DECLARE_INTERRUPT(101) \
481 DECLARE_INTERRUPT(102) \
482 DECLARE_INTERRUPT(103) \
483 DECLARE_INTERRUPT(104) \
484 DECLARE_INTERRUPT(105) \
485 DECLARE_INTERRUPT(106) \
486 DECLARE_INTERRUPT(107) \
487 DECLARE_INTERRUPT(108) \
488 DECLARE_INTERRUPT(109) \
489 DECLARE_INTERRUPT(110) \
490 DECLARE_INTERRUPT(111) \
491 DECLARE_INTERRUPT(112) \
492 DECLARE_INTERRUPT(113) \
493 DECLARE_INTERRUPT(114) \
494 DECLARE_INTERRUPT(115) \
495 DECLARE_INTERRUPT(116) \
496 DECLARE_INTERRUPT(117) \
497 DECLARE_INTERRUPT(118) \
498 DECLARE_INTERRUPT(119) \
499 DECLARE_INTERRUPT(120) \
500 DECLARE_INTERRUPT(121) \
501 DECLARE_INTERRUPT(122) \
502 DECLARE_INTERRUPT(123) \
503 DECLARE_INTERRUPT(124) \
504 DECLARE_INTERRUPT(125) \
505 DECLARE_INTERRUPT(126) \
506 DECLARE_INTERRUPT(127) \
507 DECLARE_INTERRUPT(128) \
508 DECLARE_INTERRUPT(129) \
509 DECLARE_INTERRUPT(130) \
510 DECLARE_INTERRUPT(131) \
511 DECLARE_INTERRUPT(132) \
512 DECLARE_INTERRUPT(133) \
513 DECLARE_INTERRUPT(134) \
514 DECLARE_INTERRUPT(135) \
515 DECLARE_INTERRUPT(136) \
516 DECLARE_INTERRUPT(137) \
517 DECLARE_INTERRUPT(138) \
518 DECLARE_INTERRUPT(139) \
519 DECLARE_INTERRUPT(140) \
520 DECLARE_INTERRUPT(141) \
521 DECLARE_INTERRUPT(142) \
522 DECLARE_INTERRUPT(143) \
523 DECLARE_INTERRUPT(144) \
524 DECLARE_INTERRUPT(145) \
525 DECLARE_INTERRUPT(146) \
526 DECLARE_INTERRUPT(147) \
527 DECLARE_INTERRUPT(148) \
528 DECLARE_INTERRUPT(149) \
529 DECLARE_INTERRUPT(150) \
530 DECLARE_INTERRUPT(151) \
531 DECLARE_INTERRUPT(152) \
532 DECLARE_INTERRUPT(153) \
533 DECLARE_INTERRUPT(154) \
534 DECLARE_INTERRUPT(155) \
535 DECLARE_INTERRUPT(156) \
536 DECLARE_INTERRUPT(157) \
537 DECLARE_INTERRUPT(158) \
538 DECLARE_INTERRUPT(159) \
539 DECLARE_INTERRUPT(160) \
540 DECLARE_INTERRUPT(161) \
541 DECLARE_INTERRUPT(162) \
542 DECLARE_INTERRUPT(163) \
543 DECLARE_INTERRUPT(164) \
544 DECLARE_INTERRUPT(165) \
545 DECLARE_INTERRUPT(166) \
546 DECLARE_INTERRUPT(167) \
547 DECLARE_INTERRUPT(168) \
548 DECLARE_INTERRUPT(169) \
549 DECLARE_INTERRUPT(170) \
550 DECLARE_INTERRUPT(171) \
551 DECLARE_INTERRUPT(172) \
552 DECLARE_INTERRUPT(173) \
553 DECLARE_INTERRUPT(174) \
554 DECLARE_INTERRUPT(175) \
555 DECLARE_INTERRUPT(176) \
556 DECLARE_INTERRUPT(177) \
557 DECLARE_INTERRUPT(178) \
558 DECLARE_INTERRUPT(179) \
559 DECLARE_INTERRUPT(180) \
560 DECLARE_INTERRUPT(181) \
561 DECLARE_INTERRUPT(182) \
562 DECLARE_INTERRUPT(183) \
563 DECLARE_INTERRUPT(184) \
564 DECLARE_INTERRUPT(185) \
565 DECLARE_INTERRUPT(186) \
566 DECLARE_INTERRUPT(187) \
567 DECLARE_INTERRUPT(188) \
568 DECLARE_INTERRUPT(189) \
569 DECLARE_INTERRUPT(190) \
570 DECLARE_INTERRUPT(191) \
571 DECLARE_INTERRUPT(192) \
572 DECLARE_INTERRUPT(193) \
573 DECLARE_INTERRUPT(194) \
574 DECLARE_INTERRUPT(195) \
575 DECLARE_INTERRUPT(196) \
576 DECLARE_INTERRUPT(197) \
577 DECLARE_INTERRUPT(198) \
578 DECLARE_INTERRUPT(199) \
579 DECLARE_INTERRUPT(200) \
580 DECLARE_INTERRUPT(201) \
581 DECLARE_INTERRUPT(202) \
582 DECLARE_INTERRUPT(203) \
583 DECLARE_INTERRUPT(204) \
584 DECLARE_INTERRUPT(205) \
585 DECLARE_INTERRUPT(206) \
586 DECLARE_INTERRUPT(207) \
587 DECLARE_INTERRUPT(208) \
588 DECLARE_INTERRUPT(209) \
589 DECLARE_INTERRUPT(210) \
590 DECLARE_INTERRUPT(211) \
591 DECLARE_INTERRUPT(212) \
592 DECLARE_INTERRUPT(213) \
593 DECLARE_INTERRUPT(214) \
594 DECLARE_INTERRUPT(215) \
595 DECLARE_INTERRUPT(216) \
596 DECLARE_INTERRUPT(217) \
597 DECLARE_INTERRUPT(218) \
598 DECLARE_INTERRUPT(219) \
599 DECLARE_INTERRUPT(220) \
600 DECLARE_INTERRUPT(221) \
601 DECLARE_INTERRUPT(222) \
602 DECLARE_INTERRUPT(223) \
603 DECLARE_INTERRUPT(224) \
604 DECLARE_INTERRUPT(225) \
605 DECLARE_INTERRUPT(226) \
606 DECLARE_INTERRUPT(227) \
607 DECLARE_INTERRUPT(228) \
608 DECLARE_INTERRUPT(229) \
609 DECLARE_INTERRUPT(230) \
610 DECLARE_INTERRUPT(231) \
611 DECLARE_INTERRUPT(232) \
612 DECLARE_INTERRUPT(233) \
613 DECLARE_INTERRUPT(234) \
614 DECLARE_INTERRUPT(235) \
615 DECLARE_INTERRUPT(236) \
616 DECLARE_INTERRUPT(237) \
617 DECLARE_INTERRUPT(238) \
618 DECLARE_INTERRUPT(239) \
619 DECLARE_INTERRUPT(240) \
620 DECLARE_INTERRUPT(241) \
621 DECLARE_INTERRUPT(242) \
622 DECLARE_INTERRUPT(243) \
623 DECLARE_INTERRUPT(244) \
624 DECLARE_INTERRUPT(245) \
625 DECLARE_INTERRUPT(246) \
626 DECLARE_INTERRUPT(247) \
627 DECLARE_INTERRUPT(248) \
628 DECLARE_INTERRUPT(249) \
629 DECLARE_INTERRUPT(250) \
630 DECLARE_INTERRUPT(251) \
631 DECLARE_INTERRUPT(252) \
632 DECLARE_INTERRUPT(253) \
633 DECLARE_INTERRUPT(254) \
634 DECLARE_INTERRUPT(255));