subr_kdb.c (227309) | subr_kdb.c (228424) |
---|---|
1/*- 2 * Copyright (c) 2004 The FreeBSD Project 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 The FreeBSD Project 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/subr_kdb.c 227309 2011-11-07 15:43:11Z ed $"); | 28__FBSDID("$FreeBSD: head/sys/kern/subr_kdb.c 228424 2011-12-11 21:02:01Z avg $"); |
29 30#include "opt_kdb.h" 31#include "opt_stack.h" 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kdb.h> 36#include <sys/kernel.h> --- 184 unchanged lines hidden (view full) --- 221 return (error); 222 (*fp)(0x11111111, 0x22222222, 0x33333333); 223 return (0); 224} 225 226void 227kdb_panic(const char *msg) 228{ | 29 30#include "opt_kdb.h" 31#include "opt_stack.h" 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kdb.h> 36#include <sys/kernel.h> --- 184 unchanged lines hidden (view full) --- 221 return (error); 222 (*fp)(0x11111111, 0x22222222, 0x33333333); 223 return (0); 224} 225 226void 227kdb_panic(const char *msg) 228{ |
229#ifdef SMP 230 cpuset_t other_cpus; | |
231 | 229 |
232 other_cpus = all_cpus; 233 CPU_CLR(PCPU_GET(cpuid), &other_cpus); 234 stop_cpus_hard(other_cpus); 235#endif | |
236 printf("KDB: panic\n"); 237 panic("%s", msg); 238} 239 240void 241kdb_reboot(void) 242{ 243 --- 345 unchanged lines hidden (view full) --- 589kdb_trap(int type, int code, struct trapframe *tf) 590{ 591#ifdef SMP 592 cpuset_t other_cpus; 593#endif 594 struct kdb_dbbe *be; 595 register_t intr; 596 int handled; | 230 printf("KDB: panic\n"); 231 panic("%s", msg); 232} 233 234void 235kdb_reboot(void) 236{ 237 --- 345 unchanged lines hidden (view full) --- 583kdb_trap(int type, int code, struct trapframe *tf) 584{ 585#ifdef SMP 586 cpuset_t other_cpus; 587#endif 588 struct kdb_dbbe *be; 589 register_t intr; 590 int handled; |
591#ifdef SMP 592 int did_stop_cpus; 593#endif |
|
597 598 be = kdb_dbbe; 599 if (be == NULL || be->dbbe_trap == NULL) 600 return (0); 601 602 /* We reenter the debugger through kdb_reenter(). */ 603 if (kdb_active) 604 return (0); 605 606 intr = intr_disable(); 607 608#ifdef SMP | 594 595 be = kdb_dbbe; 596 if (be == NULL || be->dbbe_trap == NULL) 597 return (0); 598 599 /* We reenter the debugger through kdb_reenter(). */ 600 if (kdb_active) 601 return (0); 602 603 intr = intr_disable(); 604 605#ifdef SMP |
609 other_cpus = all_cpus; 610 CPU_CLR(PCPU_GET(cpuid), &other_cpus); 611 stop_cpus_hard(other_cpus); | 606 if (!SCHEDULER_STOPPED()) { 607 other_cpus = all_cpus; 608 CPU_CLR(PCPU_GET(cpuid), &other_cpus); 609 stop_cpus_hard(other_cpus); 610 did_stop_cpus = 1; 611 } else 612 did_stop_cpus = 0; |
612#endif 613 614 kdb_active++; 615 616 kdb_frame = tf; 617 618 /* Let MD code do its thing first... */ 619 kdb_cpu_trap(type, code); --- 9 unchanged lines hidden (view full) --- 629 if (be == NULL || be->dbbe_trap == NULL) 630 break; 631 printf("Switching to %s back-end\n", be->dbbe_name); 632 } 633 634 kdb_active--; 635 636#ifdef SMP | 613#endif 614 615 kdb_active++; 616 617 kdb_frame = tf; 618 619 /* Let MD code do its thing first... */ 620 kdb_cpu_trap(type, code); --- 9 unchanged lines hidden (view full) --- 630 if (be == NULL || be->dbbe_trap == NULL) 631 break; 632 printf("Switching to %s back-end\n", be->dbbe_name); 633 } 634 635 kdb_active--; 636 637#ifdef SMP |
637 restart_cpus(stopped_cpus); | 638 if (did_stop_cpus) 639 restart_cpus(stopped_cpus); |
638#endif 639 640 intr_restore(intr); 641 642 return (handled); 643} | 640#endif 641 642 intr_restore(intr); 643 644 return (handled); 645} |