aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/ptrace.h
diff options
context:
space:
mode:
authorPratyush Anand <panand@redhat.com>2014-12-19 12:57:51 +0530
committerSteve Capper <steve.capper@linaro.org>2015-01-27 16:46:19 +0000
commita9c74c15500ba2e663d4f9e09f7756bfa7f1c229 (patch)
tree2bb31be6691c645e4ff81ecff873f5eb7ae378b2 /arch/arm64/include/asm/ptrace.h
parentd7ae3126cd7d4f476f64ba3b68d0761bc3ba1266 (diff)
downloadlinux-a9c74c15500ba2e663d4f9e09f7756bfa7f1c229.tar.gz
ARM64: include asm-generic/ptrace.h in asm/ptrace.h
instruction_pointer_set is needed for uprobe implementation. asm-generic/ptrace.h already defines it. So include it in asm/ptrace.h. But inclusion of asm-generic/ptrace.h, needs definition of GET_USP, SET_USP, GET_FP & SET_FP as they are different than the generic definition. So, define them in asm/ptrace.h. user_stack_pointer, instruction_pointer and profile_pc have already been defined by asm-generic/ptrace.h now, therefore remove them from asm/ptrace.h. To modify instruction pointer in kprobe, use instruction_pointer_set(regs, val) instead of instruction_pointer(regs) = val, otherwise lvalue error. Signed-off-by: Pratyush Anand <panand@redhat.com>
Diffstat (limited to 'arch/arm64/include/asm/ptrace.h')
-rw-r--r--arch/arm64/include/asm/ptrace.h32
1 files changed, 25 insertions, 7 deletions
diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
index e436b490781..b5d4f92ae2a 100644
--- a/arch/arm64/include/asm/ptrace.h
+++ b/arch/arm64/include/asm/ptrace.h
@@ -137,10 +137,6 @@ struct pt_regs {
#define fast_interrupts_enabled(regs) \
(!((regs)->pstate & PSR_F_BIT))
-
-#define user_stack_pointer(regs) \
- (!compat_user_mode(regs) ? (regs)->sp : (regs)->compat_sp)
-
/**
* regs_get_register() - get register value from its offset
* @regs: pt_regs from which register value is gotten
@@ -203,13 +199,35 @@ static inline int valid_user_regs(struct user_pt_regs *regs)
return 0;
}
-#define instruction_pointer(regs) ((regs)->pc)
+#define GET_USP(regs) \
+ (!compat_user_mode(regs) ? (regs)->sp : (regs)->compat_sp)
+
+#define SET_USP(regs, val) \
+ do { \
+ if (compat_user_mode(regs)) \
+ (regs)->compat_sp = val; \
+ else \
+ (regs)->sp = val; \
+ } while (0)
+
+#define GET_FP(regs) \
+ (!compat_user_mode(regs) ? (regs)->regs[29] : (regs)->compat_fp)
+
+#define SET_FP(regs, val) \
+ do { \
+ if (compat_user_mode(regs)) \
+ (regs)->compat_fp = val; \
+ else \
+ (regs)->regs[29] = val; \
+ } while (0)
+
+#include <asm-generic/ptrace.h>
+
#define stack_pointer(regs) ((regs)->sp)
#ifdef CONFIG_SMP
+#undef profile_pc
extern unsigned long profile_pc(struct pt_regs *regs);
-#else
-#define profile_pc(regs) instruction_pointer(regs)
#endif
#endif /* __ASSEMBLY__ */