arm64: Add regs_return_value() in syscall.h
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Wed, 30 Apr 2014 09:51:31 +0000 (10:51 +0100)
committerMark Brown <broonie@linaro.org>
Fri, 30 May 2014 17:15:41 +0000 (18:15 +0100)
This macro, regs_return_value, is used mainly for audit to record system
call's results, but may also be used in test_kprobes.c.

Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit d34a3ebd8d25cf691a94fae66a957a480cf46430)
Signed-off-by: Mark Brown <broonie@linaro.org>
arch/arm64/include/asm/ptrace.h

index 41a71ee4c3df42743eb5aa494f72e6287cff55bb..f38a8aa58d4c729f68c7b3437d7310011cfc96f7 100644 (file)
@@ -133,6 +133,11 @@ struct pt_regs {
 #define user_stack_pointer(regs) \
        ((regs)->sp)
 
+static inline unsigned long regs_return_value(struct pt_regs *regs)
+{
+       return regs->regs[0];
+}
+
 /*
  * Are the current registers suitable for user mode? (used to maintain
  * security in signal handlers)