[acpi] Allow for platforms that provide ACPI tables individually

The ACPI API currently expects platforms to provide access to a single
contiguous ACPI table.  Some platforms (e.g. Linux userspace) do not
provide a convenient way to obtain the entire ACPI table, but do
provide access to individual tables.

All iPXE consumers of the ACPI API require access only to individual
tables.

Redefine the internal API to make acpi_find() an API method, with all
existing implementations delegating to the current RSDT-based
implementation.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2021-03-01 00:08:23 +00:00
parent d175936b78
commit 9776f6ece1
8 changed files with 46 additions and 6 deletions

View File

@@ -83,13 +83,13 @@ void acpi_fix_checksum ( struct acpi_header *acpi ) {
}
/**
* Locate ACPI table
* Locate ACPI table via RSDT
*
* @v signature Requested table signature
* @v index Requested index of table with this signature
* @ret table Table, or UNULL if not found
*/
userptr_t acpi_find ( uint32_t signature, unsigned int index ) {
userptr_t acpi_find_via_rsdt ( uint32_t signature, unsigned int index ) {
struct acpi_header acpi;
struct acpi_rsdt *rsdtab;
typeof ( rsdtab->entry[0] ) entry;

View File

@@ -1,3 +1,3 @@
#include <ipxe/acpi.h>
PROVIDE_ACPI_INLINE ( null, acpi_find_rsdt );
PROVIDE_ACPI_INLINE ( null, acpi_find );