1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_PERF_REGS_H
3 #define _LINUX_PERF_REGS_H
5 #include <linux/sched/task_stack.h>
12 #ifdef CONFIG_HAVE_PERF_REGS
13 #include <asm/perf_regs.h>
14 u64 perf_reg_value(struct pt_regs *regs, int idx);
15 int perf_reg_validate(u64 mask);
16 u64 perf_reg_abi(struct task_struct *task);
17 void perf_get_regs_user(struct perf_regs *regs_user,
19 struct pt_regs *regs_user_copy);
21 static inline u64 perf_reg_value(struct pt_regs *regs, int idx)
26 static inline int perf_reg_validate(u64 mask)
28 return mask ? -ENOSYS : 0;
31 static inline u64 perf_reg_abi(struct task_struct *task)
33 return PERF_SAMPLE_REGS_ABI_NONE;
36 static inline void perf_get_regs_user(struct perf_regs *regs_user,
38 struct pt_regs *regs_user_copy)
40 regs_user->regs = task_pt_regs(current);
41 regs_user->abi = perf_reg_abi(current);
43 #endif /* CONFIG_HAVE_PERF_REGS */
44 #endif /* _LINUX_PERF_REGS_H */