mirror of
https://github.com/reactos/reactos
synced 2025-10-06 00:12:51 +02:00
[NTOS:KE/x64] Handle extended processor state on context switch
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user