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
This commit is contained in:
Michael Lotz 2008-10-15 23:49:24 +00:00
parent 945a6a41ac
commit a04a170937

View File

@ -17,6 +17,7 @@
#include <arch/cpu.h>
#include <arch/debug_console.h>
#include <boot/stage2.h>
#include <debug.h>
#include <string.h>
#include <stdlib.h>
@ -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);
}
}