38#define L4STAT_ERR_OK 0
39#define L4STAT_ERR_EINVAL -1
40#define L4STAT_ERR_ERROR -2
41#define L4STAT_ERR_TOOMANY -3
42#define L4STAT_ERR_IMPLEMENTED -4
45void l4stat_register_drv (
void);
47extern int l4stat_counter_print(
unsigned int counter);
52#define CCTRL_NCPU (0xf << CCTRL_NCPU_BIT)
53#define CCTRL_NCNT_L3STAT (0x1ff << CCTRL_NCNT_BIT)
54#define CCTRL_NCNT (0x1f << CCTRL_NCNT_BIT)
55#define CCTRL_MC (0x1 << CCTRL_MC_BIT)
56#define CCTRL_IA (0x1 << CCTRL_IA_BIT)
57#define CCTRL_DS (0x1 << CCTRL_DS_BIT)
58#define CCTRL_EE (0x1 << CCTRL_EE_BIT)
59#define CCTRL_AE (0x1 << CCTRL_AE_BIT)
60#define CCTRL_EL (0x1 << CCTRL_EL_BIT)
61#define CCTRL_CD (0x1 << CCTRL_CD_BIT)
62#define CCTRL_SU (0x3 << CCTRL_SU_BIT)
63#define CCTRL_CL (0x1 << CCTRL_CL_BIT)
64#define CCTRL_EN (0x1 << CCTRL_EN_BIT)
65#define CCTRL_EVENTID (0xff << CCTRL_EVENTID_BIT)
66#define CCTRL_CPUAHBM (0xf << CCTRL_CPUAHBM_BIT)
68#define CCTRL_NCPU_BIT 28
69#define CCTRL_NCNT_BIT 23
70#define CCTRL_MC_BIT 22
71#define CCTRL_IA_BIT 21
72#define CCTRL_DS_BIT 20
73#define CCTRL_EE_BIT 19
74#define CCTRL_AE_BIT 18
75#define CCTRL_EL_BIT 17
76#define CCTRL_CD_BIT 16
77#define CCTRL_SU_BIT 14
78#define CCTRL_CL_BIT 13
79#define CCTRL_EN_BIT 12
80#define CCTRL_EVENTID_BIT 4
81#define CCTRL_CPUAHBM_BIT 0
83#define L4STAT_OPTIONS_EVENT_LEVEL_ENABLE CCTRL_EL
84#define L4STAT_OPTIONS_EVENT_LEVEL_DISABLE 0
85#define L4STAT_OPTIONS_MAXIMUM_DURATION CCTRL_CD
86#define L4STAT_OPTIONS_SUPERVISOR_MODE_FILTER (0x1 << CCTRL_SU_BIT)
87#define L4STAT_OPTIONS_USER_MODE_FILTER (0x2 << CCTRL_SU_BIT)
88#define L4STAT_OPTIONS_NO_FILTER 0
89#define L4STAT_OPTIONS_CLEAR_ON_READ CCTRL_CL
91extern int l4stat_counter_enable(
unsigned int counter,
int event,
int cpu,
int options);
92extern int l4stat_counter_disable(
unsigned int counter);
93extern int l4stat_counter_set(
unsigned int counter, uint32_t val);
94extern int l4stat_counter_get(
unsigned int counter, uint32_t *val);
96static inline int l4stat_counter_clear(
unsigned int counter)
98 return l4stat_counter_set(counter, 0);
101extern int l4stat_counter_max_set(
unsigned int counter, uint32_t val);
102extern int l4stat_counter_max_get(
unsigned int counter, uint32_t *val);
103extern int l4stat_tstamp_set(uint32_t val);
104extern int l4stat_tstamp_get(uint32_t *val);