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
KiUpdateSystemTime (KIRQL oldIrql
, ULONG Eip
);
41 VOID
KeAcquireDispatcherDatabaseLock(BOOLEAN Wait
);
42 VOID
KeReleaseDispatcherDatabaseLock(BOOLEAN Wait
);
43 BOOLEAN
KeDispatcherObjectWake(DISPATCHER_HEADER
* hdr
);
44 VOID STDCALL
KeExpireTimers(PKDPC Apc
,
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
);
58 KiDeliverNormalApc(VOID
);
60 BOOLEAN STDCALL
KeRemoveQueueApc (PKAPC Apc
);
62 /* INITIALIZATION FUNCTIONS *************************************************/
64 VOID
KeInitExceptions(VOID
);
65 VOID
KeInitInterrupts(VOID
);
66 VOID
KeInitTimer(VOID
);
68 VOID
KeInitDispatcher(VOID
);
69 VOID
KeInitializeDispatcher(VOID
);
70 VOID
KeInitializeTimerImpl(VOID
);
71 VOID
KeInitializeBugCheck(VOID
);
72 VOID
Phase1Initialization(PVOID Context
);
77 BOOLEAN
KiDeliverUserApc(PKTRAP_FRAME TrapFrame
);
79 KiAddProfileEvent(KPROFILE_SOURCE Source
, ULONG Pc
);
81 KiDispatchException(PEXCEPTION_RECORD ExceptionRecord
,
84 KPROCESSOR_MODE PreviousMode
,
85 BOOLEAN SearchFrames
);
86 VOID
KeTrapFrameToContext(PKTRAP_FRAME TrapFrame
,
89 KeApplicationProcessorInit(VOID
);
91 KePrepareForApplicationProcessorInit(ULONG id
);
93 KiUserTrapHandler(PKTRAP_FRAME Tf
, ULONG ExceptionNr
, PVOID Cr2
);
95 KePushAndStackSwitchAndSysRet(ULONG Push
, PVOID NewStack
);
97 KeStackSwitchAndRet(PVOID NewStack
);
99 KeBugCheckWithTf(ULONG BugCheckCode
,
100 ULONG BugCheckParameter1
,
101 ULONG BugCheckParameter2
,
102 ULONG BugCheckParameter3
,
103 ULONG BugCheckParameter4
,
106 KiDumpTrapFrame(PKTRAP_FRAME Tf
, ULONG ExceptionNr
, ULONG cr2
);
108 #endif /* not __ASM__ */
110 #define MAXIMUM_PROCESSORS 32
112 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_KE_H */