diff --git a/arch/arm64/src/common/arm64_syscall.c b/arch/arm64/src/common/arm64_syscall.c index 6e837df1c23..ab1a67f4660 100644 --- a/arch/arm64/src/common/arm64_syscall.c +++ b/arch/arm64/src/common/arm64_syscall.c @@ -269,13 +269,13 @@ uint64_t *arm64_syscall(uint64_t *regs) /* Create a frame for info and copy the kernel info */ - rtcb->xcp.ustkptr = (uintptr_t *)read_sysreg(sp_el0); + rtcb->xcp.ustkptr = (uintptr_t *)regs[REG_SP_EL0]; usp = (uintptr_t)rtcb->xcp.ustkptr - sizeof(siginfo_t); memcpy((void *)usp, (void *)regs[REG_X2], sizeof(siginfo_t)); /* Now set the updated SP and user copy of "info" to R2 */ - write_sysreg(usp, sp_el0); + regs[REG_SP_EL0] = usp; regs[REG_X2] = usp; } #endif