summaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/ptrace.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2020-07-18 17:47:43 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2020-07-28 00:57:05 -0700
commit8b7a87a03f7c15c7a1e1647c3527292604e80f6f (patch)
treed74522605da28d8d06f4874f8f4822a9657adb78 /arch/xtensa/kernel/ptrace.c
parentef1a935c08ea97436f62edb0b1427d60e31b777b (diff)
downloadlinux-8b7a87a03f7c15c7a1e1647c3527292604e80f6f.tar.bz2
xtensa: expose syscall through user_pt_regs
Use one of the reserved slots in struct user_pt_regs to return syscall number in the GPR regset. Update syscall number from the GPR regset only when it's non-zero. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel/ptrace.c')
-rw-r--r--arch/xtensa/kernel/ptrace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
index 0278d7dfb4d6..437b4297948d 100644
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -52,6 +52,7 @@ static int gpr_get(struct task_struct *target,
.threadptr = regs->threadptr,
.windowbase = regs->windowbase,
.windowstart = regs->windowstart,
+ .syscall = regs->syscall,
};
memcpy(newregs.a,
@@ -91,6 +92,9 @@ static int gpr_set(struct task_struct *target,
regs->sar = newregs.sar;
regs->threadptr = newregs.threadptr;
+ if (newregs.syscall)
+ regs->syscall = newregs.syscall;
+
if (newregs.windowbase != regs->windowbase ||
newregs.windowstart != regs->windowstart) {
u32 rotws, wmask;