topology_64.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #define cpumask_of_node(node) (&numa_cpumask_lookup_table[node])
  11. struct pci_bus;
  12. #ifdef CONFIG_PCI
  13. extern int pcibus_to_node(struct pci_bus *pbus);
  14. #else
  15. static inline int pcibus_to_node(struct pci_bus *pbus)
  16. {
  17. return -1;
  18. }
  19. #endif
  20. #define cpumask_of_pcibus(bus) \
  21. (pcibus_to_node(bus) == -1 ? \
  22. cpu_all_mask : \
  23. cpumask_of_node(pcibus_to_node(bus)))
  24. #define SD_NODE_INIT (struct sched_domain) { \
  25. .min_interval = 8, \
  26. .max_interval = 32, \
  27. .busy_factor = 32, \
  28. .imbalance_pct = 125, \
  29. .cache_nice_tries = 2, \
  30. .busy_idx = 3, \
  31. .idle_idx = 2, \
  32. .newidle_idx = 0, \
  33. .wake_idx = 0, \
  34. .forkexec_idx = 0, \
  35. .flags = SD_LOAD_BALANCE \
  36. | SD_BALANCE_FORK \
  37. | SD_BALANCE_EXEC \
  38. | SD_SERIALIZE, \
  39. .last_balance = jiffies, \
  40. .balance_interval = 1, \
  41. }
  42. #else /* CONFIG_NUMA */
  43. #include <asm-generic/topology.h>
  44. #endif /* !(CONFIG_NUMA) */
  45. #ifdef CONFIG_SMP
  46. #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
  47. #define topology_core_id(cpu) (cpu_data(cpu).core_id)
  48. #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
  49. #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
  50. #define mc_capable() (sparc64_multi_core)
  51. #define smt_capable() (sparc64_multi_core)
  52. #endif /* CONFIG_SMP */
  53. #define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu])
  54. #endif /* _ASM_SPARC64_TOPOLOGY_H */