]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT table
authorStar Zeng <star.zeng@intel.com>
Fri, 20 Apr 2018 07:13:32 +0000 (15:13 +0800)
committerStar Zeng <star.zeng@intel.com>
Wed, 25 Apr 2018 07:50:55 +0000 (15:50 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=933

We see UEFI spec is saying to use EfiBootServicesData for ESRT table.

UEFI 2.7 chapter 23.3:
The ESRT shall be stored in memory of type EfiBootServicesData.

And we see EsrtDxe is using AllocatePool for ESRT table, but
EsrtFmpDxe is using AllocateRuntimeZeroPool for ESRT table.

This patch updates code to use EfiBootServicesData for ESRT table
in EsrtFmpDxe.

Change-Id: I72a73e0cc0a37e429cc262d68eb284fb268cb5ef
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c

index 3da4a62fb1c404e07a1da7c5fb9e61a9f8c2763e..cc9dd63b53cd694fa1b2de496c0490a68169be30 100644 (file)
@@ -190,7 +190,7 @@ CreateEsrtEntry (
     }\r
 \r
     NewSize  = ((mTable->FwResourceCountMax + GROWTH_STEP) * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof (EFI_SYSTEM_RESOURCE_TABLE);\r
-    NewTable = AllocateRuntimeZeroPool (NewSize);\r
+    NewTable = AllocateZeroPool (NewSize);\r
     if (NewTable == NULL) {\r
       DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to allocate memory larger table for ESRT. \n"));\r
       return EFI_OUT_OF_RESOURCES;\r
@@ -439,7 +439,7 @@ EsrtFmpEntryPoint (
   //\r
   // Allocate Memory for table\r
   //\r
-  mTable = AllocateRuntimeZeroPool (\r
+  mTable = AllocateZeroPool (\r
              (GROWTH_STEP * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof (EFI_SYSTEM_RESOURCE_TABLE)\r
              );\r
   ASSERT (mTable != NULL);\r