mirror of https://github.com/acidanthera/audk.git
Fix two minor defects:
1. CoreGetMemoryMap() returns unclean data 2. Zero length memory descriptor might be added to the memory map git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4790 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
9521b669f8
commit
383c303c49
|
@ -2473,6 +2473,9 @@ Returns:
|
||||||
if (MemorySpaceMap[Index].ImageHandle == NULL) {
|
if (MemorySpaceMap[Index].ImageHandle == NULL) {
|
||||||
BaseAddress = PageAlignAddress (MemorySpaceMap[Index].BaseAddress);
|
BaseAddress = PageAlignAddress (MemorySpaceMap[Index].BaseAddress);
|
||||||
Length = PageAlignLength (MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length - BaseAddress);
|
Length = PageAlignLength (MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length - BaseAddress);
|
||||||
|
if (Length == 0 || MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length < BaseAddress) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
CoreAddMemoryDescriptor (
|
CoreAddMemoryDescriptor (
|
||||||
EfiConventionalMemory,
|
EfiConventionalMemory,
|
||||||
BaseAddress,
|
BaseAddress,
|
||||||
|
|
|
@ -1432,7 +1432,7 @@ Returns:
|
||||||
//
|
//
|
||||||
// Build the map
|
// Build the map
|
||||||
//
|
//
|
||||||
ZeroMem (MemoryMap, Size);
|
ZeroMem (MemoryMap, BufferSize);
|
||||||
for (Link = gMemoryMap.ForwardLink; Link != &gMemoryMap; Link = Link->ForwardLink) {
|
for (Link = gMemoryMap.ForwardLink; Link != &gMemoryMap; Link = Link->ForwardLink) {
|
||||||
Entry = CR (Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);
|
Entry = CR (Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);
|
||||||
ASSERT (Entry->VirtualStart == 0);
|
ASSERT (Entry->VirtualStart == 0);
|
||||||
|
|
Loading…
Reference in New Issue