Deleted Added
full compact
pmc_mdep.h (183033) pmc_mdep.h (184802)
1/*-
2 * Copyright (c) 2003-2005,2008 Joseph Koshy
3 * Copyright (c) 2007 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * Portions of this software were developed by A. Joseph Koshy under
7 * sponsorship from the FreeBSD Foundation and Google, Inc.
8 *

--- 13 unchanged lines hidden (view full) ---

22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
1/*-
2 * Copyright (c) 2003-2005,2008 Joseph Koshy
3 * Copyright (c) 2007 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * Portions of this software were developed by A. Joseph Koshy under
7 * sponsorship from the FreeBSD Foundation and Google, Inc.
8 *

--- 13 unchanged lines hidden (view full) ---

22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * $FreeBSD: head/sys/i386/include/pmc_mdep.h 183033 2008-09-15 06:47:52Z jkoshy $
30 * $FreeBSD: head/sys/i386/include/pmc_mdep.h 184802 2008-11-09 17:37:54Z jkoshy $
31 */
32
33#ifndef _MACHINE_PMC_MDEP_H
34#define _MACHINE_PMC_MDEP_H 1
35
31 */
32
33#ifndef _MACHINE_PMC_MDEP_H
34#define _MACHINE_PMC_MDEP_H 1
35
36#ifdef _KERNEL
37struct pmc_mdep;
38#endif
39
36/*
37 * On the i386 platform we support the following PMCs.
38 *
40/*
41 * On the i386 platform we support the following PMCs.
42 *
43 * TSC The timestamp counter
39 * K7 AMD Athlon XP/MP and other 32 bit processors.
40 * K8 AMD Athlon64 and Opteron PMCs in 32 bit mode.
41 * PIV Intel P4/HTT and P4/EMT64
42 * PPRO Intel Pentium Pro, Pentium-II, Pentium-III, Celeron and
43 * Pentium-M processors
44 * PENTIUM Intel Pentium MMX.
44 * K7 AMD Athlon XP/MP and other 32 bit processors.
45 * K8 AMD Athlon64 and Opteron PMCs in 32 bit mode.
46 * PIV Intel P4/HTT and P4/EMT64
47 * PPRO Intel Pentium Pro, Pentium-II, Pentium-III, Celeron and
48 * Pentium-M processors
49 * PENTIUM Intel Pentium MMX.
50 * IAP Intel Core/Core2/Atom programmable PMCs.
51 * IAF Intel fixed-function PMCs.
45 */
46
47#include <dev/hwpmc/hwpmc_amd.h> /* K7 and K8 */
48#include <dev/hwpmc/hwpmc_piv.h>
49#include <dev/hwpmc/hwpmc_ppro.h>
50#include <dev/hwpmc/hwpmc_pentium.h>
52 */
53
54#include <dev/hwpmc/hwpmc_amd.h> /* K7 and K8 */
55#include <dev/hwpmc/hwpmc_piv.h>
56#include <dev/hwpmc/hwpmc_ppro.h>
57#include <dev/hwpmc/hwpmc_pentium.h>
58#include <dev/hwpmc/hwpmc_tsc.h>
51
52/*
59
60/*
61 * Intel processors implementing V2 and later of the Intel performance
62 * measurement architecture have PMCs of the following classes: TSC,
63 * IAF and IAP.
64 */
65#define PMC_MDEP_CLASS_INDEX_TSC 0
66#define PMC_MDEP_CLASS_INDEX_K7 1
67#define PMC_MDEP_CLASS_INDEX_K8 1
68#define PMC_MDEP_CLASS_INDEX_P4 1
69#define PMC_MDEP_CLASS_INDEX_P5 1
70#define PMC_MDEP_CLASS_INDEX_P6 1
71#define PMC_MDEP_CLASS_INDEX_IAF 1
72#define PMC_MDEP_CLASS_INDEX_IAP 2
73
74/*
53 * Architecture specific extensions to <sys/pmc.h> structures.
54 */
55
56union pmc_md_op_pmcallocate {
57 struct pmc_md_amd_op_pmcallocate pm_amd;
58 struct pmc_md_ppro_op_pmcallocate pm_ppro;
59 struct pmc_md_pentium_op_pmcallocate pm_pentium;
60 struct pmc_md_p4_op_pmcallocate pm_p4;

--- 10 unchanged lines hidden (view full) ---

71union pmc_md_pmc {
72 struct pmc_md_amd_pmc pm_amd;
73 struct pmc_md_ppro_pmc pm_ppro;
74 struct pmc_md_pentium_pmc pm_pentium;
75 struct pmc_md_p4_pmc pm_p4;
76};
77
78struct pmc;
75 * Architecture specific extensions to <sys/pmc.h> structures.
76 */
77
78union pmc_md_op_pmcallocate {
79 struct pmc_md_amd_op_pmcallocate pm_amd;
80 struct pmc_md_ppro_op_pmcallocate pm_ppro;
81 struct pmc_md_pentium_op_pmcallocate pm_pentium;
82 struct pmc_md_p4_op_pmcallocate pm_p4;

--- 10 unchanged lines hidden (view full) ---

93union pmc_md_pmc {
94 struct pmc_md_amd_pmc pm_amd;
95 struct pmc_md_ppro_pmc pm_ppro;
96 struct pmc_md_pentium_pmc pm_pentium;
97 struct pmc_md_p4_pmc pm_p4;
98};
99
100struct pmc;
101struct pmc_mdep;
79
80#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_eip)
81#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_ebp)
82
83/*
84 * The layout of the stack frame on entry into the NMI handler depends on
85 * whether a privilege level change (and consequent stack switch) was
86 * required for entry.

--- 32 unchanged lines hidden (view full) ---

119
120/*
121 * Prototypes
122 */
123
124void start_exceptions(void), end_exceptions(void);
125void pmc_x86_lapic_enable_pmc_interrupt(void);
126
102
103#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_eip)
104#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_ebp)
105
106/*
107 * The layout of the stack frame on entry into the NMI handler depends on
108 * whether a privilege level change (and consequent stack switch) was
109 * required for entry.

--- 32 unchanged lines hidden (view full) ---

142
143/*
144 * Prototypes
145 */
146
147void start_exceptions(void), end_exceptions(void);
148void pmc_x86_lapic_enable_pmc_interrupt(void);
149
150struct pmc_mdep *pmc_amd_initialize(void);
151void pmc_amd_finalize(struct pmc_mdep *_md);
152struct pmc_mdep *pmc_intel_initialize(void);
153void pmc_intel_finalize(struct pmc_mdep *_md);
154
127#endif /* _KERNEL */
128#endif /* _MACHINE_PMC_MDEP_H */
155#endif /* _KERNEL */
156#endif /* _MACHINE_PMC_MDEP_H */