diff options
Diffstat (limited to 'include/linux/perf_regs.h')
| -rw-r--r-- | include/linux/perf_regs.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/perf_regs.h b/include/linux/perf_regs.h index 3c73d5fe18be..a5f98d53d732 100644 --- a/include/linux/perf_regs.h +++ b/include/linux/perf_regs.h | |||
| @@ -1,11 +1,19 @@ | |||
| 1 | #ifndef _LINUX_PERF_REGS_H | 1 | #ifndef _LINUX_PERF_REGS_H |
| 2 | #define _LINUX_PERF_REGS_H | 2 | #define _LINUX_PERF_REGS_H |
| 3 | 3 | ||
| 4 | struct perf_regs { | ||
| 5 | __u64 abi; | ||
| 6 | struct pt_regs *regs; | ||
| 7 | }; | ||
| 8 | |||
| 4 | #ifdef CONFIG_HAVE_PERF_REGS | 9 | #ifdef CONFIG_HAVE_PERF_REGS |
| 5 | #include <asm/perf_regs.h> | 10 | #include <asm/perf_regs.h> |
| 6 | u64 perf_reg_value(struct pt_regs *regs, int idx); | 11 | u64 perf_reg_value(struct pt_regs *regs, int idx); |
| 7 | int perf_reg_validate(u64 mask); | 12 | int perf_reg_validate(u64 mask); |
| 8 | u64 perf_reg_abi(struct task_struct *task); | 13 | u64 perf_reg_abi(struct task_struct *task); |
| 14 | void perf_get_regs_user(struct perf_regs *regs_user, | ||
| 15 | struct pt_regs *regs, | ||
| 16 | struct pt_regs *regs_user_copy); | ||
| 9 | #else | 17 | #else |
| 10 | static inline u64 perf_reg_value(struct pt_regs *regs, int idx) | 18 | static inline u64 perf_reg_value(struct pt_regs *regs, int idx) |
| 11 | { | 19 | { |
| @@ -21,5 +29,13 @@ static inline u64 perf_reg_abi(struct task_struct *task) | |||
| 21 | { | 29 | { |
| 22 | return PERF_SAMPLE_REGS_ABI_NONE; | 30 | return PERF_SAMPLE_REGS_ABI_NONE; |
| 23 | } | 31 | } |
| 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 | } | ||
| 24 | #endif /* CONFIG_HAVE_PERF_REGS */ | 40 | #endif /* CONFIG_HAVE_PERF_REGS */ |
| 25 | #endif /* _LINUX_PERF_REGS_H */ | 41 | #endif /* _LINUX_PERF_REGS_H */ |
