]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/asm-generic/topology.h
percpu: handle __percpu notations in UP accessors
[linux-2.6.git] / include / asm-generic / topology.h
index ec96e8b0f1901e7c8045415eef2cbd2c247b46dc..fd60700503c8545795a031e15147e466154f0051 100644 (file)
 #ifndef _ASM_GENERIC_TOPOLOGY_H
 #define _ASM_GENERIC_TOPOLOGY_H
 
+#ifndef        CONFIG_NUMA
+
 /* Other architectures wishing to use this simple topology API should fill
    in the below functions as appropriate in their own <asm/topology.h> file. */
 #ifndef cpu_to_node
-#define cpu_to_node(cpu)       (0)
+#define cpu_to_node(cpu)       ((void)(cpu),0)
+#endif
+#ifndef cpu_to_mem
+#define cpu_to_mem(cpu)                ((void)(cpu),0)
 #endif
 #ifndef parent_node
-#define parent_node(node)      (0)
+#define parent_node(node)      ((void)(node),0)
 #endif
-#ifndef node_to_cpumask
-#define node_to_cpumask(node)  (cpu_online_map)
+#ifndef cpumask_of_node
+#define cpumask_of_node(node)  ((void)node, cpu_online_mask)
 #endif
-#ifndef node_to_first_cpu
-#define node_to_first_cpu(node)        (0)
+#ifndef pcibus_to_node
+#define pcibus_to_node(bus)    ((void)(bus), -1)
 #endif
-#ifndef pcibus_to_cpumask
-#define pcibus_to_cpumask(bus) (cpu_online_map)
+
+#ifndef cpumask_of_pcibus
+#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ?            \
+                                cpu_all_mask :                         \
+                                cpumask_of_node(pcibus_to_node(bus)))
 #endif
 
+#endif /* CONFIG_NUMA */
+
 #endif /* _ASM_GENERIC_TOPOLOGY_H */