subr_kdb.c (157442) | subr_kdb.c (157448) |
---|---|
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 157442 2006-04-03 20:55:52Z marcel $"); | 28__FBSDID("$FreeBSD: head/sys/kern/subr_kdb.c 157448 2006-04-03 22:51:47Z marcel $"); |
29 30#include "opt_kdb.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kdb.h> 35#include <sys/kernel.h> 36#include <sys/malloc.h> 37#include <sys/pcpu.h> 38#include <sys/proc.h> 39#include <sys/smp.h> 40#include <sys/sysctl.h> 41 42#include <machine/kdb.h> 43#include <machine/pcb.h> 44 45#ifdef SMP | 29 30#include "opt_kdb.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kdb.h> 35#include <sys/kernel.h> 36#include <sys/malloc.h> 37#include <sys/pcpu.h> 38#include <sys/proc.h> 39#include <sys/smp.h> 40#include <sys/sysctl.h> 41 42#include <machine/kdb.h> 43#include <machine/pcb.h> 44 45#ifdef SMP |
46#if defined (__i386__) || defined(__amd64__) || defined(__sparc64__) || defined(__alpha__) 47#define HAVE_STOPPEDPCBS | |
48#include <machine/smp.h> 49#endif | 46#include <machine/smp.h> 47#endif |
50#endif | |
51 52int kdb_active = 0; 53void *kdb_jmpbufp = NULL; 54struct kdb_dbbe *kdb_dbbe = NULL; 55struct pcb kdb_pcb; 56struct pcb *kdb_thrctx = NULL; 57struct thread *kdb_thread = NULL; 58struct trapframe *kdb_frame = NULL; --- 294 unchanged lines hidden (view full) --- 353 354/* 355 * Thread related support functions. 356 */ 357 358struct pcb * 359kdb_thr_ctx(struct thread *thr) 360{ | 48 49int kdb_active = 0; 50void *kdb_jmpbufp = NULL; 51struct kdb_dbbe *kdb_dbbe = NULL; 52struct pcb kdb_pcb; 53struct pcb *kdb_thrctx = NULL; 54struct thread *kdb_thread = NULL; 55struct trapframe *kdb_frame = NULL; --- 294 unchanged lines hidden (view full) --- 350 351/* 352 * Thread related support functions. 353 */ 354 355struct pcb * 356kdb_thr_ctx(struct thread *thr) 357{ |
361#ifdef HAVE_STOPPEDPCBS | 358#if defined(SMP) && defined(KDB_STOPPEDPCB) |
362 struct pcpu *pc; | 359 struct pcpu *pc; |
363 u_int cpuid; | |
364#endif | 360#endif |
365 | 361 |
366 if (thr == curthread) 367 return (&kdb_pcb); 368 | 362 if (thr == curthread) 363 return (&kdb_pcb); 364 |
369#ifdef HAVE_STOPPEDPCBS | 365#if defined(SMP) && defined(KDB_STOPPEDPCB) |
370 SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { | 366 SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { |
371 cpuid = pc->pc_cpuid; 372 if (pc->pc_curthread == thr && (stopped_cpus & (1 << cpuid))) 373 return (&stoppcbs[cpuid]); | 367 if (pc->pc_curthread == thr && (stopped_cpus & pc->pc_cpumask)) 368 return (KDB_STOPPEDPCB(pc)); |
374 } 375#endif 376 return (thr->td_pcb); 377} 378 379struct thread * 380kdb_thr_first(void) 381{ --- 117 unchanged lines hidden --- | 369 } 370#endif 371 return (thr->td_pcb); 372} 373 374struct thread * 375kdb_thr_first(void) 376{ --- 117 unchanged lines hidden --- |