blob: d3964b28b128a1587754c19ffb82e50c65ec2ab7 [file] [log] [blame]
Tejun Heobbc9e2f2011-01-23 14:37:39 +01001#ifndef _ASM_X86_NUMA_H
2#define _ASM_X86_NUMA_H
3
Tejun Heode2d9442011-01-23 14:37:41 +01004#include <asm/topology.h>
Tejun Heobbc9e2f2011-01-23 14:37:39 +01005#include <asm/apicdef.h>
6
7#ifdef CONFIG_NUMA
8/*
9 * __apicid_to_node[] stores the raw mapping between physical apicid and
10 * node and is used to initialize cpu_to_node mapping.
11 *
12 * The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus
13 * should be accessed by the accessors - set_apicid_to_node() and
14 * numa_cpu_node().
15 */
16extern s16 __apicid_to_node[MAX_LOCAL_APIC];
17
18static inline void set_apicid_to_node(int apicid, s16 node)
19{
20 __apicid_to_node[apicid] = node;
21}
22#else /* CONFIG_NUMA */
23static inline void set_apicid_to_node(int apicid, s16 node)
24{
25}
26#endif /* CONFIG_NUMA */
27
Thomas Gleixner96a388d2007-10-11 11:20:03 +020028#ifdef CONFIG_X86_32
29# include "numa_32.h"
30#else
31# include "numa_64.h"
32#endif
Tejun Heobbc9e2f2011-01-23 14:37:39 +010033
Tejun Heo645a7912011-01-23 14:37:40 +010034#ifdef CONFIG_NUMA
35extern void __cpuinit numa_set_node(int cpu, int node);
36extern void __cpuinit numa_clear_node(int cpu);
Tejun Heode2d9442011-01-23 14:37:41 +010037extern void __cpuinit numa_add_cpu(int cpu);
38extern void __cpuinit numa_remove_cpu(int cpu);
Tejun Heo645a7912011-01-23 14:37:40 +010039#else /* CONFIG_NUMA */
40static inline void numa_set_node(int cpu, int node) { }
41static inline void numa_clear_node(int cpu) { }
Tejun Heode2d9442011-01-23 14:37:41 +010042static inline void numa_add_cpu(int cpu) { }
43static inline void numa_remove_cpu(int cpu) { }
Tejun Heo645a7912011-01-23 14:37:40 +010044#endif /* CONFIG_NUMA */
45
Tejun Heode2d9442011-01-23 14:37:41 +010046#ifdef CONFIG_DEBUG_PER_CPU_MAPS
47struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable);
48#endif
49
Tejun Heobbc9e2f2011-01-23 14:37:39 +010050#endif /* _ASM_X86_NUMA_H */