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.
This commit is contained in:
Marcel Moolenaar 2006-04-03 22:51:47 +00:00
parent 68e8466655
commit bfcdefd8aa
6 changed files with 15 additions and 10 deletions

View file

@ -31,6 +31,8 @@
#include <machine/frame.h>
#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid]
static __inline void
kdb_cpu_clear_singlestep(void)
{

View file

@ -32,6 +32,8 @@
#include <machine/frame.h>
#include <machine/psl.h>
#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid]
static __inline void
kdb_cpu_clear_singlestep(void)
{

View file

@ -32,6 +32,8 @@
#include <machine/frame.h>
#include <machine/psl.h>
#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid]
static __inline void
kdb_cpu_clear_singlestep(void)
{

View file

@ -33,6 +33,8 @@
#include <machine/frame.h>
#include <machine/ia64_cpu.h>
#define KDB_STOPPEDPCB(pc) (pc)->pc_pcb
static __inline void
kdb_cpu_clear_singlestep(void)
{

View file

@ -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);

View file

@ -31,6 +31,8 @@
#include <machine/cpufunc.h>
#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid]
static __inline void
kdb_cpu_clear_singlestep(void)
{