diff options
author | jhb <jhb@FreeBSD.org> | 2005-11-03 21:08:20 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-11-03 21:08:20 +0000 |
commit | b2c57e8bc8e4b4f7424f7b7cfdfa5db7279a248f (patch) | |
tree | 8dca468fca38c4de1d112029ae7cb94ecf77592a /sys/alpha | |
parent | 935ba49b57c25a08e0773785ead144bdb08a5368 (diff) | |
download | FreeBSD-src-b2c57e8bc8e4b4f7424f7b7cfdfa5db7279a248f.zip FreeBSD-src-b2c57e8bc8e4b4f7424f7b7cfdfa5db7279a248f.tar.gz |
Add stoppcbs[] arrays on Alpha and sparc64 and have each CPU save its
current context in the IPI_STOP handler so that we can get accurate stack
traces of threads on other CPUs on these two archs like we do now on i386
and amd64.
Tested on: alpha, sparc64
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/alpha/mp_machdep.c | 10 | ||||
-rw-r--r-- | sys/alpha/include/smp.h | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/alpha/alpha/mp_machdep.c b/sys/alpha/alpha/mp_machdep.c index c1b9706d..e548d4f 100644 --- a/sys/alpha/alpha/mp_machdep.c +++ b/sys/alpha/alpha/mp_machdep.c @@ -62,6 +62,7 @@ static volatile int aps_ready = 0; static struct mtx ap_boot_mtx; u_int64_t boot_cpu_id; +struct pcb stoppcbs[MAXCPU]; static void release_aps(void *dummy); static int smp_cpu_enabled(struct pcs *pcsp); @@ -543,11 +544,12 @@ smp_handle_ipi(struct trapframe *frame) case IPI_STOP: CTR0(KTR_SMP, "IPI_STOP"); - atomic_set_int(&stopped_cpus, cpumask); + savectx(&stoppcbs[PCPU_GET(cpuid)]); + atomic_set_acq_int(&stopped_cpus, cpumask); while ((started_cpus & cpumask) == 0) - alpha_mb(); - atomic_clear_int(&started_cpus, cpumask); - atomic_clear_int(&stopped_cpus, cpumask); + cpu_spinwait(); + atomic_clear_rel_int(&started_cpus, cpumask); + atomic_clear_rel_int(&stopped_cpus, cpumask); break; } } diff --git a/sys/alpha/include/smp.h b/sys/alpha/include/smp.h index 9660d09..9bfd0c6 100644 --- a/sys/alpha/include/smp.h +++ b/sys/alpha/include/smp.h @@ -27,6 +27,7 @@ #ifndef LOCORE extern u_int64_t boot_cpu_id; +extern struct pcb stoppcbs[]; void ipi_selected(u_int cpus, u_int64_t ipi); void ipi_all(u_int64_t ipi); |