BlockEntry = TranslationTable;\r
}\r
} else {\r
- // Case of Invalid Entry and we are at a page level above of the one targetted.\r
if (IndexLevel != PageLevel) {\r
+ //\r
+ // Case when we have an Invalid Entry and we are at a page level above of the one targetted.\r
+ //\r
+\r
// Create a new translation table\r
TranslationTable = (UINT64*)AllocatePages (EFI_SIZE_TO_PAGES((TT_ENTRY_COUNT * sizeof(UINT64)) + TT_ALIGNMENT_DESCRIPTION_TABLE));\r
if (TranslationTable == NULL) {\r
*BlockEntry = ((UINTN)TranslationTable & TT_ADDRESS_MASK_DESCRIPTION_TABLE) | TT_TYPE_TABLE_ENTRY;\r
// Update the last block entry with the newly created translation table\r
*LastBlockEntry = TT_LAST_BLOCK_ADDRESS(TranslationTable, TT_ENTRY_COUNT);\r
+ } else {\r
+ //\r
+ // Case when the new region is part of an existing page table\r
+ //\r
+ *LastBlockEntry = TT_LAST_BLOCK_ADDRESS(TranslationTable, TT_ENTRY_COUNT);\r
}\r
}\r
}\r
UINT64 TCR;\r
RETURN_STATUS Status;\r
\r
- if(MemoryTable == NULL)\r
- {\r
+ if(MemoryTable == NULL) {\r
ASSERT (MemoryTable != NULL);\r
return RETURN_INVALID_PARAMETER;\r
}\r