]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmLib/Arm9/Arm9Lib.c
ArmPkg/Arm9Lib: Assert if memory region size is TT_DESCRIPTOR_SECTION_SIZE aligned
[mirror_edk2.git] / ArmPkg / Library / ArmLib / Arm9 / Arm9Lib.c
index 1bdc439258a78bfea3c8448a547934e34fc64bf3..6b698a3356d3ea49888b71d3fcacb2999211a269 100644 (file)
@@ -52,6 +52,9 @@ FillTranslationTable (
   Entry    = TRANSLATION_TABLE_ENTRY_FOR_VIRTUAL_ADDRESS(TranslationTable, MemoryRegion->VirtualBase);
   Sections = MemoryRegion->Length / TT_DESCRIPTOR_SECTION_SIZE;
   
+  // The current code does not support memory region size that is not aligned on TT_DESCRIPTOR_SECTION_SIZE boundary
+  ASSERT (MemoryRegion->Length % TT_DESCRIPTOR_SECTION_SIZE == 0);
+  
   for (Index = 0; Index < Sections; Index++)
   {
     *Entry++     =  TT_DESCRIPTOR_SECTION_BASE_ADDRESS(PhysicalBase) | Attributes;