diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-12-10 15:17:16 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-12-18 11:39:13 -0500 |
commit | 831f1463aaf1eb27265c18ce81d312f9029c8c99 (patch) | |
tree | 5f4a2b71241cc977457fdc447019dd7179e75948 | |
parent | dd54ccda8e59c046c8e9bc34c6cbd51b317ed83e (diff) | |
download | seabios-831f1463aaf1eb27265c18ce81d312f9029c8c99.tar.gz |
smbios: smbios_major_version()/smbios_minor_version() helpers
They new helpers will be useful when we start supporting SMBIOS
3.0 entry points. Use the new helpers at display_uuid().
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r-- | src/fw/biostables.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/fw/biostables.c b/src/fw/biostables.c index d22ab643..10eaa369 100644 --- a/src/fw/biostables.c +++ b/src/fw/biostables.c @@ -324,6 +324,24 @@ void *smbios_get_tables(u32 *length) return NULL; } +static int +smbios_major_version(void) +{ + if (SMBios21Addr) + return SMBios21Addr->smbios_major_version; + else + return 0; +} + +static int +smbios_minor_version(void) +{ + if (SMBios21Addr) + return SMBios21Addr->smbios_minor_version; + else + return 0; +} + void display_uuid(void) { @@ -344,9 +362,9 @@ display_uuid(void) * the encoding, but we follow dmidecode and assume big-endian * encoding. */ - if (SMBios21Addr->smbios_major_version > 2 || - (SMBios21Addr->smbios_major_version == 2 && - SMBios21Addr->smbios_minor_version >= 6)) { + if (smbios_major_version() > 2 || + (smbios_major_version() == 2 && + smbios_minor_version() >= 6)) { printf("Machine UUID" " %02x%02x%02x%02x" "-%02x%02x" |