Date: Mon, 1 Nov 2010 02:22:48 +0000 (UTC) From: Alan Cox <alc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r214617 - head/sys/powerpc/aim Message-ID: <201011010222.oA12Mm74021199@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: alc Date: Mon Nov 1 02:22:48 2010 New Revision: 214617 URL: http://svn.freebsd.org/changeset/base/214617 Log: Implement pmap_is_prefaultable(). Reviewed by: nwhitehorn Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Mon Nov 1 02:21:35 2010 (r214616) +++ head/sys/powerpc/aim/mmu_oea.c Mon Nov 1 02:22:48 2010 (r214617) @@ -304,6 +304,7 @@ vm_paddr_t moea_extract(mmu_t, pmap_t, v vm_page_t moea_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t); void moea_init(mmu_t); boolean_t moea_is_modified(mmu_t, vm_page_t); +boolean_t moea_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea_is_referenced(mmu_t, vm_page_t); boolean_t moea_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); @@ -347,6 +348,7 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_extract_and_hold, moea_extract_and_hold), MMUMETHOD(mmu_init, moea_init), MMUMETHOD(mmu_is_modified, moea_is_modified), + MMUMETHOD(mmu_is_prefaultable, moea_is_prefaultable), MMUMETHOD(mmu_is_referenced, moea_is_referenced), MMUMETHOD(mmu_ts_referenced, moea_ts_referenced), MMUMETHOD(mmu_map, moea_map), @@ -1324,6 +1326,19 @@ moea_is_modified(mmu_t mmu, vm_page_t m) return (moea_query_bit(m, PTE_CHG)); } +boolean_t +moea_is_prefaultable(mmu_t mmu, pmap_t pmap, vm_offset_t va) +{ + struct pvo_entry *pvo; + boolean_t rv; + + PMAP_LOCK(pmap); + pvo = moea_pvo_find_va(pmap, va & ~ADDR_POFF, NULL); + rv = pvo == NULL || (pvo->pvo_pte.pte.pte_hi & PTE_VALID) == 0; + PMAP_UNLOCK(pmap); + return (rv); +} + void moea_clear_reference(mmu_t mmu, vm_page_t m) { Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Nov 1 02:21:35 2010 (r214616) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Nov 1 02:22:48 2010 (r214617) @@ -400,6 +400,7 @@ vm_paddr_t moea64_extract(mmu_t, pmap_t, vm_page_t moea64_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t); void moea64_init(mmu_t); boolean_t moea64_is_modified(mmu_t, vm_page_t); +boolean_t moea64_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea64_is_referenced(mmu_t, vm_page_t); boolean_t moea64_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); @@ -441,6 +442,7 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_extract_and_hold, moea64_extract_and_hold), MMUMETHOD(mmu_init, moea64_init), MMUMETHOD(mmu_is_modified, moea64_is_modified), + MMUMETHOD(mmu_is_prefaultable, moea64_is_prefaultable), MMUMETHOD(mmu_is_referenced, moea64_is_referenced), MMUMETHOD(mmu_ts_referenced, moea64_ts_referenced), MMUMETHOD(mmu_map, moea64_map), @@ -1786,6 +1788,19 @@ moea64_is_modified(mmu_t mmu, vm_page_t return (moea64_query_bit(m, LPTE_CHG)); } +boolean_t +moea64_is_prefaultable(mmu_t mmu, pmap_t pmap, vm_offset_t va) +{ + struct pvo_entry *pvo; + boolean_t rv; + + PMAP_LOCK(pmap); + pvo = moea64_pvo_find_va(pmap, va & ~ADDR_POFF); + rv = pvo == NULL || (pvo->pvo_pte.lpte.pte_hi & LPTE_VALID) == 0; + PMAP_UNLOCK(pmap); + return (rv); +} + void moea64_clear_reference(mmu_t mmu, vm_page_t m) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011010222.oA12Mm74021199>