summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/booke/pmap.c
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2013-11-11 17:37:50 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2013-11-11 17:37:50 +0000
commita1b4155638a33ca94f6883ce038586bbcff1ad2b (patch)
tree7aa8e33dae2fe2d15e51c141ed97bb773caaea7c /sys/powerpc/booke/pmap.c
parent558b5627ee3cdd00c69ae92c2b895fc8a6bd5999 (diff)
downloadFreeBSD-src-a1b4155638a33ca94f6883ce038586bbcff1ad2b.zip
FreeBSD-src-a1b4155638a33ca94f6883ce038586bbcff1ad2b.tar.gz
Follow up r223485, which made AIM use the ABI thread pointer instead of
PCPU fields for curthread, by doing the same to Book-E. This closes some potential races switching between CPUs. As a side effect, it turns out the AIM and Book-E swtch.S implementations were the same to within a few registers, so move that to powerpc/powerpc. MFC after: 3 months
Diffstat (limited to 'sys/powerpc/booke/pmap.c')
-rw-r--r--sys/powerpc/booke/pmap.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index 6d943c9..a271b99 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -100,8 +100,6 @@ __FBSDID("$FreeBSD$");
#define TODO panic("%s: not implemented", __func__);
-extern struct mtx sched_lock;
-
extern int dumpsys_minidump;
extern unsigned char _etext[];
@@ -1906,7 +1904,7 @@ mmu_booke_activate(mmu_t mmu, struct thread *td)
KASSERT((pmap != kernel_pmap), ("mmu_booke_activate: kernel_pmap!"));
- mtx_lock_spin(&sched_lock);
+ sched_pin();
cpuid = PCPU_GET(cpuid);
CPU_SET_ATOMIC(cpuid, &pmap->pm_active);
@@ -1919,7 +1917,7 @@ mmu_booke_activate(mmu_t mmu, struct thread *td)
mtspr(SPR_PID0, pmap->pm_tid[cpuid]);
__asm __volatile("isync");
- mtx_unlock_spin(&sched_lock);
+ sched_unpin();
CTR3(KTR_PMAP, "%s: e (tid = %d for '%s')", __func__,
pmap->pm_tid[PCPU_GET(cpuid)], td->td_proc->p_comm);
OpenPOWER on IntegriCloud