]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-x86/msr.h
[SPARC]: Merge include/asm-sparc{,64}/prom.h
[linux-2.6-omap-h63xx.git] / include / asm-x86 / msr.h
index 040d3910d8919b9c4dd87514a56c0f8aba1024e3..3ca29ebebbb18dd8f7547eab749a94f0ce157874 100644 (file)
@@ -13,7 +13,7 @@
 #include <asm/asm.h>
 #include <asm/errno.h>
 
-static inline unsigned long long native_read_tscp(int *aux)
+static inline unsigned long long native_read_tscp(unsigned int *aux)
 {
        unsigned long low, high;
        asm volatile (".byte 0x0f,0x01,0xf9"
@@ -57,10 +57,7 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr,
                     ".section .fixup,\"ax\"\n\t"
                     "3:  mov %3,%0 ; jmp 1b\n\t"
                     ".previous\n\t"
-                    ".section __ex_table,\"a\"\n"
-                    _ASM_ALIGN "\n\t"
-                    _ASM_PTR " 2b,3b\n\t"
-                    ".previous"
+                    _ASM_EXTABLE(2b,3b)
                     : "=r" (*err), EAX_EDX_RET(val, low, high)
                     : "c" (msr), "i" (-EFAULT));
        return EAX_EDX_VAL(val, low, high);
@@ -81,21 +78,23 @@ static inline int native_write_msr_safe(unsigned int msr,
                     ".section .fixup,\"ax\"\n\t"
                     "3:  mov %4,%0 ; jmp 1b\n\t"
                     ".previous\n\t"
-                    ".section __ex_table,\"a\"\n"
-                    _ASM_ALIGN "\n\t"
-                    _ASM_PTR " 2b,3b\n\t"
-                    ".previous"
+                    _ASM_EXTABLE(2b,3b)
                     : "=a" (err)
                     : "c" (msr), "0" (low), "d" (high),
                       "i" (-EFAULT));
        return err;
 }
 
-static inline unsigned long long native_read_tsc(void)
+extern unsigned long long native_read_tsc(void);
+
+static __always_inline unsigned long long __native_read_tsc(void)
 {
        DECLARE_ARGS(val, low, high);
 
+       rdtsc_barrier();
        asm volatile("rdtsc" : EAX_EDX_RET(val, low, high));
+       rdtsc_barrier();
+
        return EAX_EDX_VAL(val, low, high);
 }
 
@@ -157,8 +156,6 @@ static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high)
 #define rdtscll(val)                                           \
        ((val) = native_read_tsc())
 
-#define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
-
 #define rdpmc(counter,low,high)                                        \
        do {                                                    \
                u64 _l = native_read_pmc(counter);              \