diff options
author | Andi Kleen <ak@linux.intel.com> | 2012-06-05 20:56:50 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-06-06 11:23:27 -0400 |
commit | 1ff4d58a192aea7f245981e2579765f961f6eb9c (patch) | |
tree | d925939440c4c36bf6f46d5aeb4eb609c4f3038f | |
parent | 1c2ac3fde3e35279958e7b0408e2dcf866465301 (diff) |
x86: Add rdpmcl()
Add a version of rdpmc() that directly reads into a u64
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1338944211-28275-4-git-send-email-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/msr.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/paravirt.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index 084ef95274cd..e489c1475be9 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h | |||
@@ -237,6 +237,8 @@ do { \ | |||
237 | (high) = (u32)(_l >> 32); \ | 237 | (high) = (u32)(_l >> 32); \ |
238 | } while (0) | 238 | } while (0) |
239 | 239 | ||
240 | #define rdpmcl(counter, val) ((val) = native_read_pmc(counter)) | ||
241 | |||
240 | #define rdtscp(low, high, aux) \ | 242 | #define rdtscp(low, high, aux) \ |
241 | do { \ | 243 | do { \ |
242 | unsigned long long _val = native_read_tscp(&(aux)); \ | 244 | unsigned long long _val = native_read_tscp(&(aux)); \ |
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 6cbbabf52707..14ce05dfe04e 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h | |||
@@ -252,6 +252,8 @@ do { \ | |||
252 | high = _l >> 32; \ | 252 | high = _l >> 32; \ |
253 | } while (0) | 253 | } while (0) |
254 | 254 | ||
255 | #define rdpmcl(counter, val) ((val) = paravirt_read_pmc(counter)) | ||
256 | |||
255 | static inline unsigned long long paravirt_rdtscp(unsigned int *aux) | 257 | static inline unsigned long long paravirt_rdtscp(unsigned int *aux) |
256 | { | 258 | { |
257 | return PVOP_CALL1(u64, pv_cpu_ops.read_tscp, aux); | 259 | return PVOP_CALL1(u64, pv_cpu_ops.read_tscp, aux); |