UINTN RootTableEntryCount;\r
UINT64 *TranslationTable;\r
UINT64 *BlockEntry;\r
+ UINT64 *SubTableBlockEntry;\r
UINT64 BlockEntryAddress;\r
UINTN BaseAddressAlignment;\r
UINTN PageLevel;\r
}\r
TranslationTable = (UINT64*)((UINTN)TranslationTable & TT_ADDRESS_MASK_DESCRIPTION_TABLE);\r
\r
+ // Populate the newly created lower level table\r
+ SubTableBlockEntry = TranslationTable;\r
+ for (Index = 0; Index < TT_ENTRY_COUNT; Index++) {\r
+ *SubTableBlockEntry = Attributes | (BlockEntryAddress + (Index << TT_ADDRESS_OFFSET_AT_LEVEL(IndexLevel + 1)));\r
+ SubTableBlockEntry++;\r
+ }\r
+\r
// Fill the BlockEntry with the new TranslationTable\r
*BlockEntry = ((UINTN)TranslationTable & TT_ADDRESS_MASK_DESCRIPTION_TABLE) | TableAttributes | 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
\r
- // Populate the newly created lower level table\r
- BlockEntry = TranslationTable;\r
- for (Index = 0; Index < TT_ENTRY_COUNT; Index++) {\r
- *BlockEntry = Attributes | (BlockEntryAddress + (Index << TT_ADDRESS_OFFSET_AT_LEVEL(IndexLevel + 1)));\r
- BlockEntry++;\r
- }\r
// Block Entry points at the beginning of the Translation Table\r
BlockEntry = TranslationTable;\r
}\r