[acpi] Remove userptr_t from ACPI table parsing

Simplify the ACPI table parsing code by assuming that all table
content is fully accessible via pointer dereferences.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-04-22 14:13:45 +01:00
parent c059b34170
commit 0b3fc48fef
14 changed files with 152 additions and 162 deletions
+4 -3
View File
@@ -31,6 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*/
#include <ipxe/acpi.h>
#include <ipxe/uaccess.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/Guid/Acpi.h>
#include <ipxe/efi/efi_acpi.h>
@@ -42,15 +43,15 @@ EFI_USE_TABLE ( ACPI_10_TABLE, &rsdp, 0 );
/**
* Locate ACPI root system description table
*
* @ret rsdt ACPI root system description table, or UNULL
* @ret rsdt ACPI root system description table, or NULL
*/
static userptr_t efi_find_rsdt ( void ) {
static const struct acpi_rsdt * efi_find_rsdt ( void ) {
/* Locate RSDT via ACPI configuration table, if available */
if ( rsdp )
return phys_to_virt ( rsdp->RsdtAddress );
return UNULL;
return NULL;
}
PROVIDE_ACPI ( efi, acpi_find_rsdt, efi_find_rsdt );
+5 -4
View File
@@ -42,7 +42,7 @@ struct linux_acpi_table {
/** Index */
unsigned int index;
/** Cached data */
userptr_t data;
void *data;
};
/** List of cached ACPI tables */
@@ -53,9 +53,10 @@ static LIST_HEAD ( linux_acpi_tables );
*
* @v signature Requested table signature
* @v index Requested index of table with this signature
* @ret table Table, or UNULL if not found
* @ret table Table, or NULL if not found
*/
static userptr_t linux_acpi_find ( uint32_t signature, unsigned int index ) {
static const struct acpi_header * linux_acpi_find ( uint32_t signature,
unsigned int index ) {
struct linux_acpi_table *table;
struct acpi_header *header;
union {
@@ -121,7 +122,7 @@ static userptr_t linux_acpi_find ( uint32_t signature, unsigned int index ) {
err_read:
free ( table );
err_alloc:
return UNULL;
return NULL;
}
/**