Sync to trunk head(r38096)
[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 #if defined(_M_IX86) || defined(_M_AMD64)
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 extern ULONG KiDPCTimeout;
159
160 /* MACROS *************************************************************************/
161
162 #define AFFINITY_MASK(Id) KiMask32Array[Id]
163 #define PRIORITY_MASK(Id) KiMask32Array[Id]
164
165 /* The following macro initializes a dispatcher object's header */
166 #define KeInitializeDispatcherHeader(Header, t, s, State) \
167 { \
168 (Header)->Type = t; \
169 (Header)->Absolute = 0; \
170 (Header)->Inserted = 0; \
171 (Header)->Size = s; \
172 (Header)->SignalState = State; \
173 InitializeListHead(&((Header)->WaitListHead)); \
174 }
175
176 /* Tells us if the Timer or Event is a Syncronization or Notification Object */
177 #define TIMER_OR_EVENT_TYPE 0x7L
178
179 /* One of the Reserved Wait Blocks, this one is for the Thread's Timer */
180 #define TIMER_WAIT_BLOCK 0x3L
181
182 /* IOPM Definitions */
183 #define IO_ACCESS_MAP_NONE 0
184 #define IOPM_OFFSET FIELD_OFFSET(KTSS, IoMaps[0].IoMap)
185 #define KiComputeIopmOffset(MapNumber) \
186 (MapNumber == IO_ACCESS_MAP_NONE) ? \
187 (USHORT)(sizeof(KTSS)) : \
188 (USHORT)(FIELD_OFFSET(KTSS, IoMaps[MapNumber-1].IoMap))
189
190 #define SIZE_OF_FX_REGISTERS 32
191
192 /* INTERNAL KERNEL FUNCTIONS ************************************************/
193
194 /* Finds a new thread to run */
195 LONG_PTR
196 FASTCALL
197 KiSwapThread(
198 IN PKTHREAD Thread,
199 IN PKPRCB Prcb
200 );
201
202 VOID
203 NTAPI
204 KeReadyThread(
205 IN PKTHREAD Thread
206 );
207
208 BOOLEAN
209 NTAPI
210 KeSetDisableBoostThread(
211 IN OUT PKTHREAD Thread,
212 IN BOOLEAN Disable
213 );
214
215 VOID
216 NTAPI
217 KeBalanceSetManager(IN PVOID Context);
218
219 VOID
220 NTAPI
221 KiReadyThread(IN PKTHREAD Thread);
222
223 ULONG
224 NTAPI
225 KeSuspendThread(PKTHREAD Thread);
226
227 BOOLEAN
228 NTAPI
229 KeReadStateThread(IN PKTHREAD Thread);
230
231 BOOLEAN
232 FASTCALL
233 KiSwapContext(
234 IN PKTHREAD CurrentThread,
235 IN PKTHREAD NewThread
236 );
237
238 VOID
239 NTAPI
240 KiAdjustQuantumThread(IN PKTHREAD Thread);
241
242 VOID
243 FASTCALL
244 KiExitDispatcher(KIRQL OldIrql);
245
246 VOID
247 NTAPI
248 KiDeferredReadyThread(IN PKTHREAD Thread);
249
250 PKTHREAD
251 FASTCALL
252 KiIdleSchedule(
253 IN PKPRCB Prcb
254 );
255
256 VOID
257 FASTCALL
258 KiProcessDeferredReadyList(
259 IN PKPRCB Prcb
260 );
261
262 KAFFINITY
263 FASTCALL
264 KiSetAffinityThread(
265 IN PKTHREAD Thread,
266 IN KAFFINITY Affinity
267 );
268
269 PKTHREAD
270 FASTCALL
271 KiSelectNextThread(
272 IN PKPRCB Prcb
273 );
274
275 VOID
276 NTAPI
277 CPUID(
278 OUT ULONG CpuInfo[4],
279 IN ULONG InfoType
280 );
281
282 BOOLEAN
283 FASTCALL
284 KiInsertTimerTable(
285 IN PKTIMER Timer,
286 IN ULONG Hand
287 );
288
289 VOID
290 FASTCALL
291 KiTimerListExpire(
292 IN PLIST_ENTRY ExpiredListHead,
293 IN KIRQL OldIrql
294 );
295
296 BOOLEAN
297 FASTCALL
298 KiInsertTreeTimer(
299 IN PKTIMER Timer,
300 IN LARGE_INTEGER Interval
301 );
302
303 VOID
304 FASTCALL
305 KiCompleteTimer(
306 IN PKTIMER Timer,
307 IN PKSPIN_LOCK_QUEUE LockQueue
308 );
309
310 /* gmutex.c ********************************************************************/
311
312 VOID
313 FASTCALL
314 KiAcquireGuardedMutexContented(PKGUARDED_MUTEX GuardedMutex);
315
316 /* gate.c **********************************************************************/
317
318 VOID
319 FASTCALL
320 KeInitializeGate(PKGATE Gate);
321
322 VOID
323 FASTCALL
324 KeSignalGateBoostPriority(PKGATE Gate);
325
326 VOID
327 FASTCALL
328 KeWaitForGate(
329 PKGATE Gate,
330 KWAIT_REASON WaitReason,
331 KPROCESSOR_MODE WaitMode
332 );
333
334 /* ipi.c ********************************************************************/
335
336 VOID
337 FASTCALL
338 KiIpiSend(
339 KAFFINITY TargetSet,
340 ULONG IpiRequest
341 );
342
343 VOID
344 NTAPI
345 KiIpiSendPacket(
346 IN KAFFINITY TargetProcessors,
347 IN PKIPI_WORKER WorkerFunction,
348 IN PKIPI_BROADCAST_WORKER BroadcastFunction,
349 IN ULONG_PTR Context,
350 IN PULONG Count
351 );
352
353 VOID
354 FASTCALL
355 KiIpiSignalPacketDone(
356 IN PKIPI_CONTEXT PacketContext
357 );
358
359 VOID
360 FASTCALL
361 KiIpiSignalPacketDoneAndStall(
362 IN PKIPI_CONTEXT PacketContext,
363 IN volatile PULONG ReverseStall
364 );
365
366 /* next file ***************************************************************/
367
368 UCHAR
369 NTAPI
370 KeFindNextRightSetAffinity(
371 IN UCHAR Number,
372 IN ULONG Set
373 );
374
375 VOID
376 NTAPI
377 DbgBreakPointNoBugCheck(VOID);
378
379 VOID
380 NTAPI
381 KeInitializeProfile(
382 struct _KPROFILE* Profile,
383 struct _KPROCESS* Process,
384 PVOID ImageBase,
385 ULONG ImageSize,
386 ULONG BucketSize,
387 KPROFILE_SOURCE ProfileSource,
388 KAFFINITY Affinity
389 );
390
391 VOID
392 NTAPI
393 KeStartProfile(
394 struct _KPROFILE* Profile,
395 PVOID Buffer
396 );
397
398 BOOLEAN
399 NTAPI
400 KeStopProfile(struct _KPROFILE* Profile);
401
402 ULONG
403 NTAPI
404 KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource);
405
406 VOID
407 NTAPI
408 KeSetIntervalProfile(
409 KPROFILE_SOURCE ProfileSource,
410 ULONG Interval
411 );
412
413 VOID
414 NTAPI
415 KeProfileInterrupt(
416 PKTRAP_FRAME TrapFrame
417 );
418
419 VOID
420 NTAPI
421 KeProfileInterruptWithSource(
422 IN PKTRAP_FRAME TrapFrame,
423 IN KPROFILE_SOURCE Source
424 );
425
426 VOID
427 NTAPI
428 KeUpdateRunTime(
429 PKTRAP_FRAME TrapFrame,
430 KIRQL Irql
431 );
432
433 VOID
434 NTAPI
435 KiExpireTimers(
436 PKDPC Dpc,
437 PVOID DeferredContext,
438 PVOID SystemArgument1,
439 PVOID SystemArgument2
440 );
441
442 VOID
443 NTAPI
444 KeInitializeThread(
445 IN PKPROCESS Process,
446 IN OUT PKTHREAD Thread,
447 IN PKSYSTEM_ROUTINE SystemRoutine,
448 IN PKSTART_ROUTINE StartRoutine,
449 IN PVOID StartContext,
450 IN PCONTEXT Context,
451 IN PVOID Teb,
452 IN PVOID KernelStack
453 );
454
455 VOID
456 NTAPI
457 KeUninitThread(
458 IN PKTHREAD Thread
459 );
460
461 NTSTATUS
462 NTAPI
463 KeInitThread(
464 IN OUT PKTHREAD Thread,
465 IN PVOID KernelStack,
466 IN PKSYSTEM_ROUTINE SystemRoutine,
467 IN PKSTART_ROUTINE StartRoutine,
468 IN PVOID StartContext,
469 IN PCONTEXT Context,
470 IN PVOID Teb,
471 IN PKPROCESS Process
472 );
473
474 VOID
475 NTAPI
476 KeStartThread(
477 IN OUT PKTHREAD Thread
478 );
479
480 BOOLEAN
481 NTAPI
482 KeAlertThread(
483 IN PKTHREAD Thread,
484 IN KPROCESSOR_MODE AlertMode
485 );
486
487 ULONG
488 NTAPI
489 KeAlertResumeThread(
490 IN PKTHREAD Thread
491 );
492
493 ULONG
494 NTAPI
495 KeResumeThread(
496 IN PKTHREAD Thread
497 );
498
499 PVOID
500 NTAPI
501 KeSwitchKernelStack(
502 IN PVOID StackBase,
503 IN PVOID StackLimit
504 );
505
506 VOID
507 NTAPI
508 KeRundownThread(VOID);
509
510 NTSTATUS
511 NTAPI
512 KeReleaseThread(PKTHREAD Thread);
513
514 VOID
515 NTAPI
516 KiSuspendRundown(
517 IN PKAPC Apc
518 );
519
520 VOID
521 NTAPI
522 KiSuspendNop(
523 IN PKAPC Apc,
524 IN PKNORMAL_ROUTINE *NormalRoutine,
525 IN PVOID *NormalContext,
526 IN PVOID *SystemArgument1,
527 IN PVOID *SystemArgument2
528 );
529
530 VOID
531 NTAPI
532 KiSuspendThread(
533 IN PVOID NormalContext,
534 IN PVOID SystemArgument1,
535 IN PVOID SystemArgument2
536 );
537
538 LONG
539 NTAPI
540 KeQueryBasePriorityThread(IN PKTHREAD Thread);
541
542 VOID
543 FASTCALL
544 KiSetPriorityThread(
545 IN PKTHREAD Thread,
546 IN KPRIORITY Priority
547 );
548
549 VOID
550 FASTCALL
551 KiUnlinkThread(
552 IN PKTHREAD Thread,
553 IN NTSTATUS WaitStatus
554 );
555
556 VOID
557 NTAPI
558 KeDumpStackFrames(PULONG Frame);
559
560 BOOLEAN
561 NTAPI
562 KiTestAlert(VOID);
563
564 VOID
565 FASTCALL
566 KiUnwaitThread(
567 IN PKTHREAD Thread,
568 IN LONG_PTR WaitStatus,
569 IN KPRIORITY Increment
570 );
571
572 VOID
573 NTAPI
574 KeInitializeProcess(
575 struct _KPROCESS *Process,
576 KPRIORITY Priority,
577 KAFFINITY Affinity,
578 PULONG DirectoryTableBase,
579 IN BOOLEAN Enable
580 );
581
582 VOID
583 NTAPI
584 KeSetQuantumProcess(
585 IN PKPROCESS Process,
586 IN UCHAR Quantum
587 );
588
589 KPRIORITY
590 NTAPI
591 KeSetPriorityAndQuantumProcess(
592 IN PKPROCESS Process,
593 IN KPRIORITY Priority,
594 IN UCHAR Quantum OPTIONAL
595 );
596
597 ULONG
598 NTAPI
599 KeForceResumeThread(IN PKTHREAD Thread);
600
601 VOID
602 NTAPI
603 KeThawAllThreads(
604 VOID
605 );
606
607 VOID
608 NTAPI
609 KeFreezeAllThreads(
610 VOID
611 );
612
613 BOOLEAN
614 NTAPI
615 KeDisableThreadApcQueueing(IN PKTHREAD Thread);
616
617 VOID
618 FASTCALL
619 KiWaitTest(
620 PVOID Object,
621 KPRIORITY Increment
622 );
623
624 VOID
625 NTAPI
626 KeContextToTrapFrame(
627 PCONTEXT Context,
628 PKEXCEPTION_FRAME ExeptionFrame,
629 PKTRAP_FRAME TrapFrame,
630 ULONG ContextFlags,
631 KPROCESSOR_MODE PreviousMode
632 );
633
634 VOID
635 NTAPI
636 KiCheckForKernelApcDelivery(VOID);
637
638 LONG
639 NTAPI
640 KiInsertQueue(
641 IN PKQUEUE Queue,
642 IN PLIST_ENTRY Entry,
643 BOOLEAN Head
644 );
645
646 VOID
647 NTAPI
648 KiTimerExpiration(
649 IN PKDPC Dpc,
650 IN PVOID DeferredContext,
651 IN PVOID SystemArgument1,
652 IN PVOID SystemArgument2
653 );
654
655 ULONG
656 NTAPI
657 KiComputeTimerTableIndex(
658 IN LONGLONG TimeValue
659 );
660
661 ULONG
662 NTAPI
663 KeSetProcess(
664 struct _KPROCESS* Process,
665 KPRIORITY Increment,
666 BOOLEAN InWait
667 );
668
669 VOID
670 NTAPI
671 KeInitializeEventPair(PKEVENT_PAIR EventPair);
672
673 VOID
674 NTAPI
675 KiInitializeUserApc(
676 IN PKEXCEPTION_FRAME Reserved,
677 IN PKTRAP_FRAME TrapFrame,
678 IN PKNORMAL_ROUTINE NormalRoutine,
679 IN PVOID NormalContext,
680 IN PVOID SystemArgument1,
681 IN PVOID SystemArgument2
682 );
683
684 PLIST_ENTRY
685 NTAPI
686 KeFlushQueueApc(
687 IN PKTHREAD Thread,
688 IN KPROCESSOR_MODE PreviousMode
689 );
690
691 VOID
692 NTAPI
693 KiAttachProcess(
694 struct _KTHREAD *Thread,
695 struct _KPROCESS *Process,
696 PKLOCK_QUEUE_HANDLE ApcLock,
697 struct _KAPC_STATE *SavedApcState
698 );
699
700 VOID
701 NTAPI
702 KiSwapProcess(
703 struct _KPROCESS *NewProcess,
704 struct _KPROCESS *OldProcess
705 );
706
707 BOOLEAN
708 NTAPI
709 KeTestAlertThread(IN KPROCESSOR_MODE AlertMode);
710
711 BOOLEAN
712 NTAPI
713 KeRemoveQueueApc(PKAPC Apc);
714
715 VOID
716 FASTCALL
717 KiActivateWaiterQueue(IN PKQUEUE Queue);
718
719 ULONG
720 NTAPI
721 KeQueryRuntimeProcess(IN PKPROCESS Process,
722 OUT PULONG UserTime);
723
724 /* INITIALIZATION FUNCTIONS *************************************************/
725
726 BOOLEAN
727 NTAPI
728 KeInitSystem(VOID);
729
730 VOID
731 NTAPI
732 KeInitExceptions(VOID);
733
734 VOID
735 NTAPI
736 KeInitInterrupts(VOID);
737
738 VOID
739 NTAPI
740 KiInitializeBugCheck(VOID);
741
742 VOID
743 NTAPI
744 KiSystemStartupReal(
745 IN PLOADER_PARAMETER_BLOCK LoaderBlock
746 );
747
748 BOOLEAN
749 NTAPI
750 KiDeliverUserApc(PKTRAP_FRAME TrapFrame);
751
752 VOID
753 NTAPI
754 KiMoveApcState(
755 PKAPC_STATE OldState,
756 PKAPC_STATE NewState
757 );
758
759 VOID
760 NTAPI
761 KiAddProfileEvent(
762 KPROFILE_SOURCE Source,
763 ULONG Pc
764 );
765
766 VOID
767 NTAPI
768 KiDispatchException(
769 PEXCEPTION_RECORD ExceptionRecord,
770 PKEXCEPTION_FRAME ExceptionFrame,
771 PKTRAP_FRAME Tf,
772 KPROCESSOR_MODE PreviousMode,
773 BOOLEAN SearchFrames
774 );
775
776 VOID
777 NTAPI
778 KeTrapFrameToContext(
779 IN PKTRAP_FRAME TrapFrame,
780 IN PKEXCEPTION_FRAME ExceptionFrame,
781 IN OUT PCONTEXT Context
782 );
783
784 VOID
785 NTAPI
786 KeBugCheckWithTf(
787 ULONG BugCheckCode,
788 ULONG_PTR BugCheckParameter1,
789 ULONG_PTR BugCheckParameter2,
790 ULONG_PTR BugCheckParameter3,
791 ULONG_PTR BugCheckParameter4,
792 PKTRAP_FRAME Tf
793 );
794
795 VOID
796 NTAPI
797 KeFlushCurrentTb(VOID);
798
799 BOOLEAN
800 NTAPI
801 KeInvalidateAllCaches(VOID);
802
803 VOID
804 FASTCALL
805 KeZeroPages(IN PVOID Address,
806 IN ULONG Size);
807
808 BOOLEAN
809 FASTCALL
810 KeInvalidAccessAllowed(IN PVOID TrapInformation OPTIONAL);
811
812 VOID
813 NTAPI
814 KeRosDumpStackFrames(
815 PULONG_PTR Frame,
816 ULONG FrameCount
817 );
818
819 VOID
820 NTAPI
821 KeSetSystemTime(
822 IN PLARGE_INTEGER NewSystemTime,
823 OUT PLARGE_INTEGER OldSystemTime,
824 IN BOOLEAN FixInterruptTime,
825 IN PLARGE_INTEGER HalTime
826 );
827
828 ULONG
829 NTAPI
830 KeV86Exception(
831 ULONG ExceptionNr,
832 PKTRAP_FRAME Tf,
833 ULONG address
834 );
835
836 VOID
837 NTAPI
838 KiStartUnexpectedRange(
839 VOID
840 );
841
842 VOID
843 NTAPI
844 KiEndUnexpectedRange(
845 VOID
846 );
847
848 VOID
849 NTAPI
850 KiInterruptDispatch(
851 VOID
852 );
853
854 VOID
855 NTAPI
856 KiChainedDispatch(
857 VOID
858 );
859
860 VOID
861 NTAPI
862 Ki386AdjustEsp0(
863 IN PKTRAP_FRAME TrapFrame
864 );
865
866 VOID
867 NTAPI
868 Ki386SetupAndExitToV86Mode(
869 OUT PTEB VdmTeb
870 );
871
872 VOID
873 NTAPI
874 KeI386VdmInitialize(
875 VOID
876 );
877
878 VOID
879 NTAPI
880 KiInitializeMachineType(
881 VOID
882 );
883
884 //
885 // We need to do major portability work
886 //
887 #ifdef _M_IX86
888 VOID
889 NTAPI
890 KiFlushNPXState(
891 IN FLOATING_SAVE_AREA *SaveArea
892 );
893 #endif
894
895 VOID
896 NTAPI
897 KiSetupStackAndInitializeKernel(
898 IN PKPROCESS InitProcess,
899 IN PKTHREAD InitThread,
900 IN PVOID IdleStack,
901 IN PKPRCB Prcb,
902 IN CCHAR Number,
903 IN PLOADER_PARAMETER_BLOCK LoaderBlock
904 );
905
906 VOID
907 NTAPI
908 KiInitSpinLocks(
909 IN PKPRCB Prcb,
910 IN CCHAR Number
911 );
912
913 LARGE_INTEGER
914 NTAPI
915 KiComputeReciprocal(
916 IN LONG Divisor,
917 OUT PUCHAR Shift
918 );
919
920 VOID
921 NTAPI
922 KiInitSystem(
923 VOID
924 );
925
926 VOID
927 FASTCALL
928 KiInsertQueueApc(
929 IN PKAPC Apc,
930 IN KPRIORITY PriorityBoost
931 );
932
933 NTSTATUS
934 NTAPI
935 KiCallUserMode(
936 IN PVOID *OutputBuffer,
937 IN PULONG OutputLength
938 );
939
940 PULONG
941 NTAPI
942 KiGetUserModeStackAddress(
943 VOID
944 );
945
946 ULONG_PTR
947 NTAPI
948 Ki386EnableGlobalPage(IN volatile ULONG_PTR Context);
949
950 VOID
951 NTAPI
952 KiInitializePAT(VOID);
953
954 VOID
955 NTAPI
956 KiInitializeMTRR(IN BOOLEAN FinalCpu);
957
958 VOID
959 NTAPI
960 KiAmdK6InitializeMTRR(VOID);
961
962 VOID
963 NTAPI
964 KiRestoreFastSyscallReturnState(VOID);
965
966 ULONG_PTR
967 NTAPI
968 Ki386EnableDE(IN ULONG_PTR Context);
969
970 ULONG_PTR
971 NTAPI
972 Ki386EnableFxsr(IN ULONG_PTR Context);
973
974 ULONG_PTR
975 NTAPI
976 Ki386EnableXMMIExceptions(IN ULONG_PTR Context);
977
978 VOID
979 NTAPI
980 KiInitMachineDependent(VOID);
981
982 VOID
983 NTAPI
984 KiI386PentiumLockErrataFixup(VOID);
985
986 VOID
987 WRMSR(
988 IN ULONG Register,
989 IN LONGLONG Value
990 );
991
992 BOOLEAN
993 NTAPI
994 KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
995 IN PKEXCEPTION_FRAME ExceptionFrame);
996
997 VOID
998 NTAPI
999 KeThawExecution(IN BOOLEAN Enable);
1000
1001 BOOLEAN
1002 NTAPI
1003 KeDisableInterrupts(
1004 VOID
1005 );
1006
1007 VOID
1008 FASTCALL
1009 KeAcquireQueuedSpinLockAtDpcLevel(
1010 IN OUT PKSPIN_LOCK_QUEUE LockQueue
1011 );
1012
1013 VOID
1014 FASTCALL
1015 KeReleaseQueuedSpinLockFromDpcLevel(
1016 IN OUT PKSPIN_LOCK_QUEUE LockQueue
1017 );
1018
1019 VOID
1020 NTAPI
1021 KiRestoreProcessorControlState(
1022 IN PKPROCESSOR_STATE ProcessorState
1023 );
1024
1025 VOID
1026 NTAPI
1027 KiSaveProcessorControlState(
1028 OUT PKPROCESSOR_STATE ProcessorState
1029 );
1030
1031 VOID
1032 FASTCALL
1033 KiRetireDpcList(
1034 IN PKPRCB Prcb
1035 );
1036
1037 VOID
1038 NTAPI
1039 KiQuantumEnd(
1040 VOID
1041 );
1042
1043 VOID
1044 KiSystemService(
1045 IN PKTHREAD Thread,
1046 IN PKTRAP_FRAME TrapFrame,
1047 IN ULONG Instruction
1048 );
1049
1050 VOID
1051 KiIdleLoop(
1052 VOID
1053 );
1054
1055 PVOID
1056 NTAPI
1057 KiPcToFileHeader(IN PVOID Eip,
1058 OUT PLDR_DATA_TABLE_ENTRY *LdrEntry,
1059 IN BOOLEAN DriversOnly,
1060 OUT PBOOLEAN InKernel);
1061
1062 PVOID
1063 NTAPI
1064 KiRosPcToUserFileHeader(IN PVOID Eip,
1065 OUT PLDR_DATA_TABLE_ENTRY *LdrEntry);
1066
1067 #include "ke_x.h"
1068
1069 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_KE_H */