[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

View File

@@ -32,6 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
/* Forcibly enable assertions */
#undef NDEBUG
#include <string.h>
#include <ipxe/acpi.h>
#include <ipxe/acpimac.h>
#include <ipxe/if_ether.h>
@@ -185,26 +186,27 @@ static struct acpi_test_tables *acpi_test_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 acpi_test_find ( uint32_t signature, unsigned int index ) {
static const struct acpi_header * acpi_test_find ( uint32_t signature,
unsigned int index ) {
struct acpi_test_table *table;
unsigned int i;
/* Fail if no test tables are installed */
if ( ! acpi_test_tables )
return UNULL;
return NULL;
/* Scan through test tables */
for ( i = 0 ; i < acpi_test_tables->count ; i++ ) {
table = acpi_test_tables->table[i];
if ( ( signature == le32_to_cpu ( table->signature.raw ) ) &&
( index-- == 0 ) ) {
return virt_to_user ( table->data );
return table->data;
}
}
return UNULL;
return NULL;
}
/** Override ACPI table finder */