diff options
-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 |