- 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

svn path=/branches/ros-amd64-bringup/; revision=35782
This commit is contained in:
Timo Kreuzer
2008-08-30 01:44:37 +00:00
parent 85e83d6573
commit efdc0f4571
6 changed files with 194 additions and 25 deletions
-15
View File
@@ -7,7 +7,6 @@ unsigned long (*FrLdrDbgPrint)(const char *Format, ...);
STUB(KdpEnableSafeMem)
STUB(KiIdleLoop)
STUB(KeAcquireInStackQueuedSpinLockRaiseToSynch)
STUB(KeBugcheckCallbackListHead)
STUB(ExpInterlockedPushEntrySList)
STUB(NtContinue)
@@ -131,12 +130,6 @@ STUB(IoTranslateBusAddress)
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(KeQueryActiveProcessors)
STUB(KeQueryMultiThreadProcessorSet)
STUB(KeQueryPrcbAddress)
STUB(KeReadStateMutex)
STUB(KeReleaseQueuedSpinLock)
STUB(KeReleaseSpinLock)
STUB(KeRestoreFloatingPointState)
STUB(KeSaveFloatingPointState)
STUB(KeSaveStateForHibernate)
@@ -161,8 +152,6 @@ STUB(KeSetDmaIoCoherency)
STUB(KeSignalCallDpcDone)
STUB(KeSignalCallDpcSynchronize)
STUB(KeSynchronizeExecution)
STUB(KeTryToAcquireQueuedSpinLock)
STUB(KeTryToAcquireQueuedSpinLockRaiseToSynch)
STUB(KeUpdateRunTime)
STUB(KeUpdateSystemTime)
STUB(KeUserModeCallback)
@@ -245,10 +234,6 @@ STUB(_local_unwind)
STUB(_setjmp)
STUB(_setjmpex)
STUB(longjmp)
STUB(KfReleaseSpinLock)
STUB(KeAcquireInStackQueuedSpinLock)
STUB(KeReleaseInStackQueuedSpinLock)
STUB(KfAcquireSpinLock)
STUB(KeProcessorArchitecture)
STUB(KeProcessorLevel)
STUB(KeProcessorRevision)
@@ -65,6 +65,9 @@ typedef struct _KIDT_INIT
//#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;
+188
View File
@@ -0,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 ([email protected])
*/
/* 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 */
+2
View File
@@ -86,6 +86,7 @@ KeReleaseQueuedSpinLockFromDpcLevel(IN PKSPIN_LOCK_QUEUE LockHandle)
/* PUBLIC FUNCTIONS **********************************************************/
#ifdef _X86_
/*
* @implemented
*/
@@ -96,6 +97,7 @@ KeInitializeSpinLock(IN PKSPIN_LOCK SpinLock)
/* Clear it */
*SpinLock = 0;
}
#endif
/*
* @implemented
@@ -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>
-10
View File
@@ -4,16 +4,6 @@
;
EXPORTS
;
KfAcquireSpinLock
KfReleaseSpinLock
KefAcquireSpinLockAtDpcLevel
KefReleaseSpinLockFromDpcLevel
KeInitializeSpinLock
KeGetCurrentProcessorNumber
RtlConvertUlongToLargeInteger
RtlExtendedIntegerMultiply
;
; original:
CcCanIWrite
CcCopyRead
CcCopyWrite