diff options
Diffstat (limited to 'sys/vm/vm_phys.c')
-rw-r--r-- | sys/vm/vm_phys.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 48e7f6c9a795..c16282974a40 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -623,6 +623,26 @@ vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, #endif } +int +_vm_phys_domain(vm_paddr_t pa) +{ +#ifdef NUMA + int i; + + if (vm_ndomains == 1 || mem_affinity == NULL) + return (0); + + /* + * Check for any memory that overlaps. + */ + for (i = 0; mem_affinity[i].end != 0; i++) + if (mem_affinity[i].start <= pa && + mem_affinity[i].end >= pa) + return (mem_affinity[i].domain); +#endif + return (0); +} + /* * Split a contiguous, power of two-sized set of physical pages. * |