lipengfei28 commented on code in PR #14739:
URL: https://github.com/apache/nuttx/pull/14739#discussion_r1839667019
##########
arch/arm64/include/irq.h:
##########
@@ -407,14 +407,16 @@ static inline void up_irq_restore(irqstate_t flags)
#define up_update_task(t) modify_sysreg(t, ~1ul, tpidr_el1)
#define up_interrupt_context() (read_sysreg(tpidr_el1) & 1)
-#define up_switch_context(tcb, rtcb) \
- do { \
- if (!up_interrupt_context()) \
- { \
- sys_call2(SYS_switch_context, (uintptr_t)&rtcb->xcp.regs, \
- (uintptr_t)tcb->xcp.regs); \
- } \
- } while (0)
+#define up_switch_context(tcb, rtcb) \
+ do \
+ { \
+ if (!up_interrupt_context()) \
+ { \
+ sys_call2(SYS_switch_context, (uintptr_t)rtcb, \
+ (uintptr_t)tcb); \
Review Comment:
done
##########
arch/arm64/src/common/arm64_syscall.c:
##########
@@ -217,10 +217,13 @@ uint64_t *arm64_syscall(uint64_t *regs)
case SYS_switch_context:
{
+ struct tcb_s *rtcb = (struct tcb_s *)regs[REG_X1];
+
DEBUGASSERT(regs[REG_X1] != 0 && regs[REG_X2] != 0);
- *(uint64_t **)regs[REG_X1] = regs;
+ tcb = (struct tcb_s *)regs[REG_X2];
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]