]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix a bug in the DXE Core that generates an ASSERT() when the page at address zero...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 22 Mar 2013 21:18:02 +0000 (21:18 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 22 Mar 2013 21:18:02 +0000 (21:18 +0000)
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14217 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/Mem/Page.c

index 6d5a259eb669dc7a462e0c217ecd28ba6325d07e..8a6d35d6e45dcd0501163d0c62975244968556d2 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Memory page management functions.\r
 \r
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -834,7 +834,18 @@ CoreConvertPages (
     //\r
     CoreAddRange (NewType, Start, RangeEnd, Attribute);\r
     if (NewType == EfiConventionalMemory) {\r
-      DEBUG_CLEAR_MEMORY ((VOID *)(UINTN) Start, (UINTN) (RangeEnd - Start + 1));\r
+      //\r
+      // Avoid calling DEBUG_CLEAR_MEMORY() for an address of 0 because this\r
+      // macro will ASSERT() if address is 0.  Instead, CoreAddRange() guarantees\r
+      // that the page starting at address 0 is always filled with zeros.\r
+      //\r
+      if (Start == 0) {\r
+        if (RangeEnd > EFI_PAGE_SIZE) {\r
+          DEBUG_CLEAR_MEMORY ((VOID *)(UINTN) EFI_PAGE_SIZE, (UINTN) (RangeEnd - EFI_PAGE_SIZE + 1));\r
+        }\r
+      } else {\r
+        DEBUG_CLEAR_MEMORY ((VOID *)(UINTN) Start, (UINTN) (RangeEnd - Start + 1));\r
+      }\r
     }\r
 \r
     //\r