Jiri Olsa | c5e6319 | 2012-08-07 15:20:36 +0200 | [diff] [blame] | 1 | #ifndef _LINUX_PERF_REGS_H |
| 2 | #define _LINUX_PERF_REGS_H |
| 3 | |
Andy Lutomirski | 88a7c26 | 2015-01-04 10:36:19 -0800 | [diff] [blame^] | 4 | struct perf_regs { |
| 5 | __u64 abi; |
| 6 | struct pt_regs *regs; |
| 7 | }; |
| 8 | |
Jiri Olsa | c5e6319 | 2012-08-07 15:20:36 +0200 | [diff] [blame] | 9 | #ifdef CONFIG_HAVE_PERF_REGS |
| 10 | #include <asm/perf_regs.h> |
| 11 | u64 perf_reg_value(struct pt_regs *regs, int idx); |
| 12 | int perf_reg_validate(u64 mask); |
Jiri Olsa | 4018994 | 2012-08-07 15:20:37 +0200 | [diff] [blame] | 13 | u64 perf_reg_abi(struct task_struct *task); |
Andy Lutomirski | 88a7c26 | 2015-01-04 10:36:19 -0800 | [diff] [blame^] | 14 | void perf_get_regs_user(struct perf_regs *regs_user, |
| 15 | struct pt_regs *regs, |
| 16 | struct pt_regs *regs_user_copy); |
Jiri Olsa | c5e6319 | 2012-08-07 15:20:36 +0200 | [diff] [blame] | 17 | #else |
| 18 | static inline u64 perf_reg_value(struct pt_regs *regs, int idx) |
| 19 | { |
| 20 | return 0; |
| 21 | } |
| 22 | |
| 23 | static inline int perf_reg_validate(u64 mask) |
| 24 | { |
| 25 | return mask ? -ENOSYS : 0; |
| 26 | } |
Jiri Olsa | 4018994 | 2012-08-07 15:20:37 +0200 | [diff] [blame] | 27 | |
| 28 | static inline u64 perf_reg_abi(struct task_struct *task) |
| 29 | { |
| 30 | return PERF_SAMPLE_REGS_ABI_NONE; |
| 31 | } |
Andy Lutomirski | 88a7c26 | 2015-01-04 10:36:19 -0800 | [diff] [blame^] | 32 | |
| 33 | static inline void perf_get_regs_user(struct perf_regs *regs_user, |
| 34 | struct pt_regs *regs, |
| 35 | struct pt_regs *regs_user_copy) |
| 36 | { |
| 37 | regs_user->regs = task_pt_regs(current); |
| 38 | regs_user->abi = perf_reg_abi(current); |
| 39 | } |
Jiri Olsa | c5e6319 | 2012-08-07 15:20:36 +0200 | [diff] [blame] | 40 | #endif /* CONFIG_HAVE_PERF_REGS */ |
| 41 | #endif /* _LINUX_PERF_REGS_H */ |