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>
15 #ifndef PERF_REG_EXTENDED_MASK
16 #define PERF_REG_EXTENDED_MASK 0
19 u64 perf_reg_value(struct pt_regs *regs, int idx);
20 int perf_reg_validate(u64 mask);
21 u64 perf_reg_abi(struct task_struct *task);
22 void perf_get_regs_user(struct perf_regs *regs_user,
23 struct pt_regs *regs);
26 #define PERF_REG_EXTENDED_MASK 0
28 static inline u64 perf_reg_value(struct pt_regs *regs, int idx)
33 static inline int perf_reg_validate(u64 mask)
35 return mask ? -ENOSYS : 0;
38 static inline u64 perf_reg_abi(struct task_struct *task)
40 return PERF_SAMPLE_REGS_ABI_NONE;
43 static inline void perf_get_regs_user(struct perf_regs *regs_user,
46 regs_user->regs = task_pt_regs(current);
47 regs_user->abi = perf_reg_abi(current);
49 #endif /* CONFIG_HAVE_PERF_REGS */
50 #endif /* _LINUX_PERF_REGS_H */