From ebabe5662485b9dee570d815862584963d239d0b Mon Sep 17 00:00:00 2001 From: Casper Hornstrup Date: Sat, 7 Jun 2003 10:14:40 +0000 Subject: [PATCH] 2003-06-07 Casper S. Hornstrup 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 . * 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 --- reactos/ChangeLog | 43 ++ reactos/hal/halx86/include/hal.h | 3 - reactos/include/ddk/fstypes.h | 10 +- reactos/include/ddk/halfuncs.h | 35 +- reactos/include/ddk/iofuncs.h | 11 +- reactos/include/ddk/kefuncs.h | 23 +- reactos/include/ddk/ketypes.h | 31 +- reactos/include/ddk/mmtypes.h | 6 +- reactos/include/ddk/ntddk.h | 3 +- reactos/include/ddk/pstypes.h | 15 +- reactos/include/ntos.h | 6 +- reactos/include/ntos/file.h | 8 + reactos/include/ntos/halfuncs.h | 51 +++ reactos/include/{ddk => ntos}/kdfuncs.h | 7 +- reactos/include/ntos/mm.h | 3 + reactos/include/ntos/ps.h | 12 + reactos/include/{ddk => ntos}/service.h | 22 +- reactos/include/ntos/types.h | 7 + reactos/include/ntos/zwtypes.h | 19 + reactos/lib/ntdll/rtl/i386/exception.c | 11 +- reactos/ntoskrnl/ex/napi.c | 10 +- reactos/ntoskrnl/include/internal/hal/bus.h | 121 ------ reactos/ntoskrnl/include/internal/hal/hal.h | 48 -- reactos/ntoskrnl/include/internal/hal/mps.h | 435 ------------------- reactos/ntoskrnl/include/internal/i386/hal.h | 3 - reactos/ntoskrnl/include/internal/ke.h | 3 +- reactos/ntoskrnl/include/internal/ntoskrnl.h | 3 +- reactos/ntoskrnl/include/internal/ps.h | 20 +- reactos/ntoskrnl/ke/apc.c | 23 +- reactos/ntoskrnl/ke/i386/irq.c | 5 +- reactos/ntoskrnl/ke/i386/usercall.c | 7 +- reactos/ntoskrnl/ke/i386/usertrap.c | 5 +- reactos/ntoskrnl/ke/kqueue.c | 40 +- reactos/ntoskrnl/rtl/i386/exception.c | 13 +- reactos/subsys/win32k/main/dllmain.c | 7 +- reactos/subsys/win32k/main/svctabm.c | 5 +- 36 files changed, 277 insertions(+), 797 deletions(-) create mode 100755 reactos/include/ntos/halfuncs.h rename reactos/include/{ddk => ntos}/kdfuncs.h (92%) mode change 100644 => 100755 rename reactos/include/{ddk => ntos}/service.h (80%) mode change 100644 => 100755 delete mode 100644 reactos/ntoskrnl/include/internal/hal/bus.h delete mode 100644 reactos/ntoskrnl/include/internal/hal/hal.h delete mode 100644 reactos/ntoskrnl/include/internal/hal/mps.h diff --git a/reactos/ChangeLog b/reactos/ChangeLog index 577d5da65e2..282b1c2bfe8 100644 --- a/reactos/ChangeLog +++ b/reactos/ChangeLog @@ -1,3 +1,46 @@ +2003-06-07 Casper S. Hornstrup + + 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 . + * 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. + 2003-06-07 Casper S. Hornstrup * ntoskrnl/cm/regfile.c (CmiCopyKey): Fix unsigned/signed warning. diff --git a/reactos/hal/halx86/include/hal.h b/reactos/hal/halx86/include/hal.h index 87939c1589a..41837920015 100644 --- a/reactos/hal/halx86/include/hal.h +++ b/reactos/hal/halx86/include/hal.h @@ -5,9 +5,6 @@ #ifndef __INTERNAL_HAL_HAL_H #define __INTERNAL_HAL_HAL_H -//#include -//#include - /* * FUNCTION: Probes for a BIOS32 extension */ diff --git a/reactos/include/ddk/fstypes.h b/reactos/include/ddk/fstypes.h index be4adec1ca5..f1d4f8c2369 100644 --- a/reactos/include/ddk/fstypes.h +++ b/reactos/include/ddk/fstypes.h @@ -1,6 +1,6 @@ #ifndef __INCLUDE_DDK_FSTYPES_H #define __INCLUDE_DDK_FSTYPES_H -/* $Id: fstypes.h,v 1.10 2003/04/19 17:17:10 ea Exp $ */ +/* $Id: fstypes.h,v 1.11 2003/06/07 10:14:39 chorns Exp $ */ #define FSRTL_TAG TAG('F','S','r','t') @@ -20,14 +20,6 @@ typedef struct _FILE_LOCK_INFO { LARGE_INTEGER EndingByte; } FILE_LOCK_INFO, *PFILE_LOCK_INFO; -typedef struct _FILE_LOCK_TOC { - KSPIN_LOCK SpinLock; - LIST_ENTRY GrantedListHead; - LIST_ENTRY PendingListHead; - LIST_ENTRY CompletedListHead; - LIST_ENTRY UnlockedListHead; -} FILE_LOCK_TOC, *PFILE_LOCK_TOC; - typedef struct _FILE_LOCK_GRANTED { LIST_ENTRY ListEntry; FILE_LOCK_INFO Lock; diff --git a/reactos/include/ddk/halfuncs.h b/reactos/include/ddk/halfuncs.h index 0d53dfeef75..3e539f0e879 100644 --- a/reactos/include/ddk/halfuncs.h +++ b/reactos/include/ddk/halfuncs.h @@ -1,6 +1,6 @@ #ifndef __INCLUDE_DDK_HALFUNCS_H #define __INCLUDE_DDK_HALFUNCS_H -/* $Id: halfuncs.h,v 1.5 2003/05/28 18:09:09 chorns Exp $ */ +/* $Id: halfuncs.h,v 1.6 2003/06/07 10:14:39 chorns Exp $ */ #include @@ -27,9 +27,6 @@ PVOID STDCALL HalAllocateCrashDumpRegisters(IN PADAPTER_OBJECT AdapterObject, IN OUT PULONG NumberOfMapRegisters); -BOOLEAN STDCALL -HalAllProcessorsStarted(VOID); - NTSTATUS STDCALL HalAssignSlotResources( PUNICODE_STRING RegistryPath, @@ -42,11 +39,6 @@ HalAssignSlotResources( PCM_RESOURCE_LIST *AllocatedResources ); -BOOLEAN STDCALL -HalBeginSystemInterrupt(ULONG Vector, - KIRQL Irql, - PKIRQL OldIrql); - VOID STDCALL HalCalibratePerformanceCounter(ULONG Count); @@ -55,23 +47,9 @@ FASTCALL HalClearSoftwareInterrupt */ -BOOLEAN STDCALL -HalDisableSystemInterrupt(ULONG Vector, - ULONG Unknown2); - VOID STDCALL HalDisplayString(IN PCH String); -BOOLEAN STDCALL -HalEnableSystemInterrupt(ULONG Vector, - ULONG Unknown2, - ULONG Unknown3); - -VOID STDCALL -HalEndSystemInterrupt(KIRQL Irql, - ULONG Unknown2); - - /* * HalExamineMBR() is not exported explicitly. * It is exported by the HalDispatchTable. @@ -136,14 +114,6 @@ HalGetInterruptVector(INTERFACE_TYPE InterfaceType, PKIRQL Irql, PKAFFINITY Affinity); -VOID STDCALL -HalInitializeProcessor(ULONG ProcessorNumber, - PVOID ProcessorStack); - -BOOLEAN STDCALL -HalInitSystem(ULONG BootPhase, - PLOADER_PARAMETER_BLOCK LoaderBlock); - BOOLEAN STDCALL HalMakeBeep(ULONG Frequency); @@ -167,9 +137,6 @@ HalQueryRealTimeClock(PTIME_FIELDS Time); ULONG STDCALL HalReadDmaCounter(PADAPTER_OBJECT AdapterObject); -VOID STDCALL -HalReportResourceUsage(VOID); - VOID STDCALL HalRequestIpi(ULONG Unknown); diff --git a/reactos/include/ddk/iofuncs.h b/reactos/include/ddk/iofuncs.h index d4bbeb5b2ea..53ec60bb05f 100644 --- a/reactos/include/ddk/iofuncs.h +++ b/reactos/include/ddk/iofuncs.h @@ -1,6 +1,6 @@ #ifndef _INCLUDE_DDK_IOFUNCS_H #define _INCLUDE_DDK_IOFUNCS_H -/* $Id: iofuncs.h,v 1.37 2003/04/26 23:13:26 hyperion Exp $ */ +/* $Id: iofuncs.h,v 1.38 2003/06/07 10:14:39 chorns Exp $ */ /* --- EXPORTED BY NTOSKRNL --- */ @@ -1139,15 +1139,6 @@ IofCompleteRequest ( /* --- EXPORTED BY HAL --- */ -VOID -STDCALL -IoAssignDriveLetters ( - IN PLOADER_PARAMETER_BLOCK LoaderBlock, - IN PSTRING NtDeviceName, - OUT PUCHAR NtSystemPath, - OUT PSTRING NtSystemPathString - ); - BOOLEAN STDCALL IoFlushAdapterBuffers ( diff --git a/reactos/include/ddk/kefuncs.h b/reactos/include/ddk/kefuncs.h index 4f169d052ac..81668512899 100644 --- a/reactos/include/ddk/kefuncs.h +++ b/reactos/include/ddk/kefuncs.h @@ -85,14 +85,15 @@ ULONG KeGetDcacheFillSize(VOID); ULONG STDCALL KeGetPreviousMode (VOID); -VOID STDCALL KeInitializeApc (PKAPC Apc, - struct _KTHREAD* Thread, - KAPC_ENVIRONMENT Environment, - PKKERNEL_ROUTINE KernelRoutine, - PKRUNDOWN_ROUTINE RundownRoutine, - PKNORMAL_ROUTINE NormalRoutine, - KPROCESSOR_MODE Mode, - PVOID Context); +VOID STDCALL KeInitializeApc (IN PKAPC Apc, + IN PKTHREAD Thread, + IN UCHAR StateIndex, + IN PKKERNEL_ROUTINE KernelRoutine, + IN PKRUNDOWN_ROUTINE RundownRoutine, + IN PKNORMAL_ROUTINE NormalRoutine, + IN UCHAR Mode, + IN PVOID Context); + /* * VOID @@ -223,12 +224,6 @@ KeRaiseIrqlToDpcLevel ( VOID ); -KIRQL -STDCALL -KeRaiseIrqlToSynchLevel ( - VOID - ); - /* * FUNCTION: Raises a user mode exception * ARGUMENTS: diff --git a/reactos/include/ddk/ketypes.h b/reactos/include/ddk/ketypes.h index 72be56b8c51..16707c87915 100644 --- a/reactos/include/ddk/ketypes.h +++ b/reactos/include/ddk/ketypes.h @@ -44,12 +44,6 @@ typedef VOID STDCALL_FUNC typedef VOID STDCALL_FUNC (*PKRUNDOWN_ROUTINE)(struct _KAPC* Apc); -typedef enum _KAPC_ENVIRONMENT { - OriginalApcEnvironment, - AttachedApcEnvironment, - CurrentApcEnvironment -} KAPC_ENVIRONMENT; - struct _DISPATCHER_HEADER; typedef struct _KWAIT_BLOCK @@ -105,9 +99,11 @@ typedef struct _KSPIN_LOCK typedef struct _KDEVICE_QUEUE { - LIST_ENTRY ListHead; - BOOLEAN Busy; - KSPIN_LOCK Lock; + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; } KDEVICE_QUEUE, *PKDEVICE_QUEUE; @@ -205,8 +201,8 @@ typedef struct _KDPC typedef struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY Entry; - ULONG Key; + LIST_ENTRY DeviceListEntry; + ULONG SortKey; BOOLEAN Inserted; } KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY; @@ -221,19 +217,6 @@ typedef BOOLEAN STDCALL_FUNC (*PKSERVICE_ROUTINE)(struct _KINTERRUPT* Interrupt, PVOID ServiceContext); -typedef struct _KINTERRUPT -{ - ULONG Vector; - KAFFINITY ProcessorEnableMask; - PKSPIN_LOCK IrqLock; - BOOLEAN Shareable; - BOOLEAN FloatingSave; - PKSERVICE_ROUTINE ServiceRoutine; - PVOID ServiceContext; - LIST_ENTRY Entry; - KIRQL SynchLevel; -} KINTERRUPT, *PKINTERRUPT; - typedef struct _KSYSTEM_TIME { ULONG LowPart; diff --git a/reactos/include/ddk/mmtypes.h b/reactos/include/ddk/mmtypes.h index 05dd05e2655..64212d0f090 100644 --- a/reactos/include/ddk/mmtypes.h +++ b/reactos/include/ddk/mmtypes.h @@ -1,4 +1,4 @@ -/* $Id: mmtypes.h,v 1.15 2003/05/28 18:09:09 chorns Exp $ */ +/* $Id: mmtypes.h,v 1.16 2003/06/07 10:14:39 chorns Exp $ */ #ifndef _INCLUDE_DDK_MMTYPES_H #define _INCLUDE_DDK_MMTYPES_H @@ -7,10 +7,6 @@ #include -#define PAGE_ROUND_UP(x) ( (((ULONG)x)%PAGE_SIZE) ? ((((ULONG)x)&(~0xfff))+0x1000) : ((ULONG)x) ) -#define PAGE_ROUND_DOWN(x) (((ULONG)x)&(~0xfff)) - - /* * FUNCTION: Determines if the given virtual address is page aligned */ diff --git a/reactos/include/ddk/ntddk.h b/reactos/include/ddk/ntddk.h index 4910490246e..dc38c548b00 100644 --- a/reactos/include/ddk/ntddk.h +++ b/reactos/include/ddk/ntddk.h @@ -1,4 +1,4 @@ -/* $Id: ntddk.h,v 1.35 2003/05/28 18:09:09 chorns Exp $ +/* $Id: ntddk.h,v 1.36 2003/06/07 10:14:39 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -76,7 +76,6 @@ extern "C" #include #include #include -#include #include #include #include diff --git a/reactos/include/ddk/pstypes.h b/reactos/include/ddk/pstypes.h index b34c67d1cb5..0a7f78d8ac5 100644 --- a/reactos/include/ddk/pstypes.h +++ b/reactos/include/ddk/pstypes.h @@ -21,6 +21,8 @@ struct _KPROCESS; struct _ETHREAD; struct _KTHREAD; +typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD; + typedef NTSTATUS STDCALL_FUNC (*PKSTART_ROUTINE)(PVOID StartContext); typedef VOID STDCALL_FUNC (*PCREATE_PROCESS_NOTIFY_ROUTINE)(HANDLE ParentId, @@ -46,17 +48,4 @@ struct _KPROCESS; #define HIGH_PRIORITY (31) #define MAXIMUM_PRIORITY (32) - -#ifdef __NTOSKRNL__ -extern struct _EPROCESS* EXPORTED PsInitialSystemProcess; -extern POBJECT_TYPE EXPORTED PsProcessType; -extern POBJECT_TYPE EXPORTED PsThreadType; -#else -#ifdef __GNU__ // robd -extern struct _EPROCESS* IMPORTED PsInitialSystemProcess; -extern POBJECT_TYPE IMPORTED PsProcessType; -extern POBJECT_TYPE IMPORTED PsThreadType; -#endif -#endif - #endif /* __INCLUDE_DDK_PSTYPES_H */ diff --git a/reactos/include/ntos.h b/reactos/include/ntos.h index 2f49fecf6a0..eadde9c7f30 100644 --- a/reactos/include/ntos.h +++ b/reactos/include/ntos.h @@ -1,6 +1,6 @@ #ifndef _NTOS_H #define _NTOS_H -/* $Id: ntos.h,v 1.10 2003/06/01 14:59:01 chorns Exp $ */ +/* $Id: ntos.h,v 1.11 2003/06/07 10:14:39 chorns Exp $ */ #if defined(NTOS_MODE_USER) // include windows.h before ntddk.h to get user mode prototype for InterlockedXxx functions @@ -38,6 +38,7 @@ #include "ntos/rtl.h" #include "ntos/zwtypes.h" #include "ntos/zw.h" +#include "ntos/service.h" #include "ntdll/csr.h" #include "ntdll/dbg.h" #include "ntdll/ldr.h" @@ -80,7 +81,10 @@ #include "ntos/rtl.h" #include "ntos/zwtypes.h" #include "ntos/zw.h" +#include "ntos/service.h" #include "ntos/haltypes.h" +#include "ntos/halfuncs.h" +#include "ntos/kdfuncs.h" #include "ntos/obtypes.h" #include "ntos/tss.h" #include "rosrtl/thread.h" diff --git a/reactos/include/ntos/file.h b/reactos/include/ntos/file.h index fd2d983ce02..64cebf144bc 100644 --- a/reactos/include/ntos/file.h +++ b/reactos/include/ntos/file.h @@ -115,4 +115,12 @@ #endif /* !__USE_W32API */ +typedef struct _FILE_LOCK_TOC { + KSPIN_LOCK SpinLock; + LIST_ENTRY GrantedListHead; + LIST_ENTRY PendingListHead; + LIST_ENTRY CompletedListHead; + LIST_ENTRY UnlockedListHead; +} FILE_LOCK_TOC, *PFILE_LOCK_TOC; + #endif /* __INCLUDE_FILE_H */ diff --git a/reactos/include/ntos/halfuncs.h b/reactos/include/ntos/halfuncs.h new file mode 100755 index 00000000000..54cf4da2569 --- /dev/null +++ b/reactos/include/ntos/halfuncs.h @@ -0,0 +1,51 @@ +#ifndef __INCLUDE_NTOS_HALFUNCS_H +#define __INCLUDE_NTOS_HALFUNCS_H + +#include + +BOOLEAN STDCALL +HalAllProcessorsStarted(VOID); + +BOOLEAN STDCALL +HalBeginSystemInterrupt(ULONG Vector, + KIRQL Irql, + PKIRQL OldIrql); + +BOOLEAN STDCALL +HalDisableSystemInterrupt(ULONG Vector, + ULONG Unknown2); + +BOOLEAN STDCALL +HalEnableSystemInterrupt(ULONG Vector, + ULONG Unknown2, + ULONG Unknown3); + +VOID STDCALL +HalEndSystemInterrupt(KIRQL Irql, + ULONG Unknown2); + +VOID STDCALL +HalInitializeProcessor(ULONG ProcessorNumber, + PVOID ProcessorStack); + +BOOLEAN STDCALL +HalInitSystem(ULONG BootPhase, + PLOADER_PARAMETER_BLOCK LoaderBlock); + +VOID STDCALL +HalReportResourceUsage(VOID); + +VOID +STDCALL +IoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, + IN PSTRING NtDeviceName, + OUT PUCHAR NtSystemPath, + OUT PSTRING NtSystemPathString); + +KIRQL +STDCALL +KeRaiseIrqlToSynchLevel(VOID); + +#endif /* __INCLUDE_NTOS_HALDDK_H */ + +/* EOF */ diff --git a/reactos/include/ddk/kdfuncs.h b/reactos/include/ntos/kdfuncs.h old mode 100644 new mode 100755 similarity index 92% rename from reactos/include/ddk/kdfuncs.h rename to reactos/include/ntos/kdfuncs.h index 5d70fda2a0a..77022494c1f --- a/reactos/include/ddk/kdfuncs.h +++ b/reactos/include/ntos/kdfuncs.h @@ -1,8 +1,9 @@ #ifndef __INCLUDE_DDK_KDFUNCS_H #define __INCLUDE_DDK_KDFUNCS_H -/* $Id: kdfuncs.h,v 1.8 2002/09/08 10:47:44 chorns Exp $ */ +/* $Id: kdfuncs.h,v 1.1 2003/06/07 10:14:39 chorns Exp $ */ + +#ifndef __USE_W32API -/* --- NTOSKRNL.EXE --- */ #if defined(__NTOSKRNL__) extern BOOLEAN KdDebuggerEnabled __declspec(dllexport); extern BOOLEAN KdDebuggerNotPresent __declspec(dllexport); @@ -11,6 +12,8 @@ extern BOOLEAN KdDebuggerEnabled __declspec(dllimport); extern BOOLEAN KdDebuggerNotPresent __declspec(dllimport); #endif +#endif /* __USE_W32API */ + BYTE STDCALL KdPollBreakIn ( diff --git a/reactos/include/ntos/mm.h b/reactos/include/ntos/mm.h index 706ee3724f1..2c97e1409ef 100644 --- a/reactos/include/ntos/mm.h +++ b/reactos/include/ntos/mm.h @@ -59,4 +59,7 @@ #endif /* __USE_W32API */ +#define PAGE_ROUND_UP(x) ( (((ULONG)x)%PAGE_SIZE) ? ((((ULONG)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG)x) ) +#define PAGE_ROUND_DOWN(x) (((ULONG)x)&(~(PAGE_SIZE-1))) + #endif /* __INCLUDE_MM_H */ diff --git a/reactos/include/ntos/ps.h b/reactos/include/ntos/ps.h index e2169219930..25b2bfd014a 100644 --- a/reactos/include/ntos/ps.h +++ b/reactos/include/ntos/ps.h @@ -83,4 +83,16 @@ #endif /* !__USE_W32API */ +#ifdef __NTOSKRNL__ +extern struct _EPROCESS* EXPORTED PsInitialSystemProcess; +extern POBJECT_TYPE EXPORTED PsProcessType; +extern POBJECT_TYPE EXPORTED PsThreadType; +#else +#ifdef __GNU__ // robd +extern struct _EPROCESS* IMPORTED PsInitialSystemProcess; +extern POBJECT_TYPE IMPORTED PsProcessType; +extern POBJECT_TYPE IMPORTED PsThreadType; +#endif +#endif + #endif /* __INCLUDE_PS_H */ diff --git a/reactos/include/ddk/service.h b/reactos/include/ntos/service.h old mode 100644 new mode 100755 similarity index 80% rename from reactos/include/ddk/service.h rename to reactos/include/ntos/service.h index e6a684899ec..3b27b77a5cc --- a/reactos/include/ddk/service.h +++ b/reactos/include/ntos/service.h @@ -1,12 +1,14 @@ -#ifndef __INTERNAL_SERVICE_H -#define __INTERNAL_SERVICE_H +#ifndef __NTOS_SERVICE_H +#define __NTOS_SERVICE_H /* number of entries in the service descriptor tables */ #define SSDT_MAX_ENTRIES 4 +#ifndef __USE_W32API + #pragma pack(1) // System Service Dispatch Table @@ -25,27 +27,31 @@ typedef struct t_KeServiceDescriptorTableEntry { unsigned int NumberOfServices; PSSPT SSPT; -} KE_SERVICE_DESCRIPTOR_TABLE_ENTRY, *PKE_SERVICE_DESCRIPTOR_TABLE_ENTRY; +} SSDT_ENTRY, *PSSDT_ENTRY; #pragma pack() +#endif /* __USE_W32API */ + /* --- NTOSKRNL.EXE --- */ #if defined(__NTOSKRNL__) extern -KE_SERVICE_DESCRIPTOR_TABLE_ENTRY +SSDT_ENTRY KeServiceDescriptorTable[SSDT_MAX_ENTRIES] __declspec(dllexport); #else extern -KE_SERVICE_DESCRIPTOR_TABLE_ENTRY +SSDT_ENTRY KeServiceDescriptorTable[SSDT_MAX_ENTRIES] __declspec(dllimport); #endif extern -KE_SERVICE_DESCRIPTOR_TABLE_ENTRY +SSDT_ENTRY KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES]; +#ifndef __USE_W32API + BOOLEAN STDCALL KeAddSystemServiceTable ( @@ -56,5 +62,7 @@ KeAddSystemServiceTable ( ULONG TableIndex ); -#endif +#endif /* __USE_W32API */ + +#endif /* __NTOS_SERVICE_H */ diff --git a/reactos/include/ntos/types.h b/reactos/include/ntos/types.h index 3d917b6aa99..20810c325fc 100644 --- a/reactos/include/ntos/types.h +++ b/reactos/include/ntos/types.h @@ -517,4 +517,11 @@ typedef struct _LOADER_PARAMETER_BLOCK ULONG BootLoaderName; } LOADER_PARAMETER_BLOCK, *PLOADER_PARAMETER_BLOCK; +typedef enum _KAPC_ENVIRONMENT +{ + OriginalApcEnvironment, + AttachedApcEnvironment, + CurrentApcEnvironment +} KAPC_ENVIRONMENT; + #endif /* __INCLUDE_TYPES_H */ diff --git a/reactos/include/ntos/zwtypes.h b/reactos/include/ntos/zwtypes.h index 15b0a1b5f57..ea7dd8c9044 100755 --- a/reactos/include/ntos/zwtypes.h +++ b/reactos/include/ntos/zwtypes.h @@ -1647,4 +1647,23 @@ struct _LPC_PORT_BASIC_INFORMATION } LPC_PORT_BASIC_INFORMATION, * PLPC_PORT_BASIC_INFORMATION; +typedef struct _KINTERRUPT +{ + ULONG Vector; + KAFFINITY ProcessorEnableMask; + PKSPIN_LOCK IrqLock; + BOOLEAN Shareable; + BOOLEAN FloatingSave; + PKSERVICE_ROUTINE ServiceRoutine; + PVOID ServiceContext; + LIST_ENTRY Entry; + KIRQL SynchLevel; +} KINTERRUPT; + +#ifndef __USE_W32API + +typedef struct _KINTERRUPT *PKINTERRUPT; + +#endif /* __USE_W32API */ + #endif diff --git a/reactos/lib/ntdll/rtl/i386/exception.c b/reactos/lib/ntdll/rtl/i386/exception.c index f31ab66f288..946bd6be6ac 100755 --- a/reactos/lib/ntdll/rtl/i386/exception.c +++ b/reactos/lib/ntdll/rtl/i386/exception.c @@ -1,4 +1,4 @@ -/* $Id: exception.c,v 1.3 2002/10/26 09:53:15 dwelch Exp $ +/* $Id: exception.c,v 1.4 2003/06/07 10:14:39 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -43,6 +43,9 @@ RtlpCaptureContext(PCONTEXT pContext); RtlpCaptureContext(Context); \ } +#define SehpContinue(Context, TestAlert) \ + NtContinue(Context, TestAlert) + /*** Code below this line is shared with ntoskrnl/rtl/i386/exception.c - please keep in sync ***/ VOID STDCALL @@ -203,7 +206,7 @@ RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, else { /* Copy the (possibly changed) context back to the trap frame and return */ - NtContinue(Context, FALSE); + SehpContinue(Context, FALSE); return ExceptionContinueExecution; } } @@ -330,7 +333,7 @@ RtlUnwind(PEXCEPTION_REGISTRATION RegistrationFrame, if (ERHead == RegistrationFrame) { DPRINT("Continueing execution\n"); - NtContinue(&Context, FALSE); + SehpContinue(&Context, FALSE); return; } else @@ -425,7 +428,7 @@ RtlUnwind(PEXCEPTION_REGISTRATION RegistrationFrame, RegistrationFrame); if ((ULONG_PTR)RegistrationFrame == -1) - NtContinue(&Context, FALSE); + SehpContinue(&Context, FALSE); else NtRaiseException(pExceptRec, &Context, 0); } diff --git a/reactos/ntoskrnl/ex/napi.c b/reactos/ntoskrnl/ex/napi.c index 939584bf898..677170dbc25 100644 --- a/reactos/ntoskrnl/ex/napi.c +++ b/reactos/ntoskrnl/ex/napi.c @@ -8,17 +8,15 @@ /* INCLUDES *****************************************************************/ +#define NTOS_MODE_KERNEL #include #include -/* GLOBALS ******************************************************************/ - -#include #include -/* GLOBALS *****************************************************************/ +/* GLOBALS ******************************************************************/ -KE_SERVICE_DESCRIPTOR_TABLE_ENTRY +SSDT_ENTRY __declspec(dllexport) KeServiceDescriptorTable[SSDT_MAX_ENTRIES] = { @@ -28,7 +26,7 @@ KeServiceDescriptorTable[SSDT_MAX_ENTRIES] = { NULL, NULL, 0, NULL } }; -KE_SERVICE_DESCRIPTOR_TABLE_ENTRY +SSDT_ENTRY KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES] = { { MainSSDT, NULL, NUMBER_OF_SYSCALLS, MainSSPT }, diff --git a/reactos/ntoskrnl/include/internal/hal/bus.h b/reactos/ntoskrnl/include/internal/hal/bus.h deleted file mode 100644 index 5fb87c56bac..00000000000 --- a/reactos/ntoskrnl/include/internal/hal/bus.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - - */ - -#ifndef __INTERNAL_HAL_BUS_H -#define __INTERNAL_HAL_BUS_H - -struct _BUS_HANDLER; - -typedef NTSTATUS (STDCALL *pAdjustResourceList) ( - IN struct _BUS_HANDLER *BusHandler, - IN ULONG BusNumber, - IN OUT PCM_RESOURCE_LIST Resources - ); - -typedef NTSTATUS (STDCALL *pAssignSlotResources) ( - IN struct _BUS_HANDLER *BusHandler, - IN ULONG BusNumber, - IN PUNICODE_STRING RegistryPath, - IN PUNICODE_STRING DriverClassName, - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT DeviceObject, - IN ULONG SlotNumber, - IN OUT PCM_RESOURCE_LIST *AllocatedResources - ); - -typedef ULONG (STDCALL *pGetSetBusData) ( - IN struct _BUS_HANDLER *BusHandler, - IN ULONG BusNumber, - IN ULONG SlotNumber, - OUT PVOID Buffer, - IN ULONG Offset, - IN ULONG Length - ); - -typedef ULONG (STDCALL *pGetInterruptVector) ( - IN struct _BUS_HANDLER *BusHandler, - IN ULONG BusNumber, - IN ULONG BusInterruptLevel, - IN ULONG BusInterruptVector, - OUT PKIRQL Irql, - OUT PKAFFINITY Affinity - ); - -typedef ULONG (STDCALL *pTranslateBusAddress) ( - IN struct _BUS_HANDLER *BusHandler, - IN ULONG BusNumber, - IN PHYSICAL_ADDRESS BusAddress, - IN OUT PULONG AddressSpace, - OUT PPHYSICAL_ADDRESS TranslatedAddress - ); - -typedef struct _BUS_HANDLER -{ - LIST_ENTRY Entry; - INTERFACE_TYPE InterfaceType; - BUS_DATA_TYPE BusDataType; - ULONG BusNumber; - ULONG RefCount; - - pGetSetBusData GetBusData; - pGetSetBusData SetBusData; - pAdjustResourceList AdjustResourceList; - pAssignSlotResources AssignSlotResources; - pGetInterruptVector GetInterruptVector; - pTranslateBusAddress TranslateBusAddress; -} BUS_HANDLER, *PBUS_HANDLER; - - -/* FUNCTIONS *****************************************************************/ - -/* bus.c */ -PBUS_HANDLER -HalpAllocateBusHandler(INTERFACE_TYPE InterfaceType, - BUS_DATA_TYPE BusDataType, - ULONG BusNumber); - -/* sysbus.h */ -ULONG STDCALL -HalpGetSystemInterruptVector(PVOID BusHandler, - ULONG BusNumber, - ULONG BusInterruptLevel, - ULONG BusInterruptVector, - PKIRQL Irql, - PKAFFINITY Affinity); - -BOOLEAN STDCALL -HalpTranslateSystemBusAddress(PBUS_HANDLER BusHandler, - ULONG BusNumber, - PHYSICAL_ADDRESS BusAddress, - PULONG AddressSpace, - PPHYSICAL_ADDRESS TranslatedAddress); - -/* isa.c */ -BOOLEAN STDCALL -HalpTranslateIsaBusAddress(PBUS_HANDLER BusHandler, - ULONG BusNumber, - PHYSICAL_ADDRESS BusAddress, - PULONG AddressSpace, - PPHYSICAL_ADDRESS TranslatedAddress); - -/* time.c */ -ULONG STDCALL -HalpGetCmosData(PBUS_HANDLER BusHandler, - ULONG BusNumber, - ULONG SlotNumber, - PVOID Buffer, - ULONG Offset, - ULONG Length); - -ULONG STDCALL -HalpSetCmosData(PBUS_HANDLER BusHandler, - ULONG BusNumber, - ULONG SlotNumber, - PVOID Buffer, - ULONG Offset, - ULONG Length); - -#endif /* __INTERNAL_HAL_BUS_H */ - -/* EOF */ \ No newline at end of file diff --git a/reactos/ntoskrnl/include/internal/hal/hal.h b/reactos/ntoskrnl/include/internal/hal/hal.h deleted file mode 100644 index 675a5d59552..00000000000 --- a/reactos/ntoskrnl/include/internal/hal/hal.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - */ - -#ifndef __INTERNAL_HAL_HAL_H -#define __INTERNAL_HAL_HAL_H - -#include -#include - -/* - * FUNCTION: Probes for a BIOS32 extension - */ -VOID Hal_bios32_probe(VOID); - -/* - * FUNCTION: Determines if a a bios32 service is present - */ -BOOLEAN Hal_bios32_is_service_present(ULONG service); - -VOID HalInitializeDisplay (PLOADER_PARAMETER_BLOCK LoaderBlock); -VOID HalResetDisplay (VOID); - -VOID HalpInitBusHandlers (VOID); - -/* irql.c */ -VOID HalpInitPICs(VOID); - -/* udelay.c */ -VOID HalpCalibrateStallExecution(VOID); - -/* pci.c */ -VOID HalpInitPciBus (VOID); - -/* enum.c */ -VOID HalpStartEnumerator (VOID); - -struct _ADAPTER_OBJECT { - int Channel; - PVOID PagePort; - PVOID CountPort; - PVOID OffsetPort; - KSPIN_LOCK SpinLock; - PVOID Buffer; - BOOLEAN Inuse; -}; - -#endif /* __INTERNAL_HAL_HAL_H */ diff --git a/reactos/ntoskrnl/include/internal/hal/mps.h b/reactos/ntoskrnl/include/internal/hal/mps.h deleted file mode 100644 index 6fc8e47ccb2..00000000000 --- a/reactos/ntoskrnl/include/internal/hal/mps.h +++ /dev/null @@ -1,435 +0,0 @@ -#ifndef __INCLUDE_HAL_MPS -#define __INCLUDE_HAL_MPS - -#define APIC_DEFAULT_BASE 0xFEE00000 /* Default Local APIC Base Register Address */ -#define IOAPIC_DEFAULT_BASE 0xFEC00000 /* Default I/O APIC Base Register Address */ - -/* APIC Register Address Map */ -#define APIC_ID 0x0020 /* Local APIC ID Register (R/W) */ -#define APIC_VER 0x0030 /* Local APIC Version Register (R) */ -#define APIC_TPR 0x0080 /* Task Priority Register (R/W) */ -#define APIC_APR 0x0090 /* Arbitration Priority Register (R) */ -#define APIC_PPR 0x00A0 /* Processor Priority Register (R) */ -#define APIC_EOI 0x00B0 /* EOI Register (W) */ -#define APIC_LDR 0x00D0 /* Logical Destination Register (R/W) */ -#define APIC_DFR 0x00E0 /* Destination Format Register (0-27 R, 28-31 R/W) */ -#define APIC_SIVR 0x00F0 /* Spurious Interrupt Vector Register (0-3 R, 4-9 R/W) */ -#define APIC_ISR 0x0100 /* Interrupt Service Register 0-255 (R) */ -#define APIC_TMR 0x0180 /* Trigger Mode Register 0-255 (R) */ -#define APIC_IRR 0x0200 /* Interrupt Request Register 0-255 (r) */ -#define APIC_ESR 0x0280 /* Error Status Register (R) */ -#define APIC_ICR0 0x0300 /* Interrupt Command Register 0-31 (R/W) */ -#define APIC_ICR1 0x0310 /* Interrupt Command Register 32-63 (R/W) */ -#define APIC_LVTT 0x0320 /* Local Vector Table (Timer) (R/W) */ -#define APIC_LVTPC 0x0340 /* Performance Counter LVT (R/W) */ -#define APIC_LINT0 0x0350 /* Local Vector Table (LINT0) (R/W) */ -#define APIC_LINT1 0x0360 /* Local Vector Table (LINT1) (R/W) */ -#define APIC_LVT3 0x0370 /* Local Vector Table (Error) (R/W) */ -#define APIC_ICRT 0x0380 /* Initial Count Register for Timer (R/W) */ -#define APIC_CCRT 0x0390 /* Current Count Register for Timer (R) */ -#define APIC_TDCR 0x03E0 /* Timer Divide Configuration Register (R/W) */ - -#define APIC_ID_MASK (0xF << 24) -#define GET_APIC_ID(x) (((x) & APIC_ID_MASK) >> 24) -#define APIC_VER_MASK 0xFF00FF -#define GET_APIC_VERSION(x)((x) & 0xFF) -#define GET_APIC_MAXLVT(x) (((x) >> 16) & 0xFF) - -#define APIC_TPR_PRI 0xFF -#define APIC_TPR_INT 0xF0 -#define APIC_TPR_SUB 0xF -#define APIC_TPR_MAX 0xFF /* Maximum priority */ -#define APIC_TPR_MIN 0x20 /* Minimum priority */ - -#define APIC_LDR_MASK (0xFF << 24) - -#define APIC_SIVR_ENABLE (0x1 << 8) -#define APIC_SIVR_FOCUS (0x1 << 9) - -#define APIC_ESR_MASK (0xFE << 0) /* Error Mask */ - -#define APIC_ICR0_VECTOR (0xFF << 0) /* Vector */ -#define APIC_ICR0_DM (0x7 << 8) /* Delivery Mode */ -#define APIC_ICR0_DESTM (0x1 << 11) /* Destination Mode */ -#define APIC_ICR0_DS (0x1 << 12) /* Delivery Status */ -#define APIC_ICR0_LEVEL (0x1 << 14) /* Level */ -#define APIC_ICR0_TM (0x1 << 15) /* Trigger Mode */ -#define APIC_ICR0_DESTS (0x3 << 18) /* Destination Shorthand */ - -/* Delivery Modes */ -#define APIC_DM_FIXED (0x0 << 8) -#define APIC_DM_LOWEST (0x1 << 8) -#define APIC_DM_SMI (0x2 << 8) -#define APIC_DM_REMRD (0x3 << 8) -#define APIC_DM_NMI (0x4 << 8) -#define APIC_DM_INIT (0x5 << 8) -#define APIC_DM_STARTUP (0x6 << 8) -#define APIC_DM_EXTINT (0x7 << 8) -#define GET_APIC_DELIVERY_MODE(x) (((x) >> 8) & 0x7) -#define SET_APIC_DELIVERY_MODE(x,y) (((x) & ~0x700) | ((y) << 8)) - -/* Destination Shorthand values */ -#define APIC_ICR0_DESTS_FIELD (0x0 << 0) -#define APIC_ICR0_DESTS_SELF (0x1 << 18) -#define APIC_ICR0_DESTS_ALL (0x2 << 18) -#define APIC_ICR0_DESTS_ALL_BUT_SELF (0x3 << 18) - -#define APIC_ICR0_LEVEL_DEASSERT (0x0 << 14) /* Deassert level */ -#define APIC_ICR0_LEVEL_ASSERT (0x1 << 14) /* Assert level */ - -#define GET_APIC_DEST_FIELD(x) (((x) >> 24) & 0xFF) -#define SET_APIC_DEST_FIELD(x) (((x) & 0xFF) << 24) - -#define GET_APIC_TIMER_BASE(x) (((x) >> 18) & 0x3) -#define SET_APIC_TIMER_BASE(x) ((x) << 18) -#define APIC_TIMER_BASE_CLKIN 0x0 -#define APIC_TIMER_BASE_TMBASE 0x1 -#define APIC_TIMER_BASE_DIV 0x2 - -#define APIC_LVT_VECTOR (0xFF << 0) /* Vector */ -#define APIC_LVT_DS (0x1 << 12) /* Delivery Status */ -#define APIC_LVT_REMOTE_IRR (0x1 << 14) /* Remote IRR */ -#define APIC_LVT_LEVEL_TRIGGER (0x1 << 15) /* Lvel Triggered */ -#define APIC_LVT_MASKED (0x1 << 16) /* Mask */ -#define APIC_LVT_PERIODIC (0x1 << 17) /* Timer Mode */ - -#define APIC_LVT3_DM (0x7 << 8) -#define APIC_LVT3_IIPP (0x1 << 13) -#define APIC_LVT3_TM (0x1 << 15) -#define APIC_LVT3_MASKED (0x1 << 16) -#define APIC_LVT3_OS (0x1 << 17) - -#define APIC_TDCR_TMBASE (0x1 << 2) -#define APIC_TDCR_MASK 0x0F -#define APIC_TDCR_2 0x00 -#define APIC_TDCR_4 0x01 -#define APIC_TDCR_8 0x02 -#define APIC_TDCR_16 0x03 -#define APIC_TDCR_32 0x08 -#define APIC_TDCR_64 0x09 -#define APIC_TDCR_128 0x0A -#define APIC_TDCR_1 0x0B - -#define APIC_TARGET_SELF 0x100 -#define APIC_TARGET_ALL 0x200 -#define APIC_TARGET_ALL_BUT_SELF 0x300 - -#define IPI_CACHE_FLUSH 0x40 -#define IPI_INV_TLB 0x41 -#define IPI_INV_PTE 0x42 -#define IPI_INV_RESCHED 0x43 -#define IPI_STOP 0x44 - - -#define APIC_INTEGRATED(version) (version & 0xF0) - - -/* I/O APIC Register Address Map */ -#define IOAPIC_IOREGSEL 0x0000 /* I/O Register Select (index) (R/W) */ -#define IOAPIC_IOWIN 0x0010 /* I/O window (data) (R/W) */ - -#define IOAPIC_ID 0x0000 /* IO APIC ID (R/W) */ -#define IOAPIC_VER 0x0001 /* IO APIC Version (R) */ -#define IOAPIC_ARB 0x0002 /* IO APIC Arbitration ID (R) */ -#define IOAPIC_REDTBL 0x0010 /* Redirection Table (0-23 64-bit registers) (R/W) */ - -#define IOAPIC_ID_MASK (0xF << 24) -#define GET_IOAPIC_ID(x) (((x) & IOAPIC_ID_MASK) >> 24) -#define SET_IOAPIC_ID(x) ((x) << 24) - -#define IOAPIC_VER_MASK (0xFF) -#define GET_IOAPIC_VERSION(x) (((x) & IOAPIC_VER_MASK)) -#define IOAPIC_MRE_MASK (0xFF << 16) /* Maximum Redirection Entry */ -#define GET_IOAPIC_MRE(x) (((x) & IOAPIC_MRE_MASK) >> 16) - -#define IOAPIC_ARB_MASK (0xF << 24) -#define GET_IOAPIC_ARB(x) (((x) & IOAPIC_ARB_MASK) >> 24) - -#define IOAPIC_TBL_DELMOD (0x7 << 10) /* Delivery Mode (see APIC_DM_*) */ -#define IOAPIC_TBL_DM (0x1 << 11) /* Destination Mode */ -#define IOAPIC_TBL_DS (0x1 << 12) /* Delivery Status */ -#define IOAPIC_TBL_INTPOL (0x1 << 13) /* Interrupt Input Pin Polarity */ -#define IOAPIC_TBL_RIRR (0x1 << 14) /* Remote IRR */ -#define IOAPIC_TBL_TM (0x1 << 15) /* Trigger Mode */ -#define IOAPIC_TBL_IM (0x1 << 16) /* Interrupt Mask */ -#define IOAPIC_TBL_DF0 (0xF << 56) /* Destination Field (physical mode) */ -#define IOAPIC_TBL_DF1 (0xFF<< 56) /* Destination Field (logical mode) */ -#define IOAPIC_TBL_VECTOR (0xFF << 0) /* Vector (10h - FEh) */ - -typedef struct _IOAPIC_ROUTE_ENTRY { - ULONG vector : 8, - delivery_mode : 3, /* 000: FIXED - * 001: lowest priority - * 111: ExtINT - */ - dest_mode : 1, /* 0: physical, 1: logical */ - delivery_status : 1, - polarity : 1, - irr : 1, - trigger : 1, /* 0: edge, 1: level */ - mask : 1, /* 0: enabled, 1: disabled */ - __reserved_2 : 15; - - union { struct { ULONG - __reserved_1 : 24, - physical_dest : 4, - __reserved_2 : 4; - } physical; - - struct { ULONG - __reserved_1 : 24, - logical_dest : 8; - } logical; - } dest; -} __attribute__ ((packed)) IOAPIC_ROUTE_ENTRY, *PIOAPIC_ROUTE_ENTRY; - -typedef struct _IOAPIC_INFO -{ - ULONG ApicId; /* APIC ID */ - ULONG ApicVersion; /* APIC version */ - ULONG ApicAddress; /* APIC address */ - ULONG EntryCount; /* Number of redirection entries */ -} IOAPIC_INFO, *PIOAPIC_INFO; - - -/* - * Local APIC timer IRQ vector is on a different priority level, - * to work around the 'lost local interrupt if more than 2 IRQ - * sources per level' errata. - */ -#define LOCAL_TIMER_VECTOR 0xEF - -#define CALL_FUNCTION_VECTOR 0xFB -#define RESCHEDULE_VECTOR 0xFC -#define INVALIDATE_TLB_VECTOR 0xFD -#define ERROR_VECTOR 0xFE -#define SPURIOUS_VECTOR 0xFF /* Must be 0xXF */ - -/* - * First APIC vector available to drivers: (vectors 0x30-0xEE) - * we start at 0x31 to spread out vectors evenly between priority - * levels. - */ -#define FIRST_DEVICE_VECTOR 0x31 -#define FIRST_SYSTEM_VECTOR 0xEF -#define NUMBER_DEVICE_VECTORS (FIRST_SYSTEM_VECTOR - FIRST_DEVICE_VECTOR) - - -/* MP Floating Pointer Structure */ -#define MPF_SIGNATURE (('_' << 24) | ('P' << 16) | ('M' << 8) | '_') - -typedef struct __attribute__((packed)) _MP_FLOATING_POINTER -{ - ULONG Signature; /* _MP_ */ - ULONG Address; /* Physical Address Pointer (0 means no configuration table exist) */ - UCHAR Length; /* Structure length in 16-byte paragraphs */ - UCHAR Specification; /* Specification revision */ - UCHAR Checksum; /* Checksum */ - UCHAR Feature1; /* MP System Configuration Type */ - UCHAR Feature2; /* Bit 7 set for IMCR|PIC */ - UCHAR Feature3; /* Unused (0) */ - UCHAR Feature4; /* Unused (0) */ - UCHAR Feature5; /* Unused (0) */ -} __attribute__((packed)) MP_FLOATING_POINTER, *PMP_FLOATING_POINTER; - -#define FEATURE2_IMCRP 0x80 - -/* MP Configuration Table Header */ -#define MPC_SIGNATURE (('P' << 24) | ('M' << 16) | ('C' << 8) | 'P') - -typedef struct __attribute__((packed)) _MP_CONFIGURATION_TABLE -{ - ULONG Signature; /* PCMP */ - USHORT Length; /* Size of configuration table */ - CHAR Specification; /* Specification Revision */ - CHAR Checksum; /* Checksum */ - CHAR Oem[8]; /* OEM ID */ - CHAR ProductId[12]; /* Product ID */ - ULONG OemTable; /* 0 if not present */ - USHORT OemTableSize; /* 0 if not present */ - USHORT EntryCount; /* Number of entries */ - ULONG LocalAPICAddress; /* Local APIC address */ - USHORT ExtTableLength; /* Extended Table Length */ - UCHAR ExtTableChecksum; /* Extended Table Checksum */ - UCHAR Reserved; /* Reserved */ -} __attribute__((packed)) MP_CONFIGURATION_TABLE, *PMP_CONFIGURATION_TABLE; - -/* MP Configuration Table Entries */ -#define MPCTE_PROCESSOR 0 /* One entry per processor */ -#define MPCTE_BUS 1 /* One entry per bus */ -#define MPCTE_IOAPIC 2 /* One entry per I/O APIC */ -#define MPCTE_INTSRC 3 /* One entry per bus interrupt source */ -#define MPCTE_LINTSRC 4 /* One entry per system interrupt source */ - - -typedef struct __attribute__((packed)) _MP_CONFIGURATION_PROCESSOR -{ - UCHAR Type; /* 0 */ - UCHAR ApicId; /* Local APIC ID for the processor */ - UCHAR ApicVersion; /* Local APIC version */ - UCHAR CpuFlags; /* CPU flags */ - ULONG CpuSignature; /* CPU signature */ - ULONG FeatureFlags; /* CPUID feature value */ - ULONG Reserved[2]; /* Reserved (0) */ -} __attribute__((packed)) MP_CONFIGURATION_PROCESSOR, - *PMP_CONFIGURATION_PROCESSOR; - -#define CPU_FLAG_ENABLED 1 /* Processor is available */ -#define CPU_FLAG_BSP 2 /* Processor is the bootstrap processor */ - -#define CPU_STEPPING_MASK 0x0F -#define CPU_MODEL_MASK 0xF0 -#define CPU_FAMILY_MASK 0xF00 - - -typedef struct __attribute__((packed)) _MP_CONFIGURATION_BUS -{ - UCHAR Type; /* 1 */ - UCHAR BusId; /* Bus ID */ - UCHAR BusType[6]; /* Bus type */ -} __attribute__((packed)) MP_CONFIGURATION_BUS, *PMP_CONFIGURATION_BUS; - -#define MAX_BUS 32 - -#define MP_BUS_ISA 1 -#define MP_BUS_EISA 2 -#define MP_BUS_PCI 3 -#define MP_BUS_MCA 4 - -#define BUSTYPE_EISA "EISA" -#define BUSTYPE_ISA "ISA" -#define BUSTYPE_INTERN "INTERN" /* Internal BUS */ -#define BUSTYPE_MCA "MCA" -#define BUSTYPE_VL "VL" /* Local bus */ -#define BUSTYPE_PCI "PCI" -#define BUSTYPE_PCMCIA "PCMCIA" -#define BUSTYPE_CBUS "CBUS" -#define BUSTYPE_CBUSII "CBUSII" -#define BUSTYPE_FUTURE "FUTURE" -#define BUSTYPE_MBI "MBI" -#define BUSTYPE_MBII "MBII" -#define BUSTYPE_MPI "MPI" -#define BUSTYPE_MPSA "MPSA" -#define BUSTYPE_NUBUS "NUBUS" -#define BUSTYPE_TC "TC" -#define BUSTYPE_VME "VME" -#define BUSTYPE_XPRESS "XPRESS" - - -typedef struct __attribute__((packed)) _MP_CONFIGURATION_IOAPIC -{ - UCHAR Type; /* 2 */ - UCHAR ApicId; /* I/O APIC ID */ - UCHAR ApicVersion; /* I/O APIC version */ - UCHAR ApicFlags; /* I/O APIC flags */ - ULONG ApicAddress; /* I/O APIC base address */ -} __attribute__((packed)) MP_CONFIGURATION_IOAPIC, *PMP_CONFIGURATION_IOAPIC; - -#define MAX_IOAPIC 2 - -#define MP_IOAPIC_USABLE 0x01 - - -typedef struct __attribute__((packed)) _MP_CONFIGURATION_INTSRC -{ - UCHAR Type; /* 3 */ - UCHAR IrqType; /* Interrupt type */ - USHORT IrqFlag; /* Interrupt flags */ - UCHAR SrcBusId; /* Source bus ID */ - UCHAR SrcBusIrq; /* Source bus interrupt */ - UCHAR DstApicId; /* Destination APIC ID */ - UCHAR DstApicInt; /* Destination interrupt */ -} __attribute__((packed)) MP_CONFIGURATION_INTSRC, *PMP_CONFIGURATION_INTSRC; - -#define MAX_IRQ_SOURCE 128 - -#define INT_VECTORED 0 -#define INT_NMI 1 -#define INT_SMI 2 -#define INT_EXTINT 3 - -#define IRQDIR_DEFAULT 0 -#define IRQDIR_HIGH 1 -#define IRQDIR_LOW 3 - - -typedef struct __attribute__((packed)) _MP_CONFIGURATION_INTLOCAL -{ - UCHAR Type; /* 4 */ - UCHAR IrqType; /* Interrupt type */ - USHORT IrqFlag; /* Interrupt flags */ - UCHAR SrcBusId; /* Source bus ID */ - UCHAR SrcBusIrq; /* Source bus interrupt */ - UCHAR DstApicId; /* Destination local APIC ID */ - UCHAR DstApicLInt; /* Destination local APIC interrupt */ -} MP_CONFIGURATION_INTLOCAL, *PMP_CONFIGURATION_INTLOCAL; - -#define MP_APIC_ALL 0xFF - - -static inline VOID ReadPentiumClock(PULARGE_INTEGER Count) -{ - register ULONG nLow; - register ULONG nHigh; - - __asm__ __volatile__ ("rdtsc" : "=a" (nLow), "=d" (nHigh)); - - Count->u.LowPart = nLow; - Count->u.HighPart = nHigh; -} - - -#define MAX_CPU 32 - - -typedef struct _CPU_INFO -{ - UCHAR Flags; /* CPU flags */ - UCHAR APICId; /* Local APIC ID */ - UCHAR APICVersion; /* Local APIC version */ - UCHAR MaxLVT; /* Number of LVT registers */ - ULONG BusSpeed; /* BUS speed */ - ULONG CoreSpeed; /* Core speed */ - UCHAR Padding[16-12]; /* Padding to 16-byte */ -} CPU_INFO, *PCPU_INFO; - -/* CPU flags */ -#define CPU_USABLE 0x01 /* 1 if the CPU is usable (ie. can be used) */ -#define CPU_ENABLED 0x02 /* 1 if the CPU is enabled */ -#define CPU_BSP 0x04 /* 1 if the CPU is the bootstrap processor */ - - -typedef enum { - amPIC = 0, /* IMCR and PIC compatibility mode */ - amVWIRE /* Virtual Wire compatibility mode */ -} APIC_MODE; - - -#define pushfl(x) __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */) -#define popfl(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory") - - -#define PIC_IRQS 16 - -/* Prototypes */ - -VOID HalpInitMPS(VOID); -volatile ULONG IOAPICRead(ULONG Apic, ULONG Offset); -VOID IOAPICWrite(ULONG Apic, ULONG Offset, ULONG Value); -VOID IOAPICMaskIrq(ULONG Apic, ULONG Irq); -VOID IOAPICUnmaskIrq(ULONG Apic, ULONG Irq); -volatile inline ULONG APICRead(ULONG Offset); -inline VOID APICWrite(ULONG Offset, ULONG Value); -inline VOID APICSendEOI(VOID); -inline ULONG ThisCPU(VOID); -VOID APICSendIPI(ULONG Target, - ULONG DeliveryMode, - ULONG IntNum, - ULONG Level); -/* For debugging */ -VOID IOAPICDump(VOID); -VOID APICDump(VOID); - -#endif /* __INCLUDE_HAL_MPS */ - -/* EOF */ diff --git a/reactos/ntoskrnl/include/internal/i386/hal.h b/reactos/ntoskrnl/include/internal/i386/hal.h index 960cab66fe7..fb12d3471c2 100644 --- a/reactos/ntoskrnl/include/internal/i386/hal.h +++ b/reactos/ntoskrnl/include/internal/i386/hal.h @@ -5,9 +5,6 @@ #ifndef __INTERNAL_HAL_HAL_H #define __INTERNAL_HAL_HAL_H -#include -#include - /* * FUNCTION: Probes for a BIOS32 extension */ diff --git a/reactos/ntoskrnl/include/internal/ke.h b/reactos/ntoskrnl/include/internal/ke.h index 7cc8aad47c5..21a20d960c9 100644 --- a/reactos/ntoskrnl/include/internal/ke.h +++ b/reactos/ntoskrnl/include/internal/ke.h @@ -23,8 +23,7 @@ /* INCLUDES *****************************************************************/ #ifndef __ASM__ -#include - +#include #include #endif /* not __ASM__ */ diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index 25d3e31b3c8..d9d5841149b 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -7,10 +7,11 @@ #ifndef __ASM__ +#include #define NTOS_MODE_KERNEL #include -#include +#include "internal/ke.h" /* * Use these to place a function in a specific section of the executable diff --git a/reactos/ntoskrnl/include/internal/ps.h b/reactos/ntoskrnl/include/internal/ps.h index 80d4ddcdce8..b52bb494585 100644 --- a/reactos/ntoskrnl/include/internal/ps.h +++ b/reactos/ntoskrnl/include/internal/ps.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: ps.h,v 1.45 2003/05/28 18:09:10 chorns Exp $ +/* $Id: ps.h,v 1.46 2003/06/07 10:14:39 chorns Exp $ * * FILE: ntoskrnl/ke/kthread.c * PURPOSE: Process manager definitions @@ -147,7 +147,7 @@ typedef struct _KTHREAD /* Added by Phillip Susi for list of threads in a process */ LIST_ENTRY ProcessThreadListEntry; /* 1B0 */ -} __attribute__((packed)) KTHREAD, *PKTHREAD; +} __attribute__((packed)) KTHREAD; /* Top level irp definitions. */ #define FSRTL_FSP_TOP_LEVEL_IRP (0x01) @@ -221,7 +221,13 @@ typedef struct _ETHREAD struct _W32THREAD* Win32Thread; -} __attribute__((packed)) ETHREAD, *PETHREAD; +} __attribute__((packed)) ETHREAD; + +#ifndef __USE_W32API + +typedef struct _ETHREAD *PETHREAD; + +#endif /* __USE_W32API */ typedef struct _KPROCESS @@ -286,7 +292,13 @@ typedef struct _KPROCESS UCHAR ThreadSeed; /* 066 */ /* Disable priority boosts? */ UCHAR DisableBoost; /* 067 */ -} KPROCESS, *PKPROCESS; +} KPROCESS; + +#ifndef __USE_W32API + +typedef struct _KPROCESS *PKPROCESS; + +#endif /* __USE_W32API */ struct _EPROCESS { diff --git a/reactos/ntoskrnl/ke/apc.c b/reactos/ntoskrnl/ke/apc.c index f6d01da659c..b8510790fdc 100644 --- a/reactos/ntoskrnl/ke/apc.c +++ b/reactos/ntoskrnl/ke/apc.c @@ -441,20 +441,21 @@ KeRemoveQueueApc (PKAPC Apc) VOID STDCALL -KeInitializeApc(PKAPC Apc, - PKTHREAD Thread, - KAPC_ENVIRONMENT Environment, - PKKERNEL_ROUTINE KernelRoutine, - PKRUNDOWN_ROUTINE RundownRoutine, - PKNORMAL_ROUTINE NormalRoutine, - KPROCESSOR_MODE Mode, - PVOID Context) +KeInitializeApc( + IN PKAPC Apc, + IN PKTHREAD Thread, + IN UCHAR StateIndex, + IN PKKERNEL_ROUTINE KernelRoutine, + IN PKRUNDOWN_ROUTINE RundownRoutine, + IN PKNORMAL_ROUTINE NormalRoutine, + IN UCHAR Mode, + IN PVOID Context) /* * FUNCTION: Initialize an APC object * ARGUMENTS: * Apc = Pointer to the APC object to initialized * Thread = Thread the APC is to be delivered to - * StateIndex = TBD + * StateIndex = KAPC_ENVIRONMENT * KernelRoutine = Routine to be called for a kernel-mode APC * RundownRoutine = Routine to be called if the thread has exited with * the APC being executed @@ -463,6 +464,8 @@ KeInitializeApc(PKAPC Apc, * Context = Parameter to be passed to the APC routine */ { + KAPC_ENVIRONMENT Environment = (KAPC_ENVIRONMENT) StateIndex; + DPRINT("KeInitializeApc(Apc %x, Thread %x, Environment %d, " "KernelRoutine %x, RundownRoutine %x, NormalRoutine %x, Mode %d, " "Context %x)\n",Apc,Thread,Environment,KernelRoutine,RundownRoutine, @@ -489,7 +492,7 @@ KeInitializeApc(PKAPC Apc, if (Apc->NormalRoutine != NULL) { - Apc->ApcMode = Mode; + Apc->ApcMode = (KPROCESSOR_MODE) Mode; } else { diff --git a/reactos/ntoskrnl/ke/i386/irq.c b/reactos/ntoskrnl/ke/i386/irq.c index 1033c27fb96..57891a43ef8 100644 --- a/reactos/ntoskrnl/ke/i386/irq.c +++ b/reactos/ntoskrnl/ke/i386/irq.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: irq.c,v 1.29 2003/04/06 10:45:16 chorns Exp $ +/* $Id: irq.c,v 1.30 2003/06/07 10:14:40 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/i386/irq.c @@ -35,7 +35,8 @@ /* INCLUDES ****************************************************************/ -#include +#define NTOS_MODE_KERNEL +#include #include #include #include diff --git a/reactos/ntoskrnl/ke/i386/usercall.c b/reactos/ntoskrnl/ke/i386/usercall.c index 1fcd56b7d87..02595fa0da7 100644 --- a/reactos/ntoskrnl/ke/i386/usercall.c +++ b/reactos/ntoskrnl/ke/i386/usercall.c @@ -1,4 +1,4 @@ -/* $Id: usercall.c,v 1.22 2002/09/08 10:23:30 chorns Exp $ +/* $Id: usercall.c,v 1.23 2003/06/07 10:14:40 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,8 @@ /* INCLUDES ******************************************************************/ -#include +#define NTOS_MODE_KERNEL +#include #include #include #include @@ -20,9 +21,7 @@ #define NDEBUG #include -#include -#include #include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ke/i386/usertrap.c b/reactos/ntoskrnl/ke/i386/usertrap.c index d8e7214b08c..90ba126f098 100644 --- a/reactos/ntoskrnl/ke/i386/usertrap.c +++ b/reactos/ntoskrnl/ke/i386/usertrap.c @@ -144,8 +144,9 @@ KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2) } - Er.ExceptionFlags = (STATUS_SINGLE_STEP == (NTSTATUS) Er.ExceptionCode || STATUS_BREAKPOINT == (NTSTATUS) Er.ExceptionCode ? - 0 : EXCEPTION_NONCONTINUABLE); + Er.ExceptionFlags = ((NTSTATUS) STATUS_SINGLE_STEP == (NTSTATUS) Er.ExceptionCode || + (NTSTATUS) STATUS_BREAKPOINT == (NTSTATUS) Er.ExceptionCode ? + 0 : EXCEPTION_NONCONTINUABLE); KiDispatchException(&Er, 0, Tf, UserMode, TRUE); return(0); diff --git a/reactos/ntoskrnl/ke/kqueue.c b/reactos/ntoskrnl/ke/kqueue.c index 6c8d685f23c..216aed9f615 100644 --- a/reactos/ntoskrnl/ke/kqueue.c +++ b/reactos/ntoskrnl/ke/kqueue.c @@ -34,7 +34,7 @@ KeInsertByKeyDeviceQueue (PKDEVICE_QUEUE DeviceQueue, DPRINT("KeInsertByKeyDeviceQueue()\n"); - DeviceQueueEntry->Key=SortKey; + DeviceQueueEntry->SortKey=SortKey; KeAcquireSpinLock(&DeviceQueue->Lock,&oldlvl); @@ -45,21 +45,21 @@ KeInsertByKeyDeviceQueue (PKDEVICE_QUEUE DeviceQueue, return(FALSE); } - current=DeviceQueue->ListHead.Flink; - while (current!=(&DeviceQueue->ListHead)) + current=DeviceQueue->DeviceListHead.Flink; + while (current!=(&DeviceQueue->DeviceListHead)) { - entry = CONTAINING_RECORD(current,KDEVICE_QUEUE_ENTRY,Entry); - if (entry->Key < SortKey) + entry = CONTAINING_RECORD(current,KDEVICE_QUEUE_ENTRY,DeviceListEntry); + if (entry->SortKey < SortKey) { - InsertBeforeEntryInList(&DeviceQueue->ListHead, - &DeviceQueueEntry->Entry, + InsertBeforeEntryInList(&DeviceQueue->DeviceListHead, + &DeviceQueueEntry->DeviceListEntry, current); KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); return(TRUE); } current = current->Flink; } - InsertTailList(&DeviceQueue->ListHead,&DeviceQueueEntry->Entry); + InsertTailList(&DeviceQueue->DeviceListHead,&DeviceQueueEntry->DeviceListEntry); KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); return(TRUE); @@ -82,12 +82,12 @@ KeRemoveByKeyDeviceQueue ( KeAcquireSpinLock(&DeviceQueue->Lock,&oldlvl); - current = DeviceQueue->ListHead.Flink; - while (current != &DeviceQueue->ListHead) + current = DeviceQueue->DeviceListHead.Flink; + while (current != &DeviceQueue->DeviceListHead) { - entry = CONTAINING_RECORD(current,KDEVICE_QUEUE_ENTRY,Entry); - if (entry->Key < SortKey || - current->Flink == &DeviceQueue->ListHead) + entry = CONTAINING_RECORD(current,KDEVICE_QUEUE_ENTRY,DeviceListEntry); + if (entry->SortKey < SortKey || + current->Flink == &DeviceQueue->DeviceListHead) { RemoveEntryList(current); KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); @@ -124,8 +124,8 @@ KeRemoveDeviceQueue ( KeAcquireSpinLock(&DeviceQueue->Lock,&oldlvl); - list_entry = RemoveHeadList(&DeviceQueue->ListHead); - if (list_entry==(&DeviceQueue->ListHead)) + list_entry = RemoveHeadList(&DeviceQueue->DeviceListHead); + if (list_entry==(&DeviceQueue->DeviceListHead)) { DeviceQueue->Busy=FALSE; KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); @@ -133,7 +133,7 @@ KeRemoveDeviceQueue ( } KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); - entry = CONTAINING_RECORD(list_entry,KDEVICE_QUEUE_ENTRY,Entry); + entry = CONTAINING_RECORD(list_entry,KDEVICE_QUEUE_ENTRY,DeviceListEntry); return(entry); } @@ -149,7 +149,7 @@ KeInitializeDeviceQueue ( */ { assert(DeviceQueue!=NULL); - InitializeListHead(&DeviceQueue->ListHead); + InitializeListHead(&DeviceQueue->DeviceListHead); DeviceQueue->Busy=FALSE; KeInitializeSpinLock(&DeviceQueue->Lock); } @@ -180,9 +180,9 @@ KeInsertDeviceQueue ( return(FALSE); } - InsertTailList(&DeviceQueue->ListHead, - &DeviceQueueEntry->Entry); - DeviceQueueEntry->Key=0; + InsertTailList(&DeviceQueue->DeviceListHead, + &DeviceQueueEntry->DeviceListEntry); + DeviceQueueEntry->SortKey=0; KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); return(TRUE); diff --git a/reactos/ntoskrnl/rtl/i386/exception.c b/reactos/ntoskrnl/rtl/i386/exception.c index 7c8a32aff87..2a587d25db0 100755 --- a/reactos/ntoskrnl/rtl/i386/exception.c +++ b/reactos/ntoskrnl/rtl/i386/exception.c @@ -1,4 +1,4 @@ -/* $Id: exception.c,v 1.5 2003/04/05 22:20:49 guido Exp $ +/* $Id: exception.c,v 1.6 2003/06/07 10:14:40 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -81,7 +81,10 @@ RtlpCaptureContext(PCONTEXT pContext); KeTrapFrameToContext(KeGetCurrentThread()->TrapFrame, (Context)); \ } -/*** Code below this line is shared with lib/ntdll/arch/ia32/exception.c - please keep in sync ***/ +#define SehpContinue(Context, TestAlert) \ + ZwContinue(Context, TestAlert) + +/*** Code below this line is shared with lib/ntdll/rtl/i386/exception.c - please keep in sync ***/ VOID STDCALL AsmDebug(ULONG Value) @@ -245,7 +248,7 @@ RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, else { /* Copy the (possibly changed) context back to the trap frame and return */ - NtContinue(Context, FALSE); + SehpContinue(Context, FALSE); return ExceptionContinueExecution; } } @@ -373,7 +376,7 @@ RtlUnwind(PEXCEPTION_REGISTRATION RegistrationFrame, if (ERHead == RegistrationFrame) { DPRINT("Continueing execution\n"); - NtContinue(&Context, FALSE); + SehpContinue(&Context, FALSE); return; } else @@ -468,7 +471,7 @@ RtlUnwind(PEXCEPTION_REGISTRATION RegistrationFrame, RegistrationFrame); if ((ULONG_PTR)RegistrationFrame == (ULONG_PTR)-1) - NtContinue(&Context, FALSE); + SehpContinue(&Context, FALSE); else NtRaiseException(pExceptRec, &Context, 0); } diff --git a/reactos/subsys/win32k/main/dllmain.c b/reactos/subsys/win32k/main/dllmain.c index 5e71406dc43..e17b213c323 100644 --- a/reactos/subsys/win32k/main/dllmain.c +++ b/reactos/subsys/win32k/main/dllmain.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dllmain.c,v 1.37 2003/06/06 10:18:32 gvg Exp $ +/* $Id: dllmain.c,v 1.38 2003/06/07 10:14:40 chorns Exp $ * * Entry Point for win32k.sys */ @@ -24,11 +24,10 @@ #undef WIN32_LEAN_AND_MEAN #define WIN32_NO_STATUS #include -#include +#define NTOS_MODE_KERNEL +#include #include -#include -#include #include #include diff --git a/reactos/subsys/win32k/main/svctabm.c b/reactos/subsys/win32k/main/svctabm.c index 520cd4ab792..b99f0a1ea34 100644 --- a/reactos/subsys/win32k/main/svctabm.c +++ b/reactos/subsys/win32k/main/svctabm.c @@ -34,7 +34,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: svctabm.c,v 1.4 2003/05/18 17:16:17 ea Exp $ +/* $Id: svctabm.c,v 1.5 2003/06/07 10:14:40 chorns Exp $ * * Entry Point for win32k.sys */ @@ -42,7 +42,8 @@ #undef WIN32_LEAN_AND_MEAN #define WIN32_NO_STATUS #include -#include +#define NTOS_MODE_KERNEL +#include #include /*