diff options
author | Andi Kleen <andi@firstfloor.org> | 2008-03-22 10:59:28 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 17:41:30 +0200 |
commit | 1de87bd40e119d26533b5135677901990390bfa9 (patch) | |
tree | 862877f6e54993a9067fffc0d545e75697a8184e /include/asm-x86/msr.h | |
parent | x86: don't use large pages to map the first 2/4MB of memory (diff) | |
download | linux-1de87bd40e119d26533b5135677901990390bfa9.tar.xz linux-1de87bd40e119d26533b5135677901990390bfa9.zip |
x86: re-add rdmsrl_safe
RDMSR for 64bit values with exception handling.
Makes it easier to deal with 64bit valued MSRs. The old 64bit code
base had that too as checking_rdmsrl(), but it got dropped somehow.
Signed-off-by: Andi Kleen <andi@firstfloor.org>
Cc: andreas.herrmann3@amd.com
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/msr.h')
-rw-r--r-- | include/asm-x86/msr.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h index 2c698a2e81f9..3707650a169b 100644 --- a/include/asm-x86/msr.h +++ b/include/asm-x86/msr.h @@ -150,6 +150,14 @@ static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high) __err; \ }) +static inline int rdmsrl_safe(unsigned msr, unsigned long long *p) +{ + int err; + + *p = native_read_msr_safe(msr, &err); + return err; +} + #define rdtscl(low) \ ((low) = (u32)native_read_tsc()) |