f694d206ebb628e5ca1b015e02b3320f71f3f643
[reactos.git] / reactos / ntoskrnl / include / internal / ke.h
1 /*
2 * Various useful prototypes
3 */
4
5 #ifndef __INCLUDE_INTERNAL_KERNEL_H
6 #define __INCLUDE_INTERNAL_KERNEL_H
7
8 /* INCLUDES *****************************************************************/
9
10 #include <ddk/ntddk.h>
11
12 #include <stdarg.h>
13
14 /* INTERNAL KERNEL FUNCTIONS ************************************************/
15
16 struct _KTHREAD;
17
18 typedef struct _KTRAP_FRAME
19 {
20 PVOID DebugEbp;
21 PVOID DebugEip;
22 PVOID DebugArgMark;
23 PVOID DebugPointer;
24 PVOID TempCs;
25 PVOID TempEip;
26 PVOID Dr0;
27 PVOID Dr1;
28 PVOID Dr2;
29 PVOID Dr3;
30 PVOID Dr6;
31 PVOID Dr7;
32 USHORT Gs;
33 USHORT Reserved1;
34 USHORT Es;
35 USHORT Reserved2;
36 USHORT Ds;
37 USHORT Reserved3;
38 ULONG Edx;
39 ULONG Ecx;
40 ULONG Eax;
41 ULONG PreviousMode;
42 PVOID ExceptionList;
43 USHORT Fs;
44 USHORT Reserved4;
45 ULONG Edi;
46 ULONG Esi;
47 ULONG Ebx;
48 ULONG Ebp;
49 ULONG ErrorCode;
50 ULONG Eip;
51 ULONG Cs;
52 ULONG Eflags;
53 ULONG Esp;
54 USHORT Ss;
55 USHORT Reserved5;
56 USHORT V86_Es;
57 USHORT Reserved6;
58 USHORT V86_Ds;
59 USHORT Reserved7;
60 USHORT V86_Fs;
61 USHORT Reserved8;
62 USHORT V86_Gs;
63 USHORT Reserved9;
64 } KTRAP_FRAME, *PKTRAP_FRAME;
65
66 VOID KiUpdateSystemTime (VOID);
67
68 VOID KeAcquireDispatcherDatabaseLock(BOOLEAN Wait);
69 VOID KeReleaseDispatcherDatabaseLock(BOOLEAN Wait);
70 BOOLEAN KeDispatcherObjectWake(DISPATCHER_HEADER* hdr);
71
72 #if 0
73 VOID KiInterruptDispatch(ULONG irq);
74 #endif
75 VOID KeExpireTimers(VOID);
76 NTSTATUS KeAddThreadTimeout(struct _KTHREAD* Thread,
77 PLARGE_INTEGER Interval);
78 VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type,
79 ULONG Size, ULONG SignalState);
80
81 VOID KeDumpStackFrames(PVOID Stack, ULONG NrFrames);
82 ULONG KeAllocateGdtSelector(ULONG Desc[2]);
83 VOID KeFreeGdtSelector(ULONG Entry);
84 BOOLEAN KiTestAlert(VOID);
85 VOID KeRemoveAllWaitsThread(struct _ETHREAD* Thread, NTSTATUS WaitStatus);
86 PULONG KeGetStackTopThread(struct _ETHREAD* Thread);
87 VOID KeContextToTrapFrame(PCONTEXT Context,
88 PKTRAP_FRAME TrapFrame);
89
90 /* INITIALIZATION FUNCTIONS *************************************************/
91
92 VOID KeInitExceptions(VOID);
93 VOID KeInitInterrupts(VOID);
94 VOID KeInitTimer(VOID);
95 VOID KeInitDpc(VOID);
96 VOID KeInitDispatcher(VOID);
97 VOID KeInitializeDispatcher(VOID);
98 VOID KeInitializeTimerImpl(VOID);
99 VOID KeInitializeBugCheck(VOID);
100
101 VOID KeInit1(VOID);
102 VOID KeInit2(VOID);
103
104 BOOLEAN KiDeliverUserApc(PKTRAP_FRAME TrapFrame);
105 VOID
106 NtEarlyInitVdm(VOID);
107
108 #endif