[NTOSKRNL]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 25 Sep 2011 09:12:26 +0000 (09:12 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 25 Sep 2011 09:12:26 +0000 (09:12 +0000)
- Undo disabling of systemcalls, which was disabled in r53646 for testing purpose.
- Sillence "Support for SYSENTER detected." debug print, since its the normal case, only keep the disabled and not present cases.
- Silence "xxx support detected but not yet taken advantage of" debug prints. CPU features are already reported and there is no point in printing every single feature we do not support.
- Invert if/else in KiRestoreFastSyscallReturnState

svn path=/trunk/; revision=53846

reactos/ntoskrnl/ke/i386/cpu.c
reactos/ntoskrnl/ke/i386/kiinit.c
reactos/ntoskrnl/ke/i386/patpge.c

index 7c548fe..c525777 100644 (file)
@@ -23,7 +23,7 @@ UCHAR KiNMITSS[KTSS_IO_MAPS];
 /* CPU Features and Flags */
 ULONG KeI386CpuType;
 ULONG KeI386CpuStep;
-ULONG KiFastSystemCallDisable = 1;
+ULONG KiFastSystemCallDisable = 0;
 ULONG KeI386NpxPresent = 0;
 ULONG KiMXCsrMask = 0;
 ULONG MxcsrFeatureMask = 0;
@@ -1064,21 +1064,21 @@ KiRestoreFastSyscallReturnState(VOID)
     if (KeFeatureBits & KF_FAST_SYSCALL)
     {
         /* Check if it has been disabled */
-        if (!KiFastSystemCallDisable)
+        if (KiFastSystemCallDisable)
+        {
+            /* Disable fast system call */
+            KeFeatureBits &= ~KF_FAST_SYSCALL;
+            KiFastCallExitHandler = KiSystemCallTrapReturn;
+            DPRINT1("Support for SYSENTER disabled.\n");
+        }
+        else
         {
             /* Do an IPI to enable it */
             KeIpiGenericCall(KiLoadFastSyscallMachineSpecificRegisters, 0);
 
             /* It's enabled, so use the proper exit stub */
             KiFastCallExitHandler = KiSystemCallSysExitReturn;
-            DPRINT1("Support for SYSENTER detected.\n");
-        }
-        else
-        {
-            /* Disable fast system call */
-            KeFeatureBits &= ~KF_FAST_SYSCALL;
-            KiFastCallExitHandler = KiSystemCallTrapReturn;
-            DPRINT1("Support for SYSENTER disabled.\n");
+            DPRINT("Support for SYSENTER detected.\n");
         }
     }
     else
index 21ed127..81a4954 100644 (file)
@@ -51,7 +51,7 @@ KiInitMachineDependent(VOID)
     if (KeFeatureBits & KF_LARGE_PAGE)
     {
         /* FIXME: Support this */
-        DPRINT1("Large Page support detected but not yet taken advantage of\n");
+        DPRINT("Large Page support detected but not yet taken advantage of\n");
     }
 
     /* Check for global page support */
@@ -314,7 +314,7 @@ KiInitMachineDependent(VOID)
         /* FIXME: TODO */
         DPRINT1("ISR Time Limit not yet supported\n");
     }
-    
+
     /* Set CR0 features based on detected CPU */
     KiSetCR0Bits();
 }
@@ -650,7 +650,7 @@ INIT_FUNCTION
 KiSystemStartupBootStack(VOID)
 {
     PKTHREAD Thread;
-    
+
     /* Initialize the kernel for the current CPU */
     KiInitializeKernel(&KiInitialProcess.Pcb,
                        (PKTHREAD)KeLoaderBlock->Thread,
@@ -658,15 +658,15 @@ KiSystemStartupBootStack(VOID)
                        (PKPRCB)__readfsdword(KPCR_PRCB),
                        KeNumberProcessors - 1,
                        KeLoaderBlock);
-   
+
     /* Set the priority of this thread to 0 */
     Thread = KeGetCurrentThread();
     Thread->Priority = 0;
-    
+
     /* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */
     _enable();
     KfLowerIrql(DISPATCH_LEVEL);
-    
+
     /* Set the right wait IRQL */
     Thread->WaitIrql = DISPATCH_LEVEL;
 
@@ -687,7 +687,7 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
     KIDTENTRY NmiEntry, DoubleFaultEntry;
     PKTSS Tss;
     PKIPCR Pcr;
-    
+
     /* Boot cycles timestamp */
     BootCycles = __rdtsc();
 
index 5e8e232..0bcc3a6 100644 (file)
@@ -43,7 +43,7 @@ Ki386EnableGlobalPage(IN volatile ULONG_PTR Context)
     __writecr3(Cr3);
 
     /* Now enable PGE */
-    DPRINT1("Global page support detected but not yet taken advantage of\n");
+    DPRINT("Global page support detected but not yet taken advantage of\n");
     //__writecr4(Cr4 | CR4_PGE);
 
     /* Restore interrupts */
@@ -57,5 +57,5 @@ INIT_FUNCTION
 KiInitializePAT(VOID)
 {
     /* FIXME: Support this */
-    DPRINT1("PAT support detected but not yet taken advantage of\n");
+    DPRINT("PAT support detected but not yet taken advantage of\n");
 }