1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Correct the implementation of pmap_page_is_mapped(): It should return TRUE

only if the page has one or more managed mappings.
This commit is contained in:
Alan Cox 2004-05-09 19:09:14 +00:00
parent 3bdf3cd7ba
commit 6b95d60a7f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129068
2 changed files with 19 additions and 2 deletions

View File

@ -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);

View File

@ -1623,6 +1623,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.
*/