From: Matthias Kruk Date: Fri, 20 Sep 2019 04:58:23 +0000 (+0900) Subject: Make the hacky reboot-upon-keyboard-interrupt behavior depend on CONFIG_DEBUG X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=90996d84a4dcf84ecbb21efb8a3eaa84bf7ba5f2;p=corax Make the hacky reboot-upon-keyboard-interrupt behavior depend on CONFIG_DEBUG --- diff --git a/kernel/arch/interrupt.c b/kernel/arch/interrupt.c index e1ae81c..b8b9677 100644 --- a/kernel/arch/interrupt.c +++ b/kernel/arch/interrupt.c @@ -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); }