1 #ifndef _ASM_POWERPC_TOPOLOGY_H
2 #define _ASM_POWERPC_TOPOLOGY_H
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 ? \
23 node_to_cpumask_map[node])
27 extern int pcibus_to_node(struct pci_bus
*bus
);
29 static inline int pcibus_to_node(struct pci_bus
*bus
)
35 #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
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
);
46 extern int numa_update_cpu_topology(bool cpus_locked
);
48 static inline int early_cpu_to_node(int cpu
)
52 nid
= numa_cpu_lookup_table
[cpu
];
55 * Fall back to node 0 if nid is unset (it should be, except bugs).
56 * This allows callers to safely do NODE_DATA(early_cpu_to_node(cpu)).
58 return (nid
< 0) ? 0 : nid
;
62 static inline int early_cpu_to_node(int cpu
) { return 0; }
64 static inline void dump_numa_cpu_topology(void) {}
66 static inline int sysfs_add_device_to_node(struct device
*dev
, int nid
)
71 static inline void sysfs_remove_device_from_node(struct device
*dev
,
76 static inline int numa_update_cpu_topology(bool cpus_locked
)
80 #endif /* CONFIG_NUMA */
82 #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
83 extern int start_topology_update(void);
84 extern int stop_topology_update(void);
85 extern int prrn_is_enabled(void);
87 static inline int start_topology_update(void)
91 static inline int stop_topology_update(void)
95 static inline int prrn_is_enabled(void)
99 #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
101 #include <asm-generic/topology.h>
104 #include <asm/cputable.h>
109 #define topology_physical_package_id(cpu) (cpu_to_chip_id(cpu))
110 #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
111 #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
112 #define topology_core_id(cpu) (cpu_to_core_id(cpu))
116 #endif /* __KERNEL__ */
117 #endif /* _ASM_POWERPC_TOPOLOGY_H */