mirror of
https://github.com/reactos/reactos.git
synced 2025-06-06 01:40:36 +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:
parent
9475cf4cbc
commit
4e140f4d79
2 changed files with 53 additions and 35 deletions
53
reactos/ntoskrnl/ke/freeze.c
Normal file
53
reactos/ntoskrnl/ke/freeze.c
Normal 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();
|
||||||
|
}
|
|
@ -45,10 +45,6 @@ KAFFINITY KeActiveProcessors = 1;
|
||||||
BOOLEAN KiI386PentiumLockErrataPresent;
|
BOOLEAN KiI386PentiumLockErrataPresent;
|
||||||
BOOLEAN KiSMTProcessorsPresent;
|
BOOLEAN KiSMTProcessorsPresent;
|
||||||
|
|
||||||
/* Freeze data */
|
|
||||||
KIRQL KiOldIrql;
|
|
||||||
ULONG KiFreezeFlag;
|
|
||||||
|
|
||||||
/* Flush data */
|
/* Flush data */
|
||||||
volatile LONG KiTbFlushTimeStamp;
|
volatile LONG KiTbFlushTimeStamp;
|
||||||
|
|
||||||
|
@ -906,37 +902,6 @@ KeDisableInterrupts(VOID)
|
||||||
return Return;
|
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
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
KeInvalidateAllCaches(VOID)
|
KeInvalidateAllCaches(VOID)
|
||||||
|
|
Loading…
Reference in a new issue