topology_64.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. struct pci_bus;
  24. #ifdef CONFIG_PCI
  25. extern int pcibus_to_node(struct pci_bus *pbus);
  26. #else
  27. static inline int pcibus_to_node(struct pci_bus *pbus)
  28. {
  29. return -1;
  30. }
  31. #endif
  32. #define cpumask_of_pcibus(bus) \
  33. (pcibus_to_node(bus) == -1 ? \
  34. cpu_all_mask : \
  35. cpumask_of_node(pcibus_to_node(bus)))
  36. #define SD_NODE_INIT (struct sched_domain) { \
  37. .min_interval = 8, \
  38. .max_interval = 32, \
  39. .busy_factor = 32, \
  40. .imbalance_pct = 125, \
  41. .cache_nice_tries = 2, \
  42. .busy_idx = 3, \
  43. .idle_idx = 2, \
  44. .newidle_idx = 0, \
  45. .wake_idx = 1, \
  46. .forkexec_idx = 1, \
  47. .flags = SD_LOAD_BALANCE \
  48. | SD_BALANCE_FORK \
  49. | SD_BALANCE_EXEC \
  50. | SD_SERIALIZE \
  51. | SD_WAKE_BALANCE, \
  52. .last_balance = jiffies, \
  53. .balance_interval = 1, \
  54. }
  55. #else /* CONFIG_NUMA */
  56. #include <asm-generic/topology.h>
  57. #endif /* !(CONFIG_NUMA) */
  58. #ifdef CONFIG_SMP
  59. #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
  60. #define topology_core_id(cpu) (cpu_data(cpu).core_id)
  61. #define topology_core_siblings(cpu) (cpu_core_map[cpu])
  62. #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
  63. #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
  64. #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
  65. #define mc_capable() (sparc64_multi_core)
  66. #define smt_capable() (sparc64_multi_core)
  67. #endif /* CONFIG_SMP */
  68. #define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu])
  69. #endif /* _ASM_SPARC64_TOPOLOGY_H */