diff options
author | benno <benno@FreeBSD.org> | 2002-02-28 02:54:16 +0000 |
---|---|---|
committer | benno <benno@FreeBSD.org> | 2002-02-28 02:54:16 +0000 |
commit | 7c729fe9615b1381f4965143fbeee495cb45ae58 (patch) | |
tree | 557daecde4d37f52802447373b7124957b03e398 /sys/powerpc | |
parent | 9ca8c0b6f6336e0055a8a9b340533cfba67c83a3 (diff) | |
download | FreeBSD-src-7c729fe9615b1381f4965143fbeee495cb45ae58.zip FreeBSD-src-7c729fe9615b1381f4965143fbeee495cb45ae58.tar.gz |
Implement the following functions:
- pmap_remove
- pmap_kremove
- pmap_qremove
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/mmu_oea.c | 35 | ||||
-rw-r--r-- | sys/powerpc/powerpc/mmu_oea.c | 35 | ||||
-rw-r--r-- | sys/powerpc/powerpc/pmap.c | 35 |
3 files changed, 93 insertions, 12 deletions
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index aebe911..741faf4 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -1002,10 +1002,14 @@ pmap_kextract(vm_offset_t va) return (0); } +/* + * Remove a wired page from kernel virtual address space. + */ void pmap_kremove(vm_offset_t va) { - TODO; + + pmap_remove(kernel_pmap, va, roundup(va, PAGE_SIZE)); } /* @@ -1271,6 +1275,11 @@ pmap_phys_address(int ppn) return (0); } +/* + * Map a list of wired pages into kernel virtual address space. This is + * intended for temporary mappings which do not need page modification or + * references recorded. Existing mappings in the region are overwritten. + */ void pmap_qenter(vm_offset_t va, vm_page_t *m, int count) { @@ -1280,10 +1289,17 @@ pmap_qenter(vm_offset_t va, vm_page_t *m, int count) pmap_kenter(va, VM_PAGE_TO_PHYS(m[i])); } +/* + * Remove page mappings from kernel virtual address space. Intended for + * temporary mappings entered by pmap_qenter. + */ void pmap_qremove(vm_offset_t va, int count) { - TODO; + int i; + + for (i = 0; i < count; i++, va += PAGE_SIZE) + pmap_kremove(va); } /* @@ -1303,10 +1319,21 @@ pmap_release(pmap_t pmap) TODO; } +/* + * Remove the given range of addresses from the specified map. + */ void -pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +pmap_remove(pmap_t pm, vm_offset_t sva, vm_offset_t eva) { - TODO; + struct pvo_entry *pvo; + int pteidx; + + for (; sva < eva; sva += PAGE_SIZE) { + pvo = pmap_pvo_find_va(pm, sva, &pteidx); + if (pvo != NULL) { + pmap_pvo_remove(pvo, pteidx); + } + } } void diff --git a/sys/powerpc/powerpc/mmu_oea.c b/sys/powerpc/powerpc/mmu_oea.c index aebe911..741faf4 100644 --- a/sys/powerpc/powerpc/mmu_oea.c +++ b/sys/powerpc/powerpc/mmu_oea.c @@ -1002,10 +1002,14 @@ pmap_kextract(vm_offset_t va) return (0); } +/* + * Remove a wired page from kernel virtual address space. + */ void pmap_kremove(vm_offset_t va) { - TODO; + + pmap_remove(kernel_pmap, va, roundup(va, PAGE_SIZE)); } /* @@ -1271,6 +1275,11 @@ pmap_phys_address(int ppn) return (0); } +/* + * Map a list of wired pages into kernel virtual address space. This is + * intended for temporary mappings which do not need page modification or + * references recorded. Existing mappings in the region are overwritten. + */ void pmap_qenter(vm_offset_t va, vm_page_t *m, int count) { @@ -1280,10 +1289,17 @@ pmap_qenter(vm_offset_t va, vm_page_t *m, int count) pmap_kenter(va, VM_PAGE_TO_PHYS(m[i])); } +/* + * Remove page mappings from kernel virtual address space. Intended for + * temporary mappings entered by pmap_qenter. + */ void pmap_qremove(vm_offset_t va, int count) { - TODO; + int i; + + for (i = 0; i < count; i++, va += PAGE_SIZE) + pmap_kremove(va); } /* @@ -1303,10 +1319,21 @@ pmap_release(pmap_t pmap) TODO; } +/* + * Remove the given range of addresses from the specified map. + */ void -pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +pmap_remove(pmap_t pm, vm_offset_t sva, vm_offset_t eva) { - TODO; + struct pvo_entry *pvo; + int pteidx; + + for (; sva < eva; sva += PAGE_SIZE) { + pvo = pmap_pvo_find_va(pm, sva, &pteidx); + if (pvo != NULL) { + pmap_pvo_remove(pvo, pteidx); + } + } } void diff --git a/sys/powerpc/powerpc/pmap.c b/sys/powerpc/powerpc/pmap.c index aebe911..741faf4 100644 --- a/sys/powerpc/powerpc/pmap.c +++ b/sys/powerpc/powerpc/pmap.c @@ -1002,10 +1002,14 @@ pmap_kextract(vm_offset_t va) return (0); } +/* + * Remove a wired page from kernel virtual address space. + */ void pmap_kremove(vm_offset_t va) { - TODO; + + pmap_remove(kernel_pmap, va, roundup(va, PAGE_SIZE)); } /* @@ -1271,6 +1275,11 @@ pmap_phys_address(int ppn) return (0); } +/* + * Map a list of wired pages into kernel virtual address space. This is + * intended for temporary mappings which do not need page modification or + * references recorded. Existing mappings in the region are overwritten. + */ void pmap_qenter(vm_offset_t va, vm_page_t *m, int count) { @@ -1280,10 +1289,17 @@ pmap_qenter(vm_offset_t va, vm_page_t *m, int count) pmap_kenter(va, VM_PAGE_TO_PHYS(m[i])); } +/* + * Remove page mappings from kernel virtual address space. Intended for + * temporary mappings entered by pmap_qenter. + */ void pmap_qremove(vm_offset_t va, int count) { - TODO; + int i; + + for (i = 0; i < count; i++, va += PAGE_SIZE) + pmap_kremove(va); } /* @@ -1303,10 +1319,21 @@ pmap_release(pmap_t pmap) TODO; } +/* + * Remove the given range of addresses from the specified map. + */ void -pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +pmap_remove(pmap_t pm, vm_offset_t sva, vm_offset_t eva) { - TODO; + struct pvo_entry *pvo; + int pteidx; + + for (; sva < eva; sva += PAGE_SIZE) { + pvo = pmap_pvo_find_va(pm, sva, &pteidx); + if (pvo != NULL) { + pmap_pvo_remove(pvo, pteidx); + } + } } void |