From: Udit Kumar <udit.ku...@nxp.com>

While creating Hob list, ArmPlatformPkg is hiding UEFI memory.
whereas this memory can be used by OS.

This patch, allows OS to use UEFI code area.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggar...@nxp.com>
Signed-off-by: Udit Kumar <udit.ku...@nxp.com>
---
 ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c | 28 ++++++++++++-------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c 
b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
index 2feb11f..ae6ebc4 100644
--- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
+++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
@@ -147,24 +147,24 @@ MemoryPeim (
         if (PcdGet64 (PcdFdBaseAddress) == 
NextHob.ResourceDescriptor->PhysicalStart) {
           if (SystemMemoryTop == FdTop) {
             NextHob.ResourceDescriptor->ResourceAttribute = ResourceAttributes 
& ~EFI_RESOURCE_ATTRIBUTE_PRESENT;
-          } else {
-            // Create the System Memory HOB for the firmware with the 
non-present attribute
-            BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
-                                        ResourceAttributes & 
~EFI_RESOURCE_ATTRIBUTE_PRESENT,
-                                        PcdGet64 (PcdFdBaseAddress),
-                                        PcdGet32 (PcdFdSize));
-
+          } else {
+            // Create the System Memory HOB for the firmware with the 
non-present attribute
+            BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
+                                        ResourceAttributes,
+                                        PcdGet64 (PcdFdBaseAddress),
+                                        PcdGet32 (PcdFdSize));
+
             // Top of the FD is system memory available for UEFI
             NextHob.ResourceDescriptor->PhysicalStart += PcdGet32(PcdFdSize);
             NextHob.ResourceDescriptor->ResourceLength -= PcdGet32(PcdFdSize);
           }
-        } else {
-          // Create the System Memory HOB for the firmware with the 
non-present attribute
-          BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
-                                      ResourceAttributes & 
~EFI_RESOURCE_ATTRIBUTE_PRESENT,
-                                      PcdGet64 (PcdFdBaseAddress),
-                                      PcdGet32 (PcdFdSize));
-
+        } else {
+          // Create the System Memory HOB for the firmware with the 
non-present attribute
+          BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
+                                      ResourceAttributes,
+                                      PcdGet64 (PcdFdBaseAddress),
+                                      PcdGet32 (PcdFdSize));
+
           // Update the HOB
           NextHob.ResourceDescriptor->ResourceLength = PcdGet64 
(PcdFdBaseAddress) - NextHob.ResourceDescriptor->PhysicalStart;
 
-- 
1.9.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to