Merge tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux
[linux/fpc-iii.git] / arch / powerpc / include / asm / topology.h
blob5f1048eaa5b6041d1194457bec16509dcabe7907
1 #ifndef _ASM_POWERPC_TOPOLOGY_H
2 #define _ASM_POWERPC_TOPOLOGY_H
3 #ifdef __KERNEL__
6 struct device;
7 struct device_node;
9 #ifdef CONFIG_NUMA
12 * If zone_reclaim_mode is enabled, a RECLAIM_DISTANCE of 10 will mean that
13 * all zones on all nodes will be eligible for zone_reclaim().
15 #define RECLAIM_DISTANCE 10
17 #include <asm/mmzone.h>
19 #define parent_node(node) (node)
21 #define cpumask_of_node(node) ((node) == -1 ? \
22 cpu_all_mask : \
23 node_to_cpumask_map[node])
25 struct pci_bus;
26 #ifdef CONFIG_PCI
27 extern int pcibus_to_node(struct pci_bus *bus);
28 #else
29 static inline int pcibus_to_node(struct pci_bus *bus)
31 return -1;
33 #endif
35 #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
36 cpu_all_mask : \
37 cpumask_of_node(pcibus_to_node(bus)))
39 extern int __node_distance(int, int);
40 #define node_distance(a, b) __node_distance(a, b)
42 extern void __init dump_numa_cpu_topology(void);
44 extern int sysfs_add_device_to_node(struct device *dev, int nid);
45 extern void sysfs_remove_device_from_node(struct device *dev, int nid);
47 #else
49 static inline void dump_numa_cpu_topology(void) {}
51 static inline int sysfs_add_device_to_node(struct device *dev, int nid)
53 return 0;
56 static inline void sysfs_remove_device_from_node(struct device *dev,
57 int nid)
60 #endif /* CONFIG_NUMA */
62 #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
63 extern int start_topology_update(void);
64 extern int stop_topology_update(void);
65 extern int prrn_is_enabled(void);
66 #else
67 static inline int start_topology_update(void)
69 return 0;
71 static inline int stop_topology_update(void)
73 return 0;
75 static inline int prrn_is_enabled(void)
77 return 0;
79 #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
81 #include <asm-generic/topology.h>
83 #ifdef CONFIG_SMP
84 #include <asm/cputable.h>
86 #ifdef CONFIG_PPC64
87 #include <asm/smp.h>
89 #define topology_physical_package_id(cpu) (cpu_to_chip_id(cpu))
90 #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
91 #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
92 #define topology_core_id(cpu) (cpu_to_core_id(cpu))
93 #endif
94 #endif
96 #endif /* __KERNEL__ */
97 #endif /* _ASM_POWERPC_TOPOLOGY_H */