]> git.wh0rd.org Git - patches.git/blob - linux-x86_64-msr-asm-volatile.patch
scummvm random work
[patches.git] / linux-x86_64-msr-asm-volatile.patch
1 diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h
2 index d5c55b8..ed15d2b 100644
3 --- a/include/asm-x86_64/msr.h
4 +++ b/include/asm-x86_64/msr.h
5 @@ -33,7 +33,7 @@
6  
7  /* wrmsr with exception handling */
8  #define wrmsr_safe(msr,a,b) ({ int ret__;                      \
9 -       asm volatile("2: wrmsr ; xorl %0,%0\n"                  \
10 +       __asm__ __volatile__("2: wrmsr ; xorl %0,%0\n"                  \
11                      "1:\n\t"                                   \
12                      ".section .fixup,\"ax\"\n\t"               \
13                      "3:  movl %4,%0 ; jmp 1b\n\t"              \
14 @@ -50,7 +50,7 @@
15  
16  #define rdmsr_safe(msr,a,b) \
17         ({ int ret__;                                           \
18 -         asm volatile ("1:       rdmsr\n"                      \
19 +         __asm__ __volatile__ ("1:       rdmsr\n"                      \
20                        "2:\n"                                   \
21                        ".section .fixup,\"ax\"\n"               \
22                        "3:       movl %4,%0\n"                  \
23 @@ -70,17 +70,17 @@
24       __asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx")
25  
26  #define rdtscp(low,high,aux) \
27 -     asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))
28 +     __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))
29  
30  #define rdtscll(val) do { \
31       unsigned int __a,__d; \
32 -     asm volatile("rdtsc" : "=a" (__a), "=d" (__d)); \
33 +     __asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d)); \
34       (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \
35  } while(0)
36  
37  #define rdtscpll(val, aux) do { \
38       unsigned long __a, __d; \
39 -     asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \
40 +     __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \
41       (val) = (__d << 32) | __a; \
42  } while (0)
43