Tejun Heo | bbc9e2f | 2011-01-23 14:37:39 +0100 | [diff] [blame] | 1 | #ifndef _ASM_X86_NUMA_H |
| 2 | #define _ASM_X86_NUMA_H |
| 3 | |
Tejun Heo | de2d944 | 2011-01-23 14:37:41 +0100 | [diff] [blame^] | 4 | #include <asm/topology.h> |
Tejun Heo | bbc9e2f | 2011-01-23 14:37:39 +0100 | [diff] [blame] | 5 | #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 | */ |
| 16 | extern s16 __apicid_to_node[MAX_LOCAL_APIC]; |
| 17 | |
| 18 | static inline void set_apicid_to_node(int apicid, s16 node) |
| 19 | { |
| 20 | __apicid_to_node[apicid] = node; |
| 21 | } |
| 22 | #else /* CONFIG_NUMA */ |
| 23 | static inline void set_apicid_to_node(int apicid, s16 node) |
| 24 | { |
| 25 | } |
| 26 | #endif /* CONFIG_NUMA */ |
| 27 | |
Thomas Gleixner | 96a388d | 2007-10-11 11:20:03 +0200 | [diff] [blame] | 28 | #ifdef CONFIG_X86_32 |
| 29 | # include "numa_32.h" |
| 30 | #else |
| 31 | # include "numa_64.h" |
| 32 | #endif |
Tejun Heo | bbc9e2f | 2011-01-23 14:37:39 +0100 | [diff] [blame] | 33 | |
Tejun Heo | 645a791 | 2011-01-23 14:37:40 +0100 | [diff] [blame] | 34 | #ifdef CONFIG_NUMA |
| 35 | extern void __cpuinit numa_set_node(int cpu, int node); |
| 36 | extern void __cpuinit numa_clear_node(int cpu); |
Tejun Heo | de2d944 | 2011-01-23 14:37:41 +0100 | [diff] [blame^] | 37 | extern void __cpuinit numa_add_cpu(int cpu); |
| 38 | extern void __cpuinit numa_remove_cpu(int cpu); |
Tejun Heo | 645a791 | 2011-01-23 14:37:40 +0100 | [diff] [blame] | 39 | #else /* CONFIG_NUMA */ |
| 40 | static inline void numa_set_node(int cpu, int node) { } |
| 41 | static inline void numa_clear_node(int cpu) { } |
Tejun Heo | de2d944 | 2011-01-23 14:37:41 +0100 | [diff] [blame^] | 42 | static inline void numa_add_cpu(int cpu) { } |
| 43 | static inline void numa_remove_cpu(int cpu) { } |
Tejun Heo | 645a791 | 2011-01-23 14:37:40 +0100 | [diff] [blame] | 44 | #endif /* CONFIG_NUMA */ |
| 45 | |
Tejun Heo | de2d944 | 2011-01-23 14:37:41 +0100 | [diff] [blame^] | 46 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS |
| 47 | struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable); |
| 48 | #endif |
| 49 | |
Tejun Heo | bbc9e2f | 2011-01-23 14:37:39 +0100 | [diff] [blame] | 50 | #endif /* _ASM_X86_NUMA_H */ |