topology.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. extern unsigned char cpu_socket_id[NR_CPUS];
  8. #define topology_physical_package_id(cpu) (cpu_socket_id[cpu])
  9. extern unsigned char cpu_core_id[NR_CPUS];
  10. extern cpumask_t cpu_core_map[NR_CPUS];
  11. static inline const struct cpumask *cpu_coregroup_mask(int cpu)
  12. {
  13. return &cpu_core_map[cpu];
  14. }
  15. #define topology_core_id(cpu) (cpu_core_id[cpu])
  16. #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
  17. #define mc_capable() (1)
  18. extern unsigned char cpu_book_id[NR_CPUS];
  19. extern cpumask_t cpu_book_map[NR_CPUS];
  20. static inline const struct cpumask *cpu_book_mask(int cpu)
  21. {
  22. return &cpu_book_map[cpu];
  23. }
  24. #define topology_book_id(cpu) (cpu_book_id[cpu])
  25. #define topology_book_cpumask(cpu) (&cpu_book_map[cpu])
  26. int topology_cpu_init(struct cpu *);
  27. int topology_set_cpu_management(int fc);
  28. void topology_schedule_update(void);
  29. void store_topology(struct sysinfo_15_1_x *info);
  30. void topology_expect_change(void);
  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. #ifdef CONFIG_SCHED_BOOK
  42. void s390_init_cpu_topology(void);
  43. #else
  44. static inline void s390_init_cpu_topology(void)
  45. {
  46. };
  47. #endif
  48. #define SD_BOOK_INIT SD_CPU_INIT
  49. #include <asm-generic/topology.h>
  50. #endif /* _ASM_S390_TOPOLOGY_H */