topology_64.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _ASM_SPARC64_TOPOLOGY_H
  2. #define _ASM_SPARC64_TOPOLOGY_H
  3. #ifdef CONFIG_NUMA
  4. #include <asm/mmzone.h>
  5. static inline int cpu_to_node(int cpu)
  6. {
  7. return numa_cpu_lookup_table[cpu];
  8. }
  9. #define parent_node(node) (node)
  10. #define cpumask_of_node(node) ((node) == -1 ? \
  11. cpu_all_mask : \
  12. &numa_cpumask_lookup_table[node])
  13. struct pci_bus;
  14. #ifdef CONFIG_PCI
  15. int pcibus_to_node(struct pci_bus *pbus);
  16. #else
  17. static inline int pcibus_to_node(struct pci_bus *pbus)
  18. {
  19. return -1;
  20. }
  21. #endif
  22. #define cpumask_of_pcibus(bus) \
  23. (pcibus_to_node(bus) == -1 ? \
  24. cpu_all_mask : \
  25. cpumask_of_node(pcibus_to_node(bus)))
  26. int __node_distance(int, int);
  27. #define node_distance(a, b) __node_distance(a, b)
  28. #else /* CONFIG_NUMA */
  29. #include <asm-generic/topology.h>
  30. #endif /* !(CONFIG_NUMA) */
  31. #ifdef CONFIG_SMP
  32. #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
  33. #define topology_core_id(cpu) (cpu_data(cpu).core_id)
  34. #define topology_core_cpumask(cpu) (&cpu_core_sib_map[cpu])
  35. #define topology_sibling_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
  36. #endif /* CONFIG_SMP */
  37. extern cpumask_t cpu_core_map[NR_CPUS];
  38. extern cpumask_t cpu_core_sib_map[NR_CPUS];
  39. static inline const struct cpumask *cpu_coregroup_mask(int cpu)
  40. {
  41. return &cpu_core_map[cpu];
  42. }
  43. #endif /* _ASM_SPARC64_TOPOLOGY_H */