Commit 1ff4d58a authored by Andi Kleen's avatar Andi Kleen Committed by Ingo Molnar

x86: Add rdpmcl()

Add a version of rdpmc() that directly reads into a u64
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1338944211-28275-4-git-send-email-andi@firstfloor.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 1c2ac3fd
...@@ -237,6 +237,8 @@ do { \ ...@@ -237,6 +237,8 @@ do { \
(high) = (u32)(_l >> 32); \ (high) = (u32)(_l >> 32); \
} while (0) } while (0)
#define rdpmcl(counter, val) ((val) = native_read_pmc(counter))
#define rdtscp(low, high, aux) \ #define rdtscp(low, high, aux) \
do { \ do { \
unsigned long long _val = native_read_tscp(&(aux)); \ unsigned long long _val = native_read_tscp(&(aux)); \
......
...@@ -252,6 +252,8 @@ do { \ ...@@ -252,6 +252,8 @@ do { \
high = _l >> 32; \ high = _l >> 32; \
} while (0) } while (0)
#define rdpmcl(counter, val) ((val) = paravirt_read_pmc(counter))
static inline unsigned long long paravirt_rdtscp(unsigned int *aux) static inline unsigned long long paravirt_rdtscp(unsigned int *aux)
{ {
return PVOP_CALL1(u64, pv_cpu_ops.read_tscp, aux); return PVOP_CALL1(u64, pv_cpu_ops.read_tscp, aux);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment