OvmfPkg/Xen: export search of RSDP into a library function

Xen and bhyve are placing ACPI tables into system memory. So, they can
share the same code. Therefore, create a new library which searches and
installs ACPI tables from system memory.

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:
Corvin Köhne
2023-06-06 11:21:37 +02:00
committed by mergify[bot]
parent c1dd400a13
commit f211292711
7 changed files with 152 additions and 90 deletions

View File

@@ -0,0 +1,24 @@
/** @file
Copyright (c) 2023, Corvin Köhne <corvink@FreeBSD.org>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
/**
Searches and returns the address of the ACPI Root System Description Pointer (RSDP) in system memory.
@param StartAddress Start address of search range.
@param EndAddress End address of search range.
@param RsdpPtr Return pointer to RSDP.
@retval EFI_SUCCESS RSDP successfully found.
@retval EFI_NOT_FOUND Couldn't find RSDP.
@retval EFI_ABORTED Invalid RSDP found.
**/
EFI_STATUS
EFIAPI
GetAcpiRsdpFromMemory (
IN UINT64 StartAddress,
IN UINT64 EndAddress,
OUT EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER **RsdpPtr
);