]> git.corax.cc Git - corax/commitdiff
Make the hacky reboot-upon-keyboard-interrupt behavior depend on CONFIG_DEBUG
authorMatthias Kruk <m@m10k.eu>
Fri, 20 Sep 2019 04:58:23 +0000 (13:58 +0900)
committerMatthias Kruk <m@m10k.eu>
Fri, 20 Sep 2019 04:58:23 +0000 (13:58 +0900)
kernel/arch/interrupt.c

index e1ae81c69a912a21e3afbaecfb62239077cfa756..b8b9677f29f3441380b622412888b9176c06e172 100644 (file)
@@ -62,11 +62,13 @@ int _int_handle(stack_frame_t ctx)
 /*    PANIC("Unhandled interrupt"); */
 
     if(ctx.intn == INT_KEYBOARD) {
+#if FEATURE(DEBUG)
         extern struct cpu _cpu[CONFIG_SMP_CPUS];
+#endif /* FEATURE(DEBUG) */
 
         dbg_printf("Keyboard interrupt\n");
 
-#if 0
+#if FEATURE(DEBUG)
                /* hacky reboot: clear IDT entries for
                 * #DF and #GP, then cause a #GP */
                _cpu[CPU_ID].cpu_idt[EXC_DOUBLEFAULT].sd_low = 0;
@@ -77,7 +79,7 @@ int _int_handle(stack_frame_t ctx)
                /* this is such a retarded thing to do, I don't see how this
                 * could not cause a triple fault */
                asm volatile("ljmp $0x30, $0xfee00020"); /* LEEROY JENKINS!!! */
-#endif
+#endif /* FEATURE(DEBUG) */
     } else if(ctx.intn != INT_TIMER) {
                dbg_printf("Interrupt %u occurred\n", ctx.intn);
        }