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