Skip to content

Commit

Permalink
x86_64: we should call x86_64_restorestate/x86_64_savestate
Browse files Browse the repository at this point in the history
reason:
In x86_64, g_current_regs is still used for context switching.

This commit fixes the regression from apache#13616

Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Sep 30, 2024
1 parent 7cf5e7c commit 3a21942
Show file tree
Hide file tree
Showing 3 changed files with 536 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/x86_64/src/intel64/intel64_cpupause.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,16 @@ int up_pause_handler(int irq, void *c, void *arg)

int up_pause_async_handler(int irq, void *c, void *arg)
{
struct tcb_s *tcb;
int cpu = this_cpu();

tcb = current_task(cpu);
nxsched_suspend_scheduler(tcb);
x86_64_savestate(tcb->xcp.regs);
nxsched_process_delivered(cpu);
tcb = current_task(cpu);
nxsched_resume_scheduler(tcb);
x86_64_restorestate(tcb->xcp.regs);

return OK;
}
Expand Down
Binary file added boot.iso
Binary file not shown.
Loading

0 comments on commit 3a21942

Please sign in to comment.