topology.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef _ASM_S390_TOPOLOGY_H
  2. #define _ASM_S390_TOPOLOGY_H
  3. #include <linux/cpumask.h>
  4. #include <asm/sysinfo.h>
  5. struct cpu;
  6. #ifdef CONFIG_SCHED_BOOK
  7. extern unsigned char cpu_core_id[NR_CPUS];
  8. extern cpumask_t cpu_core_map[NR_CPUS];
  9. static inline const struct cpumask *cpu_coregroup_mask(int cpu)
  10. {
  11. return &cpu_core_map[cpu];
  12. }
  13. #define topology_core_id(cpu) (cpu_core_id[cpu])
  14. #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
  15. #define mc_capable() (1)
  16. extern unsigned char cpu_book_id[NR_CPUS];
  17. extern cpumask_t cpu_book_map[NR_CPUS];
  18. static inline const struct cpumask *cpu_book_mask(int cpu)
  19. {
  20. return &cpu_book_map[cpu];
  21. }
  22. #define topology_book_id(cpu) (cpu_book_id[cpu])
  23. #define topology_book_cpumask(cpu) (&cpu_book_map[cpu])
  24. int topology_cpu_init(struct cpu *);
  25. int topology_set_cpu_management(int fc);
  26. void topology_schedule_update(void);
  27. void store_topology(struct sysinfo_15_1_x *info);
  28. void topology_expect_change(void);
  29. #else /* CONFIG_SCHED_BOOK */
  30. static inline void topology_schedule_update(void) { }
  31. static inline int topology_cpu_init(struct cpu *cpu) { return 0; }
  32. static inline void topology_expect_change(void) { }
  33. #endif /* CONFIG_SCHED_BOOK */
  34. #define POLARIZATION_UNKNOWN (-1)
  35. #define POLARIZATION_HRZ (0)
  36. #define POLARIZATION_VL (1)
  37. #define POLARIZATION_VM (2)
  38. #define POLARIZATION_VH (3)
  39. extern int cpu_polarization[];
  40. static inline void cpu_set_polarization(int cpu, int val)
  41. {
  42. #ifdef CONFIG_SCHED_BOOK
  43. cpu_polarization[cpu] = val;
  44. #endif
  45. }
  46. static inline int cpu_read_polarization(int cpu)
  47. {
  48. #ifdef CONFIG_SCHED_BOOK
  49. return cpu_polarization[cpu];
  50. #else
  51. return POLARIZATION_HRZ;
  52. #endif
  53. }
  54. #ifdef CONFIG_SCHED_BOOK
  55. void s390_init_cpu_topology(void);
  56. #else
  57. static inline void s390_init_cpu_topology(void)
  58. {
  59. };
  60. #endif
  61. #define SD_BOOK_INIT SD_CPU_INIT
  62. #include <asm-generic/topology.h>
  63. #endif /* _ASM_S390_TOPOLOGY_H */