]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg/PlatformInitLib: Add PlatformScanE820 and GetFirstNonAddressCB
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 17 Jan 2023 12:16:25 +0000 (13:16 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 17 Jan 2023 16:36:59 +0000 (16:36 +0000)
commite0375304682683f6e5c466fba948619bc6e6f377
treefd361b520084b9267bcdbc688c86c5cc4469ef2f
parenta107ad0f623669c72997443dc0431eeb732f81a0
OvmfPkg/PlatformInitLib: Add PlatformScanE820 and GetFirstNonAddressCB

First step replacing the PlatformScanOrAdd64BitE820Ram() function.

Add a PlatformScanE820() function which loops over the e280 entries
from FwCfg and calls a callback for each of them.

Add a GetFirstNonAddressCB() function which will store the first free
address (right after the last RAM block) in
PlatformInfoHob->FirstNonAddress.  This replaces calls to
PlatformScanOrAdd64BitE820Ram() with non-NULL MaxAddress.

Write any actions done (setting FirstNonAddress) to the firmware log
with INFO loglevel.

Also drop local FirstNonAddress variables and use
PlatformInfoHob->FirstNonAddress instead everywhere.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/Library/PlatformInitLib/MemDetect.c