diff options
| author | Jeff Roberson <jeff@FreeBSD.org> | 2017-11-28 23:18:35 +0000 |
|---|---|---|
| committer | Jeff Roberson <jeff@FreeBSD.org> | 2017-11-28 23:18:35 +0000 |
| commit | ef435ae7de5e4f25bfc9d1cdd92c421ad7b9793f (patch) | |
| tree | 8532ec4ada303cc1dc0a3326d13714defd6673ed /sys/vm/vm_phys.h | |
| parent | cc58910608161ecdb69b70da30f3ac80958cda0b (diff) | |
Notes
Diffstat (limited to 'sys/vm/vm_phys.h')
| -rw-r--r-- | sys/vm/vm_phys.h | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h index c9ef05c944a9..f5524af39cac 100644 --- a/sys/vm/vm_phys.h +++ b/sys/vm/vm_phys.h @@ -72,10 +72,11 @@ extern int vm_phys_nsegs; * The following functions are only to be used by the virtual memory system. */ void vm_phys_add_seg(vm_paddr_t start, vm_paddr_t end); -vm_page_t vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, - u_long alignment, vm_paddr_t boundary); -vm_page_t vm_phys_alloc_freelist_pages(int freelist, int pool, int order); -vm_page_t vm_phys_alloc_pages(int pool, int order); +vm_page_t vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, + vm_paddr_t high, u_long alignment, vm_paddr_t boundary); +vm_page_t vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, + int order); +vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); boolean_t vm_phys_domain_intersects(long mask, vm_paddr_t low, vm_paddr_t high); int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, vm_memattr_t memattr); @@ -92,12 +93,13 @@ boolean_t vm_phys_unfree_page(vm_page_t m); int vm_phys_mem_affinity(int f, int t); /* - * vm_phys_domain: * - * Return the memory domain the page belongs to. + * vm_phys_domidx: + * + * Return the index of the domain the page belongs to. */ -static inline struct vm_domain * -vm_phys_domain(vm_page_t m) +static inline int +vm_phys_domidx(vm_page_t m) { #ifdef VM_NUMA_ALLOC int domn, segind; @@ -107,12 +109,24 @@ vm_phys_domain(vm_page_t m) KASSERT(segind < vm_phys_nsegs, ("segind %d m %p", segind, m)); domn = vm_phys_segs[segind].domain; KASSERT(domn < vm_ndomains, ("domain %d m %p", domn, m)); - return (&vm_dom[domn]); + return (domn); #else - return (&vm_dom[0]); + return (0); #endif } +/* + * vm_phys_domain: + * + * Return the memory domain the page belongs to. + */ +static inline struct vm_domain * +vm_phys_domain(vm_page_t m) +{ + + return (&vm_dom[vm_phys_domidx(m)]); +} + static inline u_int vm_phys_freecnt_adj(vm_page_t m, int adj) { |
