Fix a bug in the DXE Core that generates an ASSERT() when the page at address zero is freed and DEBUG_CLEAR_MEMORY() macros are enabled.  If DEBUG_CLEAR_MEMORY() is enabled and the page at address 0 is freed, then DEBUG_CLEAR_MEMORY() is invoked skipping over the first 4K page.

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
Guarantee that free memory in the 4K page starting at address 0 is always cleared to 0.  The algorithm is to clear page zero if it is registered with the DXE Core with type EfiConventionalMemory, and to also clear page zero if it is freed using the UEFI Boot Service FreePages().  This patch improves OS compatibility for OSes that may evaluate page 0 for legacy data structures.  Before this patch, free memory may contain random values which induces random boot failures for some OSes.  This patch may also help find NULL pointer bugs sooner because all of the fields in a data structure dereferenced through NULL will also be NULL now.

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@14218 6f19259b-4bc3-4df7-8a09-765794883524