numa.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef _ASM_X86_NUMA_H
  2. #define _ASM_X86_NUMA_H
  3. #include <linux/nodemask.h>
  4. #include <asm/topology.h>
  5. #include <asm/apicdef.h>
  6. #ifdef CONFIG_NUMA
  7. #define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
  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. */
  16. extern s16 __apicid_to_node[MAX_LOCAL_APIC];
  17. static inline void set_apicid_to_node(int apicid, s16 node)
  18. {
  19. __apicid_to_node[apicid] = node;
  20. }
  21. extern int __cpuinit numa_cpu_node(int cpu);
  22. #else /* CONFIG_NUMA */
  23. static inline void set_apicid_to_node(int apicid, s16 node)
  24. {
  25. }
  26. static inline int numa_cpu_node(int cpu)
  27. {
  28. return NUMA_NO_NODE;
  29. }
  30. #endif /* CONFIG_NUMA */
  31. #ifdef CONFIG_X86_32
  32. # include "numa_32.h"
  33. #else
  34. # include "numa_64.h"
  35. #endif
  36. #ifdef CONFIG_NUMA
  37. extern void __cpuinit numa_set_node(int cpu, int node);
  38. extern void __cpuinit numa_clear_node(int cpu);
  39. extern void __init numa_init_array(void);
  40. extern void __init init_cpu_to_node(void);
  41. extern void __cpuinit numa_add_cpu(int cpu);
  42. extern void __cpuinit numa_remove_cpu(int cpu);
  43. #else /* CONFIG_NUMA */
  44. static inline void numa_set_node(int cpu, int node) { }
  45. static inline void numa_clear_node(int cpu) { }
  46. static inline void numa_init_array(void) { }
  47. static inline void init_cpu_to_node(void) { }
  48. static inline void numa_add_cpu(int cpu) { }
  49. static inline void numa_remove_cpu(int cpu) { }
  50. #endif /* CONFIG_NUMA */
  51. #ifdef CONFIG_DEBUG_PER_CPU_MAPS
  52. void debug_cpumask_set_cpu(int cpu, int node, bool enable);
  53. #endif
  54. #endif /* _ASM_X86_NUMA_H */