diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-09-08 05:39:55 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-08 05:39:55 -0400 |
commit | c324b44c34050cf2a9b58830e11c974806bd85d8 (patch) | |
tree | 3ac45a783221283925cd698334a8f5e7dd4c1df8 /include/asm-i386/msr.h | |
parent | 2fcf522509cceea524b6e7ece8fd6759b682175a (diff) | |
parent | caf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'include/asm-i386/msr.h')
-rw-r--r-- | include/asm-i386/msr.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h index c76fce8badbb..62b76cd96957 100644 --- a/include/asm-i386/msr.h +++ b/include/asm-i386/msr.h | |||
@@ -47,6 +47,21 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val) | |||
47 | : "c" (msr), "0" (a), "d" (b), "i" (-EFAULT));\ | 47 | : "c" (msr), "0" (a), "d" (b), "i" (-EFAULT));\ |
48 | ret__; }) | 48 | ret__; }) |
49 | 49 | ||
50 | /* rdmsr with exception handling */ | ||
51 | #define rdmsr_safe(msr,a,b) ({ int ret__; \ | ||
52 | asm volatile("2: rdmsr ; xorl %0,%0\n" \ | ||
53 | "1:\n\t" \ | ||
54 | ".section .fixup,\"ax\"\n\t" \ | ||
55 | "3: movl %4,%0 ; jmp 1b\n\t" \ | ||
56 | ".previous\n\t" \ | ||
57 | ".section __ex_table,\"a\"\n" \ | ||
58 | " .align 4\n\t" \ | ||
59 | " .long 2b,3b\n\t" \ | ||
60 | ".previous" \ | ||
61 | : "=r" (ret__), "=a" (*(a)), "=d" (*(b)) \ | ||
62 | : "c" (msr), "i" (-EFAULT));\ | ||
63 | ret__; }) | ||
64 | |||
50 | #define rdtsc(low,high) \ | 65 | #define rdtsc(low,high) \ |
51 | __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) | 66 | __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) |
52 | 67 | ||