ReactOS 0.4.15-dev-7958-gcd0bb1a
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
27 IN PKEXCEPTION_FRAME ExceptionFrame)
28{
31
32#ifndef CONFIG_SMP
33 UNREFERENCED_PARAMETER(TrapFrame);
34 UNREFERENCED_PARAMETER(ExceptionFrame);
35#endif
36
37 /* Disable interrupts, get previous state and set the freeze flag */
39 KiFreezeFlag = 4;
40
41#ifndef CONFIG_SMP
42 /* Raise IRQL if we have to */
46#else
47 /* Raise IRQL to HIGH_LEVEL */
49#endif
50
51#ifdef CONFIG_SMP
52 /* Architecture specific freeze code */
54#endif
55
56 /* Save the old IRQL to be restored on unfreeze */
58
59 /* Return whether interrupts were enabled */
60 return Enable;
61}
62
63VOID
66{
67#ifdef CONFIG_SMP
68 /* Architecture specific thaw code */
70#endif
71
72 /* Clear the freeze flag */
73 KiFreezeFlag = 0;
74
75 /* Cleanup CPU caches */
77
78 /* Restore the old IRQL */
79#ifndef CONFIG_SMP
81#endif
83
84 /* Re-enable interrupts */
86}
unsigned char BOOLEAN
VOID NTAPI KxThawExecution(VOID)
Definition: freeze.c:141
VOID NTAPI KxFreezeExecution(VOID)
Definition: freeze.c:78
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment KeRaiseIrqlToDpcLevel
Definition: CrNtStubs.h:68
ULONG KiFreezeFlag
Definition: freeze.c:20
BOOLEAN NTAPI KeFreezeExecution(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
Definition: freeze.c:26
KIRQL KiOldIrql
Definition: freeze.c:19
VOID NTAPI KeThawExecution(IN BOOLEAN Enable)
Definition: freeze.c:65
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
FORCEINLINE BOOLEAN KeDisableInterrupts(VOID)
Definition: ke.h:239
FORCEINLINE VOID KeRestoreInterrupts(BOOLEAN WereEnabled)
Definition: ke.h:254
VOID NTAPI KeFlushCurrentTb(VOID)
Definition: cpu.c:526
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778