aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/include/asm/processor.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-11-25 11:51:45 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2019-11-29 14:39:12 -0800
commitba9c1d65991a8be2e160447dd06eb803cbb9ba61 (patch)
tree4ab61ab6b7bbb68a128a7a2a83551e5e901e067b /arch/xtensa/include/asm/processor.h
parentxtensa: fix syscall_set_return_value (diff)
downloadlinux-dev-ba9c1d65991a8be2e160447dd06eb803cbb9ba61.tar.xz
linux-dev-ba9c1d65991a8be2e160447dd06eb803cbb9ba61.zip
xtensa: rearrange syscall tracing
system_call saves and restores syscall number across system call to make clone and execv entry and exit tracing match. This complicates things when syscall code may be changed by ptrace. Preserve syscall code in copy_thread and start_thread directly instead of doing tricks in system_call. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/include/asm/processor.h')
-rw-r--r--arch/xtensa/include/asm/processor.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
index 7495520d7a3e..6fa903daf2a2 100644
--- a/arch/xtensa/include/asm/processor.h
+++ b/arch/xtensa/include/asm/processor.h
@@ -195,6 +195,7 @@ struct thread_struct {
/* Clearing a0 terminates the backtrace. */
#define start_thread(regs, new_pc, new_sp) \
do { \
+ unsigned long syscall = (regs)->syscall; \
memset((regs), 0, sizeof(*(regs))); \
(regs)->pc = (new_pc); \
(regs)->ps = USER_PS_VALUE; \
@@ -204,7 +205,7 @@ struct thread_struct {
(regs)->depc = 0; \
(regs)->windowbase = 0; \
(regs)->windowstart = 1; \
- (regs)->syscall = NO_SYSCALL; \
+ (regs)->syscall = syscall; \
} while (0)
/* Forward declaration */