1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SPARC_PERF_EVENT_H
3 #define __ASM_SPARC_PERF_EVENT_H
5 #ifdef CONFIG_PERF_EVENTS
6 #include <asm/ptrace.h>
8 #define perf_arch_fetch_caller_regs(regs, ip) \
10 unsigned long _pstate, _asi, _pil, _i7, _fp; \
11 __asm__ __volatile__("rdpr %%pstate, %0\n\t" \
13 "rdpr %%pil, %2\n\t" \
21 (regs)->tstate = (_pstate << 8) | \
22 (_asi << 24) | (_pil << 20); \
24 (regs)->tnpc = (regs)->tpc + 4; \
25 (regs)->u_regs[UREG_I6] = _fp; \
26 (regs)->u_regs[UREG_I7] = _i7; \