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>
This commit is contained in:
parent
dd54ccda8e
commit
831f1463aa
|
@ -324,6 +324,24 @@ void *smbios_get_tables(u32 *length)
|
||||||
return NULL;
|
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
|
void
|
||||||
display_uuid(void)
|
display_uuid(void)
|
||||||
{
|
{
|
||||||
|
@ -344,9 +362,9 @@ display_uuid(void)
|
||||||
* the encoding, but we follow dmidecode and assume big-endian
|
* the encoding, but we follow dmidecode and assume big-endian
|
||||||
* encoding.
|
* encoding.
|
||||||
*/
|
*/
|
||||||
if (SMBios21Addr->smbios_major_version > 2 ||
|
if (smbios_major_version() > 2 ||
|
||||||
(SMBios21Addr->smbios_major_version == 2 &&
|
(smbios_major_version() == 2 &&
|
||||||
SMBios21Addr->smbios_minor_version >= 6)) {
|
smbios_minor_version() >= 6)) {
|
||||||
printf("Machine UUID"
|
printf("Machine UUID"
|
||||||
" %02x%02x%02x%02x"
|
" %02x%02x%02x%02x"
|
||||||
"-%02x%02x"
|
"-%02x%02x"
|
||||||
|
|
Loading…
Reference in New Issue