summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/include
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2012-06-16 18:56:19 +0000
committeralc <alc@FreeBSD.org>2012-06-16 18:56:19 +0000
commit6eeaee04e4175a3faa0ce3f7778a3abce0d8d9a2 (patch)
treeebf0376a21131a0f41835773afe0ddda56d3efbe /sys/powerpc/include
parentca31dfb2b475f8026e45a8b10673993068ebc000 (diff)
downloadFreeBSD-src-6eeaee04e4175a3faa0ce3f7778a3abce0d8d9a2.zip
FreeBSD-src-6eeaee04e4175a3faa0ce3f7778a3abce0d8d9a2.tar.gz
The page flag PGA_WRITEABLE is set and cleared exclusively by the pmap
layer, but it is read directly by the MI VM layer. This change introduces pmap_page_is_write_mapped() in order to completely encapsulate all direct access to PGA_WRITEABLE in the pmap layer. Aesthetics aside, I am making this change because amd64 will likely begin using an alternative method to track write mappings, and having pmap_page_is_write_mapped() in place allows me to make such a change without further modification to the MI VM layer. As an added bonus, tidy up some nearby comments concerning page flags. Reviewed by: kib MFC after: 6 weeks
Diffstat (limited to 'sys/powerpc/include')
-rw-r--r--sys/powerpc/include/pmap.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/powerpc/include/pmap.h b/sys/powerpc/include/pmap.h
index 2f0e5b0..f50ff11 100644
--- a/sys/powerpc/include/pmap.h
+++ b/sys/powerpc/include/pmap.h
@@ -223,6 +223,8 @@ extern struct pmap kernel_pmap_store;
#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx)
#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx)
+#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0)
+
void pmap_bootstrap(vm_offset_t, vm_offset_t);
void pmap_kenter(vm_offset_t va, vm_paddr_t pa);
void pmap_kenter_attr(vm_offset_t va, vm_offset_t pa, vm_memattr_t);
OpenPOWER on IntegriCloud