Author: sginsberg
Date: Sun Nov 8 22:10:23 2009
New Revision: 44030
URL:
http://svn.reactos.org/svn/reactos?rev=44030&view=rev
Log:
- Move processor freeze support out from x86 cpu.c to new generic freeze.c as these
routines are quite generic.
Added:
trunk/reactos/ntoskrnl/ke/freeze.c (with props)
Modified:
trunk/reactos/ntoskrnl/ke/i386/cpu.c
Added: trunk/reactos/ntoskrnl/ke/freeze.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/freeze.c?rev=4…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/freeze.c (added)
+++ trunk/reactos/ntoskrnl/ke/freeze.c [iso-8859-1] Sun Nov 8 22:10:23 2009
@@ -1,0 +1,53 @@
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: ntoskrnl/ke/freeze.c
+ * PURPOSE: Routines for freezing and unfreezing processors for
+ * kernel debugger synchronization.
+ * PROGRAMMERS: Stefan Ginsberg (stefan.ginsberg(a)reactos.org)
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include <ntoskrnl.h>
+#define NDEBUG
+#include <debug.h>
+
+/* GLOBALS ********************************************************************/
+
+/* Freeze data */
+KIRQL KiOldIrql;
+ULONG KiFreezeFlag;
+
+/* FUNCTIONS ******************************************************************/
+
+BOOLEAN
+NTAPI
+KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
+ IN PKEXCEPTION_FRAME ExceptionFrame)
+{
+ BOOLEAN Enable;
+
+ /* Disable interrupts and get previous state */
+ Enable = KeDisableInterrupts();
+
+ /* Save freeze flag */
+ KiFreezeFlag = 4;
+
+ /* Save the old IRQL */
+ KiOldIrql = KeGetCurrentIrql();
+
+ /* Return whether interrupts were enabled */
+ return Enable;
+}
+
+VOID
+NTAPI
+KeThawExecution(IN BOOLEAN Enable)
+{
+ /* Cleanup CPU caches */
+ KeFlushCurrentTb();
+
+ /* Re-enable interrupts */
+ if (Enable) _enable();
+}
Propchange: trunk/reactos/ntoskrnl/ke/freeze.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] Sun Nov 8 22:10:23 2009
@@ -45,10 +45,6 @@
BOOLEAN KiI386PentiumLockErrataPresent;
BOOLEAN KiSMTProcessorsPresent;
-/* Freeze data */
-KIRQL KiOldIrql;
-ULONG KiFreezeFlag;
-
/* Flush data */
volatile LONG KiTbFlushTimeStamp;
@@ -908,37 +904,6 @@
BOOLEAN
NTAPI
-KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
- IN PKEXCEPTION_FRAME ExceptionFrame)
-{
- BOOLEAN Enable;
-
- /* Disable interrupts and get previous state */
- Enable = KeDisableInterrupts();
-
- /* Save freeze flag */
- KiFreezeFlag = 4;
-
- /* Save the old IRQL */
- KiOldIrql = KeGetCurrentIrql();
-
- /* Return whether interrupts were enabled */
- return Enable;
-}
-
-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 */