topology_64.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. /* Returns a pointer to the cpumask of CPUs on Node 'node'. */
  15. #define node_to_cpumask_ptr(v, node) \
  16. cpumask_t *v = &(numa_cpumask_lookup_table[node])
  17. #define node_to_cpumask_ptr_next(v, node) \
  18. v = &(numa_cpumask_lookup_table[node])
  19. static inline int node_to_first_cpu(int node)
  20. {
  21. cpumask_t tmp;
  22. tmp = node_to_cpumask(node);
  23. return first_cpu(tmp);
  24. }
  25. struct pci_bus;
  26. #ifdef CONFIG_PCI
  27. extern int pcibus_to_node(struct pci_bus *pbus);
  28. #else
  29. static inline int pcibus_to_node(struct pci_bus *pbus)
  30. {
  31. return -1;
  32. }
  33. #endif
  34. #define pcibus_to_cpumask(bus) \
  35. (pcibus_to_node(bus) == -1 ? \
  36. CPU_MASK_ALL : \
  37. node_to_cpumask(pcibus_to_node(bus)))
  38. #define SD_NODE_INIT (struct sched_domain) { \
  39. .min_interval = 8, \
  40. .max_interval = 32, \
  41. .busy_factor = 32, \
  42. .imbalance_pct = 125, \
  43. .cache_nice_tries = 2, \
  44. .busy_idx = 3, \
  45. .idle_idx = 2, \
  46. .newidle_idx = 0, \
  47. .wake_idx = 1, \
  48. .forkexec_idx = 1, \
  49. .flags = SD_LOAD_BALANCE \
  50. | SD_BALANCE_FORK \
  51. | SD_BALANCE_EXEC \
  52. | SD_SERIALIZE \
  53. | SD_WAKE_BALANCE, \
  54. .last_balance = jiffies, \
  55. .balance_interval = 1, \
  56. }
  57. #else /* CONFIG_NUMA */
  58. #include <asm-generic/topology.h>
  59. #endif /* !(CONFIG_NUMA) */
  60. #ifdef CONFIG_SMP
  61. #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
  62. #define topology_core_id(cpu) (cpu_data(cpu).core_id)
  63. #define topology_core_siblings(cpu) (cpu_core_map[cpu])
  64. #define topology_thread_siblings(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_map(cpu) (cpu_core_map[cpu])
  69. #endif /* _ASM_SPARC64_TOPOLOGY_H */