numa.h 1.5 KB

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