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:
@@ -17,6 +17,7 @@
|
|||||||
#include <arch/cpu.h>
|
#include <arch/cpu.h>
|
||||||
#include <arch/debug_console.h>
|
#include <arch/debug_console.h>
|
||||||
#include <boot/stage2.h>
|
#include <boot/stage2.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -346,16 +347,21 @@ arch_debug_serial_putchar(const char c)
|
|||||||
void
|
void
|
||||||
arch_debug_serial_puts(const char *s)
|
arch_debug_serial_puts(const char *s)
|
||||||
{
|
{
|
||||||
cpu_status state = disable_interrupts();
|
cpu_status state = 0;
|
||||||
acquire_spinlock(&sSerialOutputSpinlock);
|
if (!debug_debugger_running()) {
|
||||||
|
state = disable_interrupts();
|
||||||
|
acquire_spinlock(&sSerialOutputSpinlock);
|
||||||
|
}
|
||||||
|
|
||||||
while (*s != '\0') {
|
while (*s != '\0') {
|
||||||
_arch_debug_serial_putchar(*s);
|
_arch_debug_serial_putchar(*s);
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
|
||||||
release_spinlock(&sSerialOutputSpinlock);
|
if (!debug_debugger_running()) {
|
||||||
restore_interrupts(state);
|
release_spinlock(&sSerialOutputSpinlock);
|
||||||
|
restore_interrupts(state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user