Author: tkreuzer
Date: Fri Aug 29 20:44:37 2008
New Revision: 35782
URL:
http://svn.reactos.org/svn/reactos?rev=35782&view=rev
Log:
- implement spinlocks, based on x86 up hal code
- comment out KeInitializeSpinLock on amd64 builds (it's inlined there)
- define some fastcall functions to normal on amd64
- Update amd64 stubs
- remove wrong exports from ntokrnl
Added:
branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/spinlock.c (with props)
Modified:
branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c
branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/ke.h
branches/ros-amd64-bringup/reactos/ntoskrnl/ke/spinlock.c
branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild
branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl_amd64.def
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c [iso-8859-1] Fri Aug 29
20:44:37 2008
@@ -7,7 +7,6 @@
STUB(KdpEnableSafeMem)
STUB(KiIdleLoop)
-STUB(KeAcquireInStackQueuedSpinLockRaiseToSynch)
STUB(KeBugcheckCallbackListHead)
STUB(ExpInterlockedPushEntrySList)
STUB(NtContinue)
@@ -131,12 +130,6 @@
STUB(IoWMIDeviceObjectToProviderId)
STUB(KdDebuggerEnabled)
STUB(KdDebuggerNotPresent)
-STUB(KeAcquireQueuedSpinLock)
-STUB(_imp__KeAcquireQueuedSpinLock)
-STUB(_imp__KeReleaseQueuedSpinLock)
-STUB(KeAcquireQueuedSpinLockRaiseToSynch)
-STUB(KeAcquireSpinLockRaiseToDpc)
-STUB(KeAcquireSpinLockRaiseToSynch)
STUB(KeEnterCriticalRegion)
STUB(KeEnterGuardedRegion)
STUB(KeExpandKernelStackAndCallout)
@@ -152,8 +145,6 @@
STUB(KeQueryMultiThreadProcessorSet)
STUB(KeQueryPrcbAddress)
STUB(KeReadStateMutex)
-STUB(KeReleaseQueuedSpinLock)
-STUB(KeReleaseSpinLock)
STUB(KeRestoreFloatingPointState)
STUB(KeSaveFloatingPointState)
STUB(KeSaveStateForHibernate)
@@ -161,8 +152,6 @@
STUB(KeSignalCallDpcDone)
STUB(KeSignalCallDpcSynchronize)
STUB(KeSynchronizeExecution)
-STUB(KeTryToAcquireQueuedSpinLock)
-STUB(KeTryToAcquireQueuedSpinLockRaiseToSynch)
STUB(KeUpdateRunTime)
STUB(KeUpdateSystemTime)
STUB(KeUserModeCallback)
@@ -245,10 +234,6 @@
STUB(_setjmp)
STUB(_setjmpex)
STUB(longjmp)
-STUB(KfReleaseSpinLock)
-STUB(KeAcquireInStackQueuedSpinLock)
-STUB(KeReleaseInStackQueuedSpinLock)
-STUB(KfAcquireSpinLock)
STUB(KeProcessorArchitecture)
STUB(KeProcessorLevel)
STUB(KeProcessorRevision)
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/ke.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/ke.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/ke.h [iso-8859-1]
Fri Aug 29 20:44:37 2008
@@ -65,6 +65,9 @@
//#define KeArchFnInit() Ke386FnInit()
#define KeArchFnInit() DbgPrint("KeArchFnInit is unimplemented!\n");
#define KeArchHaltProcessor() Ke386HaltProcessor()
+#define KfLowerIrql KeLowerIrql
+#define KfAcquireSpinLock KeAcquireSpinLock
+#define KfReleaseSpinLock KeReleaseSpinLock
extern ULONG Ke386CacheAlignment;
Added: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/spinlock.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/spinlock.c (added)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/spinlock.c [iso-8859-1] Fri Aug
29 20:44:37 2008
@@ -1,0 +1,188 @@
+/*
+ * PROJECT: ReactOS HAL
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: hal/halx86/up/spinlock.c
+ * PURPOSE: Spinlock and Queued Spinlock Support
+ * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <ntoskrnl.h>
+#define NDEBUG
+#include <internal/debug.h>
+
+#undef KeAcquireSpinLock
+#undef KeReleaseSpinLock
+
+/* FUNCTIONS *****************************************************************/
+
+/*
+ * @implemented
+ */
+KIRQL
+KeAcquireSpinLockRaiseToSynch(PKSPIN_LOCK SpinLock)
+{
+#ifndef CONFIG_SMP
+ /* Simply raise to dispatch */
+ return KfRaiseIrql(DISPATCH_LEVEL);
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/*
+ * @implemented
+ */
+KIRQL
+NTAPI
+KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock)
+{
+#ifndef CONFIG_SMP
+ /* Simply raise to dispatch */
+ return KfRaiseIrql(DISPATCH_LEVEL);
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+KeReleaseSpinLock(PKSPIN_LOCK SpinLock,
+ KIRQL OldIrql)
+{
+#ifndef CONFIG_SMP
+ /* Simply lower IRQL back */
+ KfLowerIrql(OldIrql);
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/*
+ * @implemented
+ */
+KIRQL
+KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
+{
+#ifndef CONFIG_SMP
+ /* Simply raise to dispatch */
+ return KfRaiseIrql(DISPATCH_LEVEL);
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/*
+ * @implemented
+ */
+KIRQL
+KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
+{
+#ifndef CONFIG_SMP
+ /* Simply raise to dispatch */
+ return KfRaiseIrql(DISPATCH_LEVEL);
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/*
+ * @implemented
+ */
+VOID
+KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock,
+ IN PKLOCK_QUEUE_HANDLE LockHandle)
+{
+#ifndef CONFIG_SMP
+ /* Simply raise to dispatch */
+ LockHandle->OldIrql = KfRaiseIrql(DISPATCH_LEVEL);
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/*
+ * @implemented
+ */
+VOID
+KeAcquireInStackQueuedSpinLockRaiseToSynch(IN PKSPIN_LOCK SpinLock,
+ IN PKLOCK_QUEUE_HANDLE LockHandle)
+{
+#ifndef CONFIG_SMP
+ /* Simply raise to synch */
+ LockHandle->OldIrql = KfRaiseIrql(SYNCH_LEVEL);
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/*
+ * @implemented
+ */
+VOID
+KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
+ IN KIRQL OldIrql)
+{
+#ifndef CONFIG_SMP
+ /* Simply lower IRQL back */
+ KfLowerIrql(OldIrql);
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/*
+ * @implemented
+ */
+VOID
+KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
+{
+#ifndef CONFIG_SMP
+ /* Simply lower IRQL back */
+ KfLowerIrql(LockHandle->OldIrql);
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/*
+ * @implemented
+ */
+BOOLEAN
+KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
+ IN PKIRQL OldIrql)
+{
+#ifndef CONFIG_SMP
+ /* Simply raise to dispatch */
+ *OldIrql = KfRaiseIrql(DISPATCH_LEVEL);
+
+ /* Always return true on UP Machines */
+ return TRUE;
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/*
+ * @implemented
+ */
+LOGICAL
+KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
+ OUT PKIRQL OldIrql)
+{
+#ifndef CONFIG_SMP
+ /* Simply raise to dispatch */
+ *OldIrql = KfRaiseIrql(DISPATCH_LEVEL);
+
+ /* Always return true on UP Machines */
+ return TRUE;
+#else
+ UNIMPLEMENTED;
+#endif
+}
+
+/* EOF */
Propchange: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/spinlock.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/spinlock.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/spinlock.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/spinlock.c [iso-8859-1] Fri Aug 29
20:44:37 2008
@@ -86,6 +86,7 @@
/* PUBLIC FUNCTIONS **********************************************************/
+#ifdef _X86_
/*
* @implemented
*/
@@ -96,6 +97,7 @@
/* Clear it */
*SpinLock = 0;
}
+#endif
/*
* @implemented
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild [iso-8859-1] Fri
Aug 29 20:44:37 2008
@@ -95,6 +95,7 @@
<file>except.c</file>
<file>irql.c</file>
<file>kiinit.c</file>
+ <file>spinlock.c</file>
<file>thrdini.c</file>
<file>trap.S</file>
</directory>
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl_amd64.def
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl_amd64.def [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl_amd64.def [iso-8859-1] Fri Aug 29
20:44:37 2008
@@ -4,16 +4,6 @@
;
EXPORTS
;
-KfAcquireSpinLock
-KfReleaseSpinLock
-KefAcquireSpinLockAtDpcLevel
-KefReleaseSpinLockFromDpcLevel
-KeInitializeSpinLock
-KeGetCurrentProcessorNumber
-RtlConvertUlongToLargeInteger
-RtlExtendedIntegerMultiply
-;
-; original:
CcCanIWrite
CcCopyRead
CcCopyWrite