topology.h 961 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __ASM_TOPOLOGY_H
  2. #define __ASM_TOPOLOGY_H
  3. #include <linux/cpumask.h>
  4. struct cpu_topology {
  5. int thread_id;
  6. int core_id;
  7. int cluster_id;
  8. cpumask_t thread_sibling;
  9. cpumask_t core_sibling;
  10. };
  11. extern struct cpu_topology cpu_topology[NR_CPUS];
  12. #define topology_physical_package_id(cpu) (cpu_topology[cpu].cluster_id)
  13. #define topology_core_id(cpu) (cpu_topology[cpu].core_id)
  14. #define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling)
  15. #define topology_sibling_cpumask(cpu) (&cpu_topology[cpu].thread_sibling)
  16. void init_cpu_topology(void);
  17. void store_cpu_topology(unsigned int cpuid);
  18. const struct cpumask *cpu_coregroup_mask(int cpu);
  19. #ifdef CONFIG_NUMA
  20. struct pci_bus;
  21. int pcibus_to_node(struct pci_bus *bus);
  22. #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
  23. cpu_all_mask : \
  24. cpumask_of_node(pcibus_to_node(bus)))
  25. #endif /* CONFIG_NUMA */
  26. #include <asm-generic/topology.h>
  27. #endif /* _ASM_ARM_TOPOLOGY_H */