Author: tkreuzer
Date: Sun Aug 24 19:12:33 2008
New Revision: 35619
URL:
http://svn.reactos.org/svn/reactos?rev=35619&view=rev
Log:
- Fix comments and comment out stmxcsr, as it crashes for some reason.
Modified:
branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] Sun Aug 24
19:12:33 2008
@@ -495,14 +495,14 @@
NTAPI
KiRestoreProcessorControlState(PKPROCESSOR_STATE ProcessorState)
{
- /* Save the CR registers */
+ /* Restore the CR registers */
__writecr0(ProcessorState->SpecialRegisters.Cr0);
// __writecr2(ProcessorState->SpecialRegisters.Cr2);
__writecr3(ProcessorState->SpecialRegisters.Cr3);
__writecr4(ProcessorState->SpecialRegisters.Cr4);
__writecr8(ProcessorState->SpecialRegisters.Cr8);
- /* Save the DR registers */
+ /* Restore the DR registers */
__writedr(0, ProcessorState->SpecialRegisters.KernelDr0);
__writedr(1, ProcessorState->SpecialRegisters.KernelDr1);
__writedr(2, ProcessorState->SpecialRegisters.KernelDr2);
@@ -510,7 +510,7 @@
__writedr(6, ProcessorState->SpecialRegisters.KernelDr6);
__writedr(7, ProcessorState->SpecialRegisters.KernelDr7);
- /* Save GDT, IDT, LDT and TSS */
+ /* Restore GDT, IDT, LDT and TSS */
__lgdt(&ProcessorState->SpecialRegisters.Gdtr.Limit);
__lldt(&ProcessorState->SpecialRegisters.Ldtr);
__ltr(&ProcessorState->SpecialRegisters.Tr);
@@ -522,6 +522,8 @@
// ProcessorState->SpecialRegisters.LastBranchFromRip
// ProcessorState->SpecialRegisters.LastExceptionToRip
// ProcessorState->SpecialRegisters.LastExceptionFromRip
+
+ /* Restore MSRs */
__writemsr(X86_MSR_GSBASE, ProcessorState->SpecialRegisters.MsrGsBase);
__writemsr(X86_MSR_KERNEL_GSBASE, ProcessorState->SpecialRegisters.MsrGsSwap);
__writemsr(X86_MSR_STAR, ProcessorState->SpecialRegisters.MsrStar);
@@ -556,12 +558,14 @@
__str(&ProcessorState->SpecialRegisters.Tr);
__sidt(&ProcessorState->SpecialRegisters.Idtr.Limit);
- __stmxcsr(&ProcessorState->SpecialRegisters.MxCsr);
+// __stmxcsr(&ProcessorState->SpecialRegisters.MxCsr);
// ProcessorState->SpecialRegisters.DebugControl =
// ProcessorState->SpecialRegisters.LastBranchToRip =
// ProcessorState->SpecialRegisters.LastBranchFromRip =
// ProcessorState->SpecialRegisters.LastExceptionToRip =
// ProcessorState->SpecialRegisters.LastExceptionFromRip =
+
+ /* Save MSRs */
ProcessorState->SpecialRegisters.MsrGsBase = __readmsr(X86_MSR_GSBASE);
ProcessorState->SpecialRegisters.MsrGsSwap = __readmsr(X86_MSR_KERNEL_GSBASE);
ProcessorState->SpecialRegisters.MsrStar = __readmsr(X86_MSR_STAR);