mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 18:11:57 +00:00
[NTOS:KE/x64] Handle extended processor state on context switch
This commit is contained in:
parent
d6874fe7b9
commit
294eb31cfd
1 changed files with 13 additions and 1 deletions
|
@ -167,9 +167,21 @@ KiSwapContextResume(
|
|||
PKPROCESS OldProcess, NewProcess;
|
||||
|
||||
/* Setup ring 0 stack pointer */
|
||||
Pcr->TssBase->Rsp0 = (ULONG64)NewThread->InitialStack; // FIXME: NPX save area?
|
||||
Pcr->TssBase->Rsp0 = (ULONG64)NewThread->InitialStack;
|
||||
Pcr->Prcb.RspBase = Pcr->TssBase->Rsp0;
|
||||
|
||||
/* Save old thread's extended state */
|
||||
if (OldThread->NpxState != 0)
|
||||
{
|
||||
KiSaveXState(OldThread->StateSaveArea, OldThread->NpxState);
|
||||
}
|
||||
|
||||
/* Load new thread's extended state */
|
||||
if (NewThread->NpxState != 0)
|
||||
{
|
||||
KiRestoreXState(NewThread->StateSaveArea, NewThread->NpxState);
|
||||
}
|
||||
|
||||
/* Now we are the new thread. Check if it's in a new process */
|
||||
OldProcess = OldThread->ApcState.Process;
|
||||
NewProcess = NewThread->ApcState.Process;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue