diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:07 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:07 -0500 |
commit | b8d1fae7dbde6a1227fa142acecb48dc3dd63817 (patch) | |
tree | 1fdc67fe977cf6c351ed41d5fdaa46fa97aba776 /include/asm-x86/msr.h | |
parent | 8f12dea6135d0a55b151dcb4c6bbe211f5f8d35d (diff) |
x86: change rdpmc interface
the rdpmc instruction gets a counter argument in rcx. However,
the i386 version was ignoring it. To make both x86_64 and i386 versions
the same, as well as to comply with the instruction semantics, this
parameter is added in the i386 version
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/msr.h')
-rw-r--r-- | include/asm-x86/msr.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h index b6262e99fc8e..effb7319c0a5 100644 --- a/include/asm-x86/msr.h +++ b/include/asm-x86/msr.h | |||
@@ -94,10 +94,10 @@ static inline unsigned long long native_read_tsc(void) | |||
94 | return val; | 94 | return val; |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline unsigned long long native_read_pmc(void) | 97 | static inline unsigned long long native_read_pmc(int counter) |
98 | { | 98 | { |
99 | unsigned long long val; | 99 | unsigned long long val; |
100 | asm volatile("rdpmc" : "=A" (val)); | 100 | asm volatile("rdpmc" : "=A" (val) : "c" (counter)); |
101 | return val; | 101 | return val; |
102 | } | 102 | } |
103 | 103 | ||
@@ -154,7 +154,7 @@ static inline int wrmsr_safe(u32 __msr, u32 __low, u32 __high) | |||
154 | 154 | ||
155 | #define rdpmc(counter,low,high) \ | 155 | #define rdpmc(counter,low,high) \ |
156 | do { \ | 156 | do { \ |
157 | u64 _l = native_read_pmc(); \ | 157 | u64 _l = native_read_pmc(counter); \ |
158 | (low) = (u32)_l; \ | 158 | (low) = (u32)_l; \ |
159 | (high) = (u32)(_l >> 32); \ | 159 | (high) = (u32)(_l >> 32); \ |
160 | } while(0) | 160 | } while(0) |