aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-08-18 00:23:48 -0400
committerPaul Mackerras <paulus@samba.org>2008-08-20 02:34:58 -0400
commit41eba0ad0033967eda346dd833194e96fdf5f405 (patch)
tree4c682a0dabd3d03fbf44988bce64fc511a541371 /arch
parentf3d3d307e6f577de3b384ef64ffb03c8b5676748 (diff)
powerpc: Turn get/set_hard_smp_proccessor_id into inlines
They don't need to be macros, and having them as inline functions avoids warnings about unused variables on some configurations when the argument isn't evaluated. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/smp.h39
1 files changed, 29 insertions, 10 deletions
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 4d28e1e4521b..c092f84302fd 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -56,9 +56,16 @@ extern int smp_hw_index[];
56 56
57#define raw_smp_processor_id() (current_thread_info()->cpu) 57#define raw_smp_processor_id() (current_thread_info()->cpu)
58#define hard_smp_processor_id() (smp_hw_index[smp_processor_id()]) 58#define hard_smp_processor_id() (smp_hw_index[smp_processor_id()])
59#define get_hard_smp_processor_id(cpu) (smp_hw_index[(cpu)]) 59
60#define set_hard_smp_processor_id(cpu, phys)\ 60static inline int get_hard_smp_processor_id(int cpu)
61 (smp_hw_index[(cpu)] = (phys)) 61{
62 return smp_hw_index[cpu];
63}
64
65static inline void set_hard_smp_processor_id(int cpu, int phys)
66{
67 smp_hw_index[cpu] = phys;
68}
62#endif 69#endif
63 70
64DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); 71DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
@@ -92,9 +99,15 @@ extern void __cpu_die(unsigned int cpu);
92#endif /* CONFIG_SMP */ 99#endif /* CONFIG_SMP */
93 100
94#ifdef CONFIG_PPC64 101#ifdef CONFIG_PPC64
95#define get_hard_smp_processor_id(CPU) (paca[(CPU)].hw_cpu_id) 102static inline int get_hard_smp_processor_id(int cpu)
96#define set_hard_smp_processor_id(CPU, VAL) \ 103{
97 do { (paca[(CPU)].hw_cpu_id = (VAL)); } while (0) 104 return paca[cpu].hw_cpu_id;
105}
106
107static inline void set_hard_smp_processor_id(int cpu, int phys)
108{
109 paca[cpu].hw_cpu_id = phys;
110}
98 111
99extern void smp_release_cpus(void); 112extern void smp_release_cpus(void);
100 113
@@ -102,10 +115,16 @@ extern void smp_release_cpus(void);
102/* 32-bit */ 115/* 32-bit */
103#ifndef CONFIG_SMP 116#ifndef CONFIG_SMP
104extern int boot_cpuid_phys; 117extern int boot_cpuid_phys;
105#define get_hard_smp_processor_id(cpu) boot_cpuid_phys 118static inline int get_hard_smp_processor_id(int cpu)
106#define set_hard_smp_processor_id(cpu, phys) 119{
107#endif 120 return boot_cpuid_phys;
108#endif 121}
122
123static inline void set_hard_smp_processor_id(int cpu, int phys)
124{
125}
126#endif /* !CONFIG_SMP */
127#endif /* !CONFIG_PPC64 */
109 128
110extern int smt_enabled_at_boot; 129extern int smt_enabled_at_boot;
111 130