- Move processor freeze support out from x86 cpu.c to new generic freeze.c as these routines are quite generic.

svn path=/trunk/; revision=44030
This commit is contained in:
Stefan Ginsberg 2009-11-08 21:10:23 +00:00
parent 9475cf4cbc
commit 4e140f4d79
2 changed files with 53 additions and 35 deletions

View file

@ -0,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@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();
}

View file

@ -45,10 +45,6 @@ KAFFINITY KeActiveProcessors = 1;
BOOLEAN KiI386PentiumLockErrataPresent;
BOOLEAN KiSMTProcessorsPresent;
/* Freeze data */
KIRQL KiOldIrql;
ULONG KiFreezeFlag;
/* Flush data */
volatile LONG KiTbFlushTimeStamp;
@ -906,37 +902,6 @@ KeDisableInterrupts(VOID)
return Return;
}
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)