3 * interface to x86 model-specific MSR operations
5 * @remark Copyright 2002 OProfile authors
6 * @remark Read the file COPYING
8 * @author Graydon Hoare
9 * @author Robert Richter <robert.richter@amd.com>
12 #ifndef OP_X86_MODEL_H
13 #define OP_X86_MODEL_H
15 #include <asm/types.h>
16 #include <asm/intel_arch_perfmon.h>
25 struct op_saved_msr saved
;
29 struct op_msr
*counters
;
30 struct op_msr
*controls
;
35 struct oprofile_operations
;
37 /* The model vtable abstracts the differences between
38 * various x86 CPU models' perfctr support.
40 struct op_x86_model_spec
{
41 unsigned int num_counters
;
42 unsigned int num_controls
;
45 int (*init
)(struct oprofile_operations
*ops
);
47 void (*fill_in_addresses
)(struct op_msrs
* const msrs
);
48 void (*setup_ctrs
)(struct op_x86_model_spec
const *model
,
49 struct op_msrs
const * const msrs
);
50 int (*check_ctrs
)(struct pt_regs
* const regs
,
51 struct op_msrs
const * const msrs
);
52 void (*start
)(struct op_msrs
const * const msrs
);
53 void (*stop
)(struct op_msrs
const * const msrs
);
54 void (*shutdown
)(struct op_msrs
const * const msrs
);
57 struct op_counter_config
;
59 extern u64
op_x86_get_ctrl(struct op_x86_model_spec
const *model
,
60 struct op_counter_config
*counter_config
);
62 extern struct op_x86_model_spec
const op_ppro_spec
;
63 extern struct op_x86_model_spec
const op_p4_spec
;
64 extern struct op_x86_model_spec
const op_p4_ht2_spec
;
65 extern struct op_x86_model_spec
const op_amd_spec
;
66 extern struct op_x86_model_spec op_arch_perfmon_spec
;
68 #endif /* OP_X86_MODEL_H */