diff options
author | marcel <marcel@FreeBSD.org> | 2006-04-03 22:51:47 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2006-04-03 22:51:47 +0000 |
commit | 8278e2d5fbf3b90494b259664803d77b2c5c2a96 (patch) | |
tree | 981658ebfce6b57566091fd168aa6d3b3c08789c /sys/kern/subr_kdb.c | |
parent | 8582a7eef54875ec23f28273f78836913636fa30 (diff) | |
download | FreeBSD-src-8278e2d5fbf3b90494b259664803d77b2c5c2a96.zip FreeBSD-src-8278e2d5fbf3b90494b259664803d77b2c5c2a96.tar.gz |
Eliminate HAVE_STOPPEDPCBS. On ia64 the PCPU holds a pointer to the
PCB in which the context of stopped CPUs is stored. To access this
PCB from KDB, we introduce a new define, called KDB_STOPPEDPCB. The
definition, when present, lives in <machine/kdb.h> and abstracts
where MD code saves the context. Define KDB_STOPPEDPCB on i386,
amd64, alpha and sparc64 in accordance to previous code.
Diffstat (limited to 'sys/kern/subr_kdb.c')
-rw-r--r-- | sys/kern/subr_kdb.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index b386604..7fb9b9e 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -43,11 +43,8 @@ __FBSDID("$FreeBSD$"); #include <machine/pcb.h> #ifdef SMP -#if defined (__i386__) || defined(__amd64__) || defined(__sparc64__) || defined(__alpha__) -#define HAVE_STOPPEDPCBS #include <machine/smp.h> #endif -#endif int kdb_active = 0; void *kdb_jmpbufp = NULL; @@ -358,19 +355,17 @@ kdb_reenter(void) struct pcb * kdb_thr_ctx(struct thread *thr) { -#ifdef HAVE_STOPPEDPCBS +#if defined(SMP) && defined(KDB_STOPPEDPCB) struct pcpu *pc; - u_int cpuid; #endif - + if (thr == curthread) return (&kdb_pcb); -#ifdef HAVE_STOPPEDPCBS +#if defined(SMP) && defined(KDB_STOPPEDPCB) SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { - cpuid = pc->pc_cpuid; - if (pc->pc_curthread == thr && (stopped_cpus & (1 << cpuid))) - return (&stoppcbs[cpuid]); + if (pc->pc_curthread == thr && (stopped_cpus & pc->pc_cpumask)) + return (KDB_STOPPEDPCB(pc)); } #endif return (thr->td_pcb); |