mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/numa: prepare NUMA setup code for unit testing
Introduce __XEN__ guards to differentiate between hypervisor vs unit test builds. Also move numa_set_node() so it's outside the __XEN__ guards. No functional change intended. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com> Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
This commit is contained in:
1 parent
ce17dc6742
commit
2b40ba07ef
1 file changed
+9
-5
+9
-5
@@ -4,6 +4,7 @@
|
||||
* Adapted for Xen: Ryan Harper <ryanh@us.ibm.com>
|
||||
*/
|
||||
|
||||
#ifdef __XEN__
|
||||
#include <xen/init.h>
|
||||
#include <xen/keyhandler.h>
|
||||
#include <xen/mm.h>
|
||||
@@ -13,6 +14,7 @@
|
||||
#include <xen/pfn.h>
|
||||
#include <xen/sched.h>
|
||||
#include <xen/softirq.h>
|
||||
#endif /* __XEN__ */
|
||||
|
||||
static nodemask_t __initdata processor_nodes_parsed;
|
||||
static nodemask_t __initdata memory_nodes_parsed;
|
||||
@@ -561,6 +563,12 @@ void __init numa_init_array(void)
|
||||
}
|
||||
}
|
||||
|
||||
void numa_set_node(unsigned int cpu, nodeid_t node)
|
||||
{
|
||||
cpu_to_node[cpu] = node;
|
||||
}
|
||||
|
||||
#ifdef __XEN__
|
||||
#ifdef CONFIG_NUMA_EMU
|
||||
static unsigned int __initdata numa_fake;
|
||||
|
||||
@@ -661,11 +669,6 @@ void numa_add_cpu(unsigned int cpu)
|
||||
cpumask_set_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]);
|
||||
}
|
||||
|
||||
void numa_set_node(unsigned int cpu, nodeid_t node)
|
||||
{
|
||||
cpu_to_node[cpu] = node;
|
||||
}
|
||||
|
||||
/* [numa=off] */
|
||||
static int __init cf_check numa_setup(const char *opt)
|
||||
{
|
||||
@@ -830,3 +833,4 @@ static int __init cf_check register_numa_trigger(void)
|
||||
return 0;
|
||||
}
|
||||
__initcall(register_numa_trigger);
|
||||
#endif /* __XEN__ */
|
||||