| # Gaudi Framework, version v23r0 |

Home |  | Generated: Mon Jan 30 2012

# pfmlib_i386_p6.h

Go to the documentation of this file.

    00001 /*
    00002  * Intel Pentium II/Pentium Pro/Pentium III/Pentium M PMU specific types and definitions
    00003  *
    00004  * Copyright (c) 2005-2007 Hewlett-Packard Development Company, L.P.
    00005  * Contributed by Stephane Eranian <eranian@hpl.hp.com>
    00006  *
    00007  * Permission is hereby granted, free of charge, to any person obtaining a copy
    00008  * of this software and associated documentation files (the "Software"), to deal
    00009  * in the Software without restriction, including without limitation the rights
    00010  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
    00011  * of the Software, and to permit persons to whom the Software is furnished to do so,
    00012  * subject to the following conditions:
    00013  *
    00014  * The above copyright notice and this permission notice shall be included in all
    00015  * copies or substantial portions of the Software.
    00016  *
    00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
    00018  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
    00019  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    00020  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
    00021  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
    00022  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    00023  */
    00024 #ifndef __PFMLIB_I386_P6_H__
    00025 #define __PFMLIB_I386_P6_H__
    00026
    00027 #include <perfmon/pfmlib.h>
    00028
    00029 /*
    00030  * privilege level mask usage for i386-p6:
    00031  *
    00032  * PFM_PLM0 = OS (kernel, hypervisor, ..)
    00033  * PFM_PLM1 = unused (ignored)
    00034  * PFM_PLM2 = unused (ignored)
    00035  * PFM_PLM3 = USR (user level)
    00036  */
    00037
    00038 #ifdef __cplusplus
    00039 extern "C" {
    00040 #endif
    00041
    00042 #define PMU_I386_P6_NUM_COUNTERS        2       /* total numbers of EvtSel/EvtCtr */
    00043 #define PMU_I386_P6_NUM_PERFSEL         2       /* total number of EvtSel defined */
    00044 #define PMU_I386_P6_NUM_PERFCTR         2       /* total number of EvtCtr defined */
    00045 #define PMU_I386_P6_COUNTER_WIDTH       32      /* hardware counter bit width   */
    00046
    00047 /*
    00048  * This structure provides a detailed way to setup a PMC register.
    00049  * Once value is loaded, it must be copied (via pmu_reg) to the
    00050  * perfmon_req_t and passed to the kernel via perfmonctl().
    00051  */
    00052 typedef union {
    00053         unsigned long   val;                    /* complete register value */
    00054         struct {
    00055                 unsigned long sel_event_mask:8; /* event mask */
    00056                 unsigned long sel_unit_mask:8;          /* unit mask */
    00057                 unsigned long sel_usr:1;                /* user level */
    00058                 unsigned long sel_os:1;                 /* system level */
    00059                 unsigned long sel_edge:1;               /* edge detec */
    00060                 unsigned long sel_pc:1;                 /* pin control */
    00061                 unsigned long sel_int:1;                /* enable APIC intr */
    00062                 unsigned long sel_res1:1;               /* reserved */
    00063                 unsigned long sel_en:1;                 /* enable */
    00064                 unsigned long sel_inv:1;                /* invert counter mask */
    00065                 unsigned long sel_cnt_mask:8;           /* counter mask */
    00066         } perfsel;
    00067 } pfm_i386_p6_sel_reg_t;
    00068
    00069 typedef union {
    00070         uint64_t val;   /* counter value */
    00071         /* counting perfctr register */
    00072         struct {
    00073                 unsigned long ctr_count:32;     /* 32-bit hardware counter  */
    00074                 unsigned long ctr_res1:32;      /* reserved */
    00075         } perfctr;
    00076 } pfm_i386_p6_ctr_reg_t;
    00077
    00078 typedef enum {
    00079         PFM_I386_P6_CNT_MASK_0,
    00080         PFM_I386_P6_CNT_MASK_1,
    00081         PFM_I386_P6_CNT_MASK_2,
    00082         PFM_I386_P6_CNT_MASK_3
    00083 } pfm_i386_p6_cnt_mask_t;
    00084
    00085 typedef struct {
    00086         pfm_i386_p6_cnt_mask_t  cnt_mask;       /* threshold (cnt_mask)  */
    00087         unsigned int            flags;          /* counter specific flag */
    00088 } pfmlib_i386_p6_counter_t;
    00089
    00090 #define PFM_I386_P6_SEL_INV     0x1     /* inverse */
    00091 #define PFM_I386_P6_SEL_EDGE    0x2     /* edge detect */
    00092
    00093 /*
    00094  * P6-specific parameters for the library
    00095  */
    00096 typedef struct {
    00097         pfmlib_i386_p6_counter_t        pfp_i386_p6_counters[PMU_I386_P6_NUM_COUNTERS]; /* extended counter features */
    00098         uint64_t                        reserved[4];            /* for future use */
    00099 } pfmlib_i386_p6_input_param_t;
    00100
    00101 typedef struct {
    00102         uint64_t        reserved[8];            /* for future use */
    00103 } pfmlib_i386_p6_output_param_t;
    00104
    00105 #ifdef __cplusplus /* extern C */
    00106 }
    00107 #endif
    00108
    00109 #endif /* __PFMLIB_I386_P6_H__ */

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines