diff options
| author | Michael Brown | 2025-04-23 10:53:38 +0200 |
|---|---|---|
| committer | Michael Brown | 2025-04-23 11:08:16 +0200 |
| commit | 0bf0f8716a3c7f85455707d8c2d727d130ee1024 (patch) | |
| tree | 2e0df1ce4cd78c980c03013b3a6528998809cf10 /src/interface/linux | |
| parent | [acpi] Remove userptr_t from ACPI table parsing (diff) | |
| download | ipxe-0bf0f8716a3c7f85455707d8c2d727d130ee1024.tar.gz ipxe-0bf0f8716a3c7f85455707d8c2d727d130ee1024.tar.xz ipxe-0bf0f8716a3c7f85455707d8c2d727d130ee1024.zip | |
[smbios] Remove userptr_t from SMBIOS structure parsing
Simplify the SMBIOS structure parsing code by assuming that all
structure content is fully accessible via pointer dereferences.
In particular, this allows the convoluted find_smbios_structure() and
read_smbios_structure() to be combined into a single function
smbios_structure() that just returns a direct pointer to the SMBIOS
structure, with smbios_string() similarly now returning a direct
pointer to the relevant string.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/linux')
| -rw-r--r-- | src/interface/linux/linux_smbios.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/interface/linux/linux_smbios.c b/src/interface/linux/linux_smbios.c index abe1b19d7..a12c936ed 100644 --- a/src/interface/linux/linux_smbios.c +++ b/src/interface/linux/linux_smbios.c @@ -35,7 +35,7 @@ static const char smbios_entry_filename[] = static const char smbios_filename[] = "/sys/firmware/dmi/tables/DMI"; /** Cache SMBIOS data */ -static userptr_t smbios_data; +static void *smbios_data; /** * Find SMBIOS @@ -46,7 +46,7 @@ static userptr_t smbios_data; static int linux_find_smbios ( struct smbios *smbios ) { struct smbios3_entry *smbios3_entry; struct smbios_entry *smbios_entry; - userptr_t entry; + void *entry; void *data; int len; int rc; @@ -98,6 +98,7 @@ static int linux_find_smbios ( struct smbios *smbios ) { return 0; ufree ( smbios_data ); + smbios_data = NULL; err_read: err_version: ufree ( entry ); @@ -116,6 +117,7 @@ static void linux_smbios_shutdown ( int booting __unused ) { /* Free SMBIOS data */ ufree ( smbios_data ); + smbios_data = NULL; } /** SMBIOS shutdown function */ |
