| .. | .. |
|---|
| 6 | 6 | |
|---|
| 7 | 7 | struct device; |
|---|
| 8 | 8 | struct device_node; |
|---|
| 9 | +struct drmem_lmb; |
|---|
| 9 | 10 | |
|---|
| 10 | 11 | #ifdef CONFIG_NUMA |
|---|
| 11 | 12 | |
|---|
| .. | .. |
|---|
| 35 | 36 | cpu_all_mask : \ |
|---|
| 36 | 37 | cpumask_of_node(pcibus_to_node(bus))) |
|---|
| 37 | 38 | |
|---|
| 39 | +int cpu_relative_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc); |
|---|
| 38 | 40 | extern int __node_distance(int, int); |
|---|
| 39 | 41 | #define node_distance(a, b) __node_distance(a, b) |
|---|
| 40 | 42 | |
|---|
| .. | .. |
|---|
| 42 | 44 | |
|---|
| 43 | 45 | extern int sysfs_add_device_to_node(struct device *dev, int nid); |
|---|
| 44 | 46 | extern void sysfs_remove_device_from_node(struct device *dev, int nid); |
|---|
| 45 | | -extern int numa_update_cpu_topology(bool cpus_locked); |
|---|
| 46 | 47 | |
|---|
| 47 | 48 | static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) |
|---|
| 48 | 49 | { |
|---|
| .. | .. |
|---|
| 61 | 62 | */ |
|---|
| 62 | 63 | return (nid < 0) ? 0 : nid; |
|---|
| 63 | 64 | } |
|---|
| 65 | + |
|---|
| 66 | +int of_drconf_to_nid_single(struct drmem_lmb *lmb); |
|---|
| 67 | +void update_numa_distance(struct device_node *node); |
|---|
| 68 | + |
|---|
| 64 | 69 | #else |
|---|
| 65 | 70 | |
|---|
| 66 | 71 | static inline int early_cpu_to_node(int cpu) { return 0; } |
|---|
| .. | .. |
|---|
| 77 | 82 | { |
|---|
| 78 | 83 | } |
|---|
| 79 | 84 | |
|---|
| 80 | | -static inline int numa_update_cpu_topology(bool cpus_locked) |
|---|
| 85 | +static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {} |
|---|
| 86 | + |
|---|
| 87 | +static inline int cpu_relative_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc) |
|---|
| 81 | 88 | { |
|---|
| 82 | 89 | return 0; |
|---|
| 83 | 90 | } |
|---|
| 84 | 91 | |
|---|
| 85 | | -static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {} |
|---|
| 92 | +static inline int of_drconf_to_nid_single(struct drmem_lmb *lmb) |
|---|
| 93 | +{ |
|---|
| 94 | + return first_online_node; |
|---|
| 95 | +} |
|---|
| 86 | 96 | |
|---|
| 97 | +static inline void update_numa_distance(struct device_node *node) {} |
|---|
| 87 | 98 | #endif /* CONFIG_NUMA */ |
|---|
| 88 | 99 | |
|---|
| 89 | 100 | #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) |
|---|
| 90 | | -extern int start_topology_update(void); |
|---|
| 91 | | -extern int stop_topology_update(void); |
|---|
| 92 | | -extern int prrn_is_enabled(void); |
|---|
| 93 | 101 | extern int find_and_online_cpu_nid(int cpu); |
|---|
| 94 | | -extern int timed_topology_update(int nsecs); |
|---|
| 95 | | -extern void __init shared_proc_topology_init(void); |
|---|
| 102 | +extern int cpu_to_coregroup_id(int cpu); |
|---|
| 96 | 103 | #else |
|---|
| 97 | | -static inline int start_topology_update(void) |
|---|
| 98 | | -{ |
|---|
| 99 | | - return 0; |
|---|
| 100 | | -} |
|---|
| 101 | | -static inline int stop_topology_update(void) |
|---|
| 102 | | -{ |
|---|
| 103 | | - return 0; |
|---|
| 104 | | -} |
|---|
| 105 | | -static inline int prrn_is_enabled(void) |
|---|
| 106 | | -{ |
|---|
| 107 | | - return 0; |
|---|
| 108 | | -} |
|---|
| 109 | 104 | static inline int find_and_online_cpu_nid(int cpu) |
|---|
| 110 | 105 | { |
|---|
| 111 | 106 | return 0; |
|---|
| 112 | 107 | } |
|---|
| 113 | | -static inline int timed_topology_update(int nsecs) |
|---|
| 108 | + |
|---|
| 109 | +static inline int cpu_to_coregroup_id(int cpu) |
|---|
| 114 | 110 | { |
|---|
| 111 | +#ifdef CONFIG_SMP |
|---|
| 112 | + return cpu_to_core_id(cpu); |
|---|
| 113 | +#else |
|---|
| 115 | 114 | return 0; |
|---|
| 115 | +#endif |
|---|
| 116 | 116 | } |
|---|
| 117 | 117 | |
|---|
| 118 | | -#ifdef CONFIG_SMP |
|---|
| 119 | | -static inline void shared_proc_topology_init(void) {} |
|---|
| 120 | | -#endif |
|---|
| 121 | 118 | #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */ |
|---|
| 122 | 119 | |
|---|
| 123 | 120 | #include <asm-generic/topology.h> |
|---|
| .. | .. |
|---|
| 129 | 126 | #include <asm/smp.h> |
|---|
| 130 | 127 | |
|---|
| 131 | 128 | #define topology_physical_package_id(cpu) (cpu_to_chip_id(cpu)) |
|---|
| 129 | + |
|---|
| 132 | 130 | #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) |
|---|
| 133 | | -#define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) |
|---|
| 131 | +#define topology_core_cpumask(cpu) (cpu_cpu_mask(cpu)) |
|---|
| 134 | 132 | #define topology_core_id(cpu) (cpu_to_core_id(cpu)) |
|---|
| 135 | 133 | |
|---|
| 136 | | -int dlpar_cpu_readd(int cpu); |
|---|
| 137 | 134 | #endif |
|---|
| 138 | 135 | #endif |
|---|
| 139 | 136 | |
|---|