pmc_mdep.h (196224) | pmc_mdep.h (206089) |
---|---|
1/*- 2 * Copyright (c) 2003-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-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/amd64/include/pmc_mdep.h 196224 2009-08-14 21:05:08Z jhb $ | 30 * $FreeBSD: head/sys/amd64/include/pmc_mdep.h 206089 2010-04-02 13:23:49Z fabient $ |
31 */ 32 33/* Machine dependent interfaces */ 34 35#ifndef _MACHINE_PMC_MDEP_H 36#define _MACHINE_PMC_MDEP_H 1 37 38#ifdef _KERNEL 39struct pmc_mdep; 40#endif 41 42#include <dev/hwpmc/hwpmc_amd.h> 43#include <dev/hwpmc/hwpmc_core.h> 44#include <dev/hwpmc/hwpmc_piv.h> 45#include <dev/hwpmc/hwpmc_tsc.h> | 31 */ 32 33/* Machine dependent interfaces */ 34 35#ifndef _MACHINE_PMC_MDEP_H 36#define _MACHINE_PMC_MDEP_H 1 37 38#ifdef _KERNEL 39struct pmc_mdep; 40#endif 41 42#include <dev/hwpmc/hwpmc_amd.h> 43#include <dev/hwpmc/hwpmc_core.h> 44#include <dev/hwpmc/hwpmc_piv.h> 45#include <dev/hwpmc/hwpmc_tsc.h> |
46#include <dev/hwpmc/hwpmc_uncore.h> |
|
46 47/* 48 * Intel processors implementing V2 and later of the Intel performance 49 * measurement architecture have PMCs of the following classes: TSC, | 47 48/* 49 * Intel processors implementing V2 and later of the Intel performance 50 * measurement architecture have PMCs of the following classes: TSC, |
50 * IAF and IAP. | 51 * IAF, IAP, UCF and UCP. |
51 */ 52#define PMC_MDEP_CLASS_INDEX_TSC 0 53#define PMC_MDEP_CLASS_INDEX_K8 1 54#define PMC_MDEP_CLASS_INDEX_P4 1 55#define PMC_MDEP_CLASS_INDEX_IAP 1 56#define PMC_MDEP_CLASS_INDEX_IAF 2 | 52 */ 53#define PMC_MDEP_CLASS_INDEX_TSC 0 54#define PMC_MDEP_CLASS_INDEX_K8 1 55#define PMC_MDEP_CLASS_INDEX_P4 1 56#define PMC_MDEP_CLASS_INDEX_IAP 1 57#define PMC_MDEP_CLASS_INDEX_IAF 2 |
58#define PMC_MDEP_CLASS_INDEX_UCP 3 59#define PMC_MDEP_CLASS_INDEX_UCF 4 |
|
57 58/* 59 * On the amd64 platform we support the following PMCs. 60 * 61 * TSC The timestamp counter 62 * K8 AMD Athlon64 and Opteron PMCs in 64 bit mode. 63 * PIV Intel P4/HTT and P4/EMT64 64 * IAP Intel Core/Core2/Atom CPUs in 64 bits mode. 65 * IAF Intel fixed-function PMCs in Core2 and later CPUs. | 60 61/* 62 * On the amd64 platform we support the following PMCs. 63 * 64 * TSC The timestamp counter 65 * K8 AMD Athlon64 and Opteron PMCs in 64 bit mode. 66 * PIV Intel P4/HTT and P4/EMT64 67 * IAP Intel Core/Core2/Atom CPUs in 64 bits mode. 68 * IAF Intel fixed-function PMCs in Core2 and later CPUs. |
69 * UCP Intel Uncore programmable PMCs. 70 * UCF Intel Uncore fixed-function PMCs. |
|
66 */ 67 68union pmc_md_op_pmcallocate { 69 struct pmc_md_amd_op_pmcallocate pm_amd; 70 struct pmc_md_iaf_op_pmcallocate pm_iaf; 71 struct pmc_md_iap_op_pmcallocate pm_iap; | 71 */ 72 73union pmc_md_op_pmcallocate { 74 struct pmc_md_amd_op_pmcallocate pm_amd; 75 struct pmc_md_iaf_op_pmcallocate pm_iaf; 76 struct pmc_md_iap_op_pmcallocate pm_iap; |
77 struct pmc_md_ucf_op_pmcallocate pm_ucf; 78 struct pmc_md_ucp_op_pmcallocate pm_ucp; |
|
72 struct pmc_md_p4_op_pmcallocate pm_p4; 73 uint64_t __pad[4]; 74}; 75 76/* Logging */ 77#define PMCLOG_READADDR PMCLOG_READ64 78#define PMCLOG_EMITADDR PMCLOG_EMIT64 79 80#ifdef _KERNEL 81 82union pmc_md_pmc { 83 struct pmc_md_amd_pmc pm_amd; 84 struct pmc_md_iaf_pmc pm_iaf; 85 struct pmc_md_iap_pmc pm_iap; | 79 struct pmc_md_p4_op_pmcallocate pm_p4; 80 uint64_t __pad[4]; 81}; 82 83/* Logging */ 84#define PMCLOG_READADDR PMCLOG_READ64 85#define PMCLOG_EMITADDR PMCLOG_EMIT64 86 87#ifdef _KERNEL 88 89union pmc_md_pmc { 90 struct pmc_md_amd_pmc pm_amd; 91 struct pmc_md_iaf_pmc pm_iaf; 92 struct pmc_md_iap_pmc pm_iap; |
93 struct pmc_md_ucf_pmc pm_ucf; 94 struct pmc_md_ucp_pmc pm_ucp; |
|
86 struct pmc_md_p4_pmc pm_p4; 87}; 88 89#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_rip) 90#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_rbp) 91#define PMC_TRAPFRAME_TO_USER_SP(TF) ((TF)->tf_rsp) 92#define PMC_TRAPFRAME_TO_KERNEL_SP(TF) ((TF)->tf_rsp) 93 --- 32 unchanged lines hidden --- | 95 struct pmc_md_p4_pmc pm_p4; 96}; 97 98#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_rip) 99#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_rbp) 100#define PMC_TRAPFRAME_TO_USER_SP(TF) ((TF)->tf_rsp) 101#define PMC_TRAPFRAME_TO_KERNEL_SP(TF) ((TF)->tf_rsp) 102 --- 32 unchanged lines hidden --- |