Skip to content

Commit 132868b

Browse files
pussuwxiaoxiang781216
authored andcommitted
arm64_syscall.c: Don't need to set register context during syscall
The register context is not needed, the original idea was to provide the user stack pointer for signal handler delivery, but the user stack can be obtained via sp_el0 so the context registers are not needed. SP0 is not stored upon exception entry anyways, so this code is just completely redundant and wrong.
1 parent 1aab457 commit 132868b

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

arch/arm64/src/common/arm64_syscall.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static void arm64_dump_syscall(const char *tag, uint64_t cmd,
9494
uintptr_t dispatch_syscall(unsigned int nbr, uintptr_t parm1,
9595
uintptr_t parm2, uintptr_t parm3,
9696
uintptr_t parm4, uintptr_t parm5,
97-
uintptr_t parm6, void *context)
97+
uintptr_t parm6)
9898
{
9999
struct tcb_s *rtcb = this_task();
100100
register long x0 asm("x0") = (long)(nbr);
@@ -116,10 +116,6 @@ uintptr_t dispatch_syscall(unsigned int nbr, uintptr_t parm1,
116116
return -ENOSYS;
117117
}
118118

119-
/* Set the user register context to TCB */
120-
121-
rtcb->xcp.regs = context;
122-
123119
/* Indicate that we are in a syscall handler */
124120

125121
rtcb->flags |= TCB_FLAG_SYSCALL;

arch/arm64/src/common/arm64_vectors.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ SECTION_FUNC(text, arm64_sync_exc)
239239
/* Call dispatch_syscall() on the kernel stack with interrupts enabled */
240240

241241
enable_irq
242-
mov x7, sp /* x7 = context */
243242
bl dispatch_syscall
244243
disable_irq
245244

0 commit comments

Comments
 (0)