Author: tkreuzer
Date: Tue Dec 9 18:56:59 2008
New Revision: 37984
URL:
http://svn.reactos.org/svn/reactos?rev=37984&view=rev
Log:
Implement KeFreezeExecution and KeThawExecution
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] Tue Dec 9
18:56:59 2008
@@ -42,6 +42,10 @@
BOOLEAN KiI386PentiumLockErrataPresent;
BOOLEAN KiSMTProcessorsPresent;
+/* Freeze data */
+KIRQL KiOldIrql;
+ULONG KiFreezeFlag;
+
/* CPU Signatures */
static const CHAR CmpIntelID[] = "GenuineIntel";
static const CHAR CmpAmdID[] = "AuthenticAMD";
@@ -547,6 +551,39 @@
BOOLEAN
NTAPI
+KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
+ IN PKEXCEPTION_FRAME ExceptionFrame)
+{
+ ULONG64 Flags = 0;
+
+ /* Disable interrupts and get previous state */
+ Flags = __readeflags();
+ //Flags = __getcallerseflags();
+ _disable();
+
+ /* Save freeze flag */
+ KiFreezeFlag = 4;
+
+ /* Save the old IRQL */
+ KiOldIrql = KeGetCurrentIrql();
+
+ /* Return whether interrupts were enabled */
+ return (Flags & EFLAGS_INTERRUPT_MASK) ? TRUE: FALSE;
+}
+
+VOID
+NTAPI
+KeThawExecution(IN BOOLEAN Enable)
+{
+ /* Cleanup CPU caches */
+ KeFlushCurrentTb();
+
+ /* Re-enable interrupts */
+ if (Enable) _enable();
+}
+
+BOOLEAN
+NTAPI
KeInvalidateAllCaches(VOID)
{
/* Only supported on Pentium Pro and higher */