topology.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. int topology_cpu_init(struct cpu *);
  22. int topology_set_cpu_management(int fc);
  23. void topology_schedule_update(void);
  24. void store_topology(struct sysinfo_15_1_x *info);
  25. void topology_expect_change(void);
  26. const struct cpumask *cpu_coregroup_mask(int cpu);
  27. #else /* CONFIG_SCHED_BOOK */
  28. static inline void topology_schedule_update(void) { }
  29. static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
  30. static inline void topology_expect_change(void) { }
  31. #endif /* CONFIG_SCHED_BOOK */
  32. #define POLARIZATION_UNKNOWN (-1)
  33. #define POLARIZATION_HRZ (0)
  34. #define POLARIZATION_VL (1)
  35. #define POLARIZATION_VM (2)
  36. #define POLARIZATION_VH (3)
  37. #ifdef CONFIG_SCHED_BOOK
  38. void s390_init_cpu_topology(void);
  39. #else
  40. static inline void s390_init_cpu_topology(void)
  41. {
  42. };
  43. #endif
  44. #include <asm-generic/topology.h>
  45. #endif /* _ASM_S390_TOPOLOGY_H */