mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 14:25:52 +00:00
[NTOS:MM] Implement and use MiAcquirePfnLockAtDpcLevel/MiReleasePfnLockFromDpcLevel.
This commit is contained in:
parent
da5949280c
commit
81532227b6
2 changed files with 24 additions and 4 deletions
|
@ -883,6 +883,28 @@ MiReleasePfnLock(
|
||||||
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
|
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FORCEINLINE
|
||||||
|
VOID
|
||||||
|
MiAcquirePfnLockAtDpcLevel(VOID)
|
||||||
|
{
|
||||||
|
PKSPIN_LOCK_QUEUE LockQueue;
|
||||||
|
|
||||||
|
ASSERT(KeGetCurrentIrql() >= DISPATCH_LEVEL);
|
||||||
|
LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
|
||||||
|
KeAcquireQueuedSpinLockAtDpcLevel(LockQueue);
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCEINLINE
|
||||||
|
VOID
|
||||||
|
MiReleasePfnLockFromDpcLevel(VOID)
|
||||||
|
{
|
||||||
|
PKSPIN_LOCK_QUEUE LockQueue;
|
||||||
|
|
||||||
|
LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
|
||||||
|
KeReleaseQueuedSpinLockFromDpcLevel(LockQueue);
|
||||||
|
ASSERT(KeGetCurrentIrql() >= DISPATCH_LEVEL);
|
||||||
|
}
|
||||||
|
|
||||||
#define MI_ASSERT_PFN_LOCK_HELD() ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL)
|
#define MI_ASSERT_PFN_LOCK_HELD() ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL)
|
||||||
|
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
|
|
|
@ -433,7 +433,6 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
PMMPFN Pfn1;
|
PMMPFN Pfn1;
|
||||||
PVOID BaseVa, BaseVaStart;
|
PVOID BaseVa, BaseVaStart;
|
||||||
PMMFREE_POOL_ENTRY FreeEntry;
|
PMMFREE_POOL_ENTRY FreeEntry;
|
||||||
PKSPIN_LOCK_QUEUE LockQueue;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Figure out how big the allocation is in pages
|
// Figure out how big the allocation is in pages
|
||||||
|
@ -844,8 +843,7 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
//
|
//
|
||||||
// Lock the PFN database too
|
// Lock the PFN database too
|
||||||
//
|
//
|
||||||
LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
|
MiAcquirePfnLockAtDpcLevel();
|
||||||
KeAcquireQueuedSpinLockAtDpcLevel(LockQueue);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Loop the pages
|
// Loop the pages
|
||||||
|
@ -889,7 +887,7 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
//
|
//
|
||||||
// Release the PFN and nonpaged pool lock
|
// Release the PFN and nonpaged pool lock
|
||||||
//
|
//
|
||||||
KeReleaseQueuedSpinLockFromDpcLevel(LockQueue);
|
MiReleasePfnLockFromDpcLevel();
|
||||||
KeReleaseQueuedSpinLock(LockQueueMmNonPagedPoolLock, OldIrql);
|
KeReleaseQueuedSpinLock(LockQueueMmNonPagedPoolLock, OldIrql);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue