diff --git a/VKernel/Kernel/sched/sched.vp b/VKernel/Kernel/sched/sched.vp index d6b5758..558b111 100644 --- a/VKernel/Kernel/sched/sched.vp +++ b/VKernel/Kernel/sched/sched.vp @@ -336,10 +336,10 @@ def _do_switch(): push r14 push r15 pushfq - # 切栈前保存本线程 SSE/FPU 状态(rax 已压栈,可作暂存;fxsave 不动通用寄存器) + # 切栈前保存 FPU/ISR mov rax, [rip + _switch_old_fpu] fxsave [rax] - # 按线程保存 ISR scratch(被抢占的 ISR 会跨越其它线程的 ISR) + # 保存 ISR scratch lea rsi, [rip + _isr_scratch] mov eax, dword ptr [rip + _switch_old_tid] imul rax, rax, 48 @@ -361,10 +361,10 @@ def _do_switch(): mov [rax], rsp mov rax, [rip + _switch_new_rsp] mov rsp, [rax] - # 换栈后恢复切入线程的 SSE/FPU 状态(不动通用寄存器;此时 rax 属新栈的保存值) + # 换栈后恢复 FPU/ISR mov rax, [rip + _switch_new_fpu] fxrstor [rax] - # 恢复切入线程的 scratch(不在 ISR 中时内容无意义,覆盖无害) + # 恢复 ISR scratch lea rsi, [rip + _isr_scratch] mov eax, dword ptr [rip + _switch_new_tid] imul rax, rax, 48