numa.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef _ASM_X86_NUMA_H
  2. #define _ASM_X86_NUMA_H
  3. #include <asm/topology.h>
  4. #include <asm/apicdef.h>
  5. #ifdef CONFIG_NUMA
  6. /*
  7. * __apicid_to_node[] stores the raw mapping between physical apicid and
  8. * node and is used to initialize cpu_to_node mapping.
  9. *
  10. * The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus
  11. * should be accessed by the accessors - set_apicid_to_node() and
  12. * numa_cpu_node().
  13. */
  14. extern s16 __apicid_to_node[MAX_LOCAL_APIC];
  15. static inline void set_apicid_to_node(int apicid, s16 node)
  16. {
  17. __apicid_to_node[apicid] = node;
  18. }
  19. #else /* CONFIG_NUMA */
  20. static inline void set_apicid_to_node(int apicid, s16 node)
  21. {
  22. }
  23. #endif /* CONFIG_NUMA */
  24. #ifdef CONFIG_X86_32
  25. # include "numa_32.h"
  26. #else
  27. # include "numa_64.h"
  28. #endif
  29. #ifdef CONFIG_NUMA
  30. extern void __cpuinit numa_set_node(int cpu, int node);
  31. extern void __cpuinit numa_clear_node(int cpu);
  32. extern void __init numa_init_array(void);
  33. extern void __init init_cpu_to_node(void);
  34. extern void __cpuinit numa_add_cpu(int cpu);
  35. extern void __cpuinit numa_remove_cpu(int cpu);
  36. #else /* CONFIG_NUMA */
  37. static inline void numa_set_node(int cpu, int node) { }
  38. static inline void numa_clear_node(int cpu) { }
  39. static inline void numa_init_array(void) { }
  40. static inline void init_cpu_to_node(void) { }
  41. static inline void numa_add_cpu(int cpu) { }
  42. static inline void numa_remove_cpu(int cpu) { }
  43. #endif /* CONFIG_NUMA */
  44. #ifdef CONFIG_DEBUG_PER_CPU_MAPS
  45. struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable);
  46. #endif
  47. #endif /* _ASM_X86_NUMA_H */