pussuw commented on code in PR #14596:
URL: https://github.com/apache/nuttx/pull/14596#discussion_r1825751280
##########
arch/arm/src/arm/arm_syscall.c:
##########
@@ -54,19 +54,23 @@
uint32_t *arm_syscall(uint32_t *regs)
{
- struct tcb_s *tcb = this_task();
+ struct tcb_s **running_task = &g_running_tasks[this_cpu()];
+ FAR struct tcb_s *tcb = this_task();
uint32_t cmd;
- int cpu;
/* Nested interrupts are not supported */
DEBUGASSERT(up_current_regs() == NULL);
+ if (*running_task != NULL)
+ {
+ (*running_task)->xcp.regs = regs;
Review Comment:
What's wrong with simply;
`tcb->xcp.regs = regs ` ?
Why do you need to involve running_tasks ?
##########
arch/arm/src/arm/arm_syscall.c:
##########
@@ -54,19 +54,23 @@
uint32_t *arm_syscall(uint32_t *regs)
{
- struct tcb_s *tcb = this_task();
+ struct tcb_s **running_task = &g_running_tasks[this_cpu()];
+ FAR struct tcb_s *tcb = this_task();
uint32_t cmd;
- int cpu;
/* Nested interrupts are not supported */
DEBUGASSERT(up_current_regs() == NULL);
+ if (*running_task != NULL)
+ {
+ (*running_task)->xcp.regs = regs;
Review Comment:
What's wrong with simply;
`tcb->xcp.regs = regs ` ?
Why do you need to involve g_running_tasks ?
--
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]