From: "Dmitry V. Levin" <ldv@strace.io>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Brian Cain <bcain@quicinc.com>, Oleg Nesterov <oleg@redhat.com>,
Alexey Gladkov <legion@kernel.org>,
Eugene Syromyatnikov <evgsyr@gmail.com>,
Mike Frysinger <vapier@gentoo.org>,
Renzo Davoli <renzo@cs.unibo.it>,
Davide Berardi <berardi.dav@gmail.com>,
strace-devel@lists.strace.io, linux-hexagon@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 2/7] hexagon: add syscall_set_return_value()
Date: Mon, 3 Feb 2025 09:00:03 +0200 [thread overview]
Message-ID: <20250203070003.GC14120@strace.io> (raw)
In-Reply-To: <20250203065849.GA14120@strace.io>
hexagon is the only architecture that provides HAVE_ARCH_TRACEHOOK but
doesn't define syscall_set_return_value(). Since this function is going
to be needed on all HAVE_ARCH_TRACEHOOK architectures to implement
PTRACE_SET_SYSCALL_INFO API, add it on hexagon, too.
Signed-off-by: Dmitry V. Levin <ldv@strace.io>
---
arch/hexagon/include/asm/syscall.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/hexagon/include/asm/syscall.h b/arch/hexagon/include/asm/syscall.h
index f6e454f18038..951ca0ed8376 100644
--- a/arch/hexagon/include/asm/syscall.h
+++ b/arch/hexagon/include/asm/syscall.h
@@ -45,6 +45,13 @@ static inline long syscall_get_return_value(struct task_struct *task,
return regs->r00;
}
+static inline void syscall_set_return_value(struct task_struct *task,
+ struct pt_regs *regs,
+ int error, long val)
+{
+ regs->r00 = (long) error ?: val;
+}
+
static inline int syscall_get_arch(struct task_struct *task)
{
return AUDIT_ARCH_HEXAGON;
--
ldv
next prev parent reply other threads:[~2025-02-03 7:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 6:58 [PATCH v4 0/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO API Dmitry V. Levin
2025-02-03 7:00 ` Dmitry V. Levin [this message]
2025-02-03 7:00 ` [PATCH v4 3/7] syscall.h: add syscall_set_arguments() Dmitry V. Levin
2025-02-03 7:00 ` [PATCH v4 4/7] syscall.h: introduce syscall_set_nr() Dmitry V. Levin
2025-02-03 9:29 ` [PATCH v4 0/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO API Alexander Gordeev
2025-02-03 10:35 ` 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=20250203070003.GC14120@strace.io \
--to=ldv@strace.io \
--cc=akpm@linux-foundation.org \
--cc=bcain@quicinc.com \
--cc=berardi.dav@gmail.com \
--cc=evgsyr@gmail.com \
--cc=legion@kernel.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=renzo@cs.unibo.it \
--cc=strace-devel@lists.strace.io \
--cc=vapier@gentoo.org \
/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).