15#define MODULE_INVOLVED_IN_ARM3
38 BoundaryMask = ~(BoundaryPfn - 1);
57 LastPage =
Page + PageCount;
62 if ((LastPage - 1) > HighestPfn) LastPage = HighestPfn + 1;
63 if (
Page < LowestPfn)
Page = LowestPfn;
68 if (!(PageCount) || ((
Page + SizeInPages) > LastPage))
continue;
89 if ((!(
Length) && (BoundaryPfn)) &&
90 (((
Page ^ (
Page + SizeInPages - 1)) & BoundaryMask)))
101 if (++
Length == SizeInPages)
133 EndPfn = Pfn1 - SizeInPages + 1;
142 Pfn1->
u3.
e2.ReferenceCount = 1;
145 Pfn1->
u3.
e1.StartOfAllocation = 0;
146 Pfn1->
u3.
e1.EndOfAllocation = 0;
154 if (Pfn1 == EndPfn)
break;
161 Pfn1->
u3.
e1.StartOfAllocation = 1;
162 (Pfn1 + SizeInPages - 1)->
u3.e1.EndOfAllocation = 1;
172 EndPfn = Pfn1 + SizeInPages;
223 PFN_NUMBER PreviousPage = 0,
Page, HighPage, BoundaryMask, Pages = 0;
228 if (LowestPfn > HighestPfn)
return NULL;
229 if (LowestPfn + SizeInPages <= LowestPfn)
return NULL;
230 if (LowestPfn + SizeInPages - 1 > HighestPfn)
return NULL;
231 if (BaseAddressPages < SizeInPages)
return NULL;
236 HighPage = HighestPfn + 1 - SizeInPages;
237 BoundaryMask = ~(BoundaryPfn - 1);
243 EndPte = StartPte + BaseAddressPages;
244 while (StartPte < EndPte)
260 if ((
Page >= LowestPfn) && (
Page <= HighPage))
265 if (!(BoundaryPfn) ||
266 (!((
Page ^ (
Page + SizeInPages - 1)) & BoundaryMask)))
279 if (Pages == SizeInPages)
292 if (
Page != (PreviousPage + 1))
304 if (++Pages == SizeInPages)
362 EndPfn = Pfn1 + SizeInPages;
369 }
while (++Pfn1 < EndPfn);
421 HighestAcceptablePfn,
448 HighestAcceptablePfn,
454 DPRINT1(
"Unable to allocate contiguous memory for %d bytes (%d pages), out of memory!\n",
NumberOfBytes, SizeInPages);
464 PFN_NUMBER PageFrameIndex, LastPage, PageCount;
493 if ((!Pfn1) || (Pfn1->
u3.
e1.StartOfAllocation == 0))
509 Pfn1->
u3.
e1.StartOfAllocation = 0;
527 }
while (Pfn1++->
u3.e1.EndOfAllocation == 0);
533 Pfn1->
u3.
e1.EndOfAllocation = 0;
538 PageCount = (
ULONG)(Pfn1 - StartPfn + 1);
553 LastPage = PageFrameIndex + PageCount;
559 }
while (PageFrameIndex < LastPage);
580 PFN_NUMBER LowestPfn, HighestPfn, BoundaryPfn;
609 if (LowestPfn > HighestPfn)
return NULL;
PVOID NTAPI MmAllocateContiguousMemorySpecifyCache(IN SIZE_T NumberOfBytes, IN PHYSICAL_ADDRESS LowestAcceptableAddress OPTIONAL, IN PHYSICAL_ADDRESS HighestAcceptableAddress, IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL, IN MEMORY_CACHING_TYPE CacheType OPTIONAL)
PVOID NTAPI MiAllocateContiguousMemory(IN SIZE_T NumberOfBytes, IN PFN_NUMBER LowestAcceptablePfn, IN PFN_NUMBER HighestAcceptablePfn, IN PFN_NUMBER BoundaryPfn, IN MEMORY_CACHING_TYPE CacheType)
PVOID NTAPI MiFindContiguousMemory(IN PFN_NUMBER LowestPfn, IN PFN_NUMBER HighestPfn, IN PFN_NUMBER BoundaryPfn, IN PFN_NUMBER SizeInPages, IN MEMORY_CACHING_TYPE CacheType)
VOID NTAPI MmFreeContiguousMemorySpecifyCache(IN PVOID BaseAddress, IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType)
PVOID NTAPI MiCheckForContiguousMemory(IN PVOID BaseAddress, IN PFN_NUMBER BaseAddressPages, IN PFN_NUMBER SizeInPages, IN PFN_NUMBER LowestPfn, IN PFN_NUMBER HighestPfn, IN PFN_NUMBER BoundaryPfn, IN MI_PFN_CACHE_ATTRIBUTE CacheAttribute)
PVOID NTAPI MmAllocateContiguousMemory(IN SIZE_T NumberOfBytes, IN PHYSICAL_ADDRESS HighestAcceptableAddress)
PFN_NUMBER NTAPI MiFindContiguousPages(IN PFN_NUMBER LowestPfn, IN PFN_NUMBER HighestPfn, IN PFN_NUMBER BoundaryPfn, IN PFN_NUMBER SizeInPages, IN MEMORY_CACHING_TYPE CacheType)
VOID NTAPI MiFreeContiguousMemory(IN PVOID BaseAddress)
VOID NTAPI MmFreeContiguousMemory(IN PVOID BaseAddress)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeGetCurrentIrql()
#define NonPagedPoolCacheAligned
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
MI_PFN_CACHE_ATTRIBUTE MiPlatformCacheAttributes[2][MmMaximumCacheType]
VOID NTAPI MmUnmapIoSpace(IN PVOID BaseAddress, IN SIZE_T NumberOfBytes)
PVOID NTAPI MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress, IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType)
#define KeLeaveGuardedRegion()
#define KeEnterGuardedRegion()
PFN_NUMBER MmHighestPhysicalPage
VOID NTAPI MiUnlinkFreeOrZeroedPage(IN PMMPFN Entry)
#define MI_SET_PFN_DELETED(x)
enum _MI_PFN_CACHE_ATTRIBUTE MI_PFN_CACHE_ATTRIBUTE
VOID NTAPI MiDecrementShareCount(IN PMMPFN Pfn1, IN PFN_NUMBER PageFrameIndex)
BOOLEAN NTAPI MiIsPfnInUse(IN PMMPFN Pfn1)
FORCEINLINE PMMPFN MI_PFN_ELEMENT(IN PFN_NUMBER Pfn)
#define MiAddressToPte(x)
#define ExFreePoolWithTag(_P, _T)
_Out_ PNDIS_HANDLE _Out_ PUINT _In_ PNDIS_STRING _In_ NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define MiPteToAddress(_Pte)
FORCEINLINE PMMPFN MiGetPfnEntry(IN PFN_NUMBER Pfn)
#define MI_SET_PROCESS2(x)
@ MI_USAGE_CONTINOUS_ALLOCATION
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
ULONG MmSizeOfNonPagedPoolInBytes
PVOID MmNonPagedPoolExpansionStart
PVOID MmNonPagedPoolStart
PPHYSICAL_MEMORY_DESCRIPTOR MmPhysicalMemoryBlock
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
PULONG MinorVersion OPTIONAL
struct _MMPFN::@1805::@1811 e2
ULONG_PTR VerifierAllocation
PHYSICAL_MEMORY_RUN Run[1]
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS _In_ PHYSICAL_ADDRESS _In_opt_ PHYSICAL_ADDRESS BoundaryAddressMultiple
#define BYTES_TO_PAGES(Size)
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS LowestAcceptableAddress
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS _In_ PHYSICAL_ADDRESS _In_opt_ PHYSICAL_ADDRESS _In_ MEMORY_CACHING_TYPE CacheType
enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE