From: "Dmitry V. Levin" <ldv@xxxxxxxxxxxx> Subject: parisc: define syscall_get_error() syscall_get_error() is required to be implemented on all architectures 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/20190510152812.GD28558@xxxxxxxxxxxx Signed-off-by: Dmitry V. Levin <ldv@xxxxxxxxxxxx> Acked-by: Helge Deller <deller@xxxxxx> [parisc] Cc: James E.J. Bottomley <jejb@xxxxxxxxxxxxxxxx> Cc: Elvira Khabirova <lineprinter@xxxxxxxxxxxx> Cc: Eugene Syromyatnikov <esyr@xxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Andy Lutomirski <luto@xxxxxxxxxx> Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> Cc: Greentime Hu <greentime@xxxxxxxxxxxxx> Cc: James Hogan <jhogan@xxxxxxxxxx> Cc: kbuild test robot <lkp@xxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Cc: Paul Burton <paul.burton@xxxxxxxx> Cc: Paul Mackerras <paulus@xxxxxxxxx> Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx> Cc: Richard Kuo <rkuo@xxxxxxxxxxxxxx> Cc: Shuah Khan <shuah@xxxxxxxxxx> Cc: Vincent Chen <deanbo422@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/parisc/include/asm/syscall.h | 7 +++++++ 1 file changed, 7 insertions(+) --- a/arch/parisc/include/asm/syscall.h~parisc-define-syscall_get_error +++ a/arch/parisc/include/asm/syscall.h @@ -29,6 +29,13 @@ static inline void syscall_get_arguments args[0] = regs->gr[26]; } +static inline long syscall_get_error(struct task_struct *task, + struct pt_regs *regs) +{ + unsigned long error = regs->gr[28]; + return IS_ERR_VALUE(error) ? error : 0; +} + static inline long syscall_get_return_value(struct task_struct *task, struct pt_regs *regs) { _