1 #ifndef _ASM_SPARC64_TOPOLOGY_H
2 #define _ASM_SPARC64_TOPOLOGY_H
6 #include <asm/mmzone.h>
8 static inline int cpu_to_node(int cpu)
10 return numa_cpu_lookup_table[cpu];
13 #define parent_node(node) (node)
15 static inline cpumask_t node_to_cpumask(int node)
17 return numa_cpumask_lookup_table[node];
20 /* Returns a pointer to the cpumask of CPUs on Node 'node'. */
21 #define node_to_cpumask_ptr(v, node) \
22 cpumask_t *v = &(numa_cpumask_lookup_table[node])
24 #define node_to_cpumask_ptr_next(v, node) \
25 v = &(numa_cpumask_lookup_table[node])
27 static inline int node_to_first_cpu(int node)
30 tmp = node_to_cpumask(node);
31 return first_cpu(tmp);
36 extern int pcibus_to_node(struct pci_bus *pbus);
38 static inline int pcibus_to_node(struct pci_bus *pbus)
44 #define pcibus_to_cpumask(bus) \
45 (pcibus_to_node(bus) == -1 ? \
47 node_to_cpumask(pcibus_to_node(bus)))
49 #define SD_NODE_INIT (struct sched_domain) { \
53 .imbalance_pct = 125, \
54 .cache_nice_tries = 2, \
60 .flags = SD_LOAD_BALANCE \
65 .last_balance = jiffies, \
66 .balance_interval = 1, \
69 #else /* CONFIG_NUMA */
71 #include <asm-generic/topology.h>
73 #endif /* !(CONFIG_NUMA) */
76 #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
77 #define topology_core_id(cpu) (cpu_data(cpu).core_id)
78 #define topology_core_siblings(cpu) (cpu_core_map[cpu])
79 #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
80 #define mc_capable() (sparc64_multi_core)
81 #define smt_capable() (sparc64_multi_core)
82 #endif /* CONFIG_SMP */
84 #define cpu_coregroup_map(cpu) (cpu_core_map[cpu])
86 #endif /* _ASM_SPARC64_TOPOLOGY_H */