]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - include/asm-powerpc/topology.h
[PATCH] spufs: fix for CONFIG_NUMA
[mirror_ubuntu-zesty-kernel.git] / include / asm-powerpc / topology.h
CommitLineData
dd56fdf2 1#ifndef _ASM_POWERPC_TOPOLOGY_H
2#define _ASM_POWERPC_TOPOLOGY_H
88ced031 3#ifdef __KERNEL__
1da177e4
LT
4
5#include <linux/config.h>
1da177e4
LT
6
7#ifdef CONFIG_NUMA
8
dd56fdf2 9#include <asm/mmzone.h>
10
1da177e4
LT
11static inline int cpu_to_node(int cpu)
12{
45fb6cea 13 return numa_cpu_lookup_table[cpu];
1da177e4
LT
14}
15
16#define parent_node(node) (node)
17
18static inline cpumask_t node_to_cpumask(int node)
19{
20 return numa_cpumask_lookup_table[node];
21}
22
23static inline int node_to_first_cpu(int node)
24{
25 cpumask_t tmp;
26 tmp = node_to_cpumask(node);
27 return first_cpu(tmp);
28}
29
561fb765 30#define pcibus_to_node(node) (-1)
1da177e4
LT
31#define pcibus_to_cpumask(bus) (cpu_online_map)
32
1da177e4
LT
33/* sched_domains SD_NODE_INIT for PPC64 machines */
34#define SD_NODE_INIT (struct sched_domain) { \
35 .span = CPU_MASK_NONE, \
36 .parent = NULL, \
37 .groups = NULL, \
38 .min_interval = 8, \
39 .max_interval = 32, \
40 .busy_factor = 32, \
41 .imbalance_pct = 125, \
1da177e4
LT
42 .cache_nice_tries = 1, \
43 .per_cpu_gain = 100, \
5cfccd7f 44 .busy_idx = 3, \
d2a33170 45 .idle_idx = 1, \
5cfccd7f
NP
46 .newidle_idx = 2, \
47 .wake_idx = 1, \
1da177e4
LT
48 .flags = SD_LOAD_BALANCE \
49 | SD_BALANCE_EXEC \
50 | SD_BALANCE_NEWIDLE \
51 | SD_WAKE_IDLE \
52 | SD_WAKE_BALANCE, \
53 .last_balance = jiffies, \
54 .balance_interval = 1, \
55 .nr_balance_failed = 0, \
56}
57
4b703a23
AB
58extern void __init dump_numa_cpu_topology(void);
59
561fb765 60#else
1da177e4 61
4b703a23
AB
62static inline void dump_numa_cpu_topology(void) {}
63
1da177e4
LT
64#include <asm-generic/topology.h>
65
561fb765
AB
66#endif /* CONFIG_NUMA */
67
88ced031 68#endif /* __KERNEL__ */
dd56fdf2 69#endif /* _ASM_POWERPC_TOPOLOGY_H */