]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
{rd,wr}msr_on_cpu SMP=n optimization
authorAdrian Bunk <bunk@stusta.de>
Tue, 20 Feb 2007 00:07:13 +0000 (01:07 +0100)
committerDave Jones <davej@redhat.com>
Tue, 20 Feb 2007 19:29:37 +0000 (14:29 -0500)
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>
arch/i386/lib/Makefile
arch/i386/lib/msr-on-cpu.c
arch/x86_64/lib/Makefile
include/asm-i386/msr.h
include/asm-x86_64/msr.h

index 0d41223472c2a159557c110bf67dc1cd5f5eda05..22d8ac5815f03475c6abb7376d7994e92fa57a51 100644 (file)
@@ -8,4 +8,4 @@ lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \
 
 lib-$(CONFIG_X86_USE_3DNOW) += mmx.o
 
-obj-= msr-on-cpu.o
+obj-$(CONFIG_SMP)      += msr-on-cpu.o
index 2092ea15ba8553574289d7d8cbee9519b3a9b78b..1c46bda409ff1e20e7e3fd6ee569c274ec66e66b 100644 (file)
@@ -3,7 +3,6 @@
 #include <linux/smp.h>
 #include <asm/msr.h>
 
-#ifdef CONFIG_SMP
 struct msr_info {
        u32 msr_no;
        u32 l, h;
@@ -54,17 +53,6 @@ void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
        }
        preempt_enable();
 }
-#else
-void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
-{
-       rdmsr(msr_no, *l, *h);
-}
-
-void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
-{
-       wrmsr(msr_no, l, h);
-}
-#endif
 
 EXPORT_SYMBOL(rdmsr_on_cpu);
 EXPORT_SYMBOL(wrmsr_on_cpu);
index 0a43f07b0290a0dce92fa137357b93981a5b6fb6..43d051ff1fb42ec82195c3b82d81c89d469fd733 100644 (file)
@@ -4,7 +4,8 @@
 
 CFLAGS_csum-partial.o := -funroll-loops
 
-obj-y := io.o iomap_copy.o msr-on-cpu.o
+obj-y := io.o iomap_copy.o
+obj-$(CONFIG_SMP)      += msr-on-cpu.o
 
 lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \
        usercopy.o getuser.o putuser.o  \
index 3516a1fb38e06404b9a381c976b4b3a3cd834975..8c35f3d90a89cfa80684e9d24d2a8c96fecf4745 100644 (file)
@@ -83,8 +83,19 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val)
                          : "c" (counter))
 #endif /* !CONFIG_PARAVIRT */
 
+#ifdef CONFIG_SMP
 void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
 void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
+#else  /*  CONFIG_SMP  */
+static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
+{
+       rdmsr(msr_no, *l, *h);
+}
+static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
+{
+       wrmsr(msr_no, l, h);
+}
+#endif  /*  CONFIG_SMP  */
 
 /* symbolic names for some interesting MSRs */
 /* Intel defined MSRs. */
index 995a2b5fb26bc5da4cec5fe92e44369cfb501f9d..902f9a58617e66ddd912ecac3555a526eb9123b4 100644 (file)
@@ -160,8 +160,19 @@ static inline unsigned int cpuid_edx(unsigned int op)
 #define MSR_IA32_UCODE_WRITE           0x79
 #define MSR_IA32_UCODE_REV             0x8b
 
+#ifdef CONFIG_SMP
 void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
 void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
+#else  /*  CONFIG_SMP  */
+static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
+{
+       rdmsr(msr_no, *l, *h);
+}
+static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
+{
+       wrmsr(msr_no, l, h);
+}
+#endif  /*  CONFIG_SMP  */
 
 #endif