diff options
author | peter <peter@FreeBSD.org> | 2002-04-15 16:00:03 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-04-15 16:00:03 +0000 |
commit | 3d8c7d4cabad90e8d24802b5e0864d76dc5a05d9 (patch) | |
tree | 07394998150236b94ddf401e0d3efec082c9ab55 /sys/amd64 | |
parent | 929a8fb33da9bf37ac6d590e39a2e60f00c6c4dd (diff) | |
download | FreeBSD-src-3d8c7d4cabad90e8d24802b5e0864d76dc5a05d9.zip FreeBSD-src-3d8c7d4cabad90e8d24802b5e0864d76dc5a05d9.tar.gz |
Pass vm_page_t instead of physical addresses to pmap_zero_page[_area]()
and pmap_copy_page(). This gets rid of a couple more physical addresses
in upper layers, with the eventual aim of supporting PAE and dealing with
the physical addressing mostly within pmap. (We will need either 64 bit
physical addresses or page indexes, possibly both depending on the
circumstances. Leaving this to pmap itself gives more flexibilitly.)
Reviewed by: jake
Tested on: i386, ia64 and (I believe) sparc64. (my alpha was hosed)
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 0b81cad..7292906 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1464,7 +1464,7 @@ _pmap_allocpte(pmap, ptepindex) pteva = VM_MAXUSER_ADDRESS + i386_ptob(ptepindex); bzero((caddr_t) pteva, PAGE_SIZE); } else { - pmap_zero_page(ptepa); + pmap_zero_page(m); } } @@ -1629,8 +1629,8 @@ pmap_growkernel(vm_offset_t addr) nkpt++; vm_page_wire(nkpg); + pmap_zero_page(nkpg); ptppaddr = VM_PAGE_TO_PHYS(nkpg); - pmap_zero_page(ptppaddr); newpdir = (pd_entry_t) (ptppaddr | PG_V | PG_RW | PG_A | PG_M); pdir_pde(PTD, kernel_vm_end) = newpdir; @@ -2861,13 +2861,14 @@ pmap_kernel() * the page into KVM and using bzero to clear its contents. */ void -pmap_zero_page(vm_offset_t phys) +pmap_zero_page(vm_page_t m) { + vm_offset_t phys = VM_PAGE_TO_PHYS(m); if (*CMAP2) panic("pmap_zero_page: CMAP2 busy"); - *CMAP2 = PG_V | PG_RW | (phys & PG_FRAME) | PG_A | PG_M; + *CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M; invltlb_1pg((vm_offset_t)CADDR2); #if defined(I686_CPU) @@ -2886,13 +2887,14 @@ pmap_zero_page(vm_offset_t phys) * off and size may not cover an area beyond a single hardware page. */ void -pmap_zero_page_area(vm_offset_t phys, int off, int size) +pmap_zero_page_area(vm_page_t m, int off, int size) { + vm_offset_t phys = VM_PAGE_TO_PHYS(m); if (*CMAP2) panic("pmap_zero_page: CMAP2 busy"); - *CMAP2 = PG_V | PG_RW | (phys & PG_FRAME) | PG_A | PG_M; + *CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M; invltlb_1pg((vm_offset_t)CADDR2); #if defined(I686_CPU) @@ -2911,7 +2913,7 @@ pmap_zero_page_area(vm_offset_t phys, int off, int size) * time. */ void -pmap_copy_page(vm_offset_t src, vm_offset_t dst) +pmap_copy_page(vm_page_t src, vm_page_t dst) { if (*CMAP1) @@ -2919,8 +2921,8 @@ pmap_copy_page(vm_offset_t src, vm_offset_t dst) if (*CMAP2) panic("pmap_copy_page: CMAP2 busy"); - *CMAP1 = PG_V | (src & PG_FRAME) | PG_A; - *CMAP2 = PG_V | PG_RW | (dst & PG_FRAME) | PG_A | PG_M; + *CMAP1 = PG_V | VM_PAGE_TO_PHYS(src) | PG_A; + *CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(dst) | PG_A | PG_M; #ifdef I386_CPU invltlb(); #else |