From a04a170937f015e3f19b24dd068d8e6af7548490 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Wed, 15 Oct 2008 23:49:24 +0000 Subject: [PATCH] bonefish + mmlr: Don't use the spinlock in arch_debug_serial_puts if we're inside the kernel debugger. This fixes a tripplefault when faulting with said spinlock held (due to a NULL string argument for example). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28155 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_debug_console.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_debug_console.c b/src/system/kernel/arch/x86/arch_debug_console.c index b021fdee1a..e89653f064 100644 --- a/src/system/kernel/arch/x86/arch_debug_console.c +++ b/src/system/kernel/arch/x86/arch_debug_console.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -346,16 +347,21 @@ arch_debug_serial_putchar(const char c) void arch_debug_serial_puts(const char *s) { - cpu_status state = disable_interrupts(); - acquire_spinlock(&sSerialOutputSpinlock); + cpu_status state = 0; + if (!debug_debugger_running()) { + state = disable_interrupts(); + acquire_spinlock(&sSerialOutputSpinlock); + } while (*s != '\0') { _arch_debug_serial_putchar(*s); s++; } - release_spinlock(&sSerialOutputSpinlock); - restore_interrupts(state); + if (!debug_debugger_running()) { + release_spinlock(&sSerialOutputSpinlock); + restore_interrupts(state); + } }