xref: /openbmc/linux/arch/sh/include/asm/perf_event.h (revision aac28965)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SH_PERF_EVENT_H
3 #define __ASM_SH_PERF_EVENT_H
4 
5 struct hw_perf_event;
6 
7 #define MAX_HWEVENTS	2
8 
9 struct sh_pmu {
10 	const char	*name;
11 	unsigned int	num_events;
12 	void		(*disable_all)(void);
13 	void		(*enable_all)(void);
14 	void		(*enable)(struct hw_perf_event *, int);
15 	void		(*disable)(struct hw_perf_event *, int);
16 	u64		(*read)(int);
17 	int		(*event_map)(int);
18 	unsigned int	max_events;
19 	unsigned long	raw_event_mask;
20 	const int	(*cache_events)[PERF_COUNT_HW_CACHE_MAX]
21 				       [PERF_COUNT_HW_CACHE_OP_MAX]
22 				       [PERF_COUNT_HW_CACHE_RESULT_MAX];
23 };
24 
25 /* arch/sh/kernel/perf_event.c */
26 extern int register_sh_pmu(struct sh_pmu *);
27 extern int reserve_pmc_hardware(void);
28 extern void release_pmc_hardware(void);
29 
30 #endif /* __ASM_SH_PERF_EVENT_H */
31