wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 1 | /* |
Graeme Russ | dbf7115 | 2011-04-13 19:43:26 +1000 | [diff] [blame] | 2 | * (C) Copyright 2008-2011 |
| 3 | * Graeme Russ, <graeme.russ@gmail.com> |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 4 | * |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 5 | * (C) Copyright 2002 |
Albert ARIBAUD | fa82f87 | 2011-08-04 18:45:45 +0200 | [diff] [blame] | 6 | * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se> |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 7 | * |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 8 | * Portions of this file are derived from the Linux kernel source |
| 9 | * Copyright (C) 1991, 1992 Linus Torvalds |
| 10 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 11 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 12 | */ |
| 13 | |
| 14 | #include <common.h> |
Stefan Reinauer | 095593c | 2012-12-02 04:49:50 +0000 | [diff] [blame] | 15 | #include <asm/cache.h> |
| 16 | #include <asm/control_regs.h> |
Graeme Russ | 9933d60 | 2008-12-07 10:29:01 +1100 | [diff] [blame] | 17 | #include <asm/interrupt.h> |
Graeme Russ | ca56a4c | 2011-02-12 15:11:28 +1100 | [diff] [blame] | 18 | #include <asm/io.h> |
Graeme Russ | 0c24c9c | 2011-02-12 15:11:32 +1100 | [diff] [blame] | 19 | #include <asm/processor-flags.h> |
Graeme Russ | 717979f | 2011-11-08 02:33:13 +0000 | [diff] [blame] | 20 | #include <linux/compiler.h> |
Vadim Bendebury | 7c71034 | 2012-12-03 13:59:20 +0000 | [diff] [blame] | 21 | #include <asm/msr.h> |
Simon Glass | 8aba36d | 2015-07-31 09:31:32 -0600 | [diff] [blame] | 22 | #include <asm/processor.h> |
Vadim Bendebury | 7c71034 | 2012-12-03 13:59:20 +0000 | [diff] [blame] | 23 | #include <asm/u-boot-x86.h> |
Bin Meng | 1dae2e0 | 2014-11-20 16:11:16 +0800 | [diff] [blame] | 24 | #include <asm/i8259.h> |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 25 | |
Simon Glass | 7282d83 | 2013-04-17 16:13:33 +0000 | [diff] [blame] | 26 | DECLARE_GLOBAL_DATA_PTR; |
| 27 | |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 28 | #define DECLARE_INTERRUPT(x) \ |
| 29 | ".globl irq_"#x"\n" \ |
Graeme Russ | 0fc1b49 | 2009-11-24 20:04:19 +1100 | [diff] [blame] | 30 | ".hidden irq_"#x"\n" \ |
| 31 | ".type irq_"#x", @function\n" \ |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 32 | "irq_"#x":\n" \ |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 33 | "pushl $"#x"\n" \ |
| 34 | "jmp irq_common_entry\n" |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 35 | |
Bin Meng | 3ccd49c | 2015-07-10 10:51:23 +0800 | [diff] [blame] | 36 | static char *exceptions[] = { |
| 37 | "Divide Error", |
| 38 | "Debug", |
| 39 | "NMI Interrupt", |
| 40 | "Breakpoint", |
| 41 | "Overflow", |
| 42 | "BOUND Range Exceeded", |
| 43 | "Invalid Opcode (Undefined Opcode)", |
| 44 | "Device Not Avaiable (No Math Coprocessor)", |
| 45 | "Double Fault", |
| 46 | "Coprocessor Segment Overrun", |
| 47 | "Invalid TSS", |
| 48 | "Segment Not Present", |
| 49 | "Stack Segment Fault", |
Simon Glass | 8aba36d | 2015-07-31 09:31:32 -0600 | [diff] [blame] | 50 | "General Protection", |
Bin Meng | 3ccd49c | 2015-07-10 10:51:23 +0800 | [diff] [blame] | 51 | "Page Fault", |
| 52 | "Reserved", |
| 53 | "x87 FPU Floating-Point Error", |
| 54 | "Alignment Check", |
| 55 | "Machine Check", |
| 56 | "SIMD Floating-Point Exception", |
| 57 | "Virtualization Exception", |
| 58 | "Reserved", |
| 59 | "Reserved", |
| 60 | "Reserved", |
| 61 | "Reserved", |
| 62 | "Reserved", |
| 63 | "Reserved", |
| 64 | "Reserved", |
| 65 | "Reserved", |
| 66 | "Reserved", |
| 67 | "Reserved", |
| 68 | "Reserved" |
| 69 | }; |
| 70 | |
Simon Glass | e1ffd81 | 2014-11-06 13:20:08 -0700 | [diff] [blame] | 71 | static void dump_regs(struct irq_regs *regs) |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 72 | { |
Bin Meng | 013cf48 | 2015-07-10 10:38:32 +0800 | [diff] [blame] | 73 | unsigned long cs, eip, eflags; |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 74 | unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; |
| 75 | unsigned long d0, d1, d2, d3, d6, d7; |
Graeme Russ | ca56a4c | 2011-02-12 15:11:28 +1100 | [diff] [blame] | 76 | unsigned long sp; |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 77 | |
Bin Meng | 013cf48 | 2015-07-10 10:38:32 +0800 | [diff] [blame] | 78 | /* |
| 79 | * Some exceptions cause an error code to be saved on the current stack |
| 80 | * after the EIP value. We should extract CS/EIP/EFLAGS from different |
| 81 | * position on the stack based on the exception number. |
| 82 | */ |
| 83 | switch (regs->irq_id) { |
| 84 | case EXC_DF: |
| 85 | case EXC_TS: |
| 86 | case EXC_NP: |
| 87 | case EXC_SS: |
| 88 | case EXC_GP: |
| 89 | case EXC_PF: |
| 90 | case EXC_AC: |
| 91 | cs = regs->context.ctx2.xcs; |
| 92 | eip = regs->context.ctx2.eip; |
| 93 | eflags = regs->context.ctx2.eflags; |
| 94 | /* We should fix up the ESP due to error code */ |
| 95 | regs->esp += 4; |
| 96 | break; |
| 97 | default: |
| 98 | cs = regs->context.ctx1.xcs; |
| 99 | eip = regs->context.ctx1.eip; |
| 100 | eflags = regs->context.ctx1.eflags; |
| 101 | break; |
| 102 | } |
| 103 | |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 104 | printf("EIP: %04x:[<%08lx>] EFLAGS: %08lx\n", |
Bin Meng | 013cf48 | 2015-07-10 10:38:32 +0800 | [diff] [blame] | 105 | (u16)cs, eip, eflags); |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 106 | |
| 107 | printf("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", |
| 108 | regs->eax, regs->ebx, regs->ecx, regs->edx); |
| 109 | printf("ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n", |
| 110 | regs->esi, regs->edi, regs->ebp, regs->esp); |
| 111 | printf(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n", |
Graeme Russ | 717979f | 2011-11-08 02:33:13 +0000 | [diff] [blame] | 112 | (u16)regs->xds, (u16)regs->xes, (u16)regs->xfs, |
| 113 | (u16)regs->xgs, (u16)regs->xss); |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 114 | |
| 115 | cr0 = read_cr0(); |
| 116 | cr2 = read_cr2(); |
| 117 | cr3 = read_cr3(); |
| 118 | cr4 = read_cr4(); |
| 119 | |
| 120 | printf("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", |
| 121 | cr0, cr2, cr3, cr4); |
| 122 | |
| 123 | d0 = get_debugreg(0); |
| 124 | d1 = get_debugreg(1); |
| 125 | d2 = get_debugreg(2); |
| 126 | d3 = get_debugreg(3); |
| 127 | |
| 128 | printf("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n", |
| 129 | d0, d1, d2, d3); |
| 130 | |
| 131 | d6 = get_debugreg(6); |
| 132 | d7 = get_debugreg(7); |
| 133 | printf("DR6: %08lx DR7: %08lx\n", |
| 134 | d6, d7); |
Graeme Russ | ca56a4c | 2011-02-12 15:11:28 +1100 | [diff] [blame] | 135 | |
| 136 | printf("Stack:\n"); |
| 137 | sp = regs->esp; |
| 138 | |
| 139 | sp += 64; |
| 140 | |
| 141 | while (sp > (regs->esp - 16)) { |
| 142 | if (sp == regs->esp) |
| 143 | printf("--->"); |
| 144 | else |
| 145 | printf(" "); |
| 146 | printf("0x%8.8lx : 0x%8.8lx\n", sp, (ulong)readl(sp)); |
| 147 | sp -= 4; |
| 148 | } |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 149 | } |
| 150 | |
Bin Meng | 3ccd49c | 2015-07-10 10:51:23 +0800 | [diff] [blame] | 151 | static void do_exception(struct irq_regs *regs) |
| 152 | { |
| 153 | printf("%s\n", exceptions[regs->irq_id]); |
| 154 | dump_regs(regs); |
| 155 | hang(); |
| 156 | } |
| 157 | |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 158 | struct idt_entry { |
| 159 | u16 base_low; |
| 160 | u16 selector; |
| 161 | u8 res; |
| 162 | u8 access; |
| 163 | u16 base_high; |
Graeme Russ | 717979f | 2011-11-08 02:33:13 +0000 | [diff] [blame] | 164 | } __packed; |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 165 | |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 166 | struct desc_ptr { |
| 167 | unsigned short size; |
| 168 | unsigned long address; |
Graeme Russ | 717979f | 2011-11-08 02:33:13 +0000 | [diff] [blame] | 169 | } __packed; |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 170 | |
Graeme Russ | 58c7a67 | 2011-12-19 14:26:18 +1100 | [diff] [blame] | 171 | struct idt_entry idt[256] __aligned(16); |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 172 | |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 173 | struct desc_ptr idt_ptr; |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 174 | |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 175 | static inline void load_idt(const struct desc_ptr *dtr) |
| 176 | { |
Graeme Russ | 717979f | 2011-11-08 02:33:13 +0000 | [diff] [blame] | 177 | asm volatile("cs lidt %0" : : "m" (*dtr)); |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 178 | } |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 179 | |
Graeme Russ | abf0cd3 | 2009-02-24 21:13:40 +1100 | [diff] [blame] | 180 | void set_vector(u8 intnum, void *routine) |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 181 | { |
Graeme Russ | 1c409bc | 2009-11-24 20:04:21 +1100 | [diff] [blame] | 182 | idt[intnum].base_high = (u16)((u32)(routine) >> 16); |
| 183 | idt[intnum].base_low = (u16)((u32)(routine) & 0xffff); |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 184 | } |
| 185 | |
Graeme Russ | 717979f | 2011-11-08 02:33:13 +0000 | [diff] [blame] | 186 | /* |
| 187 | * Ideally these would be defined static to avoid a checkpatch warning, but |
| 188 | * the compiler cannot see them in the inline asm and complains that they |
| 189 | * aren't defined |
| 190 | */ |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 191 | void irq_0(void); |
| 192 | void irq_1(void); |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 193 | |
Graeme Russ | abf0cd3 | 2009-02-24 21:13:40 +1100 | [diff] [blame] | 194 | int cpu_init_interrupts(void) |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 195 | { |
| 196 | int i; |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 197 | |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 198 | int irq_entry_size = irq_1 - irq_0; |
| 199 | void *irq_entry = (void *)irq_0; |
| 200 | |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 201 | /* Setup the IDT */ |
Graeme Russ | 717979f | 2011-11-08 02:33:13 +0000 | [diff] [blame] | 202 | for (i = 0; i < 256; i++) { |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 203 | idt[i].access = 0x8e; |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 204 | idt[i].res = 0; |
Simon Glass | 8aba36d | 2015-07-31 09:31:32 -0600 | [diff] [blame] | 205 | idt[i].selector = X86_GDT_ENTRY_32BIT_CS * X86_GDT_ENTRY_SIZE; |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 206 | set_vector(i, irq_entry); |
| 207 | irq_entry += irq_entry_size; |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 208 | } |
| 209 | |
Simon Glass | 8aba36d | 2015-07-31 09:31:32 -0600 | [diff] [blame] | 210 | idt_ptr.size = 256 * 8 - 1; |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 211 | idt_ptr.address = (unsigned long) idt; |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 212 | |
| 213 | load_idt(&idt_ptr); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 214 | |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 215 | return 0; |
| 216 | } |
| 217 | |
Simon Glass | 6f41e0e7b | 2015-04-28 20:25:16 -0600 | [diff] [blame] | 218 | void *x86_get_idt(void) |
| 219 | { |
| 220 | return &idt_ptr; |
| 221 | } |
| 222 | |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 223 | void __do_irq(int irq) |
| 224 | { |
| 225 | printf("Unhandled IRQ : %d\n", irq); |
| 226 | } |
| 227 | void do_irq(int irq) __attribute__((weak, alias("__do_irq"))); |
| 228 | |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 229 | void enable_interrupts(void) |
| 230 | { |
| 231 | asm("sti\n"); |
| 232 | } |
| 233 | |
| 234 | int disable_interrupts(void) |
| 235 | { |
| 236 | long flags; |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 237 | |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 238 | asm volatile ("pushfl ; popl %0 ; cli\n" : "=g" (flags) : ); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 239 | |
Graeme Russ | 717979f | 2011-11-08 02:33:13 +0000 | [diff] [blame] | 240 | return flags & X86_EFLAGS_IF; |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 241 | } |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 242 | |
Bin Meng | 1dae2e0 | 2014-11-20 16:11:16 +0800 | [diff] [blame] | 243 | int interrupt_init(void) |
| 244 | { |
Ben Stoltz | 3dcdd17 | 2015-08-04 12:33:46 -0600 | [diff] [blame] | 245 | /* |
| 246 | * When running as an EFI application we are not in control of |
| 247 | * interrupts and should leave them alone. |
| 248 | */ |
| 249 | #ifndef CONFIG_EFI_APP |
Bin Meng | 1dae2e0 | 2014-11-20 16:11:16 +0800 | [diff] [blame] | 250 | /* Just in case... */ |
| 251 | disable_interrupts(); |
| 252 | |
| 253 | #ifdef CONFIG_SYS_PCAT_INTERRUPTS |
| 254 | /* Initialize the master/slave i8259 pic */ |
| 255 | i8259_init(); |
| 256 | #endif |
| 257 | |
| 258 | /* Initialize core interrupt and exception functionality of CPU */ |
| 259 | cpu_init_interrupts(); |
| 260 | |
Simon Glass | e49ccea | 2015-08-04 12:34:00 -0600 | [diff] [blame] | 261 | /* |
| 262 | * It is now safe to enable interrupts. |
| 263 | * |
| 264 | * TODO(sjg@chromium.org): But we don't handle these correctly when |
| 265 | * booted from EFI. |
| 266 | */ |
| 267 | if (ll_boot_init()) |
| 268 | enable_interrupts(); |
Ben Stoltz | 3dcdd17 | 2015-08-04 12:33:46 -0600 | [diff] [blame] | 269 | #endif |
Bin Meng | 1dae2e0 | 2014-11-20 16:11:16 +0800 | [diff] [blame] | 270 | |
| 271 | return 0; |
| 272 | } |
| 273 | |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 274 | /* IRQ Low-Level Service Routine */ |
Graeme Russ | 7228efa | 2010-10-07 20:03:23 +1100 | [diff] [blame] | 275 | void irq_llsr(struct irq_regs *regs) |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 276 | { |
| 277 | /* |
| 278 | * For detailed description of each exception, refer to: |
Albert ARIBAUD | fa82f87 | 2011-08-04 18:45:45 +0200 | [diff] [blame] | 279 | * Intel® 64 and IA-32 Architectures Software Developer's Manual |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 280 | * Volume 1: Basic Architecture |
| 281 | * Order Number: 253665-029US, November 2008 |
| 282 | * Table 6-1. Exceptions and Interrupts |
| 283 | */ |
Bin Meng | 3ccd49c | 2015-07-10 10:51:23 +0800 | [diff] [blame] | 284 | if (regs->irq_id < 32) { |
| 285 | /* Architecture defined exception */ |
| 286 | do_exception(regs); |
| 287 | } else { |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 288 | /* Hardware or User IRQ */ |
Graeme Russ | 7228efa | 2010-10-07 20:03:23 +1100 | [diff] [blame] | 289 | do_irq(regs->irq_id); |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 290 | } |
| 291 | } |
| 292 | |
| 293 | /* |
| 294 | * OK - This looks really horrible, but it serves a purpose - It helps create |
| 295 | * fully relocatable code. |
| 296 | * - The call to irq_llsr will be a relative jump |
| 297 | * - The IRQ entries will be guaranteed to be in order |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 298 | * Interrupt entries are now very small (a push and a jump) but they are |
| 299 | * now slower (all registers pushed on stack which provides complete |
| 300 | * crash dumps in the low level handlers |
Graeme Russ | 7228efa | 2010-10-07 20:03:23 +1100 | [diff] [blame] | 301 | * |
| 302 | * Interrupt Entry Point: |
| 303 | * - Interrupt has caused eflags, CS and EIP to be pushed |
| 304 | * - Interrupt Vector Handler has pushed orig_eax |
| 305 | * - pt_regs.esp needs to be adjusted by 40 bytes: |
| 306 | * 12 bytes pushed by CPU (EFLAGSF, CS, EIP) |
| 307 | * 4 bytes pushed by vector handler (irq_id) |
| 308 | * 24 bytes pushed before SP (SS, GS, FS, ES, DS, EAX) |
| 309 | * NOTE: Only longs are pushed on/popped off the stack! |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 310 | */ |
| 311 | asm(".globl irq_common_entry\n" \ |
Graeme Russ | 0fc1b49 | 2009-11-24 20:04:19 +1100 | [diff] [blame] | 312 | ".hidden irq_common_entry\n" \ |
| 313 | ".type irq_common_entry, @function\n" \ |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 314 | "irq_common_entry:\n" \ |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 315 | "cld\n" \ |
Graeme Russ | 7228efa | 2010-10-07 20:03:23 +1100 | [diff] [blame] | 316 | "pushl %ss\n" \ |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 317 | "pushl %gs\n" \ |
| 318 | "pushl %fs\n" \ |
| 319 | "pushl %es\n" \ |
| 320 | "pushl %ds\n" \ |
| 321 | "pushl %eax\n" \ |
Graeme Russ | 7228efa | 2010-10-07 20:03:23 +1100 | [diff] [blame] | 322 | "movl %esp, %eax\n" \ |
| 323 | "addl $40, %eax\n" \ |
| 324 | "pushl %eax\n" \ |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 325 | "pushl %ebp\n" \ |
| 326 | "pushl %edi\n" \ |
| 327 | "pushl %esi\n" \ |
| 328 | "pushl %edx\n" \ |
| 329 | "pushl %ecx\n" \ |
| 330 | "pushl %ebx\n" \ |
| 331 | "mov %esp, %eax\n" \ |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 332 | "call irq_llsr\n" \ |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 333 | "popl %ebx\n" \ |
| 334 | "popl %ecx\n" \ |
| 335 | "popl %edx\n" \ |
| 336 | "popl %esi\n" \ |
| 337 | "popl %edi\n" \ |
| 338 | "popl %ebp\n" \ |
| 339 | "popl %eax\n" \ |
Graeme Russ | 7228efa | 2010-10-07 20:03:23 +1100 | [diff] [blame] | 340 | "popl %eax\n" \ |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 341 | "popl %ds\n" \ |
| 342 | "popl %es\n" \ |
| 343 | "popl %fs\n" \ |
| 344 | "popl %gs\n" \ |
Graeme Russ | 7228efa | 2010-10-07 20:03:23 +1100 | [diff] [blame] | 345 | "popl %ss\n" \ |
Graeme Russ | 433ff2b | 2010-04-24 00:05:38 +1000 | [diff] [blame] | 346 | "add $4, %esp\n" \ |
Graeme Russ | 564a998 | 2009-11-24 20:04:18 +1100 | [diff] [blame] | 347 | "iret\n" \ |
| 348 | DECLARE_INTERRUPT(0) \ |
| 349 | DECLARE_INTERRUPT(1) \ |
| 350 | DECLARE_INTERRUPT(2) \ |
| 351 | DECLARE_INTERRUPT(3) \ |
| 352 | DECLARE_INTERRUPT(4) \ |
| 353 | DECLARE_INTERRUPT(5) \ |
| 354 | DECLARE_INTERRUPT(6) \ |
| 355 | DECLARE_INTERRUPT(7) \ |
| 356 | DECLARE_INTERRUPT(8) \ |
| 357 | DECLARE_INTERRUPT(9) \ |
| 358 | DECLARE_INTERRUPT(10) \ |
| 359 | DECLARE_INTERRUPT(11) \ |
| 360 | DECLARE_INTERRUPT(12) \ |
| 361 | DECLARE_INTERRUPT(13) \ |
| 362 | DECLARE_INTERRUPT(14) \ |
| 363 | DECLARE_INTERRUPT(15) \ |
| 364 | DECLARE_INTERRUPT(16) \ |
| 365 | DECLARE_INTERRUPT(17) \ |
| 366 | DECLARE_INTERRUPT(18) \ |
| 367 | DECLARE_INTERRUPT(19) \ |
| 368 | DECLARE_INTERRUPT(20) \ |
| 369 | DECLARE_INTERRUPT(21) \ |
| 370 | DECLARE_INTERRUPT(22) \ |
| 371 | DECLARE_INTERRUPT(23) \ |
| 372 | DECLARE_INTERRUPT(24) \ |
| 373 | DECLARE_INTERRUPT(25) \ |
| 374 | DECLARE_INTERRUPT(26) \ |
| 375 | DECLARE_INTERRUPT(27) \ |
| 376 | DECLARE_INTERRUPT(28) \ |
| 377 | DECLARE_INTERRUPT(29) \ |
| 378 | DECLARE_INTERRUPT(30) \ |
| 379 | DECLARE_INTERRUPT(31) \ |
| 380 | DECLARE_INTERRUPT(32) \ |
| 381 | DECLARE_INTERRUPT(33) \ |
| 382 | DECLARE_INTERRUPT(34) \ |
| 383 | DECLARE_INTERRUPT(35) \ |
| 384 | DECLARE_INTERRUPT(36) \ |
| 385 | DECLARE_INTERRUPT(37) \ |
| 386 | DECLARE_INTERRUPT(38) \ |
| 387 | DECLARE_INTERRUPT(39) \ |
| 388 | DECLARE_INTERRUPT(40) \ |
| 389 | DECLARE_INTERRUPT(41) \ |
| 390 | DECLARE_INTERRUPT(42) \ |
| 391 | DECLARE_INTERRUPT(43) \ |
| 392 | DECLARE_INTERRUPT(44) \ |
| 393 | DECLARE_INTERRUPT(45) \ |
| 394 | DECLARE_INTERRUPT(46) \ |
| 395 | DECLARE_INTERRUPT(47) \ |
| 396 | DECLARE_INTERRUPT(48) \ |
| 397 | DECLARE_INTERRUPT(49) \ |
| 398 | DECLARE_INTERRUPT(50) \ |
| 399 | DECLARE_INTERRUPT(51) \ |
| 400 | DECLARE_INTERRUPT(52) \ |
| 401 | DECLARE_INTERRUPT(53) \ |
| 402 | DECLARE_INTERRUPT(54) \ |
| 403 | DECLARE_INTERRUPT(55) \ |
| 404 | DECLARE_INTERRUPT(56) \ |
| 405 | DECLARE_INTERRUPT(57) \ |
| 406 | DECLARE_INTERRUPT(58) \ |
| 407 | DECLARE_INTERRUPT(59) \ |
| 408 | DECLARE_INTERRUPT(60) \ |
| 409 | DECLARE_INTERRUPT(61) \ |
| 410 | DECLARE_INTERRUPT(62) \ |
| 411 | DECLARE_INTERRUPT(63) \ |
| 412 | DECLARE_INTERRUPT(64) \ |
| 413 | DECLARE_INTERRUPT(65) \ |
| 414 | DECLARE_INTERRUPT(66) \ |
| 415 | DECLARE_INTERRUPT(67) \ |
| 416 | DECLARE_INTERRUPT(68) \ |
| 417 | DECLARE_INTERRUPT(69) \ |
| 418 | DECLARE_INTERRUPT(70) \ |
| 419 | DECLARE_INTERRUPT(71) \ |
| 420 | DECLARE_INTERRUPT(72) \ |
| 421 | DECLARE_INTERRUPT(73) \ |
| 422 | DECLARE_INTERRUPT(74) \ |
| 423 | DECLARE_INTERRUPT(75) \ |
| 424 | DECLARE_INTERRUPT(76) \ |
| 425 | DECLARE_INTERRUPT(77) \ |
| 426 | DECLARE_INTERRUPT(78) \ |
| 427 | DECLARE_INTERRUPT(79) \ |
| 428 | DECLARE_INTERRUPT(80) \ |
| 429 | DECLARE_INTERRUPT(81) \ |
| 430 | DECLARE_INTERRUPT(82) \ |
| 431 | DECLARE_INTERRUPT(83) \ |
| 432 | DECLARE_INTERRUPT(84) \ |
| 433 | DECLARE_INTERRUPT(85) \ |
| 434 | DECLARE_INTERRUPT(86) \ |
| 435 | DECLARE_INTERRUPT(87) \ |
| 436 | DECLARE_INTERRUPT(88) \ |
| 437 | DECLARE_INTERRUPT(89) \ |
| 438 | DECLARE_INTERRUPT(90) \ |
| 439 | DECLARE_INTERRUPT(91) \ |
| 440 | DECLARE_INTERRUPT(92) \ |
| 441 | DECLARE_INTERRUPT(93) \ |
| 442 | DECLARE_INTERRUPT(94) \ |
| 443 | DECLARE_INTERRUPT(95) \ |
| 444 | DECLARE_INTERRUPT(97) \ |
| 445 | DECLARE_INTERRUPT(96) \ |
| 446 | DECLARE_INTERRUPT(98) \ |
| 447 | DECLARE_INTERRUPT(99) \ |
| 448 | DECLARE_INTERRUPT(100) \ |
| 449 | DECLARE_INTERRUPT(101) \ |
| 450 | DECLARE_INTERRUPT(102) \ |
| 451 | DECLARE_INTERRUPT(103) \ |
| 452 | DECLARE_INTERRUPT(104) \ |
| 453 | DECLARE_INTERRUPT(105) \ |
| 454 | DECLARE_INTERRUPT(106) \ |
| 455 | DECLARE_INTERRUPT(107) \ |
| 456 | DECLARE_INTERRUPT(108) \ |
| 457 | DECLARE_INTERRUPT(109) \ |
| 458 | DECLARE_INTERRUPT(110) \ |
| 459 | DECLARE_INTERRUPT(111) \ |
| 460 | DECLARE_INTERRUPT(112) \ |
| 461 | DECLARE_INTERRUPT(113) \ |
| 462 | DECLARE_INTERRUPT(114) \ |
| 463 | DECLARE_INTERRUPT(115) \ |
| 464 | DECLARE_INTERRUPT(116) \ |
| 465 | DECLARE_INTERRUPT(117) \ |
| 466 | DECLARE_INTERRUPT(118) \ |
| 467 | DECLARE_INTERRUPT(119) \ |
| 468 | DECLARE_INTERRUPT(120) \ |
| 469 | DECLARE_INTERRUPT(121) \ |
| 470 | DECLARE_INTERRUPT(122) \ |
| 471 | DECLARE_INTERRUPT(123) \ |
| 472 | DECLARE_INTERRUPT(124) \ |
| 473 | DECLARE_INTERRUPT(125) \ |
| 474 | DECLARE_INTERRUPT(126) \ |
| 475 | DECLARE_INTERRUPT(127) \ |
| 476 | DECLARE_INTERRUPT(128) \ |
| 477 | DECLARE_INTERRUPT(129) \ |
| 478 | DECLARE_INTERRUPT(130) \ |
| 479 | DECLARE_INTERRUPT(131) \ |
| 480 | DECLARE_INTERRUPT(132) \ |
| 481 | DECLARE_INTERRUPT(133) \ |
| 482 | DECLARE_INTERRUPT(134) \ |
| 483 | DECLARE_INTERRUPT(135) \ |
| 484 | DECLARE_INTERRUPT(136) \ |
| 485 | DECLARE_INTERRUPT(137) \ |
| 486 | DECLARE_INTERRUPT(138) \ |
| 487 | DECLARE_INTERRUPT(139) \ |
| 488 | DECLARE_INTERRUPT(140) \ |
| 489 | DECLARE_INTERRUPT(141) \ |
| 490 | DECLARE_INTERRUPT(142) \ |
| 491 | DECLARE_INTERRUPT(143) \ |
| 492 | DECLARE_INTERRUPT(144) \ |
| 493 | DECLARE_INTERRUPT(145) \ |
| 494 | DECLARE_INTERRUPT(146) \ |
| 495 | DECLARE_INTERRUPT(147) \ |
| 496 | DECLARE_INTERRUPT(148) \ |
| 497 | DECLARE_INTERRUPT(149) \ |
| 498 | DECLARE_INTERRUPT(150) \ |
| 499 | DECLARE_INTERRUPT(151) \ |
| 500 | DECLARE_INTERRUPT(152) \ |
| 501 | DECLARE_INTERRUPT(153) \ |
| 502 | DECLARE_INTERRUPT(154) \ |
| 503 | DECLARE_INTERRUPT(155) \ |
| 504 | DECLARE_INTERRUPT(156) \ |
| 505 | DECLARE_INTERRUPT(157) \ |
| 506 | DECLARE_INTERRUPT(158) \ |
| 507 | DECLARE_INTERRUPT(159) \ |
| 508 | DECLARE_INTERRUPT(160) \ |
| 509 | DECLARE_INTERRUPT(161) \ |
| 510 | DECLARE_INTERRUPT(162) \ |
| 511 | DECLARE_INTERRUPT(163) \ |
| 512 | DECLARE_INTERRUPT(164) \ |
| 513 | DECLARE_INTERRUPT(165) \ |
| 514 | DECLARE_INTERRUPT(166) \ |
| 515 | DECLARE_INTERRUPT(167) \ |
| 516 | DECLARE_INTERRUPT(168) \ |
| 517 | DECLARE_INTERRUPT(169) \ |
| 518 | DECLARE_INTERRUPT(170) \ |
| 519 | DECLARE_INTERRUPT(171) \ |
| 520 | DECLARE_INTERRUPT(172) \ |
| 521 | DECLARE_INTERRUPT(173) \ |
| 522 | DECLARE_INTERRUPT(174) \ |
| 523 | DECLARE_INTERRUPT(175) \ |
| 524 | DECLARE_INTERRUPT(176) \ |
| 525 | DECLARE_INTERRUPT(177) \ |
| 526 | DECLARE_INTERRUPT(178) \ |
| 527 | DECLARE_INTERRUPT(179) \ |
| 528 | DECLARE_INTERRUPT(180) \ |
| 529 | DECLARE_INTERRUPT(181) \ |
| 530 | DECLARE_INTERRUPT(182) \ |
| 531 | DECLARE_INTERRUPT(183) \ |
| 532 | DECLARE_INTERRUPT(184) \ |
| 533 | DECLARE_INTERRUPT(185) \ |
| 534 | DECLARE_INTERRUPT(186) \ |
| 535 | DECLARE_INTERRUPT(187) \ |
| 536 | DECLARE_INTERRUPT(188) \ |
| 537 | DECLARE_INTERRUPT(189) \ |
| 538 | DECLARE_INTERRUPT(190) \ |
| 539 | DECLARE_INTERRUPT(191) \ |
| 540 | DECLARE_INTERRUPT(192) \ |
| 541 | DECLARE_INTERRUPT(193) \ |
| 542 | DECLARE_INTERRUPT(194) \ |
| 543 | DECLARE_INTERRUPT(195) \ |
| 544 | DECLARE_INTERRUPT(196) \ |
| 545 | DECLARE_INTERRUPT(197) \ |
| 546 | DECLARE_INTERRUPT(198) \ |
| 547 | DECLARE_INTERRUPT(199) \ |
| 548 | DECLARE_INTERRUPT(200) \ |
| 549 | DECLARE_INTERRUPT(201) \ |
| 550 | DECLARE_INTERRUPT(202) \ |
| 551 | DECLARE_INTERRUPT(203) \ |
| 552 | DECLARE_INTERRUPT(204) \ |
| 553 | DECLARE_INTERRUPT(205) \ |
| 554 | DECLARE_INTERRUPT(206) \ |
| 555 | DECLARE_INTERRUPT(207) \ |
| 556 | DECLARE_INTERRUPT(208) \ |
| 557 | DECLARE_INTERRUPT(209) \ |
| 558 | DECLARE_INTERRUPT(210) \ |
| 559 | DECLARE_INTERRUPT(211) \ |
| 560 | DECLARE_INTERRUPT(212) \ |
| 561 | DECLARE_INTERRUPT(213) \ |
| 562 | DECLARE_INTERRUPT(214) \ |
| 563 | DECLARE_INTERRUPT(215) \ |
| 564 | DECLARE_INTERRUPT(216) \ |
| 565 | DECLARE_INTERRUPT(217) \ |
| 566 | DECLARE_INTERRUPT(218) \ |
| 567 | DECLARE_INTERRUPT(219) \ |
| 568 | DECLARE_INTERRUPT(220) \ |
| 569 | DECLARE_INTERRUPT(221) \ |
| 570 | DECLARE_INTERRUPT(222) \ |
| 571 | DECLARE_INTERRUPT(223) \ |
| 572 | DECLARE_INTERRUPT(224) \ |
| 573 | DECLARE_INTERRUPT(225) \ |
| 574 | DECLARE_INTERRUPT(226) \ |
| 575 | DECLARE_INTERRUPT(227) \ |
| 576 | DECLARE_INTERRUPT(228) \ |
| 577 | DECLARE_INTERRUPT(229) \ |
| 578 | DECLARE_INTERRUPT(230) \ |
| 579 | DECLARE_INTERRUPT(231) \ |
| 580 | DECLARE_INTERRUPT(232) \ |
| 581 | DECLARE_INTERRUPT(233) \ |
| 582 | DECLARE_INTERRUPT(234) \ |
| 583 | DECLARE_INTERRUPT(235) \ |
| 584 | DECLARE_INTERRUPT(236) \ |
| 585 | DECLARE_INTERRUPT(237) \ |
| 586 | DECLARE_INTERRUPT(238) \ |
| 587 | DECLARE_INTERRUPT(239) \ |
| 588 | DECLARE_INTERRUPT(240) \ |
| 589 | DECLARE_INTERRUPT(241) \ |
| 590 | DECLARE_INTERRUPT(242) \ |
| 591 | DECLARE_INTERRUPT(243) \ |
| 592 | DECLARE_INTERRUPT(244) \ |
| 593 | DECLARE_INTERRUPT(245) \ |
| 594 | DECLARE_INTERRUPT(246) \ |
| 595 | DECLARE_INTERRUPT(247) \ |
| 596 | DECLARE_INTERRUPT(248) \ |
| 597 | DECLARE_INTERRUPT(249) \ |
| 598 | DECLARE_INTERRUPT(250) \ |
| 599 | DECLARE_INTERRUPT(251) \ |
| 600 | DECLARE_INTERRUPT(252) \ |
| 601 | DECLARE_INTERRUPT(253) \ |
| 602 | DECLARE_INTERRUPT(254) \ |
| 603 | DECLARE_INTERRUPT(255)); |