3 * Copyright (C) 2000 David Welch <welch@cwcom.net>
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.
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.
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.
20 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_KE_H
21 #define __NTOSKRNL_INCLUDE_INTERNAL_KE_H
23 /* INCLUDES *****************************************************************/
26 #include <ddk/ntddk.h>
29 #endif /* not __ASM__ */
33 /* INTERNAL KERNEL FUNCTIONS ************************************************/
39 VOID STDCALL KeRescheduleThread();
41 VOID KiUpdateSystemTime (KIRQL oldIrql, ULONG Eip);
43 VOID KeAcquireDispatcherDatabaseLock(BOOLEAN Wait);
44 VOID KeReleaseDispatcherDatabaseLock(BOOLEAN Wait);
45 BOOLEAN KeDispatcherObjectWake(DISPATCHER_HEADER* hdr);
46 VOID STDCALL KeExpireTimers(PKDPC Apc,
50 VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type,
51 ULONG Size, ULONG SignalState);
52 VOID KeDumpStackFrames(PULONG Frame);
53 BOOLEAN KiTestAlert(VOID);
54 VOID KeRemoveAllWaitsThread(struct _ETHREAD* Thread, NTSTATUS WaitStatus);
55 PULONG KeGetStackTopThread(struct _ETHREAD* Thread);
56 VOID KeContextToTrapFrame(PCONTEXT Context,
57 PKTRAP_FRAME TrapFrame);
58 VOID KeReleaseDispatcherDatabaseLockAtDpcLevel(BOOLEAN Wait);
60 KiDeliverNormalApc(VOID);
62 BOOLEAN STDCALL KeRemoveQueueApc (PKAPC Apc);
63 PLIST_ENTRY STDCALL KeRundownQueue(IN PKQUEUE Queue);
66 /* INITIALIZATION FUNCTIONS *************************************************/
68 VOID KeInitExceptions(VOID);
69 VOID KeInitInterrupts(VOID);
70 VOID KeInitTimer(VOID);
72 VOID KeInitDispatcher(VOID);
73 VOID KeInitializeDispatcher(VOID);
74 VOID KeInitializeTimerImpl(VOID);
75 VOID KeInitializeBugCheck(VOID);
76 VOID Phase1Initialization(PVOID Context);
81 BOOLEAN KiDeliverUserApc(PKTRAP_FRAME TrapFrame);
83 KiAddProfileEvent(KPROFILE_SOURCE Source, ULONG Pc);
85 KiDispatchException(PEXCEPTION_RECORD ExceptionRecord,
88 KPROCESSOR_MODE PreviousMode,
89 BOOLEAN SearchFrames);
90 VOID KeTrapFrameToContext(PKTRAP_FRAME TrapFrame,
93 KeApplicationProcessorInit(VOID);
95 KePrepareForApplicationProcessorInit(ULONG id);
97 KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2);
99 KePushAndStackSwitchAndSysRet(ULONG Push, PVOID NewStack);
101 KeStackSwitchAndRet(PVOID NewStack);
103 KeBugCheckWithTf(ULONG BugCheckCode,
104 ULONG BugCheckParameter1,
105 ULONG BugCheckParameter2,
106 ULONG BugCheckParameter3,
107 ULONG BugCheckParameter4,
110 KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG ExceptionNr, ULONG cr2);
112 #endif /* not __ASM__ */
114 #define MAXIMUM_PROCESSORS 32
116 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_KE_H */