93c1ce545f7699d5493193ca949ffbeeeaf5c0de
[reactos.git] / reactos / ntoskrnl / include / internal / ke.h
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2000 David Welch <welch@cwcom.net>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_KE_H
21 #define __NTOSKRNL_INCLUDE_INTERNAL_KE_H
22
23 /* INCLUDES *****************************************************************/
24
25 #ifndef __ASM__
26 #include <ddk/ntddk.h>
27
28 #include <stdarg.h>
29 #endif /* not __ASM__ */
30
31 #include "arch/ke.h"
32
33 /* INTERNAL KERNEL FUNCTIONS ************************************************/
34
35 #ifndef __ASM__
36
37 struct _KTHREAD;
38
39 VOID KiUpdateSystemTime (KIRQL oldIrql, ULONG Eip);
40
41 VOID KeAcquireDispatcherDatabaseLock(BOOLEAN Wait);
42 VOID KeReleaseDispatcherDatabaseLock(BOOLEAN Wait);
43 BOOLEAN KeDispatcherObjectWake(DISPATCHER_HEADER* hdr);
44 VOID STDCALL KeExpireTimers(PKDPC Apc,
45 PVOID Arg1,
46 PVOID Arg2,
47 PVOID Arg3);
48 VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type,
49 ULONG Size, ULONG SignalState);
50 VOID KeDumpStackFrames(PULONG Frame);
51 BOOLEAN KiTestAlert(VOID);
52 VOID KeRemoveAllWaitsThread(struct _ETHREAD* Thread, NTSTATUS WaitStatus);
53 PULONG KeGetStackTopThread(struct _ETHREAD* Thread);
54 VOID KeContextToTrapFrame(PCONTEXT Context,
55 PKTRAP_FRAME TrapFrame);
56 VOID KeReleaseDispatcherDatabaseLockAtDpcLevel(BOOLEAN Wait);
57 VOID
58 KiDeliverNormalApc(VOID);
59
60 BOOLEAN STDCALL KeRemoveQueueApc (PKAPC Apc);
61
62 /* INITIALIZATION FUNCTIONS *************************************************/
63
64 VOID KeInitExceptions(VOID);
65 VOID KeInitInterrupts(VOID);
66 VOID KeInitTimer(VOID);
67 VOID KeInitDpc(VOID);
68 VOID KeInitDispatcher(VOID);
69 VOID KeInitializeDispatcher(VOID);
70 VOID KeInitializeTimerImpl(VOID);
71 VOID KeInitializeBugCheck(VOID);
72 VOID Phase1Initialization(PVOID Context);
73
74 VOID KeInit1(VOID);
75 VOID KeInit2(VOID);
76
77 BOOLEAN KiDeliverUserApc(PKTRAP_FRAME TrapFrame);
78 VOID
79 KiAddProfileEvent(KPROFILE_SOURCE Source, ULONG Pc);
80 VOID
81 KiDispatchException(PEXCEPTION_RECORD ExceptionRecord,
82 PCONTEXT Context,
83 PKTRAP_FRAME Tf,
84 KPROCESSOR_MODE PreviousMode,
85 BOOLEAN SearchFrames);
86 VOID KeTrapFrameToContext(PKTRAP_FRAME TrapFrame,
87 PCONTEXT Context);
88 VOID
89 KeApplicationProcessorInit(VOID);
90 VOID
91 KePrepareForApplicationProcessorInit(ULONG id);
92 ULONG
93 KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2);
94 VOID STDCALL
95 KePushAndStackSwitchAndSysRet(ULONG Push, PVOID NewStack);
96 VOID STDCALL
97 KeStackSwitchAndRet(PVOID NewStack);
98 VOID STDCALL
99 KeBugCheckWithTf(ULONG BugCheckCode,
100 ULONG BugCheckParameter1,
101 ULONG BugCheckParameter2,
102 ULONG BugCheckParameter3,
103 ULONG BugCheckParameter4,
104 PKTRAP_FRAME Tf);
105 VOID
106 KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG ExceptionNr, ULONG cr2);
107
108 #endif /* not __ASM__ */
109
110 #define MAXIMUM_PROCESSORS 32
111
112 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_KE_H */