mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
- 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:
@@ -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 ([email protected])
|
||||
*/
|
||||
|
||||
/* 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();
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user