topology.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _ASM_S390_TOPOLOGY_H
  2. #define _ASM_S390_TOPOLOGY_H
  3. #include <linux/cpumask.h>
  4. struct sysinfo_15_1_x;
  5. struct cpu;
  6. #ifdef CONFIG_SCHED_BOOK
  7. struct cpu_topology_s390 {
  8. unsigned short thread_id;
  9. unsigned short core_id;
  10. unsigned short socket_id;
  11. unsigned short book_id;
  12. cpumask_t thread_mask;
  13. cpumask_t core_mask;
  14. cpumask_t book_mask;
  15. };
  16. DECLARE_PER_CPU(struct cpu_topology_s390, cpu_topology);
  17. #define topology_physical_package_id(cpu) (per_cpu(cpu_topology, cpu).socket_id)
  18. #define topology_thread_id(cpu) (per_cpu(cpu_topology, cpu).thread_id)
  19. #define topology_thread_cpumask(cpu) (&per_cpu(cpu_topology, cpu).thread_mask)
  20. #define topology_core_id(cpu) (per_cpu(cpu_topology, cpu).core_id)
  21. #define topology_core_cpumask(cpu) (&per_cpu(cpu_topology, cpu).core_mask)
  22. #define topology_book_id(cpu) (per_cpu(cpu_topology, cpu).book_id)
  23. #define topology_book_cpumask(cpu) (&per_cpu(cpu_topology, cpu).book_mask)
  24. #define mc_capable() 1
  25. int topology_cpu_init(struct cpu *);
  26. int topology_set_cpu_management(int fc);
  27. void topology_schedule_update(void);
  28. void store_topology(struct sysinfo_15_1_x *info);
  29. void topology_expect_change(void);
  30. const struct cpumask *cpu_coregroup_mask(int cpu);
  31. #else /* CONFIG_SCHED_BOOK */
  32. static inline void topology_schedule_update(void) { }
  33. static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
  34. static inline void topology_expect_change(void) { }
  35. #endif /* CONFIG_SCHED_BOOK */
  36. #define POLARIZATION_UNKNOWN (-1)
  37. #define POLARIZATION_HRZ (0)
  38. #define POLARIZATION_VL (1)
  39. #define POLARIZATION_VM (2)
  40. #define POLARIZATION_VH (3)
  41. #include <asm-generic/topology.h>
  42. #endif /* _ASM_S390_TOPOLOGY_H */