summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/pmc_mdep.h
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2005-06-09 19:45:09 +0000
committerjkoshy <jkoshy@FreeBSD.org>2005-06-09 19:45:09 +0000
commit1d3209ab83aac3089f15e00934e922d222a4ecf0 (patch)
tree4970329c2802c6329dd4f6e781d84b27dbf8f412 /sys/amd64/include/pmc_mdep.h
parent4421a087425df7cc08a5671152d0ec7410bdb33e (diff)
downloadFreeBSD-src-1d3209ab83aac3089f15e00934e922d222a4ecf0.zip
FreeBSD-src-1d3209ab83aac3089f15e00934e922d222a4ecf0.tar.gz
MFP4:
- Implement sampling modes and logging support in hwpmc(4). - Separate MI and MD parts of hwpmc(4) and allow sharing of PMC implementations across different architectures. Add support for P4 (EMT64) style PMCs to the amd64 code. - New pmcstat(8) options: -E (exit time counts) -W (counts every context switch), -R (print log file). - pmc(3) API changes, improve our ability to keep ABI compatibility in the future. Add more 'alias' names for commonly used events. - bug fixes & documentation.
Diffstat (limited to 'sys/amd64/include/pmc_mdep.h')
-rw-r--r--sys/amd64/include/pmc_mdep.h51
1 files changed, 19 insertions, 32 deletions
diff --git a/sys/amd64/include/pmc_mdep.h b/sys/amd64/include/pmc_mdep.h
index 19082ba..4a67658 100644
--- a/sys/amd64/include/pmc_mdep.h
+++ b/sys/amd64/include/pmc_mdep.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003, Joseph Koshy
+ * Copyright (c) 2003-2005 Joseph Koshy
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,46 +31,33 @@
#ifndef _MACHINE_PMC_MDEP_H
#define _MACHINE_PMC_MDEP_H 1
-#include <machine/specialreg.h>
+#include <dev/hwpmc/hwpmc_amd.h>
+#include <dev/hwpmc/hwpmc_piv.h>
-/* AMD K7 PMCs */
+union pmc_md_op_pmcallocate {
+ struct pmc_md_amd_op_pmcallocate pm_amd;
+ struct pmc_md_p4_op_pmcallocate pm_p4;
+ uint64_t __pad[4];
+};
-#define K8_NPMCS 5 /* 1 TSC + 4 PMCs */
+/* Logging */
+#define PMCLOG_READADDR PMCLOG_READ64
+#define PMCLOG_EMITADDR PMCLOG_EMIT64
-#define K8_PMC_COUNTERMASK 0xFF000000
-#define K8_PMC_TO_COUNTER(x) (((x) << 24) & K8_PMC_COUNTERMASK)
-#define K8_PMC_INVERT (1 << 23)
-#define K8_PMC_ENABLE (1 << 22)
-#define K8_PMC_INT (1 << 20)
-#define K8_PMC_PC (1 << 19)
-#define K8_PMC_EDGE (1 << 18)
-#define K8_PMC_OS (1 << 17)
-#define K8_PMC_USR (1 << 16)
+#ifdef _KERNEL
-#define K8_PMC_UNITMASK_M 0x10
-#define K8_PMC_UNITMASK_O 0x08
-#define K8_PMC_UNITMASK_E 0x04
-#define K8_PMC_UNITMASK_S 0x02
-#define K8_PMC_UNITMASK_I 0x01
-#define K8_PMC_UNITMASK_MOESI 0x1F
+union pmc_md_pmc {
+ struct pmc_md_amd_pmc pm_amd;
+ struct pmc_md_p4_pmc pm_p4;
+};
-#define K8_PMC_UNITMASK 0xFF00
-#define K8_PMC_EVENTMASK 0x00FF
-#define K8_PMC_TO_UNITMASK(x) (((x) << 8) & K8_PMC_UNITMASK)
-#define K8_PMC_TO_EVENTMASK(x) ((x) & 0xFF)
-#define K8_VALID_BITS (K8_PMC_COUNTERMASK | K8_PMC_INVERT | \
- K8_PMC_ENABLE | K8_PMC_INT | K8_PMC_PC | K8_PMC_EDGE | K8_PMC_OS | \
- K8_PMC_USR | K8_PMC_UNITMASK | K8_PMC_EVENTMASK)
-
-#ifdef _KERNEL
+struct pmc;
/*
* Prototypes
*/
-#if defined(__amd64__)
-struct pmc_mdep *pmc_amd_initialize(void);
-#endif /* defined(__i386__) */
+void pmc_x86_lapic_enable_pmc_interrupt(void);
-#endif /* _KERNEL */
+#endif
#endif /* _MACHINE_PMC_MDEP_H */
OpenPOWER on IntegriCloud