topology.h 726 B

123456789101112131415161718192021222324252627
  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. #include <asm-generic/topology.h>
  20. #endif /* _ASM_ARM_TOPOLOGY_H */