Commit | Line | Data |
---|---|---|
bbc9e2f4 TH |
1 | #ifndef _ASM_X86_NUMA_H |
2 | #define _ASM_X86_NUMA_H | |
3 | ||
6bd26273 TH |
4 | #include <linux/nodemask.h> |
5 | ||
de2d9445 | 6 | #include <asm/topology.h> |
bbc9e2f4 TH |
7 | #include <asm/apicdef.h> |
8 | ||
9 | #ifdef CONFIG_NUMA | |
ef396ec9 TH |
10 | |
11 | #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) | |
12 | ||
bbc9e2f4 TH |
13 | /* |
14 | * __apicid_to_node[] stores the raw mapping between physical apicid and | |
15 | * node and is used to initialize cpu_to_node mapping. | |
16 | * | |
17 | * The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus | |
18 | * should be accessed by the accessors - set_apicid_to_node() and | |
19 | * numa_cpu_node(). | |
20 | */ | |
21 | extern s16 __apicid_to_node[MAX_LOCAL_APIC]; | |
e6df595b | 22 | extern nodemask_t numa_nodes_parsed __initdata; |
bbc9e2f4 | 23 | |
b0d31080 TH |
24 | extern int __init numa_add_memblk(int nodeid, u64 start, u64 end); |
25 | extern void __init numa_set_distance(int from, int to, int distance); | |
26 | ||
bbc9e2f4 TH |
27 | static inline void set_apicid_to_node(int apicid, s16 node) |
28 | { | |
29 | __apicid_to_node[apicid] = node; | |
30 | } | |
6bd26273 TH |
31 | |
32 | extern int __cpuinit numa_cpu_node(int cpu); | |
33 | ||
bbc9e2f4 TH |
34 | #else /* CONFIG_NUMA */ |
35 | static inline void set_apicid_to_node(int apicid, s16 node) | |
36 | { | |
37 | } | |
6bd26273 TH |
38 | |
39 | static inline int numa_cpu_node(int cpu) | |
40 | { | |
41 | return NUMA_NO_NODE; | |
42 | } | |
bbc9e2f4 TH |
43 | #endif /* CONFIG_NUMA */ |
44 | ||
96a388de TG |
45 | #ifdef CONFIG_X86_32 |
46 | # include "numa_32.h" | |
47 | #else | |
48 | # include "numa_64.h" | |
49 | #endif | |
bbc9e2f4 | 50 | |
645a7919 TH |
51 | #ifdef CONFIG_NUMA |
52 | extern void __cpuinit numa_set_node(int cpu, int node); | |
53 | extern void __cpuinit numa_clear_node(int cpu); | |
8db78cc4 TH |
54 | extern void __init numa_init_array(void); |
55 | extern void __init init_cpu_to_node(void); | |
de2d9445 TH |
56 | extern void __cpuinit numa_add_cpu(int cpu); |
57 | extern void __cpuinit numa_remove_cpu(int cpu); | |
645a7919 TH |
58 | #else /* CONFIG_NUMA */ |
59 | static inline void numa_set_node(int cpu, int node) { } | |
60 | static inline void numa_clear_node(int cpu) { } | |
8db78cc4 TH |
61 | static inline void numa_init_array(void) { } |
62 | static inline void init_cpu_to_node(void) { } | |
de2d9445 TH |
63 | static inline void numa_add_cpu(int cpu) { } |
64 | static inline void numa_remove_cpu(int cpu) { } | |
645a7919 TH |
65 | #endif /* CONFIG_NUMA */ |
66 | ||
de2d9445 | 67 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS |
7a6c6547 | 68 | void debug_cpumask_set_cpu(int cpu, int node, bool enable); |
de2d9445 TH |
69 | #endif |
70 | ||
bbc9e2f4 | 71 | #endif /* _ASM_X86_NUMA_H */ |