1#ifndef _ASM_X86_NUMA_H
2#define _ASM_X86_NUMA_H
3
4#include <linux/nodemask.h>
5
6#include <asm/topology.h>
7#include <asm/apicdef.h>
8
9#ifdef CONFIG_NUMA
10
11#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
12
13
14
15
16
17
18#define NODE_MIN_SIZE (4*1024*1024)
19
20extern int numa_off;
21
22
23
24
25
26
27
28
29
30extern s16 __apicid_to_node[MAX_LOCAL_APIC];
31extern nodemask_t numa_nodes_parsed __initdata;
32
33extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
34extern void __init numa_set_distance(int from, int to, int distance);
35
36static inline void set_apicid_to_node(int apicid, s16 node)
37{
38 __apicid_to_node[apicid] = node;
39}
40
41extern int numa_cpu_node(int cpu);
42
43#else
44static inline void set_apicid_to_node(int apicid, s16 node)
45{
46}
47
48static inline int numa_cpu_node(int cpu)
49{
50 return NUMA_NO_NODE;
51}
52#endif
53
54#ifdef CONFIG_X86_32
55# include <asm/numa_32.h>
56#endif
57
58#ifdef CONFIG_NUMA
59extern void numa_set_node(int cpu, int node);
60extern void numa_clear_node(int cpu);
61extern void __init init_cpu_to_node(void);
62extern void numa_add_cpu(int cpu);
63extern void numa_remove_cpu(int cpu);
64#else
65static inline void numa_set_node(int cpu, int node) { }
66static inline void numa_clear_node(int cpu) { }
67static inline void init_cpu_to_node(void) { }
68static inline void numa_add_cpu(int cpu) { }
69static inline void numa_remove_cpu(int cpu) { }
70#endif
71
72#ifdef CONFIG_DEBUG_PER_CPU_MAPS
73void debug_cpumask_set_cpu(int cpu, int node, bool enable);
74#endif
75
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))
79void numa_emu_cmdline(char *);
80#endif
81
82#endif
83