Revision: 14675
          http://sourceforge.net/p/edk2/code/14675
Author:   oliviermartin
Date:     2013-09-16 09:29:52 +0000 (Mon, 16 Sep 2013)
Log Message:
-----------
ArmPlatformPkg/MemoryInitPei: AARCH64 fix memory address calculations

At least for AARCH64 currently, SystemMemoryTop and FdTop can overflow
while adding the 32-bit PCDs together.  The resulting value loses the
upper 32-bits.  Cast each of the values to EFI_PHYSICAL_ADDRESS size
before doing the addition to prevent erroneous overflow.  There is currently
no 32-bit platform in EDKII open source that will overflow and this change
would not fix that problem anyway.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Garrett Kirkendall <[email protected]>
Reviewed-by: Olivier Martin <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c

Modified: trunk/edk2/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
===================================================================
--- trunk/edk2/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c  2013-09-16 
08:42:59 UTC (rev 14674)
+++ trunk/edk2/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c  2013-09-16 
09:29:52 UTC (rev 14675)
@@ -101,8 +101,8 @@
       PcdGet32 (PcdSystemMemorySize)
   );
 
-  SystemMemoryTop = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 
(PcdSystemMemorySize);
-  FdTop = PcdGet32(PcdFdBaseAddress) + PcdGet32(PcdFdSize);
+  SystemMemoryTop = (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdSystemMemoryBase) + 
(EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdSystemMemorySize);
+  FdTop = (EFI_PHYSICAL_ADDRESS)PcdGet32(PcdFdBaseAddress) + 
(EFI_PHYSICAL_ADDRESS)PcdGet32(PcdFdSize);
 
   // EDK2 does not have the concept of boot firmware copied into DRAM. To 
avoid the DXE
   // core to overwrite this area we must mark the region with the attribute 
non-present

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to