/*
* PROJECT: ReactOS HAL
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: hal/halx86/up/spinlock.c
+ * FILE: ntoskrnl/ke/amd64/spinlock.c
* PURPOSE: Spinlock and Queued Spinlock Support
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/
KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
IN PKIRQL OldIrql)
{
-#ifndef CONFIG_SMP
- /* Simply raise to dispatch */
- KeRaiseIrql(DISPATCH_LEVEL, OldIrql);
+ /* Raise to synch level */
+ KeRaiseIrql(SYNCH_LEVEL, OldIrql);
+#ifdef CONFIG_SMP
+ // HACK
+ return KeTryToAcquireSpinLockAtDpcLevel(KeGetCurrentPrcb()->LockQueue[LockNumber].Lock);
+#else
/* Add an explicit memory barrier to prevent the compiler from reordering
memory accesses across the borders of spinlocks */
KeMemoryBarrierWithoutFence();
/* Always return true on UP Machines */
return TRUE;
-#else
- UNIMPLEMENTED;
- ASSERT(FALSE);
#endif
}
KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
OUT PKIRQL OldIrql)
{
-#ifndef CONFIG_SMP
- /* Simply raise to dispatch */
+ /* Raise to dispatch level */
KeRaiseIrql(DISPATCH_LEVEL, OldIrql);
+#ifdef CONFIG_SMP
+ // HACK
+ return KeTryToAcquireSpinLockAtDpcLevel(KeGetCurrentPrcb()->LockQueue[LockNumber].Lock);
+#else
+
/* Add an explicit memory barrier to prevent the compiler from reordering
memory accesses across the borders of spinlocks */
KeMemoryBarrierWithoutFence();
/* Always return true on UP Machines */
return TRUE;
-#else
- UNIMPLEMENTED;
- ASSERT(FALSE);
#endif
}