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