aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/include/pmc_mdep.h
diff options
context:
space:
mode:
authorJoseph Koshy <jkoshy@FreeBSD.org>2008-11-09 17:37:54 +0000
committerJoseph Koshy <jkoshy@FreeBSD.org>2008-11-09 17:37:54 +0000
commite829eb6d618d215b797c8e9b5f7e8c1ec4fc328d (patch)
tree9977abc62b812534217ab29faac7edc58cae0570 /sys/i386/include/pmc_mdep.h
parent2ad65bf421997d86f3420b0fa5edd5858344f084 (diff)
Notes
Diffstat (limited to 'sys/i386/include/pmc_mdep.h')
-rw-r--r--sys/i386/include/pmc_mdep.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/i386/include/pmc_mdep.h b/sys/i386/include/pmc_mdep.h
index de0688aa8d842..720f1f3656d7d 100644
--- a/sys/i386/include/pmc_mdep.h
+++ b/sys/i386/include/pmc_mdep.h
@@ -33,21 +33,43 @@
#ifndef _MACHINE_PMC_MDEP_H
#define _MACHINE_PMC_MDEP_H 1
+#ifdef _KERNEL
+struct pmc_mdep;
+#endif
+
/*
* On the i386 platform we support the following PMCs.
*
+ * TSC The timestamp counter
* K7 AMD Athlon XP/MP and other 32 bit processors.
* K8 AMD Athlon64 and Opteron PMCs in 32 bit mode.
* PIV Intel P4/HTT and P4/EMT64
* PPRO Intel Pentium Pro, Pentium-II, Pentium-III, Celeron and
* Pentium-M processors
* PENTIUM Intel Pentium MMX.
+ * IAP Intel Core/Core2/Atom programmable PMCs.
+ * IAF Intel fixed-function PMCs.
*/
#include <dev/hwpmc/hwpmc_amd.h> /* K7 and K8 */
#include <dev/hwpmc/hwpmc_piv.h>
#include <dev/hwpmc/hwpmc_ppro.h>
#include <dev/hwpmc/hwpmc_pentium.h>
+#include <dev/hwpmc/hwpmc_tsc.h>
+
+/*
+ * Intel processors implementing V2 and later of the Intel performance
+ * measurement architecture have PMCs of the following classes: TSC,
+ * IAF and IAP.
+ */
+#define PMC_MDEP_CLASS_INDEX_TSC 0
+#define PMC_MDEP_CLASS_INDEX_K7 1
+#define PMC_MDEP_CLASS_INDEX_K8 1
+#define PMC_MDEP_CLASS_INDEX_P4 1
+#define PMC_MDEP_CLASS_INDEX_P5 1
+#define PMC_MDEP_CLASS_INDEX_P6 1
+#define PMC_MDEP_CLASS_INDEX_IAF 1
+#define PMC_MDEP_CLASS_INDEX_IAP 2
/*
* Architecture specific extensions to <sys/pmc.h> structures.
@@ -76,6 +98,7 @@ union pmc_md_pmc {
};
struct pmc;
+struct pmc_mdep;
#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_eip)
#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_ebp)
@@ -124,5 +147,10 @@ struct pmc;
void start_exceptions(void), end_exceptions(void);
void pmc_x86_lapic_enable_pmc_interrupt(void);
+struct pmc_mdep *pmc_amd_initialize(void);
+void pmc_amd_finalize(struct pmc_mdep *_md);
+struct pmc_mdep *pmc_intel_initialize(void);
+void pmc_intel_finalize(struct pmc_mdep *_md);
+
#endif /* _KERNEL */
#endif /* _MACHINE_PMC_MDEP_H */