diff --git a/sys/alpha/include/pmap.h b/sys/alpha/include/pmap.h index b64cee8e34c0..9a1a6478f9a0 100644 --- a/sys/alpha/include/pmap.h +++ b/sys/alpha/include/pmap.h @@ -183,7 +183,6 @@ struct pmap { }; #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) -#define pmap_resident_count(pmap) (pmap)->pm_stats.resident_count #define PM_FLAG_LOCKED 0x1 #define PM_FLAG_WANTED 0x2 diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 2224b94f066a..cc4608bba4c1 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -226,7 +226,6 @@ struct pmap { }; #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) -#define pmap_resident_count(pmap) (pmap)->pm_stats.resident_count typedef struct pmap *pmap_t; diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index 62afddb4a874..ceec5646473b 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -292,7 +292,6 @@ struct pmap { }; #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) -#define pmap_resident_count(pmap) (pmap)->pm_stats.resident_count typedef struct pmap *pmap_t; diff --git a/sys/ia64/include/pmap.h b/sys/ia64/include/pmap.h index d14e4b8108de..976faa899319 100644 --- a/sys/ia64/include/pmap.h +++ b/sys/ia64/include/pmap.h @@ -83,7 +83,6 @@ struct pmap { }; #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) -#define pmap_resident_count(pmap) (pmap)->pm_stats.resident_count #define PM_FLAG_LOCKED 0x1 #define PM_FLAG_WANTED 0x2 diff --git a/sys/powerpc/include/pmap.h b/sys/powerpc/include/pmap.h index e737fad04e11..98f354d5ba29 100644 --- a/sys/powerpc/include/pmap.h +++ b/sys/powerpc/include/pmap.h @@ -64,7 +64,6 @@ extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) #define pmap_page_is_mapped(m) (!LIST_EMPTY(&(m)->md.mdpg_pvoh)) -#define pmap_resident_count(pm) (pm->pm_stats.resident_count) #ifdef _KERNEL diff --git a/sys/sparc64/include/pmap.h b/sys/sparc64/include/pmap.h index c0c20dfdcdfd..b6681e1f6a51 100644 --- a/sys/sparc64/include/pmap.h +++ b/sys/sparc64/include/pmap.h @@ -50,7 +50,6 @@ #define PMAP_CONTEXT_MAX 8192 #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.tte_list)) -#define pmap_resident_count(pm) (pm->pm_stats.resident_count) typedef struct pmap *pmap_t; diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h index a6eff6efaaf8..7adfa759bfa2 100644 --- a/sys/vm/pmap.h +++ b/sys/vm/pmap.h @@ -136,5 +136,9 @@ void pmap_activate(struct thread *td); vm_offset_t pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size); void *pmap_kenter_temporary(vm_offset_t pa, int i); void pmap_init2(void); + +#define pmap_resident_count(pm) ((pm)->pm_stats.resident_count) +#define pmap_wired_count(pm) ((pm)->pm_stats.wired_count) + #endif /* _KERNEL */ #endif /* _PMAP_VM_ */ diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 4492f9b65dcc..6ae9eddcb6dd 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -477,6 +477,12 @@ vmspace_resident_count(struct vmspace *vmspace) return pmap_resident_count(vmspace_pmap(vmspace)); } +long +vmspace_wired_count(struct vmspace *vmspace) +{ + return pmap_wired_count(vmspace_pmap(vmspace)); +} + /* * vm_map_create: * diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index d1aff1f7bab4..1a510d1f97b0 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -283,6 +283,7 @@ void vm_map_wakeup(vm_map_t map); _vm_map_lock_downgrade(map, LOCK_FILE, LOCK_LINE) long vmspace_resident_count(struct vmspace *vmspace); +long vmspace_wired_count(struct vmspace *vmspace); #endif /* _KERNEL */