mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 05:26:58 +00:00
[NTOSKRNL] Implement ExfAcquireRundownProtectionCacheAware(), ExfReleaseRundownProtectionCacheAware()
This commit is contained in:
parent
47d309b262
commit
7e36e76d5d
|
@ -378,15 +378,35 @@ ExfWaitForRundownProtectionRelease(IN PEX_RUNDOWN_REF RunRef)
|
||||||
/* FIXME: STUBS **************************************************************/
|
/* FIXME: STUBS **************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented NT5.2
|
* @implemented NT5.2
|
||||||
*/
|
*/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
FASTCALL
|
FASTCALL
|
||||||
ExfAcquireRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
|
ExfAcquireRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
|
||||||
{
|
{
|
||||||
DBG_UNREFERENCED_PARAMETER(RunRefCacheAware);
|
ULONG Value;
|
||||||
UNIMPLEMENTED;
|
BOOLEAN Acquired;
|
||||||
return FALSE;
|
PEX_RUNDOWN_REF RunRef;
|
||||||
|
|
||||||
|
RunRef = (PEX_RUNDOWN_REF)((ULONG_PTR)RunRefCacheAware->RunRefs +
|
||||||
|
RunRefCacheAware->RunRefSize *
|
||||||
|
(KeGetCurrentProcessorNumber() % RunRefCacheAware->Number));
|
||||||
|
|
||||||
|
/* Get current value */
|
||||||
|
Value = RunRef->Count & !EX_RUNDOWN_ACTIVE;
|
||||||
|
/* Try to acquire the quick way if already active */
|
||||||
|
if (ExpChangeRundown(RunRef,
|
||||||
|
((RunRef->Count & !EX_RUNDOWN_ACTIVE) + EX_RUNDOWN_COUNT_INC),
|
||||||
|
Value) == Value)
|
||||||
|
{
|
||||||
|
Acquired = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Acquired = ExfAcquireRundownProtection(RunRef);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Acquired;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -404,14 +424,33 @@ ExfAcquireRundownProtectionCacheAwareEx(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCac
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented NT5.2
|
* @implemented NT5.2
|
||||||
*/
|
*/
|
||||||
VOID
|
VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
ExfReleaseRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
|
ExfReleaseRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
|
||||||
{
|
{
|
||||||
DBG_UNREFERENCED_PARAMETER(RunRefCacheAware);
|
ULONG Value;
|
||||||
UNIMPLEMENTED;
|
PEX_RUNDOWN_REF RunRef;
|
||||||
|
|
||||||
|
RunRef = (PEX_RUNDOWN_REF)((ULONG_PTR)RunRefCacheAware->RunRefs +
|
||||||
|
RunRefCacheAware->RunRefSize *
|
||||||
|
(KeGetCurrentProcessorNumber() % RunRefCacheAware->Number));
|
||||||
|
|
||||||
|
/* Get current value */
|
||||||
|
Value = RunRef->Count & !EX_RUNDOWN_ACTIVE;
|
||||||
|
/* Try to release the quick way if multiple actived */
|
||||||
|
if (ExpChangeRundown(RunRef,
|
||||||
|
((RunRef->Count & !EX_RUNDOWN_ACTIVE) - EX_RUNDOWN_COUNT_INC),
|
||||||
|
Value) == Value)
|
||||||
|
{
|
||||||
|
/* Sanity check */
|
||||||
|
ASSERT((Value >= EX_RUNDOWN_COUNT_INC) || (KeNumberProcessors > 1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ExfReleaseRundownProtection(RunRef);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue