]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - include/asm-powerpc/topology.h
[PATCH] powerpc: Allow devices to register with numa topology
[mirror_ubuntu-zesty-kernel.git] / include / asm-powerpc / topology.h
index db8095cbe09bb0d59ba8432974ecfbef426ad9c9..87362a05542b6ba5036d8631b5f20aa481651980 100644 (file)
@@ -1,8 +1,12 @@
 #ifndef _ASM_POWERPC_TOPOLOGY_H
 #define _ASM_POWERPC_TOPOLOGY_H
+#ifdef __KERNEL__
 
 #include <linux/config.h>
 
+struct sys_device;
+struct device_node;
+
 #ifdef CONFIG_NUMA
 
 #include <asm/mmzone.h>
@@ -26,6 +30,8 @@ static inline int node_to_first_cpu(int node)
        return first_cpu(tmp);
 }
 
+int of_node_to_nid(struct device_node *device);
+
 #define pcibus_to_node(node)    (-1)
 #define pcibus_to_cpumask(bus) (cpu_online_map)
 
@@ -38,7 +44,6 @@ static inline int node_to_first_cpu(int node)
        .max_interval           = 32,                   \
        .busy_factor            = 32,                   \
        .imbalance_pct          = 125,                  \
-       .cache_hot_time         = (10*1000000),         \
        .cache_nice_tries       = 1,                    \
        .per_cpu_gain           = 100,                  \
        .busy_idx               = 3,                    \
@@ -55,10 +60,34 @@ static inline int node_to_first_cpu(int node)
        .nr_balance_failed      = 0,                    \
 }
 
+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 */
 
+#endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_TOPOLOGY_H */