Author: ros-arm-bringup
Date: Fri Feb 15 22:01:45 2008
New Revision: 32379
URL:
http://svn.reactos.org/svn/reactos?rev=32379&view=rev
Log:
We now define KUSER_SHARED_DATA per architecture, since the address isn't portable.
Now SharedUserData works on ARM.
Implemented KeAcquireInSTackQueuedSpinLock, KeAcquireInStackQueuedSpinLockRaiseToSYnc and
KeReleaseInStackQueuedSpinLock based on x86 UP versions.
On ARM, the PCR is fully exposed, so some APIs are always-inlined direct-memory-access
(unlike x86 which has the fs selector, and undocumented parts of the PCR). This means we
can define several macros -- fixed the headers to allow this, by defining the previous
stuff for x86 only.
Setup registry data in the ARM loader block.
The ARM port boots all the way through ExpInitializeExecutive until reaching MmInit1. The
boot-registry is correctly loaded and parsed, as are NLS files!
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c
trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c
trunk/reactos/hal/halarm/generic/hal.c
trunk/reactos/include/ddk/winddk.h
trunk/reactos/include/ndk/ketypes.h
trunk/reactos/include/reactos/armddk.h
trunk/reactos/ntoskrnl/include/internal/ke_x.h
Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c Fri Feb 15 22:01:45 2008
@@ -28,7 +28,7 @@
extern ARM_COARSE_PAGE_TABLE BootTranslationTable, KernelTranslationTable;
extern ROS_KERNEL_ENTRY_POINT KernelEntryPoint;
extern ULONG_PTR KernelBase;
-extern ULONG_PTR AnsiData, OemData, UnicodeData;
+extern ULONG_PTR AnsiData, OemData, UnicodeData, RegistryData;
ULONG SizeBits[] =
{
@@ -290,8 +290,9 @@
//
//
- // TODO: Setup registry data
- //
+ // Setup registry data
+ //
+ ArmLoaderBlock->RegistryBase = (PVOID)((ULONG_PTR)RegistryData | KSEG0_BASE);
//
// TODO: Setup ARC Hardware tree data
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c Fri Feb 15 22:01:45 2008
@@ -16,7 +16,7 @@
);
extern BOOLEAN FrLdrLoadDriver(PCHAR szFileName, INT nPos);
-PVOID AnsiData, OemData, UnicodeData;
+PVOID AnsiData, OemData, UnicodeData, RegistryData;
/* MODULE MANAGEMENT **********************************************************/
PLOADER_MODULE
@@ -109,6 +109,11 @@
else if (!_stricmp(NameBuffer, "casemap.nls"))
{
UnicodeData = (PVOID)NextModuleBase;
+ }
+ else if (!(_stricmp(NameBuffer, "system")) ||
+ !(_stricmp(NameBuffer, "system.hiv")))
+ {
+ RegistryData = (PVOID)NextModuleBase;
}
/* Load the file image */
Modified: trunk/reactos/hal/halarm/generic/hal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/generic/hal.c?r…
==============================================================================
--- trunk/reactos/hal/halarm/generic/hal.c (original)
+++ trunk/reactos/hal/halarm/generic/hal.c Fri Feb 15 22:01:45 2008
@@ -753,33 +753,39 @@
}
-VOID
-FASTCALL
-KeAcquireInStackQueuedSpinLock(
- IN PKSPIN_LOCK SpinLock,
- IN PKLOCK_QUEUE_HANDLE LockHandle
- )
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FASTCALL
-KeAcquireInStackQueuedSpinLockRaiseToSynch(
- IN PKSPIN_LOCK SpinLock,
- IN PKLOCK_QUEUE_HANDLE LockHandle
- )
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FASTCALL
-KeReleaseInStackQueuedSpinLock(
- IN PKLOCK_QUEUE_HANDLE LockHandle
- )
-{
- UNIMPLEMENTED;
+/*
+ * @implemented
+ */
+VOID
+FASTCALL
+KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock,
+ IN PKLOCK_QUEUE_HANDLE LockHandle)
+{
+ /* Simply raise to dispatch */
+ LockHandle->OldIrql = KeSwapIrql(DISPATCH_LEVEL);
+}
+
+/*
+ * @implemented
+ */
+VOID
+FASTCALL
+KeAcquireInStackQueuedSpinLockRaiseToSynch(IN PKSPIN_LOCK SpinLock,
+ IN PKLOCK_QUEUE_HANDLE LockHandle)
+{
+ /* Simply raise to synch */
+ LockHandle->OldIrql = KeSwapIrql(SYNCH_LEVEL);
+}
+
+/*
+ * @implemented
+ */
+VOID
+FASTCALL
+KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
+{
+ /* Simply lower IRQL back */
+ KeSwapIrql(LockHandle->OldIrql);
}
VOID
Modified: trunk/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=3…
==============================================================================
--- trunk/reactos/include/ddk/winddk.h (original)
+++ trunk/reactos/include/ddk/winddk.h Fri Feb 15 22:01:45 2008
@@ -5459,6 +5459,20 @@
#error Unknown compiler
#endif
}
+
+NTHALAPI
+KIRQL
+DDKAPI
+KeGetCurrentIrql(
+ VOID);
+
+NTKERNELAPI
+PRKTHREAD
+NTAPI
+KeGetCurrentThread(
+ VOID);
+
+#define KI_USER_SHARED_DATA 0xffdf0000
#elif defined(__x86_64__)
@@ -5580,6 +5594,8 @@
#define PAGE_SIZE 0x1000
#define PAGE_SHIFT 12L
+#define SharedUserData ((KUSER_SHARED_DATA * CONST)
KI_USER_SHARED_DATA)
+
extern NTKERNELAPI PVOID MmHighestUserAddress;
extern NTKERNELAPI PVOID MmSystemRangeStart;
extern NTKERNELAPI ULONG_PTR MmUserProbeAddress;
@@ -5593,8 +5609,6 @@
#define MM_KSEG0_BASE MM_SYSTEM_RANGE_START
#define MM_SYSTEM_SPACE_END 0xFFFFFFFF
-#define KI_USER_SHARED_DATA 0xffdf0000
-#define SharedUserData ((KUSER_SHARED_DATA * CONST)
KI_USER_SHARED_DATA)
#define EFLAG_SIGN 0x8000
#define EFLAG_ZERO 0x4000
@@ -5651,11 +5665,7 @@
PVOID Reserved[4];
} PCIBUSDATA, *PPCIBUSDATA;
-NTHALAPI
-KIRQL
-DDKAPI
-KeGetCurrentIrql(
- VOID);
+
#if !defined(__INTERLOCKED_DECLARED)
#define __INTERLOCKED_DECLARED
@@ -9088,12 +9098,6 @@
KeFlushWriteBuffer(VOID);
NTKERNELAPI
-PRKTHREAD
-NTAPI
-KeGetCurrentThread(
- VOID);
-
-NTKERNELAPI
ULONG
NTAPI
KeGetRecommendedSharedDataAlignment(
Modified: trunk/reactos/include/ndk/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/ketypes.h (original)
+++ trunk/reactos/include/ndk/ketypes.h Fri Feb 15 22:01:45 2008
@@ -54,11 +54,6 @@
// Dispatcher Priority increments
//
#define THREAD_ALERT_INCREMENT 2
-
-//
-// User Shared Data in Kernel-Mode
-//
-#define KI_USER_SHARED_DATA 0xffdf0000
//
// Physical memory offset of KUSER_SHARED_DATA
Modified: trunk/reactos/include/reactos/armddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/armddk.h?r…
==============================================================================
--- trunk/reactos/include/reactos/armddk.h (original)
+++ trunk/reactos/include/reactos/armddk.h Fri Feb 15 22:01:45 2008
@@ -18,6 +18,7 @@
// FIXME: mmtypes.h?
//
#define KIPCR 0xFFFFF000
+#define KI_USER_SHARED_DATA 0xFFFFE000
#define USPCR 0x7FFF0000
#define PCR ((volatile KPCR * const)USPCR)
#define USERPCR ((volatile KPCR * const)KIPCR)
@@ -30,7 +31,12 @@
//
// Just read it from the PCR
//
-#define KeGetCurrentProcessorNumber() ((ULONG)(PCR->Number))
+#define KeGetCurrentProcessorNumber() PCR->Number
+#define KeGetCurrentIrql() PCR->CurrentIrql
+#define _KeGetCurrentThread() PCR->CurrentThread
+#define _KeGetPreviousMode() PCR->CurrentThread->PreviousMode
+#define _KeIsExecutingDpc() (PCR->DpcRoutineActive != 0)
+#define KeGetDcacheFillSize() PCR->DcacheFillSize
//
// Stub
Modified: trunk/reactos/ntoskrnl/include/internal/ke_x.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ke_x.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ke_x.h Fri Feb 15 22:01:45 2008
@@ -1526,6 +1526,7 @@
return Priority;
}
+#ifndef _M_ARM
PRKTHREAD
FORCEINLINE
KeGetCurrentThread(VOID)
@@ -1546,6 +1547,7 @@
/* Return the current mode */
return KeGetCurrentThread()->PreviousMode;
}
+#endif
VOID
FORCEINLINE