{rd,wr}msr_on_cpu SMP=n optimization

Let's save a few bytes in the CONFIG_SMP=n case.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave Jones <davej@redhat.com>

authored by Adrian Bunk and committed by Dave Jones b44755cf 48ac3271

+25 -14
+1 -1
arch/i386/lib/Makefile
··· 8 8 9 9 lib-$(CONFIG_X86_USE_3DNOW) += mmx.o 10 10 11 - obj-y = msr-on-cpu.o 11 + obj-$(CONFIG_SMP) += msr-on-cpu.o
-12
arch/i386/lib/msr-on-cpu.c
··· 3 3 #include <linux/smp.h> 4 4 #include <asm/msr.h> 5 5 6 - #ifdef CONFIG_SMP 7 6 struct msr_info { 8 7 u32 msr_no; 9 8 u32 l, h; ··· 53 54 } 54 55 preempt_enable(); 55 56 } 56 - #else 57 - void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) 58 - { 59 - rdmsr(msr_no, *l, *h); 60 - } 61 - 62 - void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) 63 - { 64 - wrmsr(msr_no, l, h); 65 - } 66 - #endif 67 57 68 58 EXPORT_SYMBOL(rdmsr_on_cpu); 69 59 EXPORT_SYMBOL(wrmsr_on_cpu);
+2 -1
arch/x86_64/lib/Makefile
··· 4 4 5 5 CFLAGS_csum-partial.o := -funroll-loops 6 6 7 - obj-y := io.o iomap_copy.o msr-on-cpu.o 7 + obj-y := io.o iomap_copy.o 8 + obj-$(CONFIG_SMP) += msr-on-cpu.o 8 9 9 10 lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \ 10 11 usercopy.o getuser.o putuser.o \
+11
include/asm-i386/msr.h
··· 83 83 : "c" (counter)) 84 84 #endif /* !CONFIG_PARAVIRT */ 85 85 86 + #ifdef CONFIG_SMP 86 87 void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 87 88 void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 89 + #else /* CONFIG_SMP */ 90 + static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) 91 + { 92 + rdmsr(msr_no, *l, *h); 93 + } 94 + static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) 95 + { 96 + wrmsr(msr_no, l, h); 97 + } 98 + #endif /* CONFIG_SMP */ 88 99 89 100 /* symbolic names for some interesting MSRs */ 90 101 /* Intel defined MSRs. */
+11
include/asm-x86_64/msr.h
··· 160 160 #define MSR_IA32_UCODE_WRITE 0x79 161 161 #define MSR_IA32_UCODE_REV 0x8b 162 162 163 + #ifdef CONFIG_SMP 163 164 void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 164 165 void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 166 + #else /* CONFIG_SMP */ 167 + static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) 168 + { 169 + rdmsr(msr_no, *l, *h); 170 + } 171 + static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) 172 + { 173 + wrmsr(msr_no, l, h); 174 + } 175 + #endif /* CONFIG_SMP */ 165 176 166 177 #endif 167 178