diff options
author | alc <alc@FreeBSD.org> | 2004-05-09 19:09:14 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-05-09 19:09:14 +0000 |
commit | 600fc14c5f300fa10bdd489c3fb7e2076be8555b (patch) | |
tree | eefdf00e1b4dc587fe462c82444b9ee786d2b4c9 /sys/sparc64 | |
parent | 52fd45ee97b90992b0135c9bbf5a65401e138e7e (diff) | |
download | FreeBSD-src-600fc14c5f300fa10bdd489c3fb7e2076be8555b.zip FreeBSD-src-600fc14c5f300fa10bdd489c3fb7e2076be8555b.tar.gz |
Correct the implementation of pmap_page_is_mapped(): It should return TRUE
only if the page has one or more managed mappings.
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/include/pmap.h | 3 | ||||
-rw-r--r-- | sys/sparc64/sparc64/pmap.c | 18 |
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/sparc64/include/pmap.h b/sys/sparc64/include/pmap.h index 8164f3a..ed1efe4 100644 --- a/sys/sparc64/include/pmap.h +++ b/sys/sparc64/include/pmap.h @@ -45,8 +45,6 @@ #define PMAP_CONTEXT_MAX 8192 -#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.tte_list)) - typedef struct pmap *pmap_t; struct md_page { @@ -71,6 +69,7 @@ void pmap_kenter(vm_offset_t va, vm_page_t m); void pmap_kremove(vm_offset_t); void pmap_kenter_flags(vm_offset_t va, vm_paddr_t pa, u_long flags); void pmap_kremove_flags(vm_offset_t va); +boolean_t pmap_page_is_mapped(vm_page_t m); int pmap_cache_enter(vm_page_t m, vm_offset_t va); void pmap_cache_remove(vm_page_t m, vm_offset_t va); diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c index bf00b9c..d2f6622 100644 --- a/sys/sparc64/sparc64/pmap.c +++ b/sys/sparc64/sparc64/pmap.c @@ -1624,6 +1624,24 @@ pmap_remove_pages(pmap_t pm, vm_offset_t sva, vm_offset_t eva) } /* + * Returns TRUE if the given page has a managed mapping. + */ +boolean_t +pmap_page_is_mapped(vm_page_t m) +{ + struct tte *tp; + + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) + return (FALSE); + TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { + if ((tp->tte_data & TD_PV) != 0) + return (TRUE); + } + return (FALSE); +} + +/* * Lower the permission for all mappings to a given page. */ void |