aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/oprofile/op_x86_model.h
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2009-05-25 09:05:50 -0400
committerRobert Richter <robert.richter@amd.com>2009-06-11 13:42:13 -0400
commitec064c093e254f4433afb17dcef7f964c76436af (patch)
treeaba3e4a8725219a17c160989e85b5b5f59df3a2b /arch/x86/oprofile/op_x86_model.h
parent1131a478245b00664ae2dbc0f68db987b51fa806 (diff)
x86/oprofile: fix and cleanup CTRL_SET_* macros
This patch fixes missing braces around macro parameters. Macro definitions from intel_arch_perfmon.h are used where possible. 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.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/x86/oprofile/op_x86_model.h b/arch/x86/oprofile/op_x86_model.h
index c80ec7d09993..a207b1c46e26 100644
--- a/arch/x86/oprofile/op_x86_model.h
+++ b/arch/x86/oprofile/op_x86_model.h
@@ -11,14 +11,16 @@
11#ifndef OP_X86_MODEL_H 11#ifndef OP_X86_MODEL_H
12#define OP_X86_MODEL_H 12#define OP_X86_MODEL_H
13 13
14#define CTR_IS_RESERVED(msrs, c) (msrs->counters[(c)].addr ? 1 : 0) 14#include <asm/intel_arch_perfmon.h>
15#define CTRL_IS_RESERVED(msrs, c) (msrs->controls[(c)].addr ? 1 : 0) 15
16#define CTRL_SET_ACTIVE(n) (n |= (1<<22)) 16#define CTR_IS_RESERVED(msrs, c) ((msrs)->counters[(c)].addr ? 1 : 0)
17#define CTRL_SET_ENABLE(val) (val |= 1<<20) 17#define CTRL_IS_RESERVED(msrs, c) ((msrs)->controls[(c)].addr ? 1 : 0)
18#define CTRL_SET_INACTIVE(n) (n &= ~(1<<22)) 18#define CTRL_SET_ACTIVE(val) ((val) |= ARCH_PERFMON_EVENTSEL0_ENABLE)
19#define CTRL_SET_KERN(val, k) (val |= ((k & 1) << 17)) 19#define CTRL_SET_ENABLE(val) ((val) |= ARCH_PERFMON_EVENTSEL_INT)
20#define CTRL_SET_UM(val, m) (val |= (m << 8)) 20#define CTRL_SET_INACTIVE(val) ((val) &= ~ARCH_PERFMON_EVENTSEL0_ENABLE)
21#define CTRL_SET_USR(val, u) (val |= ((u & 1) << 16)) 21#define CTRL_SET_KERN(val, k) ((val) |= ((k) ? ARCH_PERFMON_EVENTSEL_OS : 0))
22#define CTRL_SET_USR(val, u) ((val) |= ((u) ? ARCH_PERFMON_EVENTSEL_USR : 0))
23#define CTRL_SET_UM(val, m) ((val) |= ((m) << 8))
22 24
23struct op_saved_msr { 25struct op_saved_msr {
24 unsigned int high; 26 unsigned int high;