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)
committerJP Abgrall <jpa@google.com>
Thu, 18 Sep 2014 01:18:47 +0000 (18:18 -0700)
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>
arch/arm64/include/asm/ptrace.h

index fff28950e660bfaedb074659a39943a1fda66ea4..dbe3b00d1eb76a79cd709f8964fec84c023fefa4 100644 (file)
@@ -133,6 +133,11 @@ struct pt_regs {
 #define user_stack_pointer(regs) \
        (!compat_user_mode(regs) ? (regs)->sp : (regs)->compat_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)