18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#ifndef __ASM_CSKY_PERF_EVENT_H
58c2ecf20Sopenharmony_ci#define __ASM_CSKY_PERF_EVENT_H
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#include <abi/regdef.h>
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#define perf_arch_fetch_caller_regs(regs, __ip) { \
108c2ecf20Sopenharmony_ci	(regs)->pc = (__ip); \
118c2ecf20Sopenharmony_ci	regs_fp(regs) = (unsigned long) __builtin_frame_address(0); \
128c2ecf20Sopenharmony_ci	asm volatile("mov %0, sp\n":"=r"((regs)->usp)); \
138c2ecf20Sopenharmony_ci}
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#endif /* __ASM_PERF_EVENT_ELF_H */
16