topology.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef _ASM_POWERPC_TOPOLOGY_H
  2. #define _ASM_POWERPC_TOPOLOGY_H
  3. #ifdef __KERNEL__
  4. #include <linux/config.h>
  5. #ifdef CONFIG_NUMA
  6. #include <asm/mmzone.h>
  7. static inline int cpu_to_node(int cpu)
  8. {
  9. return numa_cpu_lookup_table[cpu];
  10. }
  11. #define parent_node(node) (node)
  12. static inline cpumask_t node_to_cpumask(int node)
  13. {
  14. return numa_cpumask_lookup_table[node];
  15. }
  16. static inline int node_to_first_cpu(int node)
  17. {
  18. cpumask_t tmp;
  19. tmp = node_to_cpumask(node);
  20. return first_cpu(tmp);
  21. }
  22. #define pcibus_to_node(node) (-1)
  23. #define pcibus_to_cpumask(bus) (cpu_online_map)
  24. /* sched_domains SD_NODE_INIT for PPC64 machines */
  25. #define SD_NODE_INIT (struct sched_domain) { \
  26. .span = CPU_MASK_NONE, \
  27. .parent = NULL, \
  28. .groups = NULL, \
  29. .min_interval = 8, \
  30. .max_interval = 32, \
  31. .busy_factor = 32, \
  32. .imbalance_pct = 125, \
  33. .cache_nice_tries = 1, \
  34. .per_cpu_gain = 100, \
  35. .busy_idx = 3, \
  36. .idle_idx = 1, \
  37. .newidle_idx = 2, \
  38. .wake_idx = 1, \
  39. .flags = SD_LOAD_BALANCE \
  40. | SD_BALANCE_EXEC \
  41. | SD_BALANCE_NEWIDLE \
  42. | SD_WAKE_IDLE \
  43. | SD_WAKE_BALANCE, \
  44. .last_balance = jiffies, \
  45. .balance_interval = 1, \
  46. .nr_balance_failed = 0, \
  47. }
  48. extern void __init dump_numa_cpu_topology(void);
  49. #else
  50. static inline void dump_numa_cpu_topology(void) {}
  51. #include <asm-generic/topology.h>
  52. #endif /* CONFIG_NUMA */
  53. #endif /* __KERNEL__ */
  54. #endif /* _ASM_POWERPC_TOPOLOGY_H */