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 |
Tejun Heo | ef396ec | 2011-02-16 17:11:07 +0100 | [diff] [blame] | 8 | |
| 9 | #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) |
| 10 | |
Tejun Heo | bbc9e2f | 2011-01-23 14:37:39 +0100 | [diff] [blame] | 11 | /* |
| 12 | * __apicid_to_node[] stores the raw mapping between physical apicid and |
| 13 | * node and is used to initialize cpu_to_node mapping. |
| 14 | * |
| 15 | * The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus |
| 16 | * should be accessed by the accessors - set_apicid_to_node() and |
| 17 | * numa_cpu_node(). |
| 18 | */ |
| 19 | extern s16 __apicid_to_node[MAX_LOCAL_APIC]; |
| 20 | |
| 21 | static inline void set_apicid_to_node(int apicid, s16 node) |
| 22 | { |
| 23 | __apicid_to_node[apicid] = node; |
| 24 | } |
| 25 | #else /* CONFIG_NUMA */ |
| 26 | static inline void set_apicid_to_node(int apicid, s16 node) |
| 27 | { |
| 28 | } |
| 29 | #endif /* CONFIG_NUMA */ |
| 30 | |
Thomas Gleixner | 96a388d | 2007-10-11 11:20:03 +0200 | [diff] [blame] | 31 | #ifdef CONFIG_X86_32 |
| 32 | # include "numa_32.h" |
| 33 | #else |
| 34 | # include "numa_64.h" |
| 35 | #endif |
Tejun Heo | bbc9e2f | 2011-01-23 14:37:39 +0100 | [diff] [blame] | 36 | |
Tejun Heo | 645a791 | 2011-01-23 14:37:40 +0100 | [diff] [blame] | 37 | #ifdef CONFIG_NUMA |
| 38 | extern void __cpuinit numa_set_node(int cpu, int node); |
| 39 | extern void __cpuinit numa_clear_node(int cpu); |
Tejun Heo | 8db78cc | 2011-01-23 14:37:42 +0100 | [diff] [blame] | 40 | extern void __init numa_init_array(void); |
| 41 | extern void __init init_cpu_to_node(void); |
Tejun Heo | de2d944 | 2011-01-23 14:37:41 +0100 | [diff] [blame] | 42 | extern void __cpuinit numa_add_cpu(int cpu); |
| 43 | extern void __cpuinit numa_remove_cpu(int cpu); |
Tejun Heo | 645a791 | 2011-01-23 14:37:40 +0100 | [diff] [blame] | 44 | #else /* CONFIG_NUMA */ |
| 45 | static inline void numa_set_node(int cpu, int node) { } |
| 46 | static inline void numa_clear_node(int cpu) { } |
Tejun Heo | 8db78cc | 2011-01-23 14:37:42 +0100 | [diff] [blame] | 47 | static inline void numa_init_array(void) { } |
| 48 | static inline void init_cpu_to_node(void) { } |
Tejun Heo | de2d944 | 2011-01-23 14:37:41 +0100 | [diff] [blame] | 49 | static inline void numa_add_cpu(int cpu) { } |
| 50 | static inline void numa_remove_cpu(int cpu) { } |
Tejun Heo | 645a791 | 2011-01-23 14:37:40 +0100 | [diff] [blame] | 51 | #endif /* CONFIG_NUMA */ |
| 52 | |
Tejun Heo | de2d944 | 2011-01-23 14:37:41 +0100 | [diff] [blame] | 53 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS |
| 54 | struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable); |
| 55 | #endif |
| 56 | |
Tejun Heo | bbc9e2f | 2011-01-23 14:37:39 +0100 | [diff] [blame] | 57 | #endif /* _ASM_X86_NUMA_H */ |