summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2011-05-18 16:50:13 +0000
committerattilio <attilio@FreeBSD.org>2011-05-18 16:50:13 +0000
commitd85d9c08767850035cab0143951e210a3f6a5434 (patch)
tree11d3fd9f61e4782a8395c7fdb679b47902c37a5d /sys
parentcc0337466b396995a739eccf548b0ac94a319801 (diff)
downloadFreeBSD-src-d85d9c08767850035cab0143951e210a3f6a5434.zip
FreeBSD-src-d85d9c08767850035cab0143951e210a3f6a5434.tar.gz
Revert r222069,222068 as they were intended to be committed to the
largeSMP branch. Reported by: pluknet
Diffstat (limited to 'sys')
-rw-r--r--sys/powerpc/booke/platform_bare.c5
-rw-r--r--sys/powerpc/booke/pmap.c11
2 files changed, 6 insertions, 10 deletions
diff --git a/sys/powerpc/booke/platform_bare.c b/sys/powerpc/booke/platform_bare.c
index de26128..8e03bd3 100644
--- a/sys/powerpc/booke/platform_bare.c
+++ b/sys/powerpc/booke/platform_bare.c
@@ -241,7 +241,7 @@ bare_smp_start_cpu(platform_t plat, struct pcpu *pc)
int timeout;
eebpcr = ccsr_read4(OCP85XX_EEBPCR);
- if ((eebpcr & (1 << (pc->pc_cpuid + 24))) != 0) {
+ if ((eebpcr & (pc->pc_cpumask << 24)) != 0) {
printf("%s: CPU=%d already out of hold-off state!\n",
__func__, pc->pc_cpuid);
return (ENXIO);
@@ -259,8 +259,7 @@ bare_smp_start_cpu(platform_t plat, struct pcpu *pc)
/*
* Release AP from hold-off state
*/
-
- eebpcr |= (1 << (pc->pc_cpuid + 24));
+ eebpcr |= (pc->pc_cpumask << 24);
ccsr_write4(OCP85XX_EEBPCR, eebpcr);
__asm __volatile("isync; msync");
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index 11be68e..2fffa3f 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$");
#include <sys/msgbuf.h>
#include <sys/lock.h>
#include <sys/mutex.h>
-#include <sys/sched.h>
#include <sys/smp.h>
#include <sys/vmmeter.h>
@@ -1229,7 +1228,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend)
PTE_VALID;
}
/* Mark kernel_pmap active on all CPUs */
- CPU_FILL(&kernel_pmap->pm_active);
+ kernel_pmap->pm_active = ~0;
/*******************************************************/
/* Final setup */
@@ -1484,7 +1483,7 @@ mmu_booke_pinit(mmu_t mmu, pmap_t pmap)
PMAP_LOCK_INIT(pmap);
for (i = 0; i < MAXCPU; i++)
pmap->pm_tid[i] = TID_NONE;
- CPU_ZERO(&kernel_pmap->pm_active);
+ pmap->pm_active = 0;
bzero(&pmap->pm_stats, sizeof(pmap->pm_stats));
bzero(&pmap->pm_pdir, sizeof(pte_t *) * PDIR_NENTRIES);
TAILQ_INIT(&pmap->pm_ptbl_list);
@@ -1839,7 +1838,7 @@ mmu_booke_activate(mmu_t mmu, struct thread *td)
mtx_lock_spin(&sched_lock);
- CPU_OR_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask));
+ atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask));
PCPU_SET(curpmap, pmap);
if (pmap->pm_tid[PCPU_GET(cpuid)] == TID_NONE)
@@ -1868,9 +1867,7 @@ mmu_booke_deactivate(mmu_t mmu, struct thread *td)
CTR5(KTR_PMAP, "%s: td=%p, proc = '%s', id = %d, pmap = 0x%08x",
__func__, td, td->td_proc->p_comm, td->td_proc->p_pid, pmap);
- sched_pin();
- CPU_NAND_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask));
- sched_unpin();
+ atomic_clear_int(&pmap->pm_active, PCPU_GET(cpumask));
PCPU_SET(curpmap, NULL);
}
OpenPOWER on IntegriCloud