Skip to content

Commit

Permalink
x86_64: fix regression #15651
Browse files Browse the repository at this point in the history
reason:
In x86_64, tcb->xcp.regs is always valid, and we obtain the location
where the context is saved through irq_xcp_regs every time an interrupt occurs.

Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Jan 23, 2025
1 parent 801cd45 commit 37eb0e6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions arch/x86_64/src/intel64/intel64_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ static uint64_t *common_handler(int irq, uint64_t *regs)
struct tcb_s **running_task = &g_running_tasks[this_cpu()];
struct tcb_s *tcb;

(*running_task)->xcp.regs = regs;

/* Current regs non-zero indicates that we are processing an interrupt;
* g_current_regs is also used to manage interrupt level context switches.
*
Expand Down Expand Up @@ -126,14 +124,8 @@ static uint64_t *common_handler(int irq, uint64_t *regs)
/* Clear irq flag */

up_set_interrupt_context(false);
regs = tcb->xcp.regs;

/* (*running_task)->xcp.regs is about to become invalid
* and will be marked as NULL to avoid misusage.
*/

(*running_task)->xcp.regs = NULL;
return regs;
return tcb->xcp.regs;
}
#endif

Expand Down

0 comments on commit 37eb0e6

Please sign in to comment.