ReactOS  r76032
freeze.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Kernel
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: ntoskrnl/ke/freeze.c
5  * PURPOSE: Routines for freezing and unfreezing processors for
6  * kernel debugger synchronization.
7  * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
8  */
9 
10 /* INCLUDES *******************************************************************/
11 
12 #include <ntoskrnl.h>
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* GLOBALS ********************************************************************/
17 
18 /* Freeze data */
21 
22 /* FUNCTIONS ******************************************************************/
23 
24 BOOLEAN
25 NTAPI
27  IN PKEXCEPTION_FRAME ExceptionFrame)
28 {
30 
31  /* Disable interrupts and get previous state */
32  Enable = KeDisableInterrupts();
33 
34  /* Save freeze flag */
35  KiFreezeFlag = 4;
36 
37  /* Save the old IRQL */
39 
40  /* Return whether interrupts were enabled */
41  return Enable;
42 }
43 
44 VOID
45 NTAPI
47 {
48  /* Cleanup CPU caches */
50 
51  /* Re-enable interrupts */
52  if (Enable) _enable();
53 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define IN
Definition: typedefs.h:38
BOOLEAN Enable
Definition: acefiex.h:245
void __cdecl _enable(void)
Definition: intrin_arm.h:373
UCHAR KIRQL
Definition: env_spec_w32.h:591
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
FORCEINLINE BOOLEAN KeDisableInterrupts(VOID)
Definition: ke.h:152
unsigned char BOOLEAN
KIRQL KiOldIrql
Definition: freeze.c:19
BOOLEAN NTAPI KeFreezeExecution(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
Definition: freeze.c:26
VOID NTAPI KeThawExecution(IN BOOLEAN Enable)
Definition: freeze.c:46
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI KeFlushCurrentTb(VOID)
Definition: cpu.c:332
ULONG KiFreezeFlag
Definition: freeze.c:20