diff mbox series

[v6,16/27] mips: define syscall_get_error()

Message ID 20181213172302.GP6024@altlinux.org (mailing list archive)
State Superseded
Headers show
Series None | expand

Commit Message

Dmitry V. Levin Dec. 13, 2018, 5:23 p.m. UTC
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.

Cc: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Elvira Khabirova <lineprinter@altlinux.org>
Cc: Eugene Syromyatnikov <esyr@redhat.com>
Cc: linux-mips@vger.kernel.org
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---

Notes:
    v6: unchanged
    v5: initial revision

 arch/mips/include/asm/syscall.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Paul Burton Dec. 13, 2018, 7 p.m. UTC | #1
Hi Dmitry,

On Thu, Dec 13, 2018 at 08:23:02PM +0300, Dmitry V. Levin wrote:
> 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.
> 
> Cc: Paul Burton <paul.burton@mips.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: James Hogan <jhogan@kernel.org>
> Cc: Oleg Nesterov <oleg@redhat.com>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Elvira Khabirova <lineprinter@altlinux.org>
> Cc: Eugene Syromyatnikov <esyr@redhat.com>
> Cc: linux-mips@vger.kernel.org
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>

Acked-by: Paul Burton <paul.burton@mips.com>

Thanks,
    Paul
Dmitry V. Levin Dec. 21, 2018, 1:31 a.m. UTC | #2
Hi Paul,

On Thu, Dec 13, 2018 at 07:00:16PM +0000, Paul Burton wrote:
> Hi Dmitry,
> 
> On Thu, Dec 13, 2018 at 08:23:02PM +0300, Dmitry V. Levin wrote:
> > 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.
> > 
> > Cc: Paul Burton <paul.burton@mips.com>
> > Cc: Ralf Baechle <ralf@linux-mips.org>
> > Cc: James Hogan <jhogan@kernel.org>
> > Cc: Oleg Nesterov <oleg@redhat.com>
> > Cc: Andy Lutomirski <luto@kernel.org>
> > Cc: Elvira Khabirova <lineprinter@altlinux.org>
> > Cc: Eugene Syromyatnikov <esyr@redhat.com>
> > Cc: linux-mips@vger.kernel.org
> > Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> 
> Acked-by: Paul Burton <paul.burton@mips.com>

As it looks like the whole series is going to be pinged for quite some time yet,
would you mind taking this patch into the mips tree?

Thanks,
diff mbox series

Patch

diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index 6cf8ffb5367e..04ab927ff47d 100644
--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -89,6 +89,12 @@  static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
 	unreachable();
 }
 
+static inline long syscall_get_error(struct task_struct *task,
+				     struct pt_regs *regs)
+{
+	return regs->regs[7] ? -regs->regs[2] : 0;
+}
+
 static inline long syscall_get_return_value(struct task_struct *task,
 					    struct pt_regs *regs)
 {