18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef __ASM_SH_PERF_EVENT_H 38c2ecf20Sopenharmony_ci#define __ASM_SH_PERF_EVENT_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_cistruct hw_perf_event; 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#define MAX_HWEVENTS 2 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_cistruct sh_pmu { 108c2ecf20Sopenharmony_ci const char *name; 118c2ecf20Sopenharmony_ci unsigned int num_events; 128c2ecf20Sopenharmony_ci void (*disable_all)(void); 138c2ecf20Sopenharmony_ci void (*enable_all)(void); 148c2ecf20Sopenharmony_ci void (*enable)(struct hw_perf_event *, int); 158c2ecf20Sopenharmony_ci void (*disable)(struct hw_perf_event *, int); 168c2ecf20Sopenharmony_ci u64 (*read)(int); 178c2ecf20Sopenharmony_ci int (*event_map)(int); 188c2ecf20Sopenharmony_ci unsigned int max_events; 198c2ecf20Sopenharmony_ci unsigned long raw_event_mask; 208c2ecf20Sopenharmony_ci const int (*cache_events)[PERF_COUNT_HW_CACHE_MAX] 218c2ecf20Sopenharmony_ci [PERF_COUNT_HW_CACHE_OP_MAX] 228c2ecf20Sopenharmony_ci [PERF_COUNT_HW_CACHE_RESULT_MAX]; 238c2ecf20Sopenharmony_ci}; 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci/* arch/sh/kernel/perf_event.c */ 268c2ecf20Sopenharmony_ciextern int register_sh_pmu(struct sh_pmu *); 278c2ecf20Sopenharmony_ciextern int reserve_pmc_hardware(void); 288c2ecf20Sopenharmony_ciextern void release_pmc_hardware(void); 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#endif /* __ASM_SH_PERF_EVENT_H */ 31