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