Rename LOADER_MEMORY_MAPPING structure to more meaningful LOADER_MEMORY_DESCRIPTOR
This commit is contained in:
parent
143803aad9
commit
5221db2e63
@ -93,13 +93,13 @@ typedef struct _LOADER_INFORMATION_BLOCK
|
||||
} LOADER_INFORMATION_BLOCK, *PLOADER_INFORMATION_BLOCK;
|
||||
|
||||
/* Boot Loader memory mapping information */
|
||||
typedef struct _LOADER_MEMORY_MAPPING
|
||||
typedef struct _LOADER_MEMORY_DESCRIPTOR
|
||||
{
|
||||
LIST_ENTRY ListEntry;
|
||||
LOADER_MEMORY_TYPE MemoryType;
|
||||
ULONG BasePage;
|
||||
ULONG PageCount;
|
||||
} LOADER_MEMORY_MAPPING, *PLOADER_MEMORY_MAPPING;
|
||||
} LOADER_MEMORY_DESCRIPTOR, *PLOADER_MEMORY_DESCRIPTOR;
|
||||
|
||||
/* Loader provided information needed by the kernel to initialize */
|
||||
typedef struct _KERNEL_INITIALIZATION_BLOCK
|
||||
|
@ -244,7 +244,7 @@ typedef struct _LIST_ENTRY32 LIST_ENTRY32, *PLIST_ENTRY32;
|
||||
typedef struct _LIST_ENTRY64 LIST_ENTRY64, *PLIST_ENTRY64;
|
||||
typedef struct _LOADER_GRAPHICS_INFORMATION_BLOCK LOADER_GRAPHICS_INFORMATION_BLOCK, *PLOADER_GRAPHICS_INFORMATION_BLOCK;
|
||||
typedef struct _LOADER_INFORMATION_BLOCK LOADER_INFORMATION_BLOCK, *PLOADER_INFORMATION_BLOCK;
|
||||
typedef struct _LOADER_MEMORY_MAPPING LOADER_MEMORY_MAPPING, *PLOADER_MEMORY_MAPPING;
|
||||
typedef struct _LOADER_MEMORY_DESCRIPTOR LOADER_MEMORY_DESCRIPTOR, *PLOADER_MEMORY_DESCRIPTOR;
|
||||
typedef struct _M128 M128, *PM128;
|
||||
typedef struct _MMCOLOR_TABLES MMCOLOR_TABLES, *PMMCOLOR_TABLES;
|
||||
typedef struct _MMPFNENTRY MMPFNENTRY, *PMMPFNENTRY;
|
||||
|
@ -73,7 +73,7 @@ XtGetMemoryDescriptorList(IN PXTBL_PAGE_MAPPING PageMap,
|
||||
EFI_STATUS Status;
|
||||
ULONGLONG Pages;
|
||||
|
||||
Pages = (ULONGLONG)EFI_SIZE_TO_PAGES((PageMap->MapSize + 1) * sizeof(LOADER_MEMORY_MAPPING));
|
||||
Pages = (ULONGLONG)EFI_SIZE_TO_PAGES((PageMap->MapSize + 1) * sizeof(LOADER_MEMORY_DESCRIPTOR));
|
||||
|
||||
Status = XtLdrProtocol->Memory.AllocatePages(Pages, &Address);
|
||||
if(Status != STATUS_EFI_SUCCESS)
|
||||
@ -95,7 +95,7 @@ XtGetMemoryDescriptorList(IN PXTBL_PAGE_MAPPING PageMap,
|
||||
while(ListEntry != &PageMap->MemoryMap)
|
||||
{
|
||||
PXTBL_MEMORY_MAPPING MemoryMapping = CONTAIN_RECORD(ListEntry, XTBL_MEMORY_MAPPING, ListEntry);
|
||||
PLOADER_MEMORY_MAPPING MemoryDescriptor = (PLOADER_MEMORY_MAPPING)Address;
|
||||
PLOADER_MEMORY_DESCRIPTOR MemoryDescriptor = (PLOADER_MEMORY_DESCRIPTOR)Address;
|
||||
|
||||
MemoryDescriptor->MemoryType = MemoryMapping->MemoryType;
|
||||
MemoryDescriptor->BasePage = (UINT_PTR)MemoryMapping->PhysicalAddress / EFI_PAGE_SIZE;
|
||||
@ -103,7 +103,7 @@ XtGetMemoryDescriptorList(IN PXTBL_PAGE_MAPPING PageMap,
|
||||
|
||||
RtlInsertTailList(MemoryDescriptorList, &MemoryDescriptor->ListEntry);
|
||||
|
||||
Address = Address + sizeof(LOADER_MEMORY_MAPPING);
|
||||
Address = Address + sizeof(LOADER_MEMORY_DESCRIPTOR);
|
||||
ListEntry = ListEntry->Flink;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ EXTERN LIST_ENTRY KepSystemResourcesListHead;
|
||||
EXTERN KSPIN_LOCK KepSystemResourcesLock;
|
||||
|
||||
/* Biggest free memory descriptor */
|
||||
EXTERN PLOADER_MEMORY_MAPPING MmFreeDescriptor;
|
||||
EXTERN PLOADER_MEMORY_DESCRIPTOR MmFreeDescriptor;
|
||||
|
||||
/* Highest physical page number */
|
||||
EXTERN ULONG_PTR MmHighestPhysicalPage;
|
||||
@ -61,7 +61,7 @@ EXTERN ULONG_PTR MmLowestPhysicalPage;
|
||||
EXTERN ULONG MmNumberOfPhysicalPages;
|
||||
|
||||
/* Old biggest free memory descriptor */
|
||||
EXTERN LOADER_MEMORY_MAPPING MmOldFreeDescriptor;
|
||||
EXTERN LOADER_MEMORY_DESCRIPTOR MmOldFreeDescriptor;
|
||||
|
||||
/* Page Map Level */
|
||||
EXTERN ULONG MmPageMapLevel;
|
||||
@ -70,7 +70,7 @@ EXTERN ULONG MmPageMapLevel;
|
||||
EXTERN UCHAR MmProcessorStructuresData[MAXIMUM_PROCESSORS][KPROCESSOR_STRUCTURES_SIZE];
|
||||
|
||||
/* Allocation descriptors dedicated for HAL */
|
||||
EXTERN LOADER_MEMORY_MAPPING MmpHalAllocationDescriptors[MM_HAL_ALLOCATION_DESCRIPTORS];
|
||||
EXTERN LOADER_MEMORY_DESCRIPTOR MmpHalAllocationDescriptors[MM_HAL_ALLOCATION_DESCRIPTORS];
|
||||
|
||||
/* Live address of kernel HAL heap */
|
||||
EXTERN PVOID MmpHalHeapStart;
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
/* Biggest free memory descriptor */
|
||||
PLOADER_MEMORY_MAPPING MmFreeDescriptor;
|
||||
PLOADER_MEMORY_DESCRIPTOR MmFreeDescriptor;
|
||||
|
||||
/* Highest physical page number */
|
||||
ULONG_PTR MmHighestPhysicalPage;
|
||||
@ -22,7 +22,7 @@ ULONG_PTR MmLowestPhysicalPage = -1;
|
||||
ULONG MmNumberOfPhysicalPages;
|
||||
|
||||
/* Old biggest free memory descriptor */
|
||||
LOADER_MEMORY_MAPPING MmOldFreeDescriptor;
|
||||
LOADER_MEMORY_DESCRIPTOR MmOldFreeDescriptor;
|
||||
|
||||
/* Page Map Level */
|
||||
ULONG MmPageMapLevel;
|
||||
@ -31,7 +31,7 @@ ULONG MmPageMapLevel;
|
||||
UCHAR MmProcessorStructuresData[MAXIMUM_PROCESSORS][KPROCESSOR_STRUCTURES_SIZE] = {0};
|
||||
|
||||
/* Allocation descriptors dedicated for HAL */
|
||||
LOADER_MEMORY_MAPPING MmpHalAllocationDescriptors[MM_HAL_ALLOCATION_DESCRIPTORS];
|
||||
LOADER_MEMORY_DESCRIPTOR MmpHalAllocationDescriptors[MM_HAL_ALLOCATION_DESCRIPTORS];
|
||||
|
||||
/* Live address of kernel HAL heap */
|
||||
PVOID MmpHalHeapStart = MM_HAL_HEAP_START_ADDRESS;
|
||||
|
@ -31,7 +31,7 @@ MmAllocateHalMemory(IN PFN_NUMBER PageCount,
|
||||
IN BOOLEAN Aligned,
|
||||
OUT PULONG_PTR Buffer)
|
||||
{
|
||||
PLOADER_MEMORY_MAPPING Descriptor, ExtraDescriptor, HalDescriptor;
|
||||
PLOADER_MEMORY_DESCRIPTOR Descriptor, ExtraDescriptor, HalDescriptor;
|
||||
PFN_NUMBER Alignment, MaxPage;
|
||||
ULONGLONG PhysicalAddress;
|
||||
PLIST_ENTRY ListEntry;
|
||||
@ -53,7 +53,7 @@ MmAllocateHalMemory(IN PFN_NUMBER PageCount,
|
||||
ListEntry = KeInitializationBlock->MemoryDescriptorListHead.Flink;
|
||||
while(ListEntry != &KeInitializationBlock->MemoryDescriptorListHead)
|
||||
{
|
||||
Descriptor = CONTAIN_RECORD(ListEntry, LOADER_MEMORY_MAPPING, ListEntry);
|
||||
Descriptor = CONTAIN_RECORD(ListEntry, LOADER_MEMORY_DESCRIPTOR, ListEntry);
|
||||
|
||||
/* Align memory to 64KB if needed */
|
||||
Alignment = Aligned ? (((Descriptor->BasePage + 0x0F) & ~0x0F) - Descriptor->BasePage) : 0;
|
||||
|
@ -64,7 +64,7 @@ XTAPI
|
||||
VOID
|
||||
MmpScanMemoryDescriptors(VOID)
|
||||
{
|
||||
PLOADER_MEMORY_MAPPING MemoryDescriptor;
|
||||
PLOADER_MEMORY_DESCRIPTOR MemoryDescriptor;
|
||||
PLIST_ENTRY MemoryMappings;
|
||||
PFN_NUMBER FreePages;
|
||||
|
||||
@ -76,7 +76,7 @@ MmpScanMemoryDescriptors(VOID)
|
||||
while(MemoryMappings != &KeInitializationBlock->MemoryDescriptorListHead)
|
||||
{
|
||||
/* Get memory descriptor */
|
||||
MemoryDescriptor = CONTAIN_RECORD(MemoryMappings, LOADER_MEMORY_MAPPING, ListEntry);
|
||||
MemoryDescriptor = CONTAIN_RECORD(MemoryMappings, LOADER_MEMORY_DESCRIPTOR, ListEntry);
|
||||
|
||||
/* Check if memory type is invisible or cached */
|
||||
if(MmpVerifyMemoryTypeInvisible(MemoryDescriptor->MemoryType) ||
|
||||
@ -125,7 +125,7 @@ MmpScanMemoryDescriptors(VOID)
|
||||
}
|
||||
|
||||
/* Store original free descriptor */
|
||||
RtlCopyMemory(&MmOldFreeDescriptor, MmFreeDescriptor, sizeof(LOADER_MEMORY_MAPPING));
|
||||
RtlCopyMemory(&MmOldFreeDescriptor, MmFreeDescriptor, sizeof(LOADER_MEMORY_DESCRIPTOR));
|
||||
}
|
||||
|
||||
/** Checks whether the specified memory type should be considered as free.
|
||||
|
Loading…
Reference in New Issue
Block a user