numa.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef __ASM_NUMA_H
  2. #define __ASM_NUMA_H
  3. #include <asm/topology.h>
  4. #ifdef CONFIG_NUMA
  5. #define NR_NODE_MEMBLKS (MAX_NUMNODES * 2)
  6. /* currently, arm64 implements flat NUMA topology */
  7. #define parent_node(node) (node)
  8. int __node_distance(int from, int to);
  9. #define node_distance(a, b) __node_distance(a, b)
  10. extern nodemask_t numa_nodes_parsed __initdata;
  11. extern bool numa_off;
  12. /* Mappings between node number and cpus on that node. */
  13. extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
  14. void numa_clear_node(unsigned int cpu);
  15. #ifdef CONFIG_DEBUG_PER_CPU_MAPS
  16. const struct cpumask *cpumask_of_node(int node);
  17. #else
  18. /* Returns a pointer to the cpumask of CPUs on Node 'node'. */
  19. static inline const struct cpumask *cpumask_of_node(int node)
  20. {
  21. return node_to_cpumask_map[node];
  22. }
  23. #endif
  24. void __init arm64_numa_init(void);
  25. int __init numa_add_memblk(int nodeid, u64 start, u64 end);
  26. void __init numa_set_distance(int from, int to, int distance);
  27. void __init numa_free_distance(void);
  28. void __init early_map_cpu_to_node(unsigned int cpu, int nid);
  29. void numa_store_cpu_info(unsigned int cpu);
  30. #else /* CONFIG_NUMA */
  31. static inline void numa_store_cpu_info(unsigned int cpu) { }
  32. static inline void arm64_numa_init(void) { }
  33. static inline void early_map_cpu_to_node(unsigned int cpu, int nid) { }
  34. #endif /* CONFIG_NUMA */
  35. #endif /* __ASM_NUMA_H */