This is an automated email from the ASF dual-hosted git repository.
masayuki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 0e87a475d3 x86_64: we should call x86_64_restorestate/x86_64_savestate
0e87a475d3 is described below
commit 0e87a475d344fb1967b9da2157b2a2432f8c5a8b
Author: hujun5 <[email protected]>
AuthorDate: Mon Sep 30 11:11:01 2024 +0800
x86_64: we should call x86_64_restorestate/x86_64_savestate
reason:
In x86_64, g_current_regs is still used for context switching.
This commit fixes the regression from
https://github.com/apache/nuttx/pull/13616
Signed-off-by: hujun5 <[email protected]>
---
arch/x86_64/src/intel64/intel64_cpupause.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86_64/src/intel64/intel64_cpupause.c
b/arch/x86_64/src/intel64/intel64_cpupause.c
index 7f6891d24c..9d95e8f08d 100644
--- a/arch/x86_64/src/intel64/intel64_cpupause.c
+++ b/arch/x86_64/src/intel64/intel64_cpupause.c
@@ -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;
}