aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/msr.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-09-22 07:08:57 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-22 07:08:57 -0400
commit0b88641f1bafdbd087d5e63987a30cc0eadd63b9 (patch)
tree81dcf756db373444140bb2623584710c628e3048 /include/asm-x86/msr.h
parentfbdbf709938d155c719c76b9894d28342632c797 (diff)
parent72d31053f62c4bc464c2783974926969614a8649 (diff)
Merge commit 'v2.6.27-rc7' into x86/debug
Diffstat (limited to 'include/asm-x86/msr.h')
-rw-r--r--include/asm-x86/msr.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h
index a30e586df933..771bcb2f8d80 100644
--- a/include/asm-x86/msr.h
+++ b/include/asm-x86/msr.h
@@ -52,14 +52,14 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr,
52{ 52{
53 DECLARE_ARGS(val, low, high); 53 DECLARE_ARGS(val, low, high);
54 54
55 asm volatile("2: rdmsr ; xor %0,%0\n" 55 asm volatile("2: rdmsr ; xor %[err],%[err]\n"
56 "1:\n\t" 56 "1:\n\t"
57 ".section .fixup,\"ax\"\n\t" 57 ".section .fixup,\"ax\"\n\t"
58 "3: mov %3,%0 ; jmp 1b\n\t" 58 "3: mov %[fault],%[err] ; jmp 1b\n\t"
59 ".previous\n\t" 59 ".previous\n\t"
60 _ASM_EXTABLE(2b, 3b) 60 _ASM_EXTABLE(2b, 3b)
61 : "=r" (*err), EAX_EDX_RET(val, low, high) 61 : [err] "=r" (*err), EAX_EDX_RET(val, low, high)
62 : "c" (msr), "i" (-EFAULT)); 62 : "c" (msr), [fault] "i" (-EFAULT));
63 return EAX_EDX_VAL(val, low, high); 63 return EAX_EDX_VAL(val, low, high);
64} 64}
65 65
@@ -89,15 +89,15 @@ static inline int native_write_msr_safe(unsigned int msr,
89 unsigned low, unsigned high) 89 unsigned low, unsigned high)
90{ 90{
91 int err; 91 int err;
92 asm volatile("2: wrmsr ; xor %0,%0\n" 92 asm volatile("2: wrmsr ; xor %[err],%[err]\n"
93 "1:\n\t" 93 "1:\n\t"
94 ".section .fixup,\"ax\"\n\t" 94 ".section .fixup,\"ax\"\n\t"
95 "3: mov %4,%0 ; jmp 1b\n\t" 95 "3: mov %[fault],%[err] ; jmp 1b\n\t"
96 ".previous\n\t" 96 ".previous\n\t"
97 _ASM_EXTABLE(2b, 3b) 97 _ASM_EXTABLE(2b, 3b)
98 : "=a" (err) 98 : [err] "=a" (err)
99 : "c" (msr), "0" (low), "d" (high), 99 : "c" (msr), "0" (low), "d" (high),
100 "i" (-EFAULT) 100 [fault] "i" (-EFAULT)
101 : "memory"); 101 : "memory");
102 return err; 102 return err;
103} 103}
@@ -215,19 +215,20 @@ do { \
215#define write_rdtscp_aux(val) wrmsr(0xc0000103, (val), 0) 215#define write_rdtscp_aux(val) wrmsr(0xc0000103, (val), 0)
216 216
217#ifdef CONFIG_SMP 217#ifdef CONFIG_SMP
218void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 218int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
219void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 219int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
220int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 220int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
221
222int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 221int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
223#else /* CONFIG_SMP */ 222#else /* CONFIG_SMP */
224static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) 223static inline int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
225{ 224{
226 rdmsr(msr_no, *l, *h); 225 rdmsr(msr_no, *l, *h);
226 return 0;
227} 227}
228static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) 228static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
229{ 229{
230 wrmsr(msr_no, l, h); 230 wrmsr(msr_no, l, h);
231 return 0;
231} 232}
232static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, 233static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no,
233 u32 *l, u32 *h) 234 u32 *l, u32 *h)