diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-11-12 05:12:38 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-11-12 05:12:38 +0000 |
commit | 358939cf2851c9d7833953cc0f31bbec62619b92 (patch) | |
tree | cd50007afa1ab03e7a63025a0ec0d906ce0d8559 /sys/powerpc/aim/mmu_oea.c | |
parent | 81f6e90db281b9c0caa871391cc4869122c8e872 (diff) | |
download | FreeBSD-src-358939cf2851c9d7833953cc0f31bbec62619b92.zip FreeBSD-src-358939cf2851c9d7833953cc0f31bbec62619b92.tar.gz |
Remove use of a separate ofw_pmap on 32-bit CPUs. Many Open Firmware
mappings need to end up in the kernel anyway since the kernel begins
executing in OF context. Separating them adds needless complexity,
especially since the powerpc64 and mmu_oea64 code gave up on it a long
time ago.
As a side effect, the PPC ofw_machdep code is no longer AIM-specific,
so move it to powerpc/ofw.
Diffstat (limited to 'sys/powerpc/aim/mmu_oea.c')
-rw-r--r-- | sys/powerpc/aim/mmu_oea.c | 43 |
1 files changed, 12 insertions, 31 deletions
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 5ba029c..7bd07e1 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -197,8 +197,6 @@ static u_int phys_avail_count; static int regions_sz, pregions_sz; static struct ofw_map *translations; -extern struct pmap ofw_pmap; - /* * Lock for the pteg and pvo tables. */ @@ -669,10 +667,7 @@ moea_cpu_bootstrap(mmu_t mmup, int ap) isync(); for (i = 0; i < 16; i++) - mtsrin(i << ADDR_SR_SHFT, EMPTY_SEGMENT); - - __asm __volatile("mtsr %0,%1" :: "n"(KERNEL_SR), "r"(KERNEL_SEGMENT)); - __asm __volatile("mtsr %0,%1" :: "n"(KERNEL2_SR), "r"(KERNEL2_SEGMENT)); + mtsrin(i << ADDR_SR_SHFT, kernel_pmap->pm_sr[i]); powerpc_sync(); sdr = (u_int)moea_pteg_table | (moea_pteg_mask >> 10); @@ -859,11 +854,16 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) moea_vsid_bitmap[0] |= 1; /* - * Set up the Open Firmware pmap and add it's mappings. + * Initialize the kernel pmap (which is statically allocated). + */ + PMAP_LOCK_INIT(kernel_pmap); + for (i = 0; i < 16; i++) + kernel_pmap->pm_sr[i] = EMPTY_SEGMENT + i; + kernel_pmap->pm_active = ~0; + + /* + * Set up the Open Firmware mappings */ - moea_pinit(mmup, &ofw_pmap); - ofw_pmap.pm_sr[KERNEL_SR] = KERNEL_SEGMENT; - ofw_pmap.pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT; if ((chosen = OF_finddevice("/chosen")) == -1) panic("moea_bootstrap: can't find /chosen"); OF_getprop(chosen, "mmu", &mmui, 4); @@ -900,16 +900,8 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) /* Enter the pages */ for (off = 0; off < translations[i].om_len; off += PAGE_SIZE) { - struct vm_page m; - - m.phys_addr = translations[i].om_pa + off; - m.md.mdpg_cache_attrs = VM_MEMATTR_DEFAULT; - m.oflags = VPO_BUSY; - PMAP_LOCK(&ofw_pmap); - moea_enter_locked(&ofw_pmap, - translations[i].om_va + off, &m, - VM_PROT_ALL, 1); - PMAP_UNLOCK(&ofw_pmap); + moea_kenter(mmup, translations[i].om_va + off, + translations[i].om_pa + off); ofw_mappings++; } } @@ -921,17 +913,6 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) ; Maxmem = powerpc_btop(phys_avail[i + 1]); - /* - * Initialize the kernel pmap (which is statically allocated). - */ - PMAP_LOCK_INIT(kernel_pmap); - for (i = 0; i < 16; i++) { - kernel_pmap->pm_sr[i] = EMPTY_SEGMENT; - } - kernel_pmap->pm_sr[KERNEL_SR] = KERNEL_SEGMENT; - kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT; - kernel_pmap->pm_active = ~0; - moea_cpu_bootstrap(mmup,0); pmap_bootstrapped++; |