sched/x86: Drop repeated word from mwait_idle() comment
[linux-2.6-block.git] / arch / powerpc / include / asm / topology.h
CommitLineData
dd56fdf2 1#ifndef _ASM_POWERPC_TOPOLOGY_H
2#define _ASM_POWERPC_TOPOLOGY_H
88ced031 3#ifdef __KERNEL__
1da177e4 4
1da177e4 5
8a25a2fd 6struct device;
953039c8
JK
7struct device_node;
8
1da177e4
LT
9#ifdef CONFIG_NUMA
10
56608209 11/*
4f9b16a6
MG
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().
56608209
AB
14 */
15#define RECLAIM_DISTANCE 10
16
dd56fdf2 17#include <asm/mmzone.h>
18
1da177e4
LT
19#define parent_node(node) (node)
20
c81b812a
AB
21#define cpumask_of_node(node) ((node) == -1 ? \
22 cpu_all_mask : \
25863de0 23 node_to_cpumask_map[node])
86c6f274 24
357518fa 25struct pci_bus;
11faa658 26#ifdef CONFIG_PCI
357518fa 27extern int pcibus_to_node(struct pci_bus *bus);
11faa658
AB
28#else
29static inline int pcibus_to_node(struct pci_bus *bus)
30{
31 return -1;
32}
33#endif
357518fa 34
86c6f274
RR
35#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
36 cpu_all_mask : \
37 cpumask_of_node(pcibus_to_node(bus)))
38
41eab6f8
AB
39extern int __node_distance(int, int);
40#define node_distance(a, b) __node_distance(a, b)
41
4b703a23
AB
42extern void __init dump_numa_cpu_topology(void);
43
8a25a2fd
KS
44extern int sysfs_add_device_to_node(struct device *dev, int nid);
45extern void sysfs_remove_device_from_node(struct device *dev, int nid);
953039c8 46
39bf990e 47#else
1da177e4 48
4b703a23
AB
49static inline void dump_numa_cpu_topology(void) {}
50
8a25a2fd 51static inline int sysfs_add_device_to_node(struct device *dev, int nid)
953039c8
JK
52{
53 return 0;
54}
55
8a25a2fd 56static inline void sysfs_remove_device_from_node(struct device *dev,
953039c8
JK
57 int nid)
58{
59}
aa6b5446 60#endif /* CONFIG_NUMA */
953039c8 61
5d7d8072
BH
62#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
63extern int start_topology_update(void);
64extern int stop_topology_update(void);
e04fa612 65extern int prrn_is_enabled(void);
5d7d8072
BH
66#else
67static inline int start_topology_update(void)
68{
69 return 0;
70}
71static inline int stop_topology_update(void)
72{
73 return 0;
74}
e04fa612
NF
75static inline int prrn_is_enabled(void)
76{
77 return 0;
78}
5d7d8072
BH
79#endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
80
1da177e4
LT
81#include <asm-generic/topology.h>
82
5c45bf27
SS
83#ifdef CONFIG_SMP
84#include <asm/cputable.h>
056f4faa
SR
85
86#ifdef CONFIG_PPC64
87#include <asm/smp.h>
88
15863ff3 89#define topology_physical_package_id(cpu) (cpu_to_chip_id(cpu))
cc1ba8ea
AB
90#define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
91#define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
e9efed3b 92#define topology_core_id(cpu) (cpu_to_core_id(cpu))
056f4faa 93#endif
5c45bf27
SS
94#endif
95
88ced031 96#endif /* __KERNEL__ */
dd56fdf2 97#endif /* _ASM_POWERPC_TOPOLOGY_H */