mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 10:11:42 +00:00
[FREELDR] Discard empty entries in PcMemGetBiosMemoryMap. CORE-13332
Improve a TRACE() from f588de2e79
.
This commit is contained in:
parent
78e5caaec2
commit
9b1e056e8f
1 changed files with 15 additions and 1 deletions
|
@ -286,6 +286,13 @@ PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSi
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Regs.x.ecx == 0)
|
||||||
|
{
|
||||||
|
TRACE("Discard empty entry. (would-be-PcBiosMapCount = %lu)\n",
|
||||||
|
PcBiosMapCount);
|
||||||
|
goto nextRange;
|
||||||
|
}
|
||||||
|
|
||||||
/* Copy data to global buffer */
|
/* Copy data to global buffer */
|
||||||
RtlCopyMemory(&PcBiosMemoryMap[PcBiosMapCount], (PVOID)BIOSCALLBUFFER, Regs.x.ecx);
|
RtlCopyMemory(&PcBiosMemoryMap[PcBiosMapCount], (PVOID)BIOSCALLBUFFER, Regs.x.ecx);
|
||||||
|
|
||||||
|
@ -295,6 +302,13 @@ PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSi
|
||||||
TRACE("Reserved: 0x%lx\n", PcBiosMemoryMap[PcBiosMapCount].Reserved);
|
TRACE("Reserved: 0x%lx\n", PcBiosMemoryMap[PcBiosMapCount].Reserved);
|
||||||
TRACE("\n");
|
TRACE("\n");
|
||||||
|
|
||||||
|
if (PcBiosMemoryMap[PcBiosMapCount].Length == 0)
|
||||||
|
{
|
||||||
|
TRACE("Discard empty range. (would-be-PcBiosMapCount = %lu, BaseAddress = %lu, Length = 0)\n",
|
||||||
|
PcBiosMapCount, PcBiosMemoryMap[PcBiosMapCount].BaseAddress);
|
||||||
|
goto nextRange;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check if this is free memory */
|
/* Check if this is free memory */
|
||||||
if (PcBiosMemoryMap[PcBiosMapCount].Type == BiosMemoryUsable)
|
if (PcBiosMemoryMap[PcBiosMapCount].Type == BiosMemoryUsable)
|
||||||
{
|
{
|
||||||
|
@ -314,7 +328,7 @@ PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSi
|
||||||
if (EndAddress <= RealBaseAddress)
|
if (EndAddress <= RealBaseAddress)
|
||||||
{
|
{
|
||||||
/* This doesn't span any page, so continue with next range */
|
/* This doesn't span any page, so continue with next range */
|
||||||
TRACE("Skipping aligned range < PAGE_SIZE. (PcBiosMapCount = %lu, BaseAddress = %lu, Length = %lu)\n",
|
TRACE("Skipping aligned range < PAGE_SIZE. (would-be-PcBiosMapCount = %lu, BaseAddress = %lu, Length = %lu)\n",
|
||||||
PcBiosMapCount,
|
PcBiosMapCount,
|
||||||
PcBiosMemoryMap[PcBiosMapCount].BaseAddress,
|
PcBiosMemoryMap[PcBiosMapCount].BaseAddress,
|
||||||
PcBiosMemoryMap[PcBiosMapCount].Length);
|
PcBiosMemoryMap[PcBiosMapCount].Length);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue