Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86

* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
x86: fix asm-x86/msr.h for user-space export
x86: fix asm-x86/byteorder.h for userspace export

+41 -37
+2 -2
include/asm-x86/byteorder.h
··· 30 30 } v; 31 31 v.u = val; 32 32 #ifdef CONFIG_X86_BSWAP 33 - asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1" 33 + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" 34 34 : "=r" (v.s.a), "=r" (v.s.b) 35 35 : "0" (v.s.a), "1" (v.s.b)); 36 36 #else 37 37 v.s.a = ___arch__swab32(v.s.a); 38 38 v.s.b = ___arch__swab32(v.s.b); 39 - asm("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b)); 39 + __asm__("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b)); 40 40 #endif 41 41 return v.u; 42 42 }
+39 -35
include/asm-x86/msr.h
··· 191 191 192 192 #define wrmsrl(msr,val) wrmsr(msr,(__u32)((__u64)(val)),((__u64)(val))>>32) 193 193 194 - /* wrmsr with exception handling */ 195 - #define wrmsr_safe(msr,a,b) ({ int ret__; \ 196 - asm volatile("2: wrmsr ; xorl %0,%0\n" \ 197 - "1:\n\t" \ 198 - ".section .fixup,\"ax\"\n\t" \ 199 - "3: movl %4,%0 ; jmp 1b\n\t" \ 200 - ".previous\n\t" \ 201 - ".section __ex_table,\"a\"\n" \ 202 - " .align 8\n\t" \ 203 - " .quad 2b,3b\n\t" \ 204 - ".previous" \ 205 - : "=a" (ret__) \ 206 - : "c" (msr), "0" (a), "d" (b), "i" (-EFAULT)); \ 207 - ret__; }) 208 - 209 - #define checking_wrmsrl(msr,val) wrmsr_safe(msr,(u32)(val),(u32)((val)>>32)) 210 - 211 - #define rdmsr_safe(msr,a,b) \ 212 - ({ int ret__; \ 213 - asm volatile ("1: rdmsr\n" \ 214 - "2:\n" \ 215 - ".section .fixup,\"ax\"\n" \ 216 - "3: movl %4,%0\n" \ 217 - " jmp 2b\n" \ 218 - ".previous\n" \ 219 - ".section __ex_table,\"a\"\n" \ 220 - " .align 8\n" \ 221 - " .quad 1b,3b\n" \ 222 - ".previous":"=&bDS" (ret__), "=a"(*(a)), "=d"(*(b)) \ 223 - :"c"(msr), "i"(-EIO), "0"(0)); \ 224 - ret__; }) 225 - 226 194 #define rdtsc(low,high) \ 227 195 __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) 228 196 ··· 198 230 __asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx") 199 231 200 232 #define rdtscp(low,high,aux) \ 201 - asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux)) 233 + __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux)) 202 234 203 235 #define rdtscll(val) do { \ 204 236 unsigned int __a,__d; \ 205 - asm volatile("rdtsc" : "=a" (__a), "=d" (__d)); \ 237 + __asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d)); \ 206 238 (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \ 207 239 } while(0) 208 240 209 241 #define rdtscpll(val, aux) do { \ 210 242 unsigned long __a, __d; \ 211 - asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \ 243 + __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \ 212 244 (val) = (__d << 32) | __a; \ 213 245 } while (0) 214 246 ··· 220 252 __asm__ __volatile__("rdpmc" \ 221 253 : "=a" (low), "=d" (high) \ 222 254 : "c" (counter)) 255 + 223 256 224 257 static inline void cpuid(int op, unsigned int *eax, unsigned int *ebx, 225 258 unsigned int *ecx, unsigned int *edx) ··· 289 320 return edx; 290 321 } 291 322 323 + #ifdef __KERNEL__ 324 + 325 + /* wrmsr with exception handling */ 326 + #define wrmsr_safe(msr,a,b) ({ int ret__; \ 327 + asm volatile("2: wrmsr ; xorl %0,%0\n" \ 328 + "1:\n\t" \ 329 + ".section .fixup,\"ax\"\n\t" \ 330 + "3: movl %4,%0 ; jmp 1b\n\t" \ 331 + ".previous\n\t" \ 332 + ".section __ex_table,\"a\"\n" \ 333 + " .align 8\n\t" \ 334 + " .quad 2b,3b\n\t" \ 335 + ".previous" \ 336 + : "=a" (ret__) \ 337 + : "c" (msr), "0" (a), "d" (b), "i" (-EFAULT)); \ 338 + ret__; }) 339 + 340 + #define checking_wrmsrl(msr,val) wrmsr_safe(msr,(u32)(val),(u32)((val)>>32)) 341 + 342 + #define rdmsr_safe(msr,a,b) \ 343 + ({ int ret__; \ 344 + asm volatile ("1: rdmsr\n" \ 345 + "2:\n" \ 346 + ".section .fixup,\"ax\"\n" \ 347 + "3: movl %4,%0\n" \ 348 + " jmp 2b\n" \ 349 + ".previous\n" \ 350 + ".section __ex_table,\"a\"\n" \ 351 + " .align 8\n" \ 352 + " .quad 1b,3b\n" \ 353 + ".previous":"=&bDS" (ret__), "=a"(*(a)), "=d"(*(b)) \ 354 + :"c"(msr), "i"(-EIO), "0"(0)); \ 355 + ret__; }) 356 + 292 357 #ifdef CONFIG_SMP 293 358 void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 294 359 void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); ··· 346 343 return wrmsr_safe(msr_no, l, h); 347 344 } 348 345 #endif /* CONFIG_SMP */ 346 + #endif /* __KERNEL__ */ 349 347 #endif /* __ASSEMBLY__ */ 350 348 351 349 #endif /* !__i386__ */