irq: Fix prints, ignore spurious irq 15
authorJack Miller <jack@codezen.org>
Sat, 18 Feb 2017 01:01:17 +0000 (19:01 -0600)
committerJack Miller <jack@codezen.org>
Fri, 12 Apr 2019 17:04:07 +0000 (12:04 -0500)
kernel/irq.c

index ac2326d..267a0af 100644 (file)
@@ -32,28 +32,29 @@ char *exception_names[NAMED_EXCEPTIONS] = {
 
 void dump_exception(struct regs *regs)
 {
-    if (regs->vector < 32) {
+    if (regs->vector == 15)
+        printk("Spurious interrupt\n");
+    else if (regs->vector < 32) {
         if (regs->vector < NAMED_EXCEPTIONS)
-            printk("-- %s --\n", exception_names[regs->vector]);
+            printk("-- %s (%d) --\n", exception_names[regs->vector], regs->vector);
         else
             printk("-- IRQ %d --\n", regs->vector);
 
-        printk("RIP 0x%016lx ERR 0x%lx\n", regs->rip, regs->error_code);
-        printk("RSP 0x%016lx RBP 0x%016lx\n", regs->rsp, regs->rbp);
-        printk("RAX 0x%016lx RBX 0x%016lx\n", regs->rax, regs->rbx);
-        printk("RCX 0x%016lx RDX 0x%016lx\n", regs->rcx, regs->rdx);
-        printk("RDI 0x%016lx RSI 0x%016lx\n", regs->rdi, regs->rsi);
-        printk("R8  0x%016lx R9  0x%016lx\n", regs->r8, regs->r9);
-        printk("R10 0x%016lx R11 0x%016lx\n", regs->r10, regs->r11);
-        printk("R12 0x%016lx R13 0x%016lx\n", regs->r12, regs->r13);
-        printk("R14 0x%016lx R15 0x%016lx\n", regs->r14, regs->r15);
-        printk("CR2 0x%016lx\n", get_cr2());
-        printk("RFLAGS 0x%016lx\n", regs->rflags);
+        printk("RIP 0x%016ulx ERR 0x%ulx\n", regs->rip, regs->error_code);
+        printk("RSP 0x%016ulx RBP 0x%016ulx\n", regs->rsp, regs->rbp);
+        printk("RAX 0x%016ulx RBX 0x%016ulx\n", regs->rax, regs->rbx);
+        printk("RCX 0x%016ulx RDX 0x%016ulx\n", regs->rcx, regs->rdx);
+        printk("RDI 0x%016ulx RSI 0x%016ulx\n", regs->rdi, regs->rsi);
+        printk("R8  0x%016ulx R9  0x%016ulx\n", regs->r8, regs->r9);
+        printk("R10 0x%016ulx R11 0x%016ulx\n", regs->r10, regs->r11);
+        printk("R12 0x%016ulx R13 0x%016ulx\n", regs->r12, regs->r13);
+        printk("R14 0x%016ulx R15 0x%016ulx\n", regs->r14, regs->r15);
+        printk("CR2 0x%016ulx\n", get_cr2());
+        printk("RFLAGS 0x%016ulx\n", regs->rflags);
 
         while (1) ;
-    } else {
-        if (regs->vector > 32)
-            printk("IRQ %d\n", regs->vector);
-        apic->eoi();
-    }
+    } else if (regs->vector > 32)
+        printk("IRQ %d\n", regs->vector);
+
+    apic->eoi();
 }