17#define MODULE_INVOLVED_IN_ARM3
20#define ASSERT_IS_ROS_PFN(x) ASSERT(MI_IS_ROS_PFN(x) == TRUE);
169 !(Pfn1->u3.e2.ReferenceCount));
190 PFN_NUMBER PageCount, LowPage, HighPage, SkipPages, PagesFound = 0,
Page;
194 INT LookForZeroedPages;
217 if (SkipPages)
DPRINT1(
"WARNING: Caller requesting SkipBytes, MDL might be mismatched\n");
237 PageCount -= (PageCount >> 4);
263 while (PagesFound < PageCount)
290 Pfn1->
u3.
e2.ReferenceCount = 1;
294 Pfn1->
u3.
e1.StartOfAllocation = 1;
295 Pfn1->
u3.
e1.EndOfAllocation = 1;
310 for (LookForZeroedPages = 1; LookForZeroedPages >= 0; LookForZeroedPages--)
343 Pfn1->
u3.
e2.ReferenceCount = 1;
347 Pfn1->
u3.
e1.StartOfAllocation = 1;
348 Pfn1->
u3.
e1.EndOfAllocation = 1;
355 if (++PagesFound == PageCount)
break;
361 if (PagesFound == PageCount)
break;
373 if (PagesFound != PageCount)
ASSERT(PagesFound < PageCount);
392 if (PagesFound != PageCount) *MdlPage =
LIST_HEAD;
398 LastMdlPage = MdlPage + PagesFound;
399 while (MdlPage < LastMdlPage)
493 oldIrql = MiAcquirePfnLock();
495 MiReleasePfnLock(oldIrql);
510 oldIrql = MiAcquirePfnLock();
512 MiReleasePfnLock(oldIrql);
534 Pfn1->
u3.
e2.ReferenceCount++;
552 RCount = Pfn1->
u3.
e2.ReferenceCount;
578 Pfn1->
u3.
e2.ReferenceCount--;
579 if (Pfn1->
u3.
e2.ReferenceCount == 0)
595 DPRINT(
"Legacy free: %lx\n", Pfn);
631 DPRINT(
"Legacy allocate: %lx\n", PfnOffset);
633 Pfn1->
u3.
e2.ReferenceCount = 1;
#define KeGetCurrentIrql()
PFN_NUMBER MmResidentAvailablePages
VOID NTAPI MmSetSavedSwapEntryPage(PFN_NUMBER Pfn, SWAPENTRY SwapEntry)
static VOID MmInsertLRULastUserPage(PFN_NUMBER Page)
VOID NTAPI MmSetRmapListHeadPage(PFN_NUMBER Pfn, PMM_RMAP_ENTRY ListHead)
BOOLEAN NTAPI MiIsPfnFree(IN PMMPFN Pfn1)
SWAPENTRY NTAPI MmGetSavedSwapEntryPage(PFN_NUMBER Pfn)
VOID NTAPI MmDereferencePage(PFN_NUMBER Pfn)
PFN_NUMBER NTAPI MmAllocPage(ULONG Type)
PFN_NUMBER MmResidentAvailableAtInit
PFN_NUMBER NTAPI MmGetLRUFirstUserPage(VOID)
VOID NTAPI MmReferencePage(PFN_NUMBER Pfn)
BOOLEAN NTAPI MmIsPageInUse(PFN_NUMBER Pfn)
#define ASSERT_IS_ROS_PFN(x)
static VOID MmRemoveLRUUserPage(PFN_NUMBER Page)
PMDL NTAPI MiAllocatePagesForMdl(IN PHYSICAL_ADDRESS LowAddress, IN PHYSICAL_ADDRESS HighAddress, IN PHYSICAL_ADDRESS SkipBytes, IN SIZE_T TotalBytes, IN MI_PFN_CACHE_ATTRIBUTE CacheAttribute, IN ULONG MdlFlags)
ULONG NTAPI MmGetReferenceCountPage(PFN_NUMBER Pfn)
SIZE_T MmtotalCommitLimitMaximum
BOOLEAN NTAPI MiIsPfnInUse(IN PMMPFN Pfn1)
PFN_NUMBER MmAvailablePages
SIZE_T MmTotalCommittedPages
PFN_NUMBER NTAPI MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast)
PMM_RMAP_ENTRY NTAPI MmGetRmapListHeadPage(PFN_NUMBER Pfn)
PFN_NUMBER MmHighestPhysicalPage
PFN_NUMBER NTAPI MiRemoveZeroPage(IN ULONG Color)
VOID NTAPI MiUnlinkFreeOrZeroedPage(IN PMMPFN Entry)
#define MI_SET_PFN_DELETED(x)
VOID NTAPI MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex)
#define MI_GET_NEXT_COLOR()
PFN_NUMBER NTAPI MiRemoveAnyPage(IN ULONG Color)
enum _MI_PFN_CACHE_ATTRIBUTE MI_PFN_CACHE_ATTRIBUTE
PMDL NTAPI MmCreateMdl(IN PMDL Mdl, IN PVOID Base, IN SIZE_T Length)
#define ExFreePoolWithTag(_P, _T)
VOID NTAPI MiZeroPhysicalPage(IN PFN_NUMBER PageFrameIndex)
FORCEINLINE PMMPFN MiGetPfnEntry(IN PFN_NUMBER Pfn)
#define MI_SET_PROCESS2(x)
#define MI_ASSERT_PFN_LOCK_HELD()
FORCEINLINE PFN_NUMBER MiGetPfnEntryIndex(IN PMMPFN Pfn1)
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
PMM_RMAP_ENTRY RmapListHead
struct _MMPFN::@1805::@1811 e2
ULONG_PTR VerifierAllocation
struct _MMPFN * PreviousLRU
#define LIST_HEAD(name, type)
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS HighAddress
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, _Size)
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS _In_ PHYSICAL_ADDRESS SkipBytes
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS _In_ PHYSICAL_ADDRESS _In_ SIZE_T TotalBytes