0001
0002 #ifndef __ASM_GENERIC_NUMA_H
0003 #define __ASM_GENERIC_NUMA_H
0004
0005 #ifdef CONFIG_NUMA
0006
0007 #define NR_NODE_MEMBLKS (MAX_NUMNODES * 2)
0008
0009 int __node_distance(int from, int to);
0010 #define node_distance(a, b) __node_distance(a, b)
0011
0012 extern nodemask_t numa_nodes_parsed __initdata;
0013
0014 extern bool numa_off;
0015
0016
0017 extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
0018 void numa_clear_node(unsigned int cpu);
0019
0020 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
0021 const struct cpumask *cpumask_of_node(int node);
0022 #else
0023
0024 static inline const struct cpumask *cpumask_of_node(int node)
0025 {
0026 if (node == NUMA_NO_NODE)
0027 return cpu_all_mask;
0028
0029 return node_to_cpumask_map[node];
0030 }
0031 #endif
0032
0033 void __init arch_numa_init(void);
0034 int __init numa_add_memblk(int nodeid, u64 start, u64 end);
0035 void __init numa_set_distance(int from, int to, int distance);
0036 void __init numa_free_distance(void);
0037 void __init early_map_cpu_to_node(unsigned int cpu, int nid);
0038 void numa_store_cpu_info(unsigned int cpu);
0039 void numa_add_cpu(unsigned int cpu);
0040 void numa_remove_cpu(unsigned int cpu);
0041
0042 #else
0043
0044 static inline void numa_store_cpu_info(unsigned int cpu) { }
0045 static inline void numa_add_cpu(unsigned int cpu) { }
0046 static inline void numa_remove_cpu(unsigned int cpu) { }
0047 static inline void arch_numa_init(void) { }
0048 static inline void early_map_cpu_to_node(unsigned int cpu, int nid) { }
0049
0050 #endif
0051
0052 #endif