topology_64.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #ifndef _ASM_SPARC64_TOPOLOGY_H
  2. #define _ASM_SPARC64_TOPOLOGY_H
  3. #ifdef CONFIG_NUMA
  4. #include <asm/mmzone.h>
  5. static inline int cpu_to_node(int cpu)
  6. {
  7. return numa_cpu_lookup_table[cpu];
  8. }
  9. #define parent_node(node) (node)
  10. static inline cpumask_t node_to_cpumask(int node)
  11. {
  12. return numa_cpumask_lookup_table[node];
  13. }
  14. #define cpumask_of_node(node) (&numa_cpumask_lookup_table[node])
  15. /*
  16. * Returns a pointer to the cpumask of CPUs on Node 'node'.
  17. * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)"
  18. */
  19. #define node_to_cpumask_ptr(v, node) \
  20. cpumask_t *v = &(numa_cpumask_lookup_table[node])
  21. #define node_to_cpumask_ptr_next(v, node) \
  22. v = &(numa_cpumask_lookup_table[node])
  23. static inline int node_to_first_cpu(int node)
  24. {
  25. return cpumask_first(cpumask_of_node(node));
  26. }
  27. struct pci_bus;
  28. #ifdef CONFIG_PCI
  29. extern int pcibus_to_node(struct pci_bus *pbus);
  30. #else
  31. static inline int pcibus_to_node(struct pci_bus *pbus)
  32. {
  33. return -1;
  34. }
  35. #endif
  36. #define pcibus_to_cpumask(bus) \
  37. (pcibus_to_node(bus) == -1 ? \
  38. CPU_MASK_ALL : \
  39. node_to_cpumask(pcibus_to_node(bus)))
  40. #define cpumask_of_pcibus(bus) \
  41. (pcibus_to_node(bus) == -1 ? \
  42. CPU_MASK_ALL_PTR : \
  43. cpumask_of_node(pcibus_to_node(bus)))
  44. #define SD_NODE_INIT (struct sched_domain) { \
  45. .min_interval = 8, \
  46. .max_interval = 32, \
  47. .busy_factor = 32, \
  48. .imbalance_pct = 125, \
  49. .cache_nice_tries = 2, \
  50. .busy_idx = 3, \
  51. .idle_idx = 2, \
  52. .newidle_idx = 0, \
  53. .wake_idx = 1, \
  54. .forkexec_idx = 1, \
  55. .flags = SD_LOAD_BALANCE \
  56. | SD_BALANCE_FORK \
  57. | SD_BALANCE_EXEC \
  58. | SD_SERIALIZE \
  59. | SD_WAKE_BALANCE, \
  60. .last_balance = jiffies, \
  61. .balance_interval = 1, \
  62. }
  63. #else /* CONFIG_NUMA */
  64. #include <asm-generic/topology.h>
  65. #endif /* !(CONFIG_NUMA) */
  66. #ifdef CONFIG_SMP
  67. #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
  68. #define topology_core_id(cpu) (cpu_data(cpu).core_id)
  69. #define topology_core_siblings(cpu) (cpu_core_map[cpu])
  70. #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
  71. #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
  72. #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
  73. #define mc_capable() (sparc64_multi_core)
  74. #define smt_capable() (sparc64_multi_core)
  75. #endif /* CONFIG_SMP */
  76. #define cpu_coregroup_map(cpu) (cpu_core_map[cpu])
  77. #define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu])
  78. #endif /* _ASM_SPARC64_TOPOLOGY_H */