topology_64.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 SD_NODE_INIT (struct sched_domain) { \
  41. .min_interval = 8, \
  42. .max_interval = 32, \
  43. .busy_factor = 32, \
  44. .imbalance_pct = 125, \
  45. .cache_nice_tries = 2, \
  46. .busy_idx = 3, \
  47. .idle_idx = 2, \
  48. .newidle_idx = 0, \
  49. .wake_idx = 1, \
  50. .forkexec_idx = 1, \
  51. .flags = SD_LOAD_BALANCE \
  52. | SD_BALANCE_FORK \
  53. | SD_BALANCE_EXEC \
  54. | SD_SERIALIZE \
  55. | SD_WAKE_BALANCE, \
  56. .last_balance = jiffies, \
  57. .balance_interval = 1, \
  58. }
  59. #else /* CONFIG_NUMA */
  60. #include <asm-generic/topology.h>
  61. #endif /* !(CONFIG_NUMA) */
  62. #ifdef CONFIG_SMP
  63. #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
  64. #define topology_core_id(cpu) (cpu_data(cpu).core_id)
  65. #define topology_core_siblings(cpu) (cpu_core_map[cpu])
  66. #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
  67. #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
  68. #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
  69. #define mc_capable() (sparc64_multi_core)
  70. #define smt_capable() (sparc64_multi_core)
  71. #endif /* CONFIG_SMP */
  72. #define cpu_coregroup_map(cpu) (cpu_core_map[cpu])
  73. #define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu])
  74. #endif /* _ASM_SPARC64_TOPOLOGY_H */