Skip to contentSkip to conversation

4/7 provide pcibus_to_cpumask from topology

PATCH New Martin J. Bligh 1 participant 1 message Feb 28, 2003 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 4/7 provide pcibus_to_cpumask from topology

Patch from Matthew Dobson

Just provides a pcibus_to_cpumask function in the topology infrastructure to access the pre-existing array.

include/asm-generic/topology.h +3 -0
diff -urpN -X /home/fletch/.diff.exclude 012-pfn_to_nid/include/asm-generic/topology.h 013-pcibus_to_cpumask/include/asm-generic/topology.h
@@ -47,6 +47,9 @@
 #ifndef node_to_memblk
 #define node_to_memblk(node)	(0)
 #endif
+#ifndef pcibus_to_cpumask
+#define pcibus_to_cpumask(bus)	(cpu_online_map)
+#endif
 
 /* Cross-node load balancing interval. */
 #ifndef NODE_BALANCE_RATE
include/asm-i386/topology.h +8 -0
diff -urpN -X /home/fletch/.diff.exclude 012-pfn_to_nid/include/asm-i386/topology.h 013-pcibus_to_cpumask/include/asm-i386/topology.h
@@ -29,6 +29,8 @@
 
 #ifdef CONFIG_NUMA
 
+#include <asm/mpspec.h>
+
 /* Mappings between logical cpu number and node number */
 extern volatile unsigned long node_2_cpu_mask[];
 extern volatile int cpu_2_node[];
@@ -60,6 +62,12 @@ static inline int node_to_first_cpu(int 
 
 /* Returns the number of the first MemBlk on Node 'node' */
 #define node_to_memblk(node) (node)
+
+/* Returns the number of the node containing PCI bus 'bus' */
+static inline unsigned long pcibus_to_cpumask(int bus)
+{
+	return node_to_cpumask(mp_bus_id_to_node[bus]);
+}
 
 /* Cross-node load balancing interval. */
 #define NODE_BALANCE_RATE 100