Store number of mappings when mapping virtual memory
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 34s
Builds / ExectOS (i686) (push) Successful in 29s

This commit is contained in:
Rafal Kupiec 2024-01-28 17:01:44 +01:00
parent 2e12d30aa4
commit 670a812649
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 4 additions and 1 deletions

View File

@ -189,6 +189,7 @@ typedef struct _XTBL_MODULE_INFO
typedef struct _XTBL_PAGE_MAPPING
{
LIST_ENTRY MemoryMap;
ULONG MapSize;
PVOID PtePointer;
SHORT PageMapLevel;
PAGE_SIZE PageSize;

View File

@ -178,6 +178,7 @@ BlInitializePageMap(OUT PXTBL_PAGE_MAPPING PageMap,
{
/* Initialize memory mappings */
RtlInitializeListHead(&PageMap->MemoryMap);
PageMap->MapSize = 0;
/* Set page map size/level and memory map address */
PageMap->PageMapLevel = PageMapLevel;
@ -457,8 +458,9 @@ BlMapVirtualMemory(IN OUT PXTBL_PAGE_MAPPING PageMap,
ListEntry = ListEntry->Flink;
}
/* Insert new mapping to the list */
/* Insert new mapping to the list and increase page map size */
RtlInsertTailList(&PageMap->MemoryMap, &Mapping1->ListEntry);
PageMap->MapSize++;
/* Return success */
return STATUS_EFI_SUCCESS;