aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/oprofile/op_x86_model.h
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2009-05-22 15:36:29 +0200
committerRobert Richter <robert.richter@amd.com>2009-06-11 19:42:10 +0200
commitff9faa8b676e195476b86f03fe58db0f01bda8f3 (patch)
tree485f0910929930536dfabf5d6829365e629440a3 /arch/x86/oprofile/op_x86_model.h
parentd20f24c66011f8a397bca6c5d1a6a7c7e612d2d7 (diff)
x86/oprofile: move common macros to op_x86_model.h
There are duplicate macro implementations in model specific code. This patch moves all common macros to op_x86_model.h. Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile/op_x86_model.h')
-rw-r--r--arch/x86/oprofile/op_x86_model.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/oprofile/op_x86_model.h b/arch/x86/oprofile/op_x86_model.h
index bd8157d12ff..c80ec7d0999 100644
--- a/arch/x86/oprofile/op_x86_model.h
+++ b/arch/x86/oprofile/op_x86_model.h
@@ -11,6 +11,15 @@
#ifndef OP_X86_MODEL_H
#define OP_X86_MODEL_H
+#define CTR_IS_RESERVED(msrs, c) (msrs->counters[(c)].addr ? 1 : 0)
+#define CTRL_IS_RESERVED(msrs, c) (msrs->controls[(c)].addr ? 1 : 0)
+#define CTRL_SET_ACTIVE(n) (n |= (1<<22))
+#define CTRL_SET_ENABLE(val) (val |= 1<<20)
+#define CTRL_SET_INACTIVE(n) (n &= ~(1<<22))
+#define CTRL_SET_KERN(val, k) (val |= ((k & 1) << 17))
+#define CTRL_SET_UM(val, m) (val |= (m << 8))
+#define CTRL_SET_USR(val, u) (val |= ((u & 1) << 16))
+
struct op_saved_msr {
unsigned int high;
unsigned int low;