From: Christoph Hellwig Date: Tue, 6 Jun 2006 14:09:39 +0000 (+0200) Subject: [PATCH] powerpc: implement pcibus_to_node and pcibus_to_cpumask X-Git-Tag: v2.6.18-rc1~1081^2~225^2~73 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=318facbee05417fb432603a8309a10cdb942a87b;p=linux-2.6 [PATCH] powerpc: implement pcibus_to_node and pcibus_to_cpumask On 64bit powerpc we can find out what node a pci bus hangs off, so implement the topology.h macros that export this information. For 32bit this seems a little more difficult, but I don't know of 32bit powerpc NUMA machines either, so let's leave it out for now. Signed-off-by: Christoph Hellwig Signed-off-by: Paul Mackerras --- diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index 87362a0554..b7abd423c5 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h @@ -32,8 +32,13 @@ static inline int node_to_first_cpu(int node) int of_node_to_nid(struct device_node *device); +#ifdef CONFIG_PPC64 +#define pcibus_to_node(bus) (of_node_to_nid(bus->sysdata)) +#define pcibus_to_cpumask(bus) (node_to_cpumask(of_node_to_nid(bus->sysdata))) +#else #define pcibus_to_node(node) (-1) #define pcibus_to_cpumask(bus) (cpu_online_map) +#endif /* sched_domains SD_NODE_INIT for PPC64 machines */ #define SD_NODE_INIT (struct sched_domain) { \