From 09d659d2751f11d64c72b2458fbf7085cb3f5120 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 28 Feb 2020 18:19:11 +0900 Subject: [PATCH] xtensa: Fix up_schedule_sigaction This fixes various crashes in ostest. --- arch/xtensa/src/common/xtensa_schedsigaction.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/xtensa/src/common/xtensa_schedsigaction.c b/arch/xtensa/src/common/xtensa_schedsigaction.c index a5fe76819e..693e55545d 100644 --- a/arch/xtensa/src/common/xtensa_schedsigaction.c +++ b/arch/xtensa/src/common/xtensa_schedsigaction.c @@ -181,8 +181,8 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ tcb->xcp.sigdeliver = sigdeliver; - tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; - tcb->xcp.saved_ps = CURRENT_REGS[REG_PS]; + tcb->xcp.saved_pc = tcb->xcp.regs[REG_PC]; + tcb->xcp.saved_ps = tcb->xcp.regs[REG_PS]; /* Then set up to vector to the trampoline with interrupts * disabled @@ -362,8 +362,8 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ tcb->xcp.sigdeliver = sigdeliver; - tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; - tcb->xcp.saved_ps = CURRENT_REGS[REG_PS]; + tcb->xcp.saved_pc = tcb->xcp.regs[REG_PC]; + tcb->xcp.saved_ps = tcb->xcp.regs[REG_PS]; /* Increment the IRQ lock count so that when the task is restarted, * it will hold the IRQ spinlock.