summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-12-10 15:08:34 -0500
committerKevin O'Connor <kevin@koconnor.net>2021-12-18 11:39:12 -0500
commitdd54ccda8e59c046c8e9bc34c6cbd51b317ed83e (patch)
tree3ee325b488fa3b3a9033d73fb28f1672f764351e
parentb251b21b2bb39e819321d89f48d14cb0559a0036 (diff)
downloadqemu-seabios-dd54ccda8e59c046c8e9bc34c6cbd51b317ed83e.tar.gz
smbios: Use smbios_get_tables()/smbios_next() at display_uuid()
Make the code more generic, and not specific for SMBIOS 2.1 entry points. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--src/fw/biostables.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fw/biostables.c b/src/fw/biostables.c
index 1adc694..d22ab64 100644
--- a/src/fw/biostables.c
+++ b/src/fw/biostables.c
@@ -327,9 +327,11 @@ void *smbios_get_tables(u32 *length)
void
display_uuid(void)
{
- struct smbios_type_1 *tbl = smbios_21_next(SMBios21Addr, NULL);
+ u32 smbios_len = 0;
+ void *smbios_tables = smbios_get_tables(&smbios_len);
+ struct smbios_type_1 *tbl = smbios_next(smbios_tables, smbios_len, NULL);
int minlen = offsetof(struct smbios_type_1, uuid) + sizeof(tbl->uuid);
- for (; tbl; tbl = smbios_21_next(SMBios21Addr, tbl))
+ for (; tbl; tbl = smbios_next(smbios_tables, smbios_len, tbl))
if (tbl->header.type == 1 && tbl->header.length >= minlen) {
u8 *uuid = tbl->uuid;
u8 empty_uuid[sizeof(tbl->uuid)] = { 0 };