mirror of
https://github.com/reactos/reactos.git
synced 2025-04-15 01:47:30 +00:00
[HAL] Hack KeTryToAcquireQueuedSpinlock & KeTryToAcquireQueuedSpinLockRaiseToSynch into a somewhat working implementation
This commit is contained in:
parent
91587a432b
commit
56d0bc31ce
1 changed files with 11 additions and 26 deletions
|
@ -172,6 +172,7 @@ KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
|
||||||
KeLowerIrql(LockHandle->OldIrql);
|
KeLowerIrql(LockHandle->OldIrql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _MINIHAL_
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -180,20 +181,12 @@ FASTCALL
|
||||||
KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
|
KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
|
||||||
IN PKIRQL OldIrql)
|
IN PKIRQL OldIrql)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SMP
|
PKSPIN_LOCK Lock = KeGetCurrentPrcb()->LockQueue[LockNumber].Lock;
|
||||||
ERROR_DBGBREAK("FIXME: Unused\n"); // FIXME: Unused
|
|
||||||
return FALSE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Simply raise to synch */
|
/* KM tests demonstrate that this raises IRQL even if locking fails */
|
||||||
KeRaiseIrql(SYNCH_LEVEL, OldIrql);
|
KeRaiseIrql(SYNCH_LEVEL, OldIrql);
|
||||||
|
/* HACK */
|
||||||
/* Add an explicit memory barrier to prevent the compiler from reordering
|
return KeTryToAcquireSpinLockAtDpcLevel(Lock);
|
||||||
memory accesses across the borders of spinlocks */
|
|
||||||
KeMemoryBarrierWithoutFence();
|
|
||||||
|
|
||||||
/* Always return true on UP Machines */
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -204,23 +197,15 @@ FASTCALL
|
||||||
KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
|
KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
|
||||||
OUT PKIRQL OldIrql)
|
OUT PKIRQL OldIrql)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SMP
|
PKSPIN_LOCK Lock = KeGetCurrentPrcb()->LockQueue[LockNumber].Lock;
|
||||||
ERROR_DBGBREAK("FIXME: Unused\n"); // FIXME: Unused
|
|
||||||
return FALSE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Simply raise to dispatch */
|
/* KM tests demonstrate that this raises IRQL even if locking fails */
|
||||||
KeRaiseIrql(DISPATCH_LEVEL, OldIrql);
|
KeRaiseIrql(DISPATCH_LEVEL, OldIrql);
|
||||||
|
/* HACK */
|
||||||
/* Add an explicit memory barrier to prevent the compiler from reordering
|
return KeTryToAcquireSpinLockAtDpcLevel(Lock);
|
||||||
memory accesses across the borders of spinlocks */
|
|
||||||
KeMemoryBarrierWithoutFence();
|
|
||||||
|
|
||||||
/* Always return true on UP Machines */
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
#endif /* !defined(_MINIHAL_) */
|
||||||
#endif
|
#endif /* defined(_M_IX86) */
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
|
|
Loading…
Reference in a new issue