{
BlMdPhysical,
BlMdVirtual,
+ BlMdTracker
} BL_MEMORY_DESCRIPTOR_TYPE;
typedef enum _BL_TRANSLATION_TYPE
BlUnusableMemory = 0xF0000002,
BlReservedMemory = 0xF0000003,
BlEfiBootMemory = 0xF0000004,
- BlEfiRuntimeMemory = 0xF0000006,
+ BlConventionalZeroedMemory = 0xF000005,
+ BlEfiRuntimeCodeMemory = 0xF0000006,
BlAcpiReclaimMemory = 0xF0000008,
BlAcpiNvsMemory = 0xF0000009,
BlDeviceIoMemory = 0xF000000A,
BlDevicePortMemory = 0xF000000B,
BlPalMemory = 0xF000000C,
+ BlEfiRuntimeDataMemory = 0xF000000E,
} BL_MEMORY_TYPE;
typedef enum _BL_MEMORY_ATTR
//
// Memory Allocation Attributes
//
- BlMemoryUnknown = 0x00010000,
- BlMemoryNonFixed = 0x00020000,
+ BlMemoryLargePages = 0x00010000,
+ BlMemoryKernelRange = 0x00020000,
BlMemoryFixed = 0x00040000,
- BlMemoryReserved = 0x00080000,
- BlMemoryValidAllocationAttributes = BlMemoryNonFixed | BlMemoryFixed | BlMemoryReserved | BlMemoryUnknown,
+ BlMemoryBelow1MB = 0x00080000,
+ BlMemoryValidAllocationAttributes = BlMemoryKernelRange | BlMemoryFixed | BlMemoryBelow1MB | BlMemoryLargePages,
BlMemoryValidAllocationAttributeMask = 0x00FF0000,
//
_Out_opt_ PLARGE_INTEGER Frequency
);
+ULONGLONG
+BlArchGetPerformanceCounter (
+ VOID
+ );
+
/* RESOURCE LOCALE INTERNATIONALIZATION ROUTINES *****************************/
NTSTATUS
/* UTILITY ROUTINES **********************************************************/
+VOID
+BlArchCpuId (
+ _In_ ULONG Function,
+ _In_ ULONG SubFunction,
+ _Out_ INT* Result
+ );
+
+BOOLEAN
+BlArchIsCpuIdFunctionSupported (
+ _In_ ULONG Function
+ );
+
VOID
BlUtlUpdateProgress (
_In_ ULONG Percentage,
_In_ ULONG DataSize
);
+NTSTATUS
+BlHtDelete (
+ _In_ ULONG TableId,
+ _In_ PBL_HASH_ENTRY Entry
+ );
+
NTSTATUS
BlHtLookup (
_In_ ULONG TableId,
_In_ BL_ARCH_MODE NewMode
);
+VOID
+BlpArchEnableTranslation (
+ VOID
+ );
+
VOID
Archx86TransferTo32BitApplicationAsm (
VOID
/* MEMORY DESCRIPTOR ROUTINES ************************************************/
+VOID
+MmMdDbgDumpList (
+ _In_ PBL_MEMORY_DESCRIPTOR_LIST DescriptorList,
+ _In_opt_ ULONG MaxCount
+);
+
VOID
MmMdInitializeList (
_In_ PBL_MEMORY_DESCRIPTOR_LIST DescriptorList,
_In_ ULONGLONG Page
);
+PBL_MEMORY_DESCRIPTOR
+MmMdFindDescriptorFromMdl (
+ _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList,
+ _In_ ULONG Flags,
+ _In_ ULONGLONG Page
+ );
+
NTSTATUS
MmMdCopyList (
_In_ PBL_MEMORY_DESCRIPTOR_LIST DestinationList,
_In_ ULONG Flags
);
+NTSTATUS
+MmMdTruncateDescriptors (
+ _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList,
+ _In_ PBL_MEMORY_DESCRIPTOR_LIST NewList,
+ _In_ ULONGLONG BasePage
+ );
+
VOID
MmMdRemoveDescriptorFromList (
_In_ PBL_MEMORY_DESCRIPTOR_LIST MdList,
/* PAGE ALLOCATOR ROUTINES ***************************************************/
+NTSTATUS
+MmPaTruncateMemory (
+ _In_ ULONGLONG BasePage
+ );
+
NTSTATUS
BlMmAllocatePhysicalPages(
_Inout_ PPHYSICAL_ADDRESS Address,
);
NTSTATUS
+MmPaReleaseSelfMapPages (
+ _In_ PHYSICAL_ADDRESS Address
+ );
+
+NTSTATUS
+MmPaReserveSelfMapPages (
+ _Inout_ PPHYSICAL_ADDRESS PhysicalAddress,
+ _In_ ULONG Alignment,
+ _In_ ULONG PageCount
+ );
+NTSTATUS
BlMmFreePhysicalPages (
_In_ PHYSICAL_ADDRESS Address
);
/* VIRTUAL MEMORY ROUTINES ***************************************************/
+NTSTATUS
+MmSelectMappingAddress (
+ _Out_ PVOID* MappingAddress,
+ _In_ PVOID PreferredAddress,
+ _In_ ULONGLONG Size,
+ _In_ ULONG AllocationAttributes,
+ _In_ ULONG Flags,
+ _In_ PHYSICAL_ADDRESS PhysicalAddress
+ );
+
+NTSTATUS
+MmMapPhysicalAddress (
+ _Inout_ PPHYSICAL_ADDRESS PhysicalAddress,
+ _Out_ PVOID* VirtualAddress,
+ _Inout_ PULONGLONG Size,
+ _In_ ULONG CacheAttributes
+ );
+
+NTSTATUS
+MmUnmapVirtualAddress (
+ _Inout_ PVOID* VirtualAddress,
+ _Inout_ PULONGLONG Size
+ );
+
NTSTATUS
BlMmMapPhysicalAddressEx (
_In_ PVOID* VirtualAddress,
_Out_ PPHYSICAL_ADDRESS PhysicalAddress
);
+BOOLEAN
+MmArchTranslateVirtualAddress (
+ _In_ PVOID VirtualAddress,
+ _Out_opt_ PPHYSICAL_ADDRESS PhysicalAddress,
+ _Out_opt_ PULONG CachingFlags
+ );
+
/* BLOCK ALLOCATOR ROUTINES **************************************************/
NTSTATUS
extern BL_MEMORY_DESCRIPTOR_LIST MmMdlMappingTrackers;
extern ULONGLONG BlpTimePerformanceFrequency;
extern LIST_ENTRY RegisteredFileSystems;
+extern BL_ADDRESS_RANGE MmArchKsegAddressRange;
+extern ULONG_PTR MmArchTopOfApplicationAddressSpace;
#endif