| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

pfmlib_coreduo.h
Go to the documentation of this file.
1 /*
2 * Intel Core Duo/Solo
3 *
4 * Copyright (c) 2009 Google, Inc
5 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
11 * of the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24 #ifndef __PFMLIB_COREDUO_H__
25 #define __PFMLIB_COREDUO_H__
26
27 #include <perfmon/pfmlib.h>
28 /*
29 * privilege level mask usage for architected PMU:
30 *
31 * PFM_PLM0 = OS (kernel, hypervisor, ..)
32 * PFM_PLM1 = unused (ignored)
33 * PFM_PLM2 = unused (ignored)
34 * PFM_PLM3 = USR (user level)
35 */
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #define PMU_COREDUO_NUM_COUNTERS 2
42
43 typedef union {
44 unsigned long long val; /* complete register value */
45 struct {
46 unsigned long sel_event_select : 8; /* event mask */
47 unsigned long sel_unit_mask : 8; /* unit mask */
48 unsigned long sel_usr : 1; /* user level */
49 unsigned long sel_os : 1; /* system level */
50 unsigned long sel_edge : 1; /* edge detec */
51 unsigned long sel_pc : 1; /* pin control */
52 unsigned long sel_int : 1; /* enable APIC intr */
53 unsigned long sel_res1 : 1; /* reserved */
54 unsigned long sel_en : 1; /* enable */
55 unsigned long sel_inv : 1; /* invert counter mask */
56 unsigned long sel_cnt_mask : 8; /* counter mask */
57 unsigned long sel_res2 : 32;
58 } perfevtsel;
59 } pfm_coreduo_sel_reg_t;
60
61 typedef struct {
62 unsigned long cnt_mask; /* threshold (cnt_mask) */
63 unsigned int flags; /* counter specific flag */
64 } pfm_coreduo_counter_t;
65
66 #define PFM_COREDUO_SEL_INV 0x1 /* inverse */
67 #define PFM_COREDUO_SEL_EDGE 0x2 /* edge detect */
68
69 /*
70 * model-specific parameters for the library
71 */
72 typedef struct {
73 pfm_coreduo_counter_t pfp_coreduo_counters[PMU_COREDUO_NUM_COUNTERS];
74 uint64_t reserved[4]; /* for future use */
75 } pfmlib_coreduo_input_param_t;
76
77 #ifdef __cplusplus /* extern C */
78 }
79 #endif
80
81 #endif /* __PFMLIB_COREUO_H__ */
pfm_coreduo_sel_reg_t::val
unsigned long long val
Definition: pfmlib_coreduo.h:44
pfm_coreduo_sel_reg_t
Definition: pfmlib_coreduo.h:43
uint64_t
unsigned long long uint64_t
Definition: instrset.h:143
PMU_COREDUO_NUM_COUNTERS
#define PMU_COREDUO_NUM_COUNTERS
Definition: pfmlib_coreduo.h:41
pfmlib_coreduo_input_param_t
Definition: pfmlib_coreduo.h:72
pfm_coreduo_counter_t
Definition: pfmlib_coreduo.h:61
pfmlib.h
pfm_coreduo_counter_t::cnt_mask
unsigned long cnt_mask
Definition: pfmlib_coreduo.h:62
pfm_coreduo_counter_t::flags
unsigned int flags
Definition: pfmlib_coreduo.h:63