diff options
author | Andriy Gapon <avg@FreeBSD.org> | 2011-12-11 21:02:01 +0000 |
---|---|---|
committer | Andriy Gapon <avg@FreeBSD.org> | 2011-12-11 21:02:01 +0000 |
commit | 353705930f6982077f267795ab3b8bd7ae201b06 (patch) | |
tree | 56c7a4a1cbf236bc73c2bcadee83d2a80f84aa18 /sys/kern/subr_kdb.c | |
parent | 469743871ebe3727fffb18566c681baee0a281d6 (diff) | |
download | src-353705930f6982077f267795ab3b8bd7ae201b06.tar.gz src-353705930f6982077f267795ab3b8bd7ae201b06.zip |
Notes
Diffstat (limited to 'sys/kern/subr_kdb.c')
-rw-r--r-- | sys/kern/subr_kdb.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index 42e188b82a84..3c9d29bcb0e4 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -226,13 +226,7 @@ kdb_sysctl_trap_code(SYSCTL_HANDLER_ARGS) void kdb_panic(const char *msg) { -#ifdef SMP - cpuset_t other_cpus; - other_cpus = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &other_cpus); - stop_cpus_hard(other_cpus); -#endif printf("KDB: panic\n"); panic("%s", msg); } @@ -594,6 +588,9 @@ kdb_trap(int type, int code, struct trapframe *tf) struct kdb_dbbe *be; register_t intr; int handled; +#ifdef SMP + int did_stop_cpus; +#endif be = kdb_dbbe; if (be == NULL || be->dbbe_trap == NULL) @@ -606,9 +603,13 @@ kdb_trap(int type, int code, struct trapframe *tf) intr = intr_disable(); #ifdef SMP - other_cpus = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &other_cpus); - stop_cpus_hard(other_cpus); + if (!SCHEDULER_STOPPED()) { + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); + stop_cpus_hard(other_cpus); + did_stop_cpus = 1; + } else + did_stop_cpus = 0; #endif kdb_active++; @@ -634,7 +635,8 @@ kdb_trap(int type, int code, struct trapframe *tf) kdb_active--; #ifdef SMP - restart_cpus(stopped_cpus); + if (did_stop_cpus) + restart_cpus(stopped_cpus); #endif intr_restore(intr); |