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/ntifs.h>
28 #endif /* not __ASM__ */
32 /* INTERNAL KERNEL FUNCTIONS ************************************************/
38 VOID STDCALL KeRescheduleThread();
40 VOID KiUpdateSystemTime (KIRQL oldIrql, ULONG Eip);
42 VOID KeAcquireDispatcherDatabaseLock(BOOLEAN Wait);
43 VOID KeReleaseDispatcherDatabaseLock(BOOLEAN Wait);
44 BOOLEAN KeDispatcherObjectWake(DISPATCHER_HEADER* hdr);
45 VOID STDCALL KeExpireTimers(PKDPC Apc,
49 VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type,
50 ULONG Size, ULONG SignalState);
51 VOID KeDumpStackFrames(PULONG Frame);
52 BOOLEAN KiTestAlert(VOID);
53 VOID KeRemoveAllWaitsThread(struct _ETHREAD* Thread, NTSTATUS WaitStatus, BOOL Unblock);
54 PULONG KeGetStackTopThread(struct _ETHREAD* Thread);
55 VOID KeContextToTrapFrame(PCONTEXT Context,
56 PKTRAP_FRAME TrapFrame);
57 VOID KeReleaseDispatcherDatabaseLockAtDpcLevel(BOOLEAN Wait);
59 KiDeliverNormalApc(VOID);
61 BOOLEAN STDCALL KeRemoveQueueApc (PKAPC Apc);
62 PLIST_ENTRY STDCALL KeRundownQueue(IN PKQUEUE Queue);
65 KeRaiseUserException(NTSTATUS ExceptionCode);
68 /* INITIALIZATION FUNCTIONS *************************************************/
70 VOID KeInitExceptions(VOID);
71 VOID KeInitInterrupts(VOID);
72 VOID KeInitTimer(VOID);
74 VOID KeInitDispatcher(VOID);
75 VOID KeInitializeDispatcher(VOID);
76 VOID KeInitializeTimerImpl(VOID);
77 VOID KeInitializeBugCheck(VOID);
78 VOID Phase1Initialization(PVOID Context);
83 BOOLEAN KiDeliverUserApc(PKTRAP_FRAME TrapFrame);
85 KiAddProfileEvent(KPROFILE_SOURCE Source, ULONG Pc);
87 KiDispatchException(PEXCEPTION_RECORD ExceptionRecord,
90 KPROCESSOR_MODE PreviousMode,
91 BOOLEAN SearchFrames);
92 VOID KeTrapFrameToContext(PKTRAP_FRAME TrapFrame,
95 KeApplicationProcessorInit(VOID);
97 KePrepareForApplicationProcessorInit(ULONG id);
99 KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2);
101 KePushAndStackSwitchAndSysRet(ULONG Push, PVOID NewStack);
103 KeStackSwitchAndRet(PVOID NewStack);
105 KeBugCheckWithTf(ULONG BugCheckCode,
106 ULONG BugCheckParameter1,
107 ULONG BugCheckParameter2,
108 ULONG BugCheckParameter3,
109 ULONG BugCheckParameter4,
111 #define KEBUGCHECKWITHTF(a,b,c,d,e,f) DbgPrint("KeBugCheckWithTf at %s:%i\n",__FILE__,__LINE__), KeBugCheckWithTf(a,b,c,d,e,f)
113 KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG ExceptionNr, ULONG cr2);
115 #endif /* not __ASM__ */
117 #define MAXIMUM_PROCESSORS 32
119 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_KE_H */