1998-09-05 17:33:57 +00:00
|
|
|
/*
|
2000-12-28 03:38:08 +00:00
|
|
|
* ReactOS kernel
|
|
|
|
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
1998-09-05 17:33:57 +00:00
|
|
|
*/
|
|
|
|
|
2002-08-14 20:58:39 +00:00
|
|
|
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_KE_H
|
|
|
|
#define __NTOSKRNL_INCLUDE_INTERNAL_KE_H
|
1998-09-05 17:33:57 +00:00
|
|
|
|
2002-09-07 15:13:13 +00:00
|
|
|
/* INCLUDES *****************************************************************/
|
1998-09-05 17:33:57 +00:00
|
|
|
|
2002-09-08 10:23:54 +00:00
|
|
|
#ifndef __ASM__
|
2003-06-07 Casper S. Hornstrup <chorns@users.sourceforge.net>
Changes for compiling with w32api
* include/ddk/service.h: Move ...
* include/ntos/service.h: ... here.
* include/ddk/kdfuncs.h: Move ...
* include/ntos/kdfuncs.h: ... here.
* include/ntos/halfuncs.h: New file.
* ntoskrnl/include/internal/hal/hal.h,
ntoskrnl/include/internal/hal/bus.h,
ntoskrnl/include/internal/hal/mps.h: Remove.
* hal/halx86/include/hal.h: Remove disabled code.
* include/ntos.h: Include ntos/service.h, ntos/halfuncs.h, and
ntos/kdfuncs.h.
* include/ddk/fstypes.h (FILE_LOCK_TOC): Move ...
* include/ntos/file.h: ... here.
* include/ddk/halfuncs.h (HalAllProcessorsStarted,
HalBeginSystemInterrupt, HalDisableSystemInterrupt,
HalEnableSystemInterrupt, HalEndSystemInterrupt,
HalInitializeProcessor, HalInitSystem, HalReportResourceUsage): Move to
include/ntos/halfuncs.h.
* include/ddk/iofuncs.h (IoAssignDriveLetters): Ditto.
* include/ddk/kefuncs.h (KeInitializeApc): Match w32api prototype.
(KeRaiseIrqlToSynchLevel): Move to include/ntos/halfuncs.h.
* include/ddk/ketypes.h (KAPC_ENVIRONMENT): Move to include/ntos/types.h.
(KDEVICE_QUEUE, KDEVICE_QUEUE_ENTRY): Match w32api prototype.
(KINTERRUPT): Move to include/ntos/zwtypes.h.
* include/ddk/mmtypes.h (PAGE_ROUND_UP, PAGE_ROUND_DOWN): Move ...
* include/ntos/mm.h: ... here.
* include/ddk/ntddk.h: Don't include ddk/kdfuncs.h.
* include/ddk/pstypes.h (PKTHREAD, PRKTHREAD): Add.
(PsInitialSystemProcess, PsProcessType, PsThreadType): Move ...
include/ntos/ps.h: ... here.
* lib/ntdll/rtl/i386/exception.c (SehpContinue): New.
* ntoskrnl/rtl/i386/exception.c (SehpContinue): Ditto.
* ntoskrnl/include/internal/ke.h: Include <ddk/ntifs.h>.
* ntoskrnl/include/internal/ntoskrnl.h: Include internal/ke.h.
* ntoskrnl/ex/napi.c: Use new structure SSDT_ENTRY.
* ntoskrnl/ke/apc.c (KeInitializeApc): Match w32api prototype.
* ntoskrnl/ke/kqueue.c: Use fields of new structures KDEVICE_QUEUE
and KDEVICE_QUEUE_ENTRY.
svn path=/trunk/; revision=4861
2003-06-07 10:14:40 +00:00
|
|
|
#include <ddk/ntifs.h>
|
2002-09-08 10:23:54 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
#endif /* not __ASM__ */
|
|
|
|
|
2002-10-19 14:24:16 +00:00
|
|
|
#include "arch/ke.h"
|
2002-08-14 20:58:39 +00:00
|
|
|
|
2004-04-14 07:11:20 +00:00
|
|
|
|
2004-04-14 12:17:26 +00:00
|
|
|
#ifndef __ASM__
|
2004-04-14 07:11:20 +00:00
|
|
|
extern LARGE_INTEGER SystemBootTime;
|
2004-04-14 23:32:53 +00:00
|
|
|
extern volatile ULONG KiKernelTime;
|
|
|
|
extern volatile ULONG KiUserTime;
|
|
|
|
extern volatile ULONG KiDpcTime;
|
2004-04-14 12:17:26 +00:00
|
|
|
#endif
|
2004-04-14 07:11:20 +00:00
|
|
|
|
1998-09-05 17:33:57 +00:00
|
|
|
/* INTERNAL KERNEL FUNCTIONS ************************************************/
|
|
|
|
|
2003-10-15 17:04:39 +00:00
|
|
|
#ifdef __USE_W32API
|
|
|
|
struct _KPROCESS* KeGetCurrentProcess(VOID);
|
|
|
|
VOID KeSetGdtSelector(ULONG Entry, ULONG Value1, ULONG Value2);
|
|
|
|
#endif
|
|
|
|
|
2002-09-08 10:23:54 +00:00
|
|
|
#ifndef __ASM__
|
2001-04-10 17:48:17 +00:00
|
|
|
|
2000-07-04 08:52:47 +00:00
|
|
|
struct _KTHREAD;
|
|
|
|
|
2004-03-06 22:26:05 +00:00
|
|
|
VOID STDCALL
|
|
|
|
DbgBreakPointNoBugCheck(VOID);
|
|
|
|
|
2003-04-06 10:45:16 +00:00
|
|
|
VOID STDCALL KeRescheduleThread();
|
|
|
|
|
2001-03-16 16:05:34 +00:00
|
|
|
VOID KiUpdateSystemTime (KIRQL oldIrql, ULONG Eip);
|
2000-07-04 08:52:47 +00:00
|
|
|
|
2003-11-02 01:16:21 +00:00
|
|
|
KIRQL KeAcquireDispatcherDatabaseLock(VOID);
|
|
|
|
VOID KeAcquireDispatcherDatabaseLockAtDpcLevel(VOID);
|
|
|
|
VOID KeReleaseDispatcherDatabaseLock(KIRQL Irql);
|
|
|
|
VOID KeReleaseDispatcherDatabaseLockFromDpcLevel(VOID);
|
|
|
|
|
1999-03-30 12:55:31 +00:00
|
|
|
BOOLEAN KeDispatcherObjectWake(DISPATCHER_HEADER* hdr);
|
2001-08-27 01:29:07 +00:00
|
|
|
VOID STDCALL KeExpireTimers(PKDPC Apc,
|
|
|
|
PVOID Arg1,
|
2002-08-14 20:58:39 +00:00
|
|
|
PVOID Arg2,
|
|
|
|
PVOID Arg3);
|
1998-09-05 17:33:57 +00:00
|
|
|
VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type,
|
|
|
|
ULONG Size, ULONG SignalState);
|
2001-04-17 04:11:01 +00:00
|
|
|
VOID KeDumpStackFrames(PULONG Frame);
|
2000-10-07 13:41:58 +00:00
|
|
|
BOOLEAN KiTestAlert(VOID);
|
2003-08-18 11:23:32 +00:00
|
|
|
VOID KeRemoveAllWaitsThread(struct _ETHREAD* Thread, NTSTATUS WaitStatus, BOOL Unblock);
|
2000-07-04 08:52:47 +00:00
|
|
|
PULONG KeGetStackTopThread(struct _ETHREAD* Thread);
|
2000-12-10 23:42:01 +00:00
|
|
|
VOID KeContextToTrapFrame(PCONTEXT Context,
|
|
|
|
PKTRAP_FRAME TrapFrame);
|
2001-02-06 00:11:20 +00:00
|
|
|
VOID
|
|
|
|
KiDeliverNormalApc(VOID);
|
2000-07-01 18:27:03 +00:00
|
|
|
|
2001-02-04 17:28:13 +00:00
|
|
|
BOOLEAN STDCALL KeRemoveQueueApc (PKAPC Apc);
|
2003-03-19 23:17:52 +00:00
|
|
|
PLIST_ENTRY STDCALL KeRundownQueue(IN PKQUEUE Queue);
|
|
|
|
|
2004-06-23 19:42:14 +00:00
|
|
|
NTSTATUS STDCALL
|
2004-06-23 19:48:39 +00:00
|
|
|
KeRaiseUserException(IN NTSTATUS ExceptionCode);
|
2001-02-04 17:28:13 +00:00
|
|
|
|
1998-09-05 17:33:57 +00:00
|
|
|
/* INITIALIZATION FUNCTIONS *************************************************/
|
|
|
|
|
|
|
|
VOID KeInitExceptions(VOID);
|
2000-07-10 21:55:49 +00:00
|
|
|
VOID KeInitInterrupts(VOID);
|
1998-09-05 17:33:57 +00:00
|
|
|
VOID KeInitTimer(VOID);
|
|
|
|
VOID KeInitDpc(VOID);
|
|
|
|
VOID KeInitDispatcher(VOID);
|
1999-03-19 05:55:55 +00:00
|
|
|
VOID KeInitializeDispatcher(VOID);
|
|
|
|
VOID KeInitializeTimerImpl(VOID);
|
1999-03-25 00:37:06 +00:00
|
|
|
VOID KeInitializeBugCheck(VOID);
|
2001-04-13 16:12:26 +00:00
|
|
|
VOID Phase1Initialization(PVOID Context);
|
1998-09-05 17:33:57 +00:00
|
|
|
|
2000-07-10 21:55:49 +00:00
|
|
|
VOID KeInit1(VOID);
|
|
|
|
VOID KeInit2(VOID);
|
|
|
|
|
2000-10-07 13:41:58 +00:00
|
|
|
BOOLEAN KiDeliverUserApc(PKTRAP_FRAME TrapFrame);
|
2003-11-27 01:13:05 +00:00
|
|
|
|
|
|
|
VOID FASTCALL
|
|
|
|
KiSwapApcEnvironment(
|
|
|
|
struct _KTHREAD* Thread,
|
|
|
|
struct _KPROCESS* NewProcess);
|
|
|
|
|
2000-12-26 05:32:44 +00:00
|
|
|
VOID
|
2002-08-14 20:58:39 +00:00
|
|
|
KiAddProfileEvent(KPROFILE_SOURCE Source, ULONG Pc);
|
2001-03-18 19:35:14 +00:00
|
|
|
VOID
|
2001-09-24 00:51:17 +00:00
|
|
|
KiDispatchException(PEXCEPTION_RECORD ExceptionRecord,
|
2001-03-18 19:35:14 +00:00
|
|
|
PCONTEXT Context,
|
|
|
|
PKTRAP_FRAME Tf,
|
|
|
|
KPROCESSOR_MODE PreviousMode,
|
|
|
|
BOOLEAN SearchFrames);
|
|
|
|
VOID KeTrapFrameToContext(PKTRAP_FRAME TrapFrame,
|
|
|
|
PCONTEXT Context);
|
2001-04-16 23:29:55 +00:00
|
|
|
VOID
|
2003-02-14 17:52:31 +00:00
|
|
|
KeApplicationProcessorInit(VOID);
|
2001-04-16 23:29:55 +00:00
|
|
|
VOID
|
2001-04-17 04:11:01 +00:00
|
|
|
KePrepareForApplicationProcessorInit(ULONG id);
|
2001-11-20 02:29:45 +00:00
|
|
|
ULONG
|
|
|
|
KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2);
|
2002-01-15 02:51:32 +00:00
|
|
|
VOID STDCALL
|
2002-06-18 21:51:11 +00:00
|
|
|
KePushAndStackSwitchAndSysRet(ULONG Push, PVOID NewStack);
|
2002-01-15 02:51:32 +00:00
|
|
|
VOID STDCALL
|
|
|
|
KeStackSwitchAndRet(PVOID NewStack);
|
2002-05-02 23:45:33 +00:00
|
|
|
VOID STDCALL
|
2003-02-14 17:52:31 +00:00
|
|
|
KeBugCheckWithTf(ULONG BugCheckCode,
|
2002-05-02 23:45:33 +00:00
|
|
|
ULONG BugCheckParameter1,
|
|
|
|
ULONG BugCheckParameter2,
|
|
|
|
ULONG BugCheckParameter3,
|
|
|
|
ULONG BugCheckParameter4,
|
|
|
|
PKTRAP_FRAME Tf);
|
2003-07-22 03:17:24 +00:00
|
|
|
#define KEBUGCHECKWITHTF(a,b,c,d,e,f) DbgPrint("KeBugCheckWithTf at %s:%i\n",__FILE__,__LINE__), KeBugCheckWithTf(a,b,c,d,e,f)
|
2002-05-02 23:45:33 +00:00
|
|
|
VOID
|
|
|
|
KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG ExceptionNr, ULONG cr2);
|
2001-04-10 17:48:17 +00:00
|
|
|
|
2004-04-14 23:32:53 +00:00
|
|
|
VOID
|
|
|
|
KiUpdateProcessThreadTime(VOID);
|
|
|
|
|
2002-09-08 10:23:54 +00:00
|
|
|
#endif /* not __ASM__ */
|
|
|
|
|
|
|
|
#define MAXIMUM_PROCESSORS 32
|
2001-04-16 02:02:07 +00:00
|
|
|
|
2002-08-14 20:58:39 +00:00
|
|
|
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_KE_H */
|