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
/** @file\r
UEFI Memory page management functions.\r
\r
/** @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
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
//\r
CoreAddRange (NewType, Start, RangeEnd, Attribute);\r
if (NewType == EfiConventionalMemory) {\r
//\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