mirror of
https://github.com/ipxe/ipxe
synced 2026-04-16 03:00:10 +03:00
[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:
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user