#define BL_MM_REQUEST_DEFAULT_TYPE 1
#define BL_MM_REQUEST_TOP_DOWN_TYPE 2
+#define BL_MM_REMOVE_PHYSICAL_REGION_FLAG 0x40000000
#define BL_MM_REMOVE_VIRTUAL_REGION_FLAG 0x80000000
#define BL_LIBRARY_FLAG_NO_DISPLAY 0x01
{
BlMdPhysical,
BlMdVirtual,
+ BlMdTracker
} BL_MEMORY_DESCRIPTOR_TYPE;
typedef enum _BL_TRANSLATION_TYPE
//
// 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,
//
BlMemoryCoalesced = 0x02000000,
BlMemoryUpdate = 0x04000000,
BlMemoryNonFirmware = 0x08000000,
+ BlMemoryPersistent = 0x10000000,
BlMemorySpecial = 0x20000000,
BlMemoryFirmware = 0x80000000,
- BlMemoryValidTypeAttributes = BlMemoryRuntime | BlMemoryCoalesced | BlMemoryUpdate | BlMemoryNonFirmware | BlMemorySpecial | BlMemoryFirmware,
+ BlMemoryValidTypeAttributes = BlMemoryRuntime | BlMemoryCoalesced | BlMemoryUpdate | BlMemoryNonFirmware | BlMemoryPersistent | BlMemorySpecial | BlMemoryFirmware,
BlMemoryValidTypeAttributeMask = 0xFF000000,
} BL_MEMORY_ATTR;
_Out_ PPHYSICAL_ADDRESS FoundRsdt
);
+NTSTATUS
+EfiFreePages (
+ _In_ ULONG Pages,
+ _In_ EFI_PHYSICAL_ADDRESS PhysicalAddress
+ );
+
/* PLATFORM TIMER ROUTINES ***************************************************/
NTSTATUS
_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,
VOID
);
+NTSTATUS
+MmFwFreePages (
+ _In_ ULONG BasePage,
+ _In_ ULONG PageCount
+ );
+
PGUID
BlGetApplicationIdentifier (
VOID
_In_ PLIST_ENTRY ListHead
);
+PBL_MEMORY_DESCRIPTOR
+MmMdFindDescriptor (
+ _In_ ULONG WhichList,
+ _In_ ULONG Flags,
+ _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,
);
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