Revision: 16517
          http://sourceforge.net/p/edk2/code/16517
Author:   oliviermartin
Date:     2014-12-12 19:15:37 +0000 (Fri, 12 Dec 2014)
Log Message:
-----------
ArmPkg/BdsLib: Update the size of the Device Tree before booting Linux

The memory reserved to load the device tree is over-allocated when
UEFI loads the blob to update the device tree with additional
information such as the command line, the initrd, etc.

This change ensures the total size declared by the device tree matches
the actual data (and not the over-allocated size value).

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

Modified Paths:
--------------
    trunk/edk2/ArmPkg/Library/BdsLib/BdsLinuxFdt.c

Modified: trunk/edk2/ArmPkg/Library/BdsLib/BdsLinuxFdt.c
===================================================================
--- trunk/edk2/ArmPkg/Library/BdsLib/BdsLinuxFdt.c      2014-12-12 19:14:22 UTC 
(rev 16516)
+++ trunk/edk2/ArmPkg/Library/BdsLib/BdsLinuxFdt.c      2014-12-12 19:15:37 UTC 
(rev 16517)
@@ -554,6 +554,9 @@
   // If we succeeded to generate the new Device Tree then free the old Device 
Tree
   gBS->FreePages (*FdtBlobBase, EFI_SIZE_TO_PAGES (*FdtBlobSize));
 
+  // Update the real size of the Device Tree
+  fdt_pack ((VOID*)(UINTN)(NewFdtBlobBase));
+
   *FdtBlobBase = NewFdtBlobBase;
   *FdtBlobSize = (UINTN)fdt_totalsize ((VOID*)(UINTN)(NewFdtBlobBase));
   return EFI_SUCCESS;


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to