Author: sginsberg
Date: Thu Aug 14 14:30:32 2008
New Revision: 35345
URL:
http://svn.reactos.org/svn/reactos?rev=35345&view=rev
Log:
- Header cleanup
- Rename ObInit to ObInitSystem
- Add missing KPCR_PRCB_PRCB_LOCK offset to the NDK
Modified:
trunk/reactos/include/ndk/asm.h
trunk/reactos/ntoskrnl/ex/init.c
trunk/reactos/ntoskrnl/include/internal/cm.h
trunk/reactos/ntoskrnl/include/internal/kd.h
trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
trunk/reactos/ntoskrnl/ob/obinit.c
Modified: trunk/reactos/include/ndk/asm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/asm.h?rev=3534…
==============================================================================
--- trunk/reactos/include/ndk/asm.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/asm.h [iso-8859-1] Thu Aug 14 14:30:32 2008
@@ -191,6 +191,7 @@
#define KPCR_PROCESSOR_NUMBER 0x130
#define KPCR_PRCB_SET_MEMBER 0x134
#define KPCR_PRCB_CPU_TYPE 0x138
+#define KPCR_PRCB_PRCB_LOCK 0xA7C
#define KPCR_NPX_THREAD 0x640
#define KPCR_DR6 0x428
#define KPCR_DR7 0x42C
Modified: trunk/reactos/ntoskrnl/ex/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=353…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] Thu Aug 14 14:30:32 2008
@@ -1203,7 +1203,7 @@
#endif
/* Create the Basic Object Manager Types to allow new Object Types */
- if (!ObInit()) KEBUGCHECK(OBJECT_INITIALIZATION_FAILED);
+ if (!ObInitSystem()) KEBUGCHECK(OBJECT_INITIALIZATION_FAILED);
/* Load basic Security for other Managers */
if (!SeInit()) KEBUGCHECK(SECURITY_INITIALIZATION_FAILED);
@@ -1516,7 +1516,7 @@
InbvUpdateProgressBar(5);
/* Call OB initialization again */
- if (!ObInit()) KeBugCheck(OBJECT1_INITIALIZATION_FAILED);
+ if (!ObInitSystem()) KeBugCheck(OBJECT1_INITIALIZATION_FAILED);
/* Initialize Basic System Objects and Worker Threads */
if (!ExInitSystem()) KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, 0, 0, 1, 0);
Modified: trunk/reactos/ntoskrnl/include/internal/cm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/cm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/cm.h [iso-8859-1] Thu Aug 14 14:30:32 2008
@@ -519,6 +519,21 @@
//
NTSTATUS CmiCallRegisteredCallbacks(IN REG_NOTIFY_CLASS Argument1, IN PVOID Argument2);
///////////////////////////////////////////////////////////////////////////////
+
+//
+// Startup and Shutdown Functions
+//
+BOOLEAN
+NTAPI
+CmInitSystem1(
+ VOID
+);
+
+VOID
+NTAPI
+CmShutdownSystem(
+ VOID
+);
//
// Mapped View Hive Functions
Modified: trunk/reactos/ntoskrnl/include/internal/kd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/kd.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/kd.h [iso-8859-1] Thu Aug 14 14:30:32 2008
@@ -182,6 +182,13 @@
);
/* INIT ROUTINES *************************************************************/
+
+BOOLEAN
+NTAPI
+KdInitSystem(
+ ULONG Reserved,
+ PLOADER_PARAMETER_BLOCK LoaderBlock
+);
VOID
STDCALL
Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] Thu Aug 14 14:30:32
2008
@@ -37,6 +37,8 @@
#define InterlockedCompareExchange64 _InterlockedCompareExchange64
#define InterlockedExchange _InterlockedExchange
#define InterlockedExchangeAdd _InterlockedExchangeAdd
+#define InterlockedOr _InterlockedOr
+#define InterlockedAnd _InterlockedAnd
#include "ke.h"
#include "i386/mm.h"
@@ -71,84 +73,6 @@
#include "hal.h"
#include "arch/intrin_i.h"
-#include <pshpack1.h>
-/*
- * Defines a descriptor as it appears in the processor tables
- */
-typedef struct __DESCRIPTOR
-{
- ULONG a;
- ULONG b;
-} IDT_DESCRIPTOR, GDT_DESCRIPTOR;
-
-#include <poppack.h>
-//extern GDT_DESCRIPTOR KiGdt[256];
-
-/*
- * Initalization functions (called once by main())
- */
-BOOLEAN NTAPI ObInit(VOID);
-BOOLEAN NTAPI CmInitSystem1(VOID);
-VOID NTAPI CmShutdownSystem(VOID);
-BOOLEAN NTAPI KdInitSystem(ULONG Reserved, PLOADER_PARAMETER_BLOCK LoaderBlock);
-
-/* FIXME - RtlpCreateUnicodeString is obsolete and should be removed ASAP! */
-BOOLEAN FASTCALL
-RtlpCreateUnicodeString(
- IN OUT PUNICODE_STRING UniDest,
- IN PCWSTR Source,
- IN POOL_TYPE PoolType);
-
-VOID
-NTAPI
-RtlpLogException(IN PEXCEPTION_RECORD ExceptionRecord,
- IN PCONTEXT ContextRecord,
- IN PVOID ContextData,
- IN ULONG Size);
-
-/* FIXME: Interlocked functions that need to be made into a public header */
-#ifdef __GNUC__
-FORCEINLINE
-LONG
-InterlockedAnd(IN OUT LONG volatile *Target,
- IN LONG Set)
-{
- LONG i;
- LONG j;
-
- j = *Target;
- do {
- i = j;
- j = InterlockedCompareExchange((PLONG)Target,
- i & Set,
- i);
-
- } while (i != j);
-
- return j;
-}
-
-FORCEINLINE
-LONG
-InterlockedOr(IN OUT LONG volatile *Target,
- IN LONG Set)
-{
- LONG i;
- LONG j;
-
- j = *Target;
- do {
- i = j;
- j = InterlockedCompareExchange((PLONG)Target,
- i | Set,
- i);
-
- } while (i != j);
-
- return j;
-}
-#endif
-
/*
* generic information class probing code
*/
@@ -324,8 +248,8 @@
C_ASSERT(FIELD_OFFSET(KTHREAD, CallbackStack) == KTHREAD_CALLBACK_STACK);
C_ASSERT(FIELD_OFFSET(KTHREAD, ApcState.Process) == KTHREAD_APCSTATE_PROCESS);
C_ASSERT(FIELD_OFFSET(KPROCESS, DirectoryTableBase) == KPROCESS_DIRECTORY_TABLE_BASE);
-//C_ASSERT(FIELD_OFFSET(KPCR, Tib.ExceptionList) == KPCR_EXCEPTION_LIST);
-//C_ASSERT(FIELD_OFFSET(KPCR, Self) == KPCR_SELF);
+C_ASSERT(FIELD_OFFSET(KPCR, Tib.ExceptionList) == KPCR_EXCEPTION_LIST);
+C_ASSERT(FIELD_OFFSET(KPCR, Self) == KPCR_SELF);
#ifdef _M_IX86
C_ASSERT(FIELD_OFFSET(KPCR, IRR) == KPCR_IRR);
C_ASSERT(FIELD_OFFSET(KPCR, IDR) == KPCR_IDR);
@@ -335,7 +259,7 @@
C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, NpxThread) ==
KPCR_NPX_THREAD);
C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) == KPCR_PRCB_DATA);
C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, KeSystemCalls) ==
KPCR_SYSTEM_CALLS);
-C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcData) +
/*FIELD_OFFSET(KDPC_DATA, DpcQueuDepth)*/12 == KPCR_PRCB_DPC_QUEUE_DEPTH);
+C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcData) +
FIELD_OFFSET(KDPC_DATA, DpcQueueDepth) == KPCR_PRCB_DPC_QUEUE_DEPTH);
C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcData) + 16 ==
KPCR_PRCB_DPC_COUNT);
C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcStack) ==
KPCR_PRCB_DPC_STACK);
C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, TimerRequest) ==
KPCR_PRCB_TIMER_REQUEST);
@@ -348,7 +272,7 @@
C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, QuantumEnd) ==
KPCR_PRCB_QUANTUM_END);
C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DeferredReadyListHead) ==
KPCR_PRCB_DEFERRED_READY_LIST_HEAD);
C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, PowerState) ==
KPCR_PRCB_POWER_STATE_IDLE_FUNCTION);
-//C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, PrcbLock) ==
KPCR_PRCB_PRCB_LOCK);
+C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, PrcbLock) ==
KPCR_PRCB_PRCB_LOCK);
C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcStack) ==
KPCR_PRCB_DPC_STACK);
C_ASSERT(sizeof(FX_SAVE_AREA) == SIZEOF_FX_SAVE_AREA);
Modified: trunk/reactos/ntoskrnl/ob/obinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obinit.c?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/obinit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ob/obinit.c [iso-8859-1] Thu Aug 14 14:30:32 2008
@@ -124,7 +124,7 @@
BOOLEAN
INIT_FUNCTION
NTAPI
-ObInit(VOID)
+ObInitSystem(VOID)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING Name;