From 2fae8f5aedb7784bd723e64f43a5ff4c27970f71 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Mon, 3 Apr 2006 17:48:09 +0000 Subject: [PATCH] Replace critical_enter() and critical_exit() in kdb_trap() with intr_disable() and intr_restore() resp. Previously, critical regions would have interrupts disabled, but that was changed. Consequently, the debugger could run with interrupts enabled. This could cause problems for the low-level console code where received characters would trigger an interrupt that causes the interrupt handler to read the character instead of the cngetc() function. --- sys/kern/subr_kdb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index 2f5d1623d955..c48f33e55abd 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -456,7 +456,7 @@ kdb_trap(int type, int code, struct trapframe *tf) #ifdef SMP int did_stop_cpus; #endif - int handled; + int handled, intr; if (kdb_dbbe == NULL || kdb_dbbe->dbbe_trap == NULL) return (0); @@ -465,7 +465,7 @@ kdb_trap(int type, int code, struct trapframe *tf) if (kdb_active) return (0); - critical_enter(); + intr = intr_disable(); kdb_active++; @@ -491,7 +491,7 @@ kdb_trap(int type, int code, struct trapframe *tf) kdb_active--; - critical_exit(); + intr_restore(intr); return (handled); }