aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <[email protected]>2019-07-16 16:29:39 -0700
committerLinus Torvalds <[email protected]>2019-07-16 19:23:24 -0700
commitf296f1df6e0e5b17654709c05b1821a1b58d329f (patch)
treecebcd854fa300b6b3a26b11a0fb08f792d0b283a
parent2938c1f8faa0b3b95581eba9738cd24f7b791c80 (diff)
powerpc: define syscall_get_error()
syscall_get_error() is required to be implemented on this architecture in addition to already implemented syscall_get_nr(), syscall_get_arguments(), syscall_get_return_value(), and syscall_get_arch() functions in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Dmitry V. Levin <[email protected]> Acked-by: Michael Ellerman <[email protected]> Cc: Elvira Khabirova <[email protected]> Cc: Eugene Syromyatnikov <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Greentime Hu <[email protected]> Cc: Helge Deller <[email protected]> [parisc] Cc: James E.J. Bottomley <[email protected]> Cc: James Hogan <[email protected]> Cc: kbuild test robot <[email protected]> Cc: Kees Cook <[email protected]> Cc: Paul Burton <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Richard Kuo <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Vincent Chen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--arch/powerpc/include/asm/syscall.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
index 81abcf6a737b..38d62acfdce7 100644
--- a/arch/powerpc/include/asm/syscall.h
+++ b/arch/powerpc/include/asm/syscall.h
@@ -35,6 +35,16 @@ static inline void syscall_rollback(struct task_struct *task,
regs->gpr[3] = regs->orig_gpr3;
}
+static inline long syscall_get_error(struct task_struct *task,
+ struct pt_regs *regs)
+{
+ /*
+ * If the system call failed,
+ * regs->gpr[3] contains a positive ERRORCODE.
+ */
+ return (regs->ccr & 0x10000000UL) ? -regs->gpr[3] : 0;
+}
+
static inline long syscall_get_return_value(struct task_struct *task,
struct pt_regs *regs)
{