x86/oprofile: replace CTR*_IS_RESERVED macros
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / x86 / oprofile / op_x86_model.h
blob69f1eb46e1b31edfd3d6f74b6240ed88eca9335f
1 /**
2 * @file op_x86_model.h
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>
18 struct op_saved_msr {
19 unsigned int high;
20 unsigned int low;
23 struct op_msr {
24 unsigned long addr;
25 struct op_saved_msr saved;
28 struct op_msrs {
29 struct op_msr *counters;
30 struct op_msr *controls;
33 struct pt_regs;
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;
43 u64 reserved;
44 u16 event_mask;
45 int (*init)(struct oprofile_operations *ops);
46 void (*exit)(void);
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 */