topology.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 core_id;
  9. unsigned short socket_id;
  10. unsigned short book_id;
  11. cpumask_t core_mask;
  12. cpumask_t book_mask;
  13. };
  14. extern struct cpu_topology_s390 cpu_topology[NR_CPUS];
  15. #define topology_physical_package_id(cpu) (cpu_topology[cpu].socket_id)
  16. #define topology_core_id(cpu) (cpu_topology[cpu].core_id)
  17. #define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_mask)
  18. #define topology_book_id(cpu) (cpu_topology[cpu].book_id)
  19. #define topology_book_cpumask(cpu) (&cpu_topology[cpu].book_mask)
  20. #define mc_capable() 1
  21. static inline const struct cpumask *cpu_coregroup_mask(int cpu)
  22. {
  23. return &cpu_topology[cpu].core_mask;
  24. }
  25. static inline const struct cpumask *cpu_book_mask(int cpu)
  26. {
  27. return &cpu_topology[cpu].book_mask;
  28. }
  29. int topology_cpu_init(struct cpu *);
  30. int topology_set_cpu_management(int fc);
  31. void topology_schedule_update(void);
  32. void store_topology(struct sysinfo_15_1_x *info);
  33. void topology_expect_change(void);
  34. #else /* CONFIG_SCHED_BOOK */
  35. static inline void topology_schedule_update(void) { }
  36. static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
  37. static inline void topology_expect_change(void) { }
  38. #endif /* CONFIG_SCHED_BOOK */
  39. #define POLARIZATION_UNKNOWN (-1)
  40. #define POLARIZATION_HRZ (0)
  41. #define POLARIZATION_VL (1)
  42. #define POLARIZATION_VM (2)
  43. #define POLARIZATION_VH (3)
  44. #ifdef CONFIG_SCHED_BOOK
  45. void s390_init_cpu_topology(void);
  46. #else
  47. static inline void s390_init_cpu_topology(void)
  48. {
  49. };
  50. #endif
  51. #define SD_BOOK_INIT SD_CPU_INIT
  52. #include <asm-generic/topology.h>
  53. #endif /* _ASM_S390_TOPOLOGY_H */