-#ifndef __INCLUDE_INTERNAL_MM_H
-#define __INCLUDE_INTERNAL_MM_H
+#pragma once
#include <internal/arch/mm.h>
extern ULONG MmHighestPhysicalPage;
extern ULONG MmAvailablePages;
extern ULONG MmResidentAvailablePages;
-extern ULONG MmNumberOfSystemPtes;
extern PVOID MmPagedPoolBase;
extern ULONG MmPagedPoolSize;
extern LIST_ENTRY MmLoadedUserImageList;
+extern KMUTANT MmSystemLoadLock;
+
extern ULONG MmNumberOfPagingFiles;
extern PVOID MmUnloadedDrivers;
extern SIZE_T MmPeakCommitment;
extern SIZE_T MmtotalCommitLimitMaximum;
-extern PVOID MiDebugMapping;
-extern PMMPTE MmDebugPte;
+extern BOOLEAN MiDbgReadyForPhysical;
struct _KTRAP_FRAME;
struct _EPROCESS;
/* Number of list heads to use */
#define MI_FREE_POOL_LISTS 4
-#define MI_HYPERSPACE_PTES (256 - 1)
-#define MI_ZERO_PTES (32)
-#define MI_MAPPING_RANGE_START (ULONG_PTR)HYPER_SPACE
-#define MI_MAPPING_RANGE_END (MI_MAPPING_RANGE_START + \
- MI_HYPERSPACE_PTES * PAGE_SIZE)
-#define MI_ZERO_PTE (PMMPTE)(MI_MAPPING_RANGE_END + \
- PAGE_SIZE)
/* Signature of free pool blocks */
#define MM_FREE_POOL_TAG 'lprF'
-#define PAGE_TO_SECTION_PAGE_DIRECTORY_OFFSET(x) \
- ((x) / (4*1024*1024))
-
-#define PAGE_TO_SECTION_PAGE_TABLE_OFFSET(x) \
- ((((x)) % (4*1024*1024)) / (4*1024))
-
-#define NR_SECTION_PAGE_TABLES 1024
-#define NR_SECTION_PAGE_ENTRIES 1024
-
-#define TEB_BASE 0x7FFDE000
-
/* Although Microsoft says this isn't hardcoded anymore,
they won't be able to change it. Stuff depends on it */
#define MM_VIRTMEM_GRANULARITY (64 * 1024)
*/
#define MM_POOL_ALIGNMENT 8
-/*
- * Maximum size of the kmalloc area (this is totally arbitary)
- */
-#define MM_KERNEL_MAP_SIZE (16*1024*1024)
-#define MM_KERNEL_MAP_BASE (0xf0c00000)
-
-/*
- * FIXME - different architectures have different cache line sizes...
- */
-#define MM_CACHE_LINE_SIZE 32
-
#define MM_ROUND_UP(x,s) \
((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1)))
USHORT ShortFlags;
} e2;
} u3;
-#ifdef _WIN64
- ULONG UsedPageTableEntries;
-#endif
union
{
MMPTE OriginalPte;
ULONG_PTR EntireFrame; // SavedSwapEntry
struct
{
- ULONG_PTR PteFrame: 8*sizeof(PVOID)-7;
+ ULONG_PTR PteFrame:25;
ULONG_PTR InPageError:1;
ULONG_PTR VerifierAllocation:1;
ULONG_PTR AweAllocation:1;
PMEMORY_AREA MemoryArea,
PVOID Address,
PMEMORY_BASIC_INFORMATION Info,
- PSIZE_T ResultLength
+ PULONG ResultLength
);
VOID
/* freelist.c **********************************************************/
-#define ASSERT_PFN(x) ASSERT((x)->u3.e1.CacheAttribute != 0)
-
FORCEINLINE
PMMPFN
MiGetPfnEntry(IN PFN_TYPE Pfn)
/* Get the entry */
Page = &MmPfnDatabase[Pfn];
- /* Make sure it's valid */
- ASSERT_PFN(Page);
-
/* Return it */
return Page;
};
PFN_TYPE
NTAPI
MmAllocPage(
- ULONG Consumer,
- SWAPENTRY SavedSwapEntry
+ ULONG Consumer
);
LONG
MmCreateProcessAddressSpace(
IN ULONG MinWs,
IN PEPROCESS Dest,
- IN PULONG_PTR DirectoryTableBase
+ IN PULONG DirectoryTableBase
);
NTSTATUS
NTAPI
MmInitializeHandBuiltProcess(
IN PEPROCESS Process,
- IN PULONG_PTR DirectoryTableBase
+ IN PULONG DirectoryTableBase
);
PMEMORY_AREA MemoryArea,
PVOID Address,
PMEMORY_BASIC_INFORMATION Info,
- PSIZE_T ResultLength
+ PULONG ResultLength
);
NTSTATUS
IN PVOID Address,
IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
OUT PVOID VirtualMemoryInformation,
- IN SIZE_T Length,
- OUT PSIZE_T ResultLength
+ IN ULONG Length,
+ OUT PULONG ResultLength
);
/* sysldr.c ******************************************************************/
{
return MmKernelAddressSpace;
}
-
-#endif