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