Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm/armv8-r: fix unable to switch context in ISR context #14498

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions arch/arm/src/armv8-r/arm_doirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
* and we will use this_task(). Therefore, it cannot be overridden.
*/

#ifdef CONFIG_SMP
anchao marked this conversation as resolved.
Show resolved Hide resolved
if (irq != GIC_SMP_CPUSTART)
#endif
{
tcb->xcp.regs = regs;
}
Expand All @@ -72,11 +74,10 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
/* Deliver the IRQ */

irq_dispatch(irq, regs);
tcb = this_task();

if (regs != tcb->xcp.regs)
{
tcb = this_task();

/* Update scheduler parameters */

nxsched_suspend_scheduler(g_running_tasks[this_cpu()]);
Expand All @@ -87,7 +88,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
* crashes.
*/

g_running_tasks[this_cpu()] = this_task();
g_running_tasks[this_cpu()] = tcb;
regs = tcb->xcp.regs;
}

Expand Down
Loading