mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
[NTOS:KE/x64] Implement KiSaveProcessorState / KiRestoreProcessorState
This commit is contained in:
parent
1d289fec77
commit
af2ce4d08f
2 changed files with 43 additions and 3 deletions
|
@ -1024,9 +1024,14 @@ KiSaveProcessorControlState(
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
KiSaveProcessorState(
|
KiSaveProcessorState(
|
||||||
IN PKTRAP_FRAME TrapFrame,
|
_In_ PKTRAP_FRAME TrapFrame,
|
||||||
IN PKEXCEPTION_FRAME ExceptionFrame
|
_In_ PKEXCEPTION_FRAME ExceptionFrame);
|
||||||
);
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
KiRestoreProcessorState(
|
||||||
|
_Out_ PKTRAP_FRAME TrapFrame,
|
||||||
|
_Out_ PKEXCEPTION_FRAME ExceptionFrame);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
|
|
|
@ -612,6 +612,41 @@ KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
|
||||||
ProcessorState->SpecialRegisters.MsrSyscallMask = __readmsr(X86_MSR_SFMASK);
|
ProcessorState->SpecialRegisters.MsrSyscallMask = __readmsr(X86_MSR_SFMASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
KiSaveProcessorState(
|
||||||
|
_In_ PKTRAP_FRAME TrapFrame,
|
||||||
|
_In_ PKEXCEPTION_FRAME ExceptionFrame)
|
||||||
|
{
|
||||||
|
PKPRCB Prcb = KeGetCurrentPrcb();
|
||||||
|
|
||||||
|
/* Save all context */
|
||||||
|
Prcb->ProcessorState.ContextFrame.ContextFlags = CONTEXT_ALL;
|
||||||
|
KeTrapFrameToContext(TrapFrame, ExceptionFrame, &Prcb->ProcessorState.ContextFrame);
|
||||||
|
|
||||||
|
/* Save control registers */
|
||||||
|
KiSaveProcessorControlState(&Prcb->ProcessorState);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
KiRestoreProcessorState(
|
||||||
|
_Out_ PKTRAP_FRAME TrapFrame,
|
||||||
|
_Out_ PKEXCEPTION_FRAME ExceptionFrame)
|
||||||
|
{
|
||||||
|
PKPRCB Prcb = KeGetCurrentPrcb();
|
||||||
|
|
||||||
|
/* Restore all context */
|
||||||
|
KeContextToTrapFrame(&Prcb->ProcessorState.ContextFrame,
|
||||||
|
ExceptionFrame,
|
||||||
|
TrapFrame,
|
||||||
|
CONTEXT_ALL,
|
||||||
|
TrapFrame->PreviousMode);
|
||||||
|
|
||||||
|
/* Restore control registers */
|
||||||
|
KiRestoreProcessorControlState(&Prcb->ProcessorState);
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
KeFlushEntireTb(IN BOOLEAN Invalid,
|
KeFlushEntireTb(IN BOOLEAN Invalid,
|
||||||
|
|
Loading…
Reference in a new issue