Skip to content

Commit

Permalink
x86: Add rdpmcl()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andi Kleen authored and Ingo Molnar committed Jun 6, 2012
1 parent 1c2ac3f commit 1ff4d58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/include/asm/msr.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ do { \
(high) = (u32)(_l >> 32); \
} while (0)

#define rdpmcl(counter, val) ((val) = native_read_pmc(counter))

#define rdtscp(low, high, aux) \
do { \
unsigned long long _val = native_read_tscp(&(aux)); \
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/include/asm/paravirt.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ do { \
high = _l >> 32; \
} while (0)

#define rdpmcl(counter, val) ((val) = paravirt_read_pmc(counter))

static inline unsigned long long paravirt_rdtscp(unsigned int *aux)
{
return PVOP_CALL1(u64, pv_cpu_ops.read_tscp, aux);
Expand Down

0 comments on commit 1ff4d58

Please sign in to comment.