bff87b8846e1edfffea3d3dca9dd6aa2b19d135b
[reactos.git] / reactos / ntoskrnl / include / internal / ke.h
1 #pragma once
2
3 /* INCLUDES *****************************************************************/
4
5 #include "arch/ke.h"
6
7 /* INTERNAL KERNEL TYPES ****************************************************/
8
9 typedef struct _WOW64_PROCESS
10 {
11 PVOID Wow64;
12 } WOW64_PROCESS, *PWOW64_PROCESS;
13
14 typedef struct _KPROFILE_SOURCE_OBJECT
15 {
16 KPROFILE_SOURCE Source;
17 LIST_ENTRY ListEntry;
18 } KPROFILE_SOURCE_OBJECT, *PKPROFILE_SOURCE_OBJECT;
19
20 typedef enum _CONNECT_TYPE
21 {
22 NoConnect,
23 NormalConnect,
24 ChainConnect,
25 UnknownConnect
26 } CONNECT_TYPE, *PCONNECT_TYPE;
27
28 typedef struct _DISPATCH_INFO
29 {
30 CONNECT_TYPE Type;
31 PKINTERRUPT Interrupt;
32 PKINTERRUPT_ROUTINE NoDispatch;
33 PKINTERRUPT_ROUTINE InterruptDispatch;
34 PKINTERRUPT_ROUTINE FloatingDispatch;
35 PKINTERRUPT_ROUTINE ChainedDispatch;
36 PKINTERRUPT_ROUTINE *FlatDispatch;
37 } DISPATCH_INFO, *PDISPATCH_INFO;
38
39 typedef struct _DEFERRED_REVERSE_BARRIER
40 {
41 ULONG Barrier;
42 ULONG TotalProcessors;
43 } DEFERRED_REVERSE_BARRIER, *PDEFERRED_REVERSE_BARRIER;
44
45 typedef struct _KI_SAMPLE_MAP
46 {
47 LARGE_INTEGER PerfStart;
48 LARGE_INTEGER PerfEnd;
49 LONGLONG PerfDelta;
50 LARGE_INTEGER PerfFreq;
51 LONGLONG TSCStart;
52 LONGLONG TSCEnd;
53 LONGLONG TSCDelta;
54 ULONG MHz;
55 } KI_SAMPLE_MAP, *PKI_SAMPLE_MAP;
56
57 typedef struct _KTIMER_TABLE_ENTRY
58 {
59 LIST_ENTRY Entry;
60 ULARGE_INTEGER Time;
61 } KTIMER_TABLE_ENTRY, *PKTIMER_TABLE_ENTRY;
62
63 #define MAX_TIMER_DPCS 16
64
65 typedef struct _DPC_QUEUE_ENTRY
66 {
67 PKDPC Dpc;
68 PKDEFERRED_ROUTINE Routine;
69 PVOID Context;
70 } DPC_QUEUE_ENTRY, *PDPC_QUEUE_ENTRY;
71
72 typedef struct _KNMI_HANDLER_CALLBACK
73 {
74 struct _KNMI_HANDLER_CALLBACK* Next;
75 PNMI_CALLBACK Callback;
76 PVOID Context;
77 PVOID Handle;
78 } KNMI_HANDLER_CALLBACK, *PKNMI_HANDLER_CALLBACK;
79
80 typedef PCHAR
81 (NTAPI *PKE_BUGCHECK_UNICODE_TO_ANSI)(
82 IN PUNICODE_STRING Unicode,
83 IN PCHAR Ansi,
84 IN ULONG Length
85 );
86
87 extern PKNMI_HANDLER_CALLBACK KiNmiCallbackListHead;
88 extern KSPIN_LOCK KiNmiCallbackListLock;
89 extern PVOID KeUserApcDispatcher;
90 extern PVOID KeUserCallbackDispatcher;
91 extern PVOID KeUserExceptionDispatcher;
92 extern PVOID KeRaiseUserExceptionDispatcher;
93 extern LARGE_INTEGER KeBootTime;
94 extern ULONGLONG KeBootTimeBias;
95 extern BOOLEAN ExCmosClockIsSane;
96 extern USHORT KeProcessorArchitecture;
97 extern USHORT KeProcessorLevel;
98 extern USHORT KeProcessorRevision;
99 extern ULONG KeFeatureBits;
100 extern KNODE KiNode0;
101 extern PKNODE KeNodeBlock[1];
102 extern UCHAR KeNumberNodes;
103 extern UCHAR KeProcessNodeSeed;
104 extern ETHREAD KiInitialThread;
105 extern EPROCESS KiInitialProcess;
106 extern PULONG KiInterruptTemplateObject;
107 extern PULONG KiInterruptTemplateDispatch;
108 extern PULONG KiInterruptTemplate2ndDispatch;
109 extern ULONG KiUnexpectedEntrySize;
110 extern ULONG_PTR KiDoubleFaultStack;
111 extern EX_PUSH_LOCK KernelAddressSpaceLock;
112 extern ULONG KiMaximumDpcQueueDepth;
113 extern ULONG KiMinimumDpcRate;
114 extern ULONG KiAdjustDpcThreshold;
115 extern ULONG KiIdealDpcRate;
116 extern BOOLEAN KeThreadDpcEnable;
117 extern LARGE_INTEGER KiTimeIncrementReciprocal;
118 extern UCHAR KiTimeIncrementShiftCount;
119 extern ULONG KiTimeLimitIsrMicroseconds;
120 extern ULONG KiServiceLimit;
121 extern LIST_ENTRY KeBugcheckCallbackListHead, KeBugcheckReasonCallbackListHead;
122 extern KSPIN_LOCK BugCheckCallbackLock;
123 extern KDPC KiTimerExpireDpc;
124 extern KTIMER_TABLE_ENTRY KiTimerTableListHead[TIMER_TABLE_SIZE];
125 extern FAST_MUTEX KiGenericCallDpcMutex;
126 extern LIST_ENTRY KiProfileListHead, KiProfileSourceListHead;
127 extern KSPIN_LOCK KiProfileLock;
128 extern LIST_ENTRY KiProcessListHead;
129 extern LIST_ENTRY KiProcessInSwapListHead, KiProcessOutSwapListHead;
130 extern LIST_ENTRY KiStackInSwapListHead;
131 extern KEVENT KiSwapEvent;
132 extern PKPRCB KiProcessorBlock[];
133 extern ULONG KiMask32Array[MAXIMUM_PRIORITY];
134 extern ULONG_PTR KiIdleSummary;
135 extern PVOID KeUserApcDispatcher;
136 extern PVOID KeUserCallbackDispatcher;
137 extern PVOID KeUserExceptionDispatcher;
138 extern PVOID KeRaiseUserExceptionDispatcher;
139 extern ULONG KeTimeIncrement;
140 extern ULONG KeTimeAdjustment;
141 extern BOOLEAN KiTimeAdjustmentEnabled;
142 extern LONG KiTickOffset;
143 extern ULONG_PTR KiBugCheckData[5];
144 extern ULONG KiFreezeFlag;
145 extern ULONG KiDPCTimeout;
146 extern PGDI_BATCHFLUSH_ROUTINE KeGdiFlushUserBatch;
147 extern ULONGLONG BootCycles, BootCyclesEnd;
148 extern ULONG ProcessCount;
149 extern VOID __cdecl KiInterruptTemplate(VOID);
150
151 /* MACROS *************************************************************************/
152
153 #define AFFINITY_MASK(Id) KiMask32Array[Id]
154 #define PRIORITY_MASK(Id) KiMask32Array[Id]
155
156 /* Tells us if the Timer or Event is a Syncronization or Notification Object */
157 #define TIMER_OR_EVENT_TYPE 0x7L
158
159 /* One of the Reserved Wait Blocks, this one is for the Thread's Timer */
160 #define TIMER_WAIT_BLOCK 0x3L
161
162 #define KTS_SYSCALL_BIT (((KTRAP_STATE_BITS) { { .SystemCall = TRUE } }).Bits)
163 #define KTS_PM_BIT (((KTRAP_STATE_BITS) { { .PreviousMode = TRUE } }).Bits)
164 #define KTS_SEG_BIT (((KTRAP_STATE_BITS) { { .Segments = TRUE } }).Bits)
165 #define KTS_VOL_BIT (((KTRAP_STATE_BITS) { { .Volatiles = TRUE } }).Bits)
166 #define KTS_FULL_BIT (((KTRAP_STATE_BITS) { { .Full = TRUE } }).Bits)
167
168 /* INTERNAL KERNEL FUNCTIONS ************************************************/
169
170 VOID
171 NTAPI
172 CPUID(
173 IN ULONG InfoType,
174 OUT PULONG CpuInfoEax,
175 OUT PULONG CpuInfoEbx,
176 OUT PULONG CpuInfoEcx,
177 OUT PULONG CpuInfoEdx
178 );
179
180 LONGLONG
181 FASTCALL
182 RDMSR(
183 IN ULONG Register
184 );
185
186 VOID
187 NTAPI
188 WRMSR(
189 IN ULONG Register,
190 IN LONGLONG Value
191 );
192
193 /* Finds a new thread to run */
194 LONG_PTR
195 FASTCALL
196 KiSwapThread(
197 IN PKTHREAD Thread,
198 IN PKPRCB Prcb
199 );
200
201 VOID
202 NTAPI
203 KeReadyThread(
204 IN PKTHREAD Thread
205 );
206
207 BOOLEAN
208 NTAPI
209 KeSetDisableBoostThread(
210 IN OUT PKTHREAD Thread,
211 IN BOOLEAN Disable
212 );
213
214 BOOLEAN
215 NTAPI
216 KeSetDisableBoostProcess(
217 IN PKPROCESS Process,
218 IN BOOLEAN Disable
219 );
220
221 BOOLEAN
222 NTAPI
223 KeSetAutoAlignmentProcess(
224 IN PKPROCESS Process,
225 IN BOOLEAN Enable
226 );
227
228 KAFFINITY
229 NTAPI
230 KeSetAffinityProcess(
231 IN PKPROCESS Process,
232 IN KAFFINITY Affinity
233 );
234
235 VOID
236 NTAPI
237 KeBoostPriorityThread(
238 IN PKTHREAD Thread,
239 IN KPRIORITY Increment
240 );
241
242 VOID
243 NTAPI
244 KeBalanceSetManager(IN PVOID Context);
245
246 VOID
247 NTAPI
248 KiReadyThread(IN PKTHREAD Thread);
249
250 ULONG
251 NTAPI
252 KeSuspendThread(PKTHREAD Thread);
253
254 BOOLEAN
255 NTAPI
256 KeReadStateThread(IN PKTHREAD Thread);
257
258 BOOLEAN
259 FASTCALL
260 KiSwapContext(
261 IN KIRQL WaitIrql,
262 IN PKTHREAD CurrentThread
263 );
264
265 VOID
266 NTAPI
267 KiAdjustQuantumThread(IN PKTHREAD Thread);
268
269 VOID
270 FASTCALL
271 KiExitDispatcher(KIRQL OldIrql);
272
273 VOID
274 FASTCALL
275 KiDeferredReadyThread(IN PKTHREAD Thread);
276
277 PKTHREAD
278 FASTCALL
279 KiIdleSchedule(
280 IN PKPRCB Prcb
281 );
282
283 VOID
284 FASTCALL
285 KiProcessDeferredReadyList(
286 IN PKPRCB Prcb
287 );
288
289 KAFFINITY
290 FASTCALL
291 KiSetAffinityThread(
292 IN PKTHREAD Thread,
293 IN KAFFINITY Affinity
294 );
295
296 PKTHREAD
297 FASTCALL
298 KiSelectNextThread(
299 IN PKPRCB Prcb
300 );
301
302 BOOLEAN
303 FASTCALL
304 KiInsertTimerTable(
305 IN PKTIMER Timer,
306 IN ULONG Hand
307 );
308
309 VOID
310 FASTCALL
311 KiTimerListExpire(
312 IN PLIST_ENTRY ExpiredListHead,
313 IN KIRQL OldIrql
314 );
315
316 BOOLEAN
317 FASTCALL
318 KiInsertTreeTimer(
319 IN PKTIMER Timer,
320 IN LARGE_INTEGER Interval
321 );
322
323 VOID
324 FASTCALL
325 KiCompleteTimer(
326 IN PKTIMER Timer,
327 IN PKSPIN_LOCK_QUEUE LockQueue
328 );
329
330 /* gmutex.c ********************************************************************/
331
332 VOID
333 FASTCALL
334 KiAcquireGuardedMutex(
335 IN OUT PKGUARDED_MUTEX GuardedMutex
336 );
337
338 VOID
339 FASTCALL
340 KiAcquireFastMutex(
341 IN PFAST_MUTEX FastMutex
342 );
343
344 /* gate.c **********************************************************************/
345
346 VOID
347 FASTCALL
348 KeInitializeGate(PKGATE Gate);
349
350 VOID
351 FASTCALL
352 KeSignalGateBoostPriority(PKGATE Gate);
353
354 VOID
355 FASTCALL
356 KeWaitForGate(
357 PKGATE Gate,
358 KWAIT_REASON WaitReason,
359 KPROCESSOR_MODE WaitMode
360 );
361
362 /* ipi.c ********************************************************************/
363
364 VOID
365 FASTCALL
366 KiIpiSend(
367 KAFFINITY TargetSet,
368 ULONG IpiRequest
369 );
370
371 VOID
372 NTAPI
373 KiIpiSendPacket(
374 IN KAFFINITY TargetProcessors,
375 IN PKIPI_WORKER WorkerFunction,
376 IN PKIPI_BROADCAST_WORKER BroadcastFunction,
377 IN ULONG_PTR Context,
378 IN PULONG Count
379 );
380
381 VOID
382 FASTCALL
383 KiIpiSignalPacketDone(
384 IN PKIPI_CONTEXT PacketContext
385 );
386
387 VOID
388 FASTCALL
389 KiIpiSignalPacketDoneAndStall(
390 IN PKIPI_CONTEXT PacketContext,
391 IN volatile PULONG ReverseStall
392 );
393
394 /* next file ***************************************************************/
395
396 UCHAR
397 NTAPI
398 KeFindNextRightSetAffinity(
399 IN UCHAR Number,
400 IN ULONG Set
401 );
402
403 VOID
404 NTAPI
405 DbgBreakPointNoBugCheck(VOID);
406
407 VOID
408 NTAPI
409 KeInitializeProfile(
410 struct _KPROFILE* Profile,
411 struct _KPROCESS* Process,
412 PVOID ImageBase,
413 SIZE_T ImageSize,
414 ULONG BucketSize,
415 KPROFILE_SOURCE ProfileSource,
416 KAFFINITY Affinity
417 );
418
419 BOOLEAN
420 NTAPI
421 KeStartProfile(
422 struct _KPROFILE* Profile,
423 PVOID Buffer
424 );
425
426 BOOLEAN
427 NTAPI
428 KeStopProfile(struct _KPROFILE* Profile);
429
430 ULONG
431 NTAPI
432 KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource);
433
434 VOID
435 NTAPI
436 KeSetIntervalProfile(
437 KPROFILE_SOURCE ProfileSource,
438 ULONG Interval
439 );
440
441 VOID
442 NTAPI
443 KeProfileInterrupt(
444 PKTRAP_FRAME TrapFrame
445 );
446
447 VOID
448 NTAPI
449 KeProfileInterruptWithSource(
450 IN PKTRAP_FRAME TrapFrame,
451 IN KPROFILE_SOURCE Source
452 );
453
454 VOID
455 NTAPI
456 KeUpdateRunTime(
457 PKTRAP_FRAME TrapFrame,
458 KIRQL Irql
459 );
460
461 VOID
462 NTAPI
463 KiExpireTimers(
464 PKDPC Dpc,
465 PVOID DeferredContext,
466 PVOID SystemArgument1,
467 PVOID SystemArgument2
468 );
469
470 VOID
471 NTAPI
472 KeInitializeThread(
473 IN PKPROCESS Process,
474 IN OUT PKTHREAD Thread,
475 IN PKSYSTEM_ROUTINE SystemRoutine,
476 IN PKSTART_ROUTINE StartRoutine,
477 IN PVOID StartContext,
478 IN PCONTEXT Context,
479 IN PVOID Teb,
480 IN PVOID KernelStack
481 );
482
483 VOID
484 NTAPI
485 KeUninitThread(
486 IN PKTHREAD Thread
487 );
488
489 NTSTATUS
490 NTAPI
491 KeInitThread(
492 IN OUT PKTHREAD Thread,
493 IN PVOID KernelStack,
494 IN PKSYSTEM_ROUTINE SystemRoutine,
495 IN PKSTART_ROUTINE StartRoutine,
496 IN PVOID StartContext,
497 IN PCONTEXT Context,
498 IN PVOID Teb,
499 IN PKPROCESS Process
500 );
501
502 VOID
503 NTAPI
504 KiInitializeContextThread(
505 PKTHREAD Thread,
506 PKSYSTEM_ROUTINE SystemRoutine,
507 PKSTART_ROUTINE StartRoutine,
508 PVOID StartContext,
509 PCONTEXT Context
510 );
511
512 VOID
513 NTAPI
514 KeStartThread(
515 IN OUT PKTHREAD Thread
516 );
517
518 BOOLEAN
519 NTAPI
520 KeAlertThread(
521 IN PKTHREAD Thread,
522 IN KPROCESSOR_MODE AlertMode
523 );
524
525 ULONG
526 NTAPI
527 KeAlertResumeThread(
528 IN PKTHREAD Thread
529 );
530
531 ULONG
532 NTAPI
533 KeResumeThread(
534 IN PKTHREAD Thread
535 );
536
537 PVOID
538 NTAPI
539 KeSwitchKernelStack(
540 IN PVOID StackBase,
541 IN PVOID StackLimit
542 );
543
544 VOID
545 NTAPI
546 KeRundownThread(VOID);
547
548 NTSTATUS
549 NTAPI
550 KeReleaseThread(PKTHREAD Thread);
551
552 VOID
553 NTAPI
554 KiSuspendRundown(
555 IN PKAPC Apc
556 );
557
558 VOID
559 NTAPI
560 KiSuspendNop(
561 IN PKAPC Apc,
562 IN PKNORMAL_ROUTINE *NormalRoutine,
563 IN PVOID *NormalContext,
564 IN PVOID *SystemArgument1,
565 IN PVOID *SystemArgument2
566 );
567
568 VOID
569 NTAPI
570 KiSuspendThread(
571 IN PVOID NormalContext,
572 IN PVOID SystemArgument1,
573 IN PVOID SystemArgument2
574 );
575
576 LONG
577 NTAPI
578 KeQueryBasePriorityThread(IN PKTHREAD Thread);
579
580 VOID
581 FASTCALL
582 KiSetPriorityThread(
583 IN PKTHREAD Thread,
584 IN KPRIORITY Priority
585 );
586
587 VOID
588 FASTCALL
589 KiUnlinkThread(
590 IN PKTHREAD Thread,
591 IN LONG_PTR WaitStatus
592 );
593
594 VOID
595 NTAPI
596 KeDumpStackFrames(PULONG Frame);
597
598 BOOLEAN
599 NTAPI
600 KiTestAlert(VOID);
601
602 VOID
603 FASTCALL
604 KiUnwaitThread(
605 IN PKTHREAD Thread,
606 IN LONG_PTR WaitStatus,
607 IN KPRIORITY Increment
608 );
609
610 VOID
611 NTAPI
612 KeInitializeProcess(
613 struct _KPROCESS *Process,
614 KPRIORITY Priority,
615 KAFFINITY Affinity,
616 PULONG_PTR DirectoryTableBase,
617 IN BOOLEAN Enable
618 );
619
620 VOID
621 NTAPI
622 KeSetQuantumProcess(
623 IN PKPROCESS Process,
624 IN UCHAR Quantum
625 );
626
627 KPRIORITY
628 NTAPI
629 KeSetPriorityAndQuantumProcess(
630 IN PKPROCESS Process,
631 IN KPRIORITY Priority,
632 IN UCHAR Quantum OPTIONAL
633 );
634
635 ULONG
636 NTAPI
637 KeForceResumeThread(IN PKTHREAD Thread);
638
639 VOID
640 NTAPI
641 KeThawAllThreads(
642 VOID
643 );
644
645 VOID
646 NTAPI
647 KeFreezeAllThreads(
648 VOID
649 );
650
651 BOOLEAN
652 NTAPI
653 KeDisableThreadApcQueueing(IN PKTHREAD Thread);
654
655 VOID
656 FASTCALL
657 KiWaitTest(
658 PVOID Object,
659 KPRIORITY Increment
660 );
661
662 VOID
663 NTAPI
664 KeContextToTrapFrame(
665 PCONTEXT Context,
666 PKEXCEPTION_FRAME ExeptionFrame,
667 PKTRAP_FRAME TrapFrame,
668 ULONG ContextFlags,
669 KPROCESSOR_MODE PreviousMode
670 );
671
672 VOID
673 NTAPI
674 Ke386SetIOPL(VOID);
675
676 VOID
677 NTAPI
678 KiCheckForKernelApcDelivery(VOID);
679
680 LONG
681 NTAPI
682 KiInsertQueue(
683 IN PKQUEUE Queue,
684 IN PLIST_ENTRY Entry,
685 BOOLEAN Head
686 );
687
688 VOID
689 NTAPI
690 KiTimerExpiration(
691 IN PKDPC Dpc,
692 IN PVOID DeferredContext,
693 IN PVOID SystemArgument1,
694 IN PVOID SystemArgument2
695 );
696
697 ULONG
698 NTAPI
699 KeSetProcess(
700 struct _KPROCESS* Process,
701 KPRIORITY Increment,
702 BOOLEAN InWait
703 );
704
705 VOID
706 NTAPI
707 KeInitializeEventPair(PKEVENT_PAIR EventPair);
708
709 VOID
710 NTAPI
711 KiInitializeUserApc(
712 IN PKEXCEPTION_FRAME Reserved,
713 IN PKTRAP_FRAME TrapFrame,
714 IN PKNORMAL_ROUTINE NormalRoutine,
715 IN PVOID NormalContext,
716 IN PVOID SystemArgument1,
717 IN PVOID SystemArgument2
718 );
719
720 PLIST_ENTRY
721 NTAPI
722 KeFlushQueueApc(
723 IN PKTHREAD Thread,
724 IN KPROCESSOR_MODE PreviousMode
725 );
726
727 VOID
728 NTAPI
729 KiAttachProcess(
730 struct _KTHREAD *Thread,
731 struct _KPROCESS *Process,
732 PKLOCK_QUEUE_HANDLE ApcLock,
733 struct _KAPC_STATE *SavedApcState
734 );
735
736 VOID
737 NTAPI
738 KiSwapProcess(
739 struct _KPROCESS *NewProcess,
740 struct _KPROCESS *OldProcess
741 );
742
743 BOOLEAN
744 NTAPI
745 KeTestAlertThread(IN KPROCESSOR_MODE AlertMode);
746
747 BOOLEAN
748 NTAPI
749 KeRemoveQueueApc(PKAPC Apc);
750
751 VOID
752 FASTCALL
753 KiActivateWaiterQueue(IN PKQUEUE Queue);
754
755 ULONG
756 NTAPI
757 KeQueryRuntimeProcess(IN PKPROCESS Process,
758 OUT PULONG UserTime);
759
760 /* INITIALIZATION FUNCTIONS *************************************************/
761
762 BOOLEAN
763 NTAPI
764 KeInitSystem(VOID);
765
766 VOID
767 NTAPI
768 KeInitExceptions(VOID);
769
770 VOID
771 NTAPI
772 KeInitInterrupts(VOID);
773
774 VOID
775 NTAPI
776 KiInitializeBugCheck(VOID);
777
778 VOID
779 NTAPI
780 KiSystemStartup(
781 IN PLOADER_PARAMETER_BLOCK LoaderBlock
782 );
783
784 BOOLEAN
785 NTAPI
786 KiDeliverUserApc(PKTRAP_FRAME TrapFrame);
787
788 VOID
789 NTAPI
790 KiMoveApcState(
791 PKAPC_STATE OldState,
792 PKAPC_STATE NewState
793 );
794
795 VOID
796 NTAPI
797 KiAddProfileEvent(
798 KPROFILE_SOURCE Source,
799 ULONG Pc
800 );
801
802 VOID
803 NTAPI
804 KiDispatchException(
805 PEXCEPTION_RECORD ExceptionRecord,
806 PKEXCEPTION_FRAME ExceptionFrame,
807 PKTRAP_FRAME Tf,
808 KPROCESSOR_MODE PreviousMode,
809 BOOLEAN SearchFrames
810 );
811
812 VOID
813 NTAPI
814 KeTrapFrameToContext(
815 IN PKTRAP_FRAME TrapFrame,
816 IN PKEXCEPTION_FRAME ExceptionFrame,
817 IN OUT PCONTEXT Context
818 );
819
820 DECLSPEC_NORETURN
821 VOID
822 NTAPI
823 KeBugCheckWithTf(
824 ULONG BugCheckCode,
825 ULONG_PTR BugCheckParameter1,
826 ULONG_PTR BugCheckParameter2,
827 ULONG_PTR BugCheckParameter3,
828 ULONG_PTR BugCheckParameter4,
829 PKTRAP_FRAME Tf
830 );
831
832 BOOLEAN
833 NTAPI
834 KiHandleNmi(VOID);
835
836 VOID
837 NTAPI
838 KeFlushCurrentTb(VOID);
839
840 BOOLEAN
841 NTAPI
842 KeInvalidateAllCaches(VOID);
843
844 VOID
845 FASTCALL
846 KeZeroPages(IN PVOID Address,
847 IN ULONG Size);
848
849 BOOLEAN
850 FASTCALL
851 KeInvalidAccessAllowed(IN PVOID TrapInformation OPTIONAL);
852
853 VOID
854 NTAPI
855 KeRosDumpStackFrames(
856 PULONG_PTR Frame,
857 ULONG FrameCount
858 );
859
860 VOID
861 NTAPI
862 KeSetSystemTime(
863 IN PLARGE_INTEGER NewSystemTime,
864 OUT PLARGE_INTEGER OldSystemTime,
865 IN BOOLEAN FixInterruptTime,
866 IN PLARGE_INTEGER HalTime
867 );
868
869 ULONG
870 NTAPI
871 KeV86Exception(
872 ULONG ExceptionNr,
873 PKTRAP_FRAME Tf,
874 ULONG address
875 );
876
877 VOID
878 NTAPI
879 KiStartUnexpectedRange(
880 VOID
881 );
882
883 VOID
884 NTAPI
885 KiEndUnexpectedRange(
886 VOID
887 );
888
889 NTSTATUS
890 NTAPI
891 KiRaiseException(
892 IN PEXCEPTION_RECORD ExceptionRecord,
893 IN PCONTEXT Context,
894 IN PKEXCEPTION_FRAME ExceptionFrame,
895 IN PKTRAP_FRAME TrapFrame,
896 IN BOOLEAN SearchFrames
897 );
898
899 NTSTATUS
900 NTAPI
901 KiContinue(
902 IN PCONTEXT Context,
903 IN PKEXCEPTION_FRAME ExceptionFrame,
904 IN PKTRAP_FRAME TrapFrame
905 );
906
907 DECLSPEC_NORETURN
908 VOID
909 FASTCALL
910 KiServiceExit(
911 IN PKTRAP_FRAME TrapFrame,
912 IN NTSTATUS Status
913 );
914
915 DECLSPEC_NORETURN
916 VOID
917 FASTCALL
918 KiServiceExit2(
919 IN PKTRAP_FRAME TrapFrame
920 );
921
922 #ifndef _M_AMD64
923 VOID
924 FASTCALL
925 KiInterruptDispatch(
926 IN PKTRAP_FRAME TrapFrame,
927 IN PKINTERRUPT Interrupt
928 );
929 #endif
930
931 VOID
932 FASTCALL
933 KiChainedDispatch(
934 IN PKTRAP_FRAME TrapFrame,
935 IN PKINTERRUPT Interrupt
936 );
937
938 VOID
939 NTAPI
940 KiInitializeMachineType(
941 VOID
942 );
943
944 VOID
945 NTAPI
946 KiSetupStackAndInitializeKernel(
947 IN PKPROCESS InitProcess,
948 IN PKTHREAD InitThread,
949 IN PVOID IdleStack,
950 IN PKPRCB Prcb,
951 IN CCHAR Number,
952 IN PLOADER_PARAMETER_BLOCK LoaderBlock
953 );
954
955 VOID
956 NTAPI
957 KiInitSpinLocks(
958 IN PKPRCB Prcb,
959 IN CCHAR Number
960 );
961
962 LARGE_INTEGER
963 NTAPI
964 KiComputeReciprocal(
965 IN LONG Divisor,
966 OUT PUCHAR Shift
967 );
968
969 VOID
970 NTAPI
971 KiInitSystem(
972 VOID
973 );
974
975 VOID
976 FASTCALL
977 KiInsertQueueApc(
978 IN PKAPC Apc,
979 IN KPRIORITY PriorityBoost
980 );
981
982 NTSTATUS
983 NTAPI
984 KiCallUserMode(
985 IN PVOID *OutputBuffer,
986 IN PULONG OutputLength
987 );
988
989 DECLSPEC_NORETURN
990 VOID
991 FASTCALL
992 KiCallbackReturn(
993 IN PVOID Stack,
994 IN NTSTATUS Status
995 );
996
997 VOID
998 NTAPI
999 KiInitMachineDependent(VOID);
1000
1001 BOOLEAN
1002 NTAPI
1003 KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
1004 IN PKEXCEPTION_FRAME ExceptionFrame);
1005
1006 VOID
1007 NTAPI
1008 KeThawExecution(IN BOOLEAN Enable);
1009
1010 VOID
1011 FASTCALL
1012 KeAcquireQueuedSpinLockAtDpcLevel(
1013 IN OUT PKSPIN_LOCK_QUEUE LockQueue
1014 );
1015
1016 VOID
1017 FASTCALL
1018 KeReleaseQueuedSpinLockFromDpcLevel(
1019 IN OUT PKSPIN_LOCK_QUEUE LockQueue
1020 );
1021
1022 VOID
1023 NTAPI
1024 KiRestoreProcessorControlState(
1025 IN PKPROCESSOR_STATE ProcessorState
1026 );
1027
1028 VOID
1029 NTAPI
1030 KiSaveProcessorControlState(
1031 OUT PKPROCESSOR_STATE ProcessorState
1032 );
1033
1034 VOID
1035 NTAPI
1036 KiSaveProcessorState(
1037 IN PKTRAP_FRAME TrapFrame,
1038 IN PKEXCEPTION_FRAME ExceptionFrame
1039 );
1040
1041 VOID
1042 FASTCALL
1043 KiRetireDpcList(
1044 IN PKPRCB Prcb
1045 );
1046
1047 VOID
1048 NTAPI
1049 KiQuantumEnd(
1050 VOID
1051 );
1052
1053 VOID
1054 FASTCALL
1055 KiIdleLoop(
1056 VOID
1057 );
1058
1059 DECLSPEC_NORETURN
1060 VOID
1061 FASTCALL
1062 KiSystemFatalException(
1063 IN ULONG ExceptionCode,
1064 IN PKTRAP_FRAME TrapFrame
1065 );
1066
1067 PVOID
1068 NTAPI
1069 KiPcToFileHeader(IN PVOID Eip,
1070 OUT PLDR_DATA_TABLE_ENTRY *LdrEntry,
1071 IN BOOLEAN DriversOnly,
1072 OUT PBOOLEAN InKernel);
1073
1074 PVOID
1075 NTAPI
1076 KiRosPcToUserFileHeader(IN PVOID Eip,
1077 OUT PLDR_DATA_TABLE_ENTRY *LdrEntry);
1078
1079 PCHAR
1080 NTAPI
1081 KeBugCheckUnicodeToAnsi(
1082 IN PUNICODE_STRING Unicode,
1083 OUT PCHAR Ansi,
1084 IN ULONG Length
1085 );
1086
1087 #include "ke_x.h"