[BOOTLIB]: Clarify some attributes now that their meaning is clearer.
[reactos.git] / reactos / boot / environ / include / bl.h
index 6ade600..f692e84 100644 (file)
@@ -122,6 +122,7 @@ C_ASSERT(BL_MM_INCLUDE_ONLY_FIRMWARE_MEMORY == 0x240);
 #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
@@ -222,6 +223,7 @@ typedef enum _BL_MEMORY_DESCRIPTOR_TYPE
 {
     BlMdPhysical,
     BlMdVirtual,
+    BlMdTracker
 } BL_MEMORY_DESCRIPTOR_TYPE;
 
 typedef enum _BL_TRANSLATION_TYPE
@@ -360,11 +362,11 @@ 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,
 
     //
@@ -374,9 +376,10 @@ typedef enum _BL_MEMORY_ATTR
     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;
 
@@ -1541,6 +1544,12 @@ EfipGetRsdt (
     _Out_ PPHYSICAL_ADDRESS FoundRsdt
     );
 
+NTSTATUS
+EfiFreePages (
+    _In_ ULONG Pages,
+    _In_ EFI_PHYSICAL_ADDRESS PhysicalAddress
+    );
+
 /* PLATFORM TIMER ROUTINES ***************************************************/
 
 NTSTATUS
@@ -1553,6 +1562,11 @@ BlTimeQueryPerformanceCounter (
     _Out_opt_ PLARGE_INTEGER Frequency
     );
 
+ULONGLONG
+BlArchGetPerformanceCounter (
+    VOID
+    );
+
 /* RESOURCE LOCALE INTERNATIONALIZATION ROUTINES *****************************/
 
 NTSTATUS
@@ -1646,6 +1660,18 @@ BlStatusError (
 
 /* UTILITY ROUTINES **********************************************************/
 
+VOID
+BlArchCpuId (
+    _In_ ULONG Function,
+    _In_ ULONG SubFunction,
+    _Out_ INT* Result
+    );
+
+BOOLEAN
+BlArchIsCpuIdFunctionSupported (
+    _In_ ULONG Function
+    );
+
 VOID
 BlUtlUpdateProgress (
     _In_ ULONG Percentage,
@@ -1711,6 +1737,12 @@ BlFwReboot (
     VOID
     );
 
+NTSTATUS
+MmFwFreePages (
+    _In_ ULONG BasePage,
+    _In_ ULONG PageCount
+    );
+
 PGUID
 BlGetApplicationIdentifier (
     VOID
@@ -1989,6 +2021,20 @@ MmMdInitializeList (
     _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,
@@ -2087,6 +2133,17 @@ MmPapAllocatePhysicalPagesInRange (
     );
 
 NTSTATUS
+MmPaReleaseSelfMapPages (
+    _In_ PHYSICAL_ADDRESS Address
+    );
+
+NTSTATUS
+MmPaReserveSelfMapPages (
+    _Inout_ PPHYSICAL_ADDRESS PhysicalAddress,
+    _In_ ULONG Alignment,
+    _In_ ULONG PageCount
+    );
+NTSTATUS
 BlMmFreePhysicalPages (
     _In_ PHYSICAL_ADDRESS Address
     );
@@ -2134,6 +2191,30 @@ BlMmGetMemoryMap (
 
 /* 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,
@@ -2154,6 +2235,13 @@ BlMmTranslateVirtualAddress (
     _Out_ PPHYSICAL_ADDRESS PhysicalAddress
     );
 
+BOOLEAN
+MmArchTranslateVirtualAddress (
+    _In_ PVOID VirtualAddress,
+    _Out_opt_ PPHYSICAL_ADDRESS PhysicalAddress,
+    _Out_opt_ PULONG CachingFlags
+    );
+
 /* BLOCK ALLOCATOR ROUTINES **************************************************/
 
 NTSTATUS
@@ -2634,5 +2722,7 @@ extern BL_MEMORY_DESCRIPTOR_LIST MmMdlFreeVirtual;
 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlMappingTrackers;
 extern ULONGLONG BlpTimePerformanceFrequency;
 extern LIST_ENTRY RegisteredFileSystems;
+extern BL_ADDRESS_RANGE MmArchKsegAddressRange;
+extern ULONG_PTR MmArchTopOfApplicationAddressSpace;
 
 #endif