]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blobdiff - include/asm-powerpc/topology.h
[PATCH] sched: introduce child field in sched_domain
[mirror_ubuntu-kernels.git] / include / asm-powerpc / topology.h
index 4cf340ccb4cd21dd95229c3ae86dd94dbbe04e79..8f7ee16781a4d6497c7fb0b8b79993768f67efc2 100644 (file)
@@ -3,6 +3,9 @@
 #ifdef __KERNEL__
 
 
+struct sys_device;
+struct device_node;
+
 #ifdef CONFIG_NUMA
 
 #include <asm/mmzone.h>
@@ -26,13 +29,21 @@ static inline int node_to_first_cpu(int node)
        return first_cpu(tmp);
 }
 
-#define pcibus_to_node(node)    (-1)
-#define pcibus_to_cpumask(bus) (cpu_online_map)
+int of_node_to_nid(struct device_node *device);
+
+struct pci_bus;
+extern int pcibus_to_node(struct pci_bus *bus);
+
+#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
+                                       CPU_MASK_ALL : \
+                                       node_to_cpumask(pcibus_to_node(bus)) \
+                               )
 
 /* sched_domains SD_NODE_INIT for PPC64 machines */
 #define SD_NODE_INIT (struct sched_domain) {           \
        .span                   = CPU_MASK_NONE,        \
        .parent                 = NULL,                 \
+       .child                  = NULL,                 \
        .groups                 = NULL,                 \
        .min_interval           = 8,                    \
        .max_interval           = 32,                   \
@@ -56,13 +67,37 @@ static inline int node_to_first_cpu(int node)
 
 extern void __init dump_numa_cpu_topology(void);
 
+extern int sysfs_add_device_to_node(struct sys_device *dev, int nid);
+extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid);
+
 #else
 
+static inline int of_node_to_nid(struct device_node *device)
+{
+       return 0;
+}
+
 static inline void dump_numa_cpu_topology(void) {}
 
+static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid)
+{
+       return 0;
+}
+
+static inline void sysfs_remove_device_from_node(struct sys_device *dev,
+                                               int nid)
+{
+}
+
+
 #include <asm-generic/topology.h>
 
 #endif /* CONFIG_NUMA */
 
+#ifdef CONFIG_SMP
+#include <asm/cputable.h>
+#define smt_capable()          (cpu_has_feature(CPU_FTR_SMT))
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_TOPOLOGY_H */