aboutsummaryrefslogtreecommitdiffstats
path: root/arch/nios2/include/asm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2022-08-08 16:09:45 +0100
committerDinh Nguyen <dinguyen@kernel.org>2022-08-15 11:25:32 -0500
commitfd0c153daad135d0ec1a53c5dbe6936a724d6ae1 (patch)
tree1b0b0486639eba2a2233205735ba09681a8864e0 /arch/nios2/include/asm
parentnios2: restarts apply only to the first sigframe we build... (diff)
downloadlinux-dev-fd0c153daad135d0ec1a53c5dbe6936a724d6ae1.tar.xz
linux-dev-fd0c153daad135d0ec1a53c5dbe6936a724d6ae1.zip
nios2: add force_successful_syscall_return()
If we use the ancient SysV syscall ABI, we'd better have tell the kernel how to claim that a negative return value is a success. Use ->orig_r2 for that - it's inaccessible via ptrace, so it's a fair game for changes and it's normally[*] non-negative on return from syscall. Set to -1; syscall is not going to be restart-worthy by definition, so we won't interfere with that use either. [*] the only exception is rt_sigreturn(), where we skip the entire messing with r1/r2 anyway. Fixes: 82ed08dd1b0e ("nios2: Exception handling") Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Diffstat (limited to 'arch/nios2/include/asm')
-rw-r--r--arch/nios2/include/asm/ptrace.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/nios2/include/asm/ptrace.h b/arch/nios2/include/asm/ptrace.h
index 642462144872..9da34c3022a2 100644
--- a/arch/nios2/include/asm/ptrace.h
+++ b/arch/nios2/include/asm/ptrace.h
@@ -74,6 +74,8 @@ extern void show_regs(struct pt_regs *);
((struct pt_regs *)((unsigned long)current_thread_info() + THREAD_SIZE)\
- 1)
+#define force_successful_syscall_return() (current_pt_regs()->orig_r2 = -1)
+
int do_syscall_trace_enter(void);
void do_syscall_trace_exit(void);
#endif /* __ASSEMBLY__ */