blob: 26fc6e2dd0fb4642474568111e0859bb2b829c00 [file] [log] [blame]
Tejun Heobbc9e2f2011-01-23 14:37:39 +01001#ifndef _ASM_X86_NUMA_H
2#define _ASM_X86_NUMA_H
3
Tejun Heode2d9442011-01-23 14:37:41 +01004#include <asm/topology.h>
Tejun Heobbc9e2f2011-01-23 14:37:39 +01005#include <asm/apicdef.h>
6
7#ifdef CONFIG_NUMA
8/*
9 * __apicid_to_node[] stores the raw mapping between physical apicid and
10 * node and is used to initialize cpu_to_node mapping.
11 *
12 * The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus
13 * should be accessed by the accessors - set_apicid_to_node() and
14 * numa_cpu_node().
15 */
16extern s16 __apicid_to_node[MAX_LOCAL_APIC];
17
18static inline void set_apicid_to_node(int apicid, s16 node)
19{
20 __apicid_to_node[apicid] = node;
21}
22#else /* CONFIG_NUMA */
23static inline void set_apicid_to_node(int apicid, s16 node)
24{
25}
26#endif /* CONFIG_NUMA */
27
Thomas Gleixner96a388d2007-10-11 11:20:03 +020028#ifdef CONFIG_X86_32
29# include "numa_32.h"
30#else
31# include "numa_64.h"
32#endif
Tejun Heobbc9e2f2011-01-23 14:37:39 +010033
Tejun Heo645a7912011-01-23 14:37:40 +010034#ifdef CONFIG_NUMA
35extern void __cpuinit numa_set_node(int cpu, int node);
36extern void __cpuinit numa_clear_node(int cpu);
Tejun Heo8db78cc2011-01-23 14:37:42 +010037extern void __init numa_init_array(void);
38extern void __init init_cpu_to_node(void);
Tejun Heode2d9442011-01-23 14:37:41 +010039extern void __cpuinit numa_add_cpu(int cpu);
40extern void __cpuinit numa_remove_cpu(int cpu);
Tejun Heo645a7912011-01-23 14:37:40 +010041#else /* CONFIG_NUMA */
42static inline void numa_set_node(int cpu, int node) { }
43static inline void numa_clear_node(int cpu) { }
Tejun Heo8db78cc2011-01-23 14:37:42 +010044static inline void numa_init_array(void) { }
45static inline void init_cpu_to_node(void) { }
Tejun Heode2d9442011-01-23 14:37:41 +010046static inline void numa_add_cpu(int cpu) { }
47static inline void numa_remove_cpu(int cpu) { }
Tejun Heo645a7912011-01-23 14:37:40 +010048#endif /* CONFIG_NUMA */
49
Tejun Heode2d9442011-01-23 14:37:41 +010050#ifdef CONFIG_DEBUG_PER_CPU_MAPS
51struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable);
52#endif
53
Tejun Heobbc9e2f2011-01-23 14:37:39 +010054#endif /* _ASM_X86_NUMA_H */