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) | |
a4106eae TH |
12 | |
13 | /* | |
14 | * Too small node sizes may confuse the VM badly. Usually they | |
15 | * result from BIOS bugs. So dont recognize nodes as standalone | |
16 | * NUMA entities that have less than this amount of RAM listed: | |
17 | */ | |
18 | #define NODE_MIN_SIZE (4*1024*1024) | |
19 | ||
20 | extern int numa_off; | |
ef396ec9 | 21 | |
bbc9e2f4 TH |
22 | /* |
23 | * __apicid_to_node[] stores the raw mapping between physical apicid and | |
24 | * node and is used to initialize cpu_to_node mapping. | |
25 | * | |
26 | * The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus | |
27 | * should be accessed by the accessors - set_apicid_to_node() and | |
28 | * numa_cpu_node(). | |
29 | */ | |
30 | extern s16 __apicid_to_node[MAX_LOCAL_APIC]; | |
e6df595b | 31 | extern nodemask_t numa_nodes_parsed __initdata; |
bbc9e2f4 | 32 | |
b0d31080 TH |
33 | extern int __init numa_add_memblk(int nodeid, u64 start, u64 end); |
34 | extern void __init numa_set_distance(int from, int to, int distance); | |
35 | ||
bbc9e2f4 TH |
36 | static inline void set_apicid_to_node(int apicid, s16 node) |
37 | { | |
38 | __apicid_to_node[apicid] = node; | |
39 | } | |
6bd26273 | 40 | |
148f9bb8 | 41 | extern int numa_cpu_node(int cpu); |
6bd26273 | 42 | |
bbc9e2f4 TH |
43 | #else /* CONFIG_NUMA */ |
44 | static inline void set_apicid_to_node(int apicid, s16 node) | |
45 | { | |
46 | } | |
6bd26273 TH |
47 | |
48 | static inline int numa_cpu_node(int cpu) | |
49 | { | |
50 | return NUMA_NO_NODE; | |
51 | } | |
bbc9e2f4 TH |
52 | #endif /* CONFIG_NUMA */ |
53 | ||
96a388de | 54 | #ifdef CONFIG_X86_32 |
a1ce3928 | 55 | # include <asm/numa_32.h> |
96a388de | 56 | #endif |
bbc9e2f4 | 57 | |
645a7919 | 58 | #ifdef CONFIG_NUMA |
e13fe869 WC |
59 | extern void numa_set_node(int cpu, int node); |
60 | extern void numa_clear_node(int cpu); | |
8db78cc4 | 61 | extern void __init init_cpu_to_node(void); |
148f9bb8 PG |
62 | extern void numa_add_cpu(int cpu); |
63 | extern void numa_remove_cpu(int cpu); | |
645a7919 TH |
64 | #else /* CONFIG_NUMA */ |
65 | static inline void numa_set_node(int cpu, int node) { } | |
66 | static inline void numa_clear_node(int cpu) { } | |
8db78cc4 | 67 | static inline void init_cpu_to_node(void) { } |
de2d9445 TH |
68 | static inline void numa_add_cpu(int cpu) { } |
69 | static inline void numa_remove_cpu(int cpu) { } | |
645a7919 TH |
70 | #endif /* CONFIG_NUMA */ |
71 | ||
de2d9445 | 72 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS |
7a6c6547 | 73 | void debug_cpumask_set_cpu(int cpu, int node, bool enable); |
de2d9445 TH |
74 | #endif |
75 | ||
a4106eae TH |
76 | #ifdef CONFIG_NUMA_EMU |
77 | #define FAKE_NODE_MIN_SIZE ((u64)32 << 20) | |
78 | #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) | |
79 | void numa_emu_cmdline(char *); | |
80 | #endif /* CONFIG_NUMA_EMU */ | |
81 | ||
bbc9e2f4 | 82 | #endif /* _ASM_X86_NUMA_H */ |