[NTOS] Fix build with CONFIG_SMP

This commit is contained in:
Timo Kreuzer 2021-06-09 22:15:12 +02:00
parent a0fb02f7f3
commit 2ed56fa794
3 changed files with 14 additions and 13 deletions

View file

@ -63,7 +63,7 @@ ExInitPoolLookasidePointers(VOID)
PGENERAL_LOOKASIDE Entry;
/* Loop for all pool lists */
for (i = 0; i < MAXIMUM_PROCESSORS; i++)
for (i = 0; i < NUMBER_POOL_LOOKASIDE_LISTS; i++)
{
/* Initialize the non-paged list */
Entry = &ExpSmallNPagedPoolLookasideLists[i];

View file

@ -167,19 +167,19 @@ BOOLEAN
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
}
@ -190,19 +190,20 @@ LOGICAL
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
}

View file

@ -167,7 +167,7 @@ KiIpiServiceRoutine(IN PKTRAP_FRAME TrapFrame,
if (InterlockedBitTestAndReset((PLONG)&Prcb->IpiFrozen, IPI_SYNCH_REQUEST))
{
#ifdef _M_ARM
#if defined(_M_ARM) || defined(_M_AMD64)
DbgBreakPoint();
#else
(void)InterlockedDecrementUL(&Prcb->SignalDone->CurrentPacket[1]);