Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/aim/mmu_oea64.c
Context not available. | |||||
/* If this address is direct-mapped, skip remapping */ | /* If this address is direct-mapped, skip remapping */ | ||||
if (hw_direct_map && | if (hw_direct_map && | ||||
translations[i].om_va == PHYS_TO_DMAP(pa_base) && | translations[i].om_va == PHYS_TO_DMAP(pa_base) && | ||||
moea64_calc_wimg(pa_base + off, VM_MEMATTR_DEFAULT) == LPTE_M) | moea64_calc_wimg(pa_base + off, VM_MEMATTR_DEFAULT) | ||||
== LPTE_M) | |||||
breno.leitao_gmail.com: It seems that there is space and tabs mixed here, as '\b\t\t\t" | |||||
continue; | continue; | ||||
PMAP_LOCK(kernel_pmap); | PMAP_LOCK(kernel_pmap); | ||||
Context not available. | |||||
} | } | ||||
} | } | ||||
PMAP_UNLOCK(kernel_pmap); | PMAP_UNLOCK(kernel_pmap); | ||||
} else { | } | ||||
size = moea64_bpvo_pool_size*sizeof(struct pvo_entry); | |||||
off = (vm_offset_t)(moea64_bpvo_pool); | |||||
for (pa = off; pa < off + size; pa += PAGE_SIZE) | |||||
moea64_kenter(mmup, pa, pa); | |||||
/* | /* | ||||
* Map certain important things, like ourselves. | * Make sure the kernel and BPVO pool stay mapped on systems either | ||||
* | * without a direct map or on which the kernel is not already executing | ||||
* NOTE: We do not map the exception vector space. That code is | * out of the direct-mapped region. | ||||
* used only in real mode, and leaving it unmapped allows us to | */ | ||||
* catch NULL pointer deferences, instead of making NULL a valid | |||||
* address. | |||||
*/ | |||||
if (!hw_direct_map || kernelstart < DMAP_BASE_ADDRESS) { | |||||
for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; | for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; | ||||
pa += PAGE_SIZE) | pa += PAGE_SIZE) | ||||
moea64_kenter(mmup, pa, pa); | moea64_kenter(mmup, pa, pa); | ||||
} | } | ||||
if (!hw_direct_map) { | |||||
size = moea64_bpvo_pool_size*sizeof(struct pvo_entry); | |||||
off = (vm_offset_t)(moea64_bpvo_pool); | |||||
for (pa = off; pa < off + size; pa += PAGE_SIZE) | |||||
moea64_kenter(mmup, pa, pa); | |||||
Not Done Inline ActionsThere is an space as the last char. breno.leitao_gmail.com: There is an space as the last char. | |||||
} | |||||
ENABLE_TRANS(msr); | ENABLE_TRANS(msr); | ||||
/* | /* | ||||
Context not available. | |||||
moea64_bpvo_pool_size*sizeof(struct pvo_entry), 0); | moea64_bpvo_pool_size*sizeof(struct pvo_entry), 0); | ||||
moea64_bpvo_pool_index = 0; | moea64_bpvo_pool_index = 0; | ||||
/* Place at address usable through the direct map */ | |||||
if (hw_direct_map) | |||||
moea64_bpvo_pool = (struct pvo_entry *) | |||||
PHYS_TO_DMAP((uintptr_t)moea64_bpvo_pool); | |||||
/* | /* | ||||
* Make sure kernel vsid is allocated as well as VSID 0. | * Make sure kernel vsid is allocated as well as VSID 0. | ||||
*/ | */ | ||||
Context not available. | |||||
Maxmem = max(Maxmem, powerpc_btop(phys_avail[i + 1])); | Maxmem = max(Maxmem, powerpc_btop(phys_avail[i + 1])); | ||||
/* | /* | ||||
* Initialize MMU and remap early physical mappings | * Initialize MMU. | ||||
*/ | */ | ||||
MMU_CPU_BOOTSTRAP(mmup,0); | MMU_CPU_BOOTSTRAP(mmup,0); | ||||
mtmsr(mfmsr() | PSL_DR | PSL_IR); | mtmsr(mfmsr() | PSL_DR | PSL_IR); | ||||
pmap_bootstrapped++; | pmap_bootstrapped++; | ||||
bs_remap_earlyboot(); | |||||
/* | /* | ||||
* Set the start and end of kva. | * Set the start and end of kva. | ||||
Context not available. | |||||
#endif | #endif | ||||
/* | /* | ||||
Not Done Inline ActionsThere is several spaces on this line breno.leitao_gmail.com: There is several spaces on this line
| |||||
* Remap any early IO mappings (console framebuffer, etc.) | |||||
*/ | |||||
bs_remap_earlyboot(); | |||||
/* | |||||
* Figure out how far we can extend virtual_end into segment 16 | * Figure out how far we can extend virtual_end into segment 16 | ||||
* without running into existing mappings. Segment 16 is guaranteed | * without running into existing mappings. Segment 16 is guaranteed | ||||
* to contain neither RAM nor devices (at least on Apple hardware), | * to contain neither RAM nor devices (at least on Apple hardware), | ||||
Context not available. | |||||
/* | /* | ||||
* Shortcut the direct-mapped case when applicable. We never put | * Shortcut the direct-mapped case when applicable. We never put | ||||
* anything but 1:1 mappings below VM_MIN_KERNEL_ADDRESS. | * anything but 1:1 (or 62-bit aliased) mappings below | ||||
* VM_MIN_KERNEL_ADDRESS. | |||||
*/ | */ | ||||
if (va < VM_MIN_KERNEL_ADDRESS) | if (va < VM_MIN_KERNEL_ADDRESS) | ||||
return (va); | return (va & ~DMAP_BASE_ADDRESS); | ||||
PMAP_LOCK(kernel_pmap); | PMAP_LOCK(kernel_pmap); | ||||
pvo = moea64_pvo_find_va(kernel_pmap, va); | pvo = moea64_pvo_find_va(kernel_pmap, va); | ||||
Context not available. | |||||
* Update vm about page writeability/executability if managed | * Update vm about page writeability/executability if managed | ||||
*/ | */ | ||||
PV_LOCKASSERT(pvo->pvo_pte.pa & LPTE_RPGN); | PV_LOCKASSERT(pvo->pvo_pte.pa & LPTE_RPGN); | ||||
pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN); | if (pvo->pvo_vaddr & PVO_MANAGED) { | ||||
pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN); | |||||
if ((pvo->pvo_vaddr & PVO_MANAGED) && pg != NULL) { | if (pg != NULL) { | ||||
LIST_REMOVE(pvo, pvo_vlink); | LIST_REMOVE(pvo, pvo_vlink); | ||||
if (LIST_EMPTY(vm_page_to_pvoh(pg))) | if (LIST_EMPTY(vm_page_to_pvoh(pg))) | ||||
vm_page_aflag_clear(pg, PGA_WRITEABLE | PGA_EXECUTABLE); | vm_page_aflag_clear(pg, | ||||
PGA_WRITEABLE | PGA_EXECUTABLE); | |||||
} | |||||
} | } | ||||
moea64_pvo_entries--; | moea64_pvo_entries--; | ||||
Context not available. | |||||
vm_offset_t ppa; | vm_offset_t ppa; | ||||
int error = 0; | int error = 0; | ||||
if (hw_direct_map && mem_valid(pa, size) == 0) | |||||
return (0); | |||||
PMAP_LOCK(kernel_pmap); | PMAP_LOCK(kernel_pmap); | ||||
key.pvo_vaddr = ppa = pa & ~ADDR_POFF; | ppa = pa & ~ADDR_POFF; | ||||
key.pvo_vaddr = DMAP_BASE_ADDRESS + ppa; | |||||
for (pvo = RB_FIND(pvo_tree, &kernel_pmap->pmap_pvo, &key); | for (pvo = RB_FIND(pvo_tree, &kernel_pmap->pmap_pvo, &key); | ||||
ppa < pa + size; ppa += PAGE_SIZE, | ppa < pa + size; ppa += PAGE_SIZE, | ||||
pvo = RB_NEXT(pvo_tree, &kernel_pmap->pmap_pvo, pvo)) { | pvo = RB_NEXT(pvo_tree, &kernel_pmap->pmap_pvo, pvo)) { | ||||
Context not available. |
It seems that there is space and tabs mixed here, as '\b\t\t\t"