OvmfPkg/Xen: export AcpiTable installation into AcpiPlatformLib
This makes the function reuseable by bhyve. Signed-off-by: Corvin Köhne <corvink@FreeBSD.org> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
f211292711
commit
1288c5415c
@ -7,10 +7,15 @@
|
||||
|
||||
**/
|
||||
|
||||
#include <Library/XenPlatformLib.h> // XenDetected()
|
||||
#include <Library/AcpiPlatformLib.h> // InstallAcpiTablesFromMemory()
|
||||
#include <Library/DebugLib.h> // DEBUG()
|
||||
#include <Library/XenPlatformLib.h> // XenDetected()
|
||||
|
||||
#include "AcpiPlatform.h"
|
||||
|
||||
#define XEN_ACPI_PHYSICAL_ADDRESS 0x000EA020
|
||||
#define XEN_BIOS_PHYSICAL_END 0x000FFFFF
|
||||
|
||||
/**
|
||||
Effective entrypoint of Acpi Platform driver.
|
||||
|
||||
@ -28,10 +33,46 @@ InstallAcpiTables (
|
||||
IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *RsdpStructurePtr;
|
||||
EFI_XEN_INFO *XenInfo;
|
||||
EFI_STATUS Status;
|
||||
|
||||
if (XenDetected ()) {
|
||||
Status = InstallXenTables (AcpiTable);
|
||||
//
|
||||
// Detect the RSDP structure
|
||||
//
|
||||
|
||||
//
|
||||
// First look for PVH one
|
||||
//
|
||||
XenInfo = XenGetInfoHOB ();
|
||||
ASSERT (XenInfo != NULL);
|
||||
if (XenInfo->RsdpPvh != NULL) {
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a: Use ACPI RSDP table at 0x%p\n",
|
||||
gEfiCallerBaseName,
|
||||
XenInfo->RsdpPvh
|
||||
));
|
||||
RsdpStructurePtr = XenInfo->RsdpPvh;
|
||||
} else {
|
||||
//
|
||||
// Otherwise, look for the HVM one
|
||||
//
|
||||
Status = GetAcpiRsdpFromMemory (
|
||||
XEN_ACPI_PHYSICAL_ADDRESS,
|
||||
XEN_BIOS_PHYSICAL_END,
|
||||
&RsdpStructurePtr
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
Status = InstallAcpiTablesFromRsdp (
|
||||
AcpiTable,
|
||||
RsdpStructurePtr
|
||||
);
|
||||
} else {
|
||||
Status = EFI_UNSUPPORTED;
|
||||
}
|
||||
|
Reference in New Issue
Block a user