aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/topology.h
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2006-06-10 06:53:06 -0400
committerPaul Mackerras <paulus@samba.org>2006-06-15 05:31:26 -0400
commit357518fa34d9dceda42bfc09642356a58370050d (patch)
treec75689198fa2667a3d73d89ff125d910061b4fcf /include/asm-powerpc/topology.h
parentf2b09c8189bc7b64a42753e98f7006b11bae1bdc (diff)
[POWERPC] pcibus_to_node fixes
of_node_to_nid returns -1 if the associativity cannot be found. This means pcibus_to_cpumask has to be careful not to pass a negative index into node_to_cpumask. Since pcibus_to_node could be used a lot, and of_node_to_nid is slow (it walks a list doing strcmps), lets also cache the node in the pci_controller struct. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/topology.h')
-rw-r--r--include/asm-powerpc/topology.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
index b7abd423c570..f4c759b5f6cc 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -32,13 +32,13 @@ static inline int node_to_first_cpu(int node)
32 32
33int of_node_to_nid(struct device_node *device); 33int of_node_to_nid(struct device_node *device);
34 34
35#ifdef CONFIG_PPC64 35struct pci_bus;
36#define pcibus_to_node(bus) (of_node_to_nid(bus->sysdata)) 36extern int pcibus_to_node(struct pci_bus *bus);
37#define pcibus_to_cpumask(bus) (node_to_cpumask(of_node_to_nid(bus->sysdata))) 37
38#else 38#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
39#define pcibus_to_node(node) (-1) 39 CPU_MASK_ALL : \
40#define pcibus_to_cpumask(bus) (cpu_online_map) 40 node_to_cpumask(pcibus_to_node(bus)) \
41#endif 41 )
42 42
43/* sched_domains SD_NODE_INIT for PPC64 machines */ 43/* sched_domains SD_NODE_INIT for PPC64 machines */
44#define SD_NODE_INIT (struct sched_domain) { \ 44#define SD_NODE_INIT (struct sched_domain) { \