ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-ppc64 / topology.h
1 #ifndef _ASM_PPC64_TOPOLOGY_H
2 #define _ASM_PPC64_TOPOLOGY_H
3
4 #include <linux/config.h>
5 #include <asm/mmzone.h>
6
7 #ifdef CONFIG_NUMA
8
9 static inline int cpu_to_node(int cpu)
10 {
11         int node;
12
13         node = numa_cpu_lookup_table[cpu];
14
15 #ifdef DEBUG_NUMA
16         BUG_ON(node == -1);
17 #endif
18
19         return node;
20 }
21
22 #define parent_node(node)       (node)
23
24 static inline cpumask_t node_to_cpumask(int node)
25 {
26         return numa_cpumask_lookup_table[node];
27 }
28
29 static inline int node_to_first_cpu(int node)
30 {
31         cpumask_t tmp;
32         tmp = node_to_cpumask(node);
33         return first_cpu(tmp);
34 }
35
36 #define pcibus_to_cpumask(bus)  (cpu_online_map)
37
38 #define nr_cpus_node(node)      (nr_cpus_in_node[node])
39
40 /* Cross-node load balancing interval. */
41 #define NODE_BALANCE_RATE 10
42
43 #else /* !CONFIG_NUMA */
44
45 #include <asm-generic/topology.h>
46
47 #endif /* CONFIG_NUMA */
48
49 #endif /* _ASM_PPC64_TOPOLOGY_H */