#include <ntoskrnl.h>
#include <debug.h>
Go to the source code of this file.
◆ NDEBUG
◆ KKINIT_FRAME
◆ KSWITCHFRAME
◆ KUINIT_FRAME
◆ PKKINIT_FRAME
◆ PKSWITCHFRAME
◆ PKUINIT_FRAME
◆ KiDispatchInterrupt()
Definition at line 305 of file thrdini.c.
306{
310
311
313
314
318 {
319
320
321
323 }
324
325
327
328
330 {
331
334 }
336 {
337
339
340
343
344
347
348
351
352
353 KxQueueReadyThread(OldThread, Prcb);
354
355
357 }
358}
void __cdecl _disable(void)
void __cdecl _enable(void)
FORCEINLINE VOID KiAcquirePrcbLock(IN PKPRCB Prcb)
BOOLEAN FASTCALL KiSwapContext(IN KIRQL WaitIrql, IN PKTHREAD CurrentThread)
VOID NTAPI KiQuantumEnd(VOID)
VOID FASTCALL KiRetireDpcList(IN PKPRCB Prcb)
volatile ULONG DpcQueueDepth
struct _KTHREAD * CurrentThread
struct _KTHREAD * NextThread
SINGLE_LIST_ENTRY DeferredReadyListHead
struct _SINGLE_LIST_ENTRY * Next
Referenced by _HalpDispatchInterruptHandler(), HalpDispatchInterruptHandler(), HalpLowerIrql(), and KiInitializePcr().
◆ KiIdleLoop()
Definition at line 153 of file thrdini.c.
154{
157
158
160 {
161
166
167
171 {
172
174
175
177 }
178
179
181 {
182
184
185
188
189
192
193
195
196#ifdef CONFIG_SMP
197
199#endif
200
201
203
204#ifdef CONFIG_SMP
205
207#endif
208 }
209 else
210 {
211
213 }
214 }
215}
#define KeLowerIrql(oldIrql)
KIRQL FASTCALL KfRaiseIrql(IN KIRQL NewIrql)
VOID FASTCALL HalClearSoftwareInterrupt(IN KIRQL Irql)
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
PROCESSOR_POWER_STATE PowerState
PPROCESSOR_IDLE_FUNCTION IdleFunction
◆ KiInitializeContextThread()
Definition at line 53 of file thrdini.c.
58{
61
62
63
64
66 {
67
68
69
73
74
75
76
79
81
82
85
86
87
88
90 ExceptionFrame,
91 TrapFrame,
94
95
96
97
98
100
101
102
103
104 ExceptionFrame->
Return = 0;
105
106
107
108
110 }
111 else
112 {
113
114
115
119
120
121
122
124
125
126
127
129 }
130
131
132
133
135 CtxSwitchFrame->R11 = (
ULONG)(ExceptionFrame ? ExceptionFrame : CtxSwitchFrame);
136
137
138
139
141 CtxSwitchFrame->R5 = (
ULONG)StartContext;
143 CtxSwitchFrame->R7 = (
ULONG)SystemRoutine;
144
145
146
147
149}
struct _KUINIT_FRAME * PKUINIT_FRAME
struct _KKINIT_FRAME * PKKINIT_FRAME
struct _KKINIT_FRAME KKINIT_FRAME
struct _KUINIT_FRAME KUINIT_FRAME
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
__in PVOID ContextPointer
VOID NTAPI KiThreadStartup(VOID)
VOID NTAPI KeContextToTrapFrame(PCONTEXT Context, PKEXCEPTION_FRAME ExeptionFrame, PKTRAP_FRAME TrapFrame, ULONG ContextFlags, KPROCESSOR_MODE PreviousMode)
KSWITCH_FRAME CtxSwitchFrame
KEXCEPTION_FRAME ExceptionFrame
KSWITCH_FRAME CtxSwitchFrame
#define RtlZeroMemory(Destination, Length)
_In_ ULONG _In_opt_ POBJECT_ATTRIBUTES _In_opt_ HANDLE _Out_opt_ PCLIENT_ID _In_ PKSTART_ROUTINE StartRoutine
◆ KiSwapContextEntry()
Definition at line 272 of file thrdini.c.
274{
277
278
279 SwitchFrame->ApcBypassDisable = OldThreadAndApcFlag & 3;
280
281
283#if 0
285 {
286
287 DPRINT1(
"WMI Tracing not supported\n");
289 }
290#endif
291
292
293 OldThread = (
PKTHREAD)(OldThreadAndApcFlag & ~3);
295
296
298
299
301}
VOID FASTCALL KiSwitchThreads(IN PKTHREAD OldThread, IN PKTHREAD NewThread)
struct _KTHREAD * PKTHREAD
PVOID PerfGlobalGroupMask
◆ KiSwapContextExit()
Definition at line 219 of file thrdini.c.
221{
226
227
229
230
231 OldProcess = OldThread->ApcState.Process;
232 NewProcess = NewThread->
ApcState.Process;
233 if (OldProcess != NewProcess)
234 {
238 }
239
240
242
243
245 {
246
251 0);
252 }
253
254
255 if (NewThread->
ApcState.KernelApcPending)
256 {
257
259 {
260
263 }
264 }
265
266
268}
FORCEINLINE VOID KeArmTranslationTableRegisterSet(IN ARM_TTB_REGISTER Ttb)
VOID FASTCALL HalRequestSoftwareInterrupt(IN KIRQL Irql)
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
ULONG_PTR DirectoryTableBase
◆ KiSwitchThreads()
◆ KiThreadStartup()
Definition at line 63 of file thrdini.c.
64{
68
69
73
74
76
77
79
80
82 {
84 }
85
86
88}
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
VOID FASTCALL KfLowerIrql(IN KIRQL NewIrql)
#define KeGetCurrentThread
PKSYSTEM_ROUTINE SystemRoutine
PKSTART_ROUTINE StartRoutine