diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-03-20 15:21:13 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-03-20 15:21:13 +0000 |
commit | 0e3223a10b0c354e6e9a8d1c3e0b0c25809c127d (patch) | |
tree | 9a34635bd3b5126221eec71ee76373b3e6e453b3 /sys/powerpc | |
parent | d02e8a616cd890d35d812b019143723789740b7c (diff) | |
download | FreeBSD-src-0e3223a10b0c354e6e9a8d1c3e0b0c25809c127d.zip FreeBSD-src-0e3223a10b0c354e6e9a8d1c3e0b0c25809c127d.tar.gz |
MFC r204269:
Use dcbz instead of word stores for page zeroing, providing a factor of
3-4 speedup.
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/mmu_oea64.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 23e5950..f5ebfef 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -1075,15 +1075,6 @@ moea64_change_wiring(mmu_t mmu, pmap_t pm, vm_offset_t va, boolean_t wired) } /* - * Zero a page of physical memory by temporarily mapping it into the tlb. - */ -void -moea64_zero_page(mmu_t mmu, vm_page_t m) -{ - moea64_zero_page_area(mmu,m,0,PAGE_SIZE); -} - -/* * This goes through and sets the physical address of our * special scratch PTE to the PA we want to zero or copy. Because * of locking issues (this can get called in pvo_enter() by @@ -1147,6 +1138,27 @@ moea64_zero_page_area(mmu_t mmu, vm_page_t m, int off, int size) mtx_unlock(&moea64_scratchpage_mtx); } +/* + * Zero a page of physical memory by temporarily mapping it + */ +void +moea64_zero_page(mmu_t mmu, vm_page_t m) +{ + vm_offset_t pa = VM_PAGE_TO_PHYS(m); + vm_offset_t off; + + if (!moea64_initialized) + panic("moea64_zero_page: can't zero pa %#x", pa); + + mtx_lock(&moea64_scratchpage_mtx); + + moea64_set_scratchpage_pa(0,pa); + for (off = 0; off < PAGE_SIZE; off += cacheline_size) + __asm __volatile("dcbz 0,%0" :: + "r"(moea64_scratchpage_va[0] + off)); + mtx_unlock(&moea64_scratchpage_mtx); +} + void moea64_zero_page_idle(mmu_t mmu, vm_page_t m) { |