topology.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef _ASM_POWERPC_TOPOLOGY_H
  2. #define _ASM_POWERPC_TOPOLOGY_H
  3. #include <linux/config.h>
  4. #ifdef CONFIG_NUMA
  5. #include <asm/mmzone.h>
  6. static inline int cpu_to_node(int cpu)
  7. {
  8. return numa_cpu_lookup_table[cpu];
  9. }
  10. #define parent_node(node) (node)
  11. static inline cpumask_t node_to_cpumask(int node)
  12. {
  13. return numa_cpumask_lookup_table[node];
  14. }
  15. static inline int node_to_first_cpu(int node)
  16. {
  17. cpumask_t tmp;
  18. tmp = node_to_cpumask(node);
  19. return first_cpu(tmp);
  20. }
  21. #define pcibus_to_node(node) (-1)
  22. #define pcibus_to_cpumask(bus) (cpu_online_map)
  23. /* sched_domains SD_NODE_INIT for PPC64 machines */
  24. #define SD_NODE_INIT (struct sched_domain) { \
  25. .span = CPU_MASK_NONE, \
  26. .parent = NULL, \
  27. .groups = NULL, \
  28. .min_interval = 8, \
  29. .max_interval = 32, \
  30. .busy_factor = 32, \
  31. .imbalance_pct = 125, \
  32. .cache_hot_time = (10*1000000), \
  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. #else
  49. #include <asm-generic/topology.h>
  50. #endif /* CONFIG_NUMA */
  51. #endif /* _ASM_POWERPC_TOPOLOGY_H */