linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: linux-kernel@vger.kernel.org
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Paul Burton <paul.burton@mips.com>,
	Elvira Khabirova <lineprinter@altlinux.org>,
	Eugene Syromyatnikov <esyr@redhat.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	James Hogan <jhogan@kernel.org>, Oleg Nesterov <oleg@redhat.com>,
	Andy Lutomirski <luto@kernel.org>,
	linux-mips@vger.kernel.org
Subject: [PATCH linux-next v9 3/7] mips: define syscall_get_error()
Date: Mon, 8 Apr 2019 20:41:52 +0300	[thread overview]
Message-ID: <20190408174152.GD11889@altlinux.org> (raw)
In-Reply-To: <20190408174036.GA11889@altlinux.org>

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.

Acked-by: Paul Burton <paul.burton@mips.com>
Cc: Elvira Khabirova <lineprinter@altlinux.org>
Cc: Eugene Syromyatnikov <esyr@redhat.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: linux-mips@vger.kernel.org
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---

Notes:
    v9: unchanged
    v8: unchanged
    v7: added Acked-by
    v6: unchanged
    v5: initial revision

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

diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index acf80ae0a430..83bb439597d8 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)
 {
-- 
ldv

  parent reply	other threads:[~2019-04-08 17:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 17:40 [PATCH linux-next v9 0/7] ptrace: add PTRACE_GET_SYSCALL_INFO request Dmitry V. Levin
2019-04-08 17:41 ` [PATCH linux-next v9 1/7] nds32: fix asm/syscall.h Dmitry V. Levin
2019-04-09  7:57   ` Greentime Hu
2019-04-08 17:41 ` [PATCH linux-next v9 2/7] hexagon: define syscall_get_error() and syscall_get_return_value() Dmitry V. Levin
2019-04-08 17:41 ` Dmitry V. Levin [this message]
2019-04-08 17:42 ` [PATCH linux-next v9 4/7] parisc: define syscall_get_error() Dmitry V. Levin
2019-04-08 17:42 ` [PATCH linux-next v9 5/7] powerpc: " Dmitry V. Levin
2019-04-08 17:42 ` [PATCH linux-next v9 6/7] ptrace: add PTRACE_GET_SYSCALL_INFO request Dmitry V. Levin
2019-04-08 17:42 ` [PATCH linux-next v9 7/7] selftests/ptrace: add a test case for PTRACE_GET_SYSCALL_INFO Dmitry V. Levin
2019-04-08 17:51   ` shuah
2019-04-08 18:04     ` Dmitry V. Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190408174152.GD11889@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=esyr@redhat.com \
    --cc=jhogan@kernel.org \
    --cc=lineprinter@altlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=oleg@redhat.com \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).