mirror of
https://github.com/ipxe/ipxe
synced 2025-12-22 13:00:39 +03:00
[smbios] Provide SMBIOS version number via smbios_version()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -55,6 +55,8 @@ static int efi_find_smbios ( struct smbios *smbios ) {
|
||||
smbios->address = phys_to_user ( smbios_entry->smbios_address );
|
||||
smbios->len = smbios_entry->smbios_len;
|
||||
smbios->count = smbios_entry->smbios_count;
|
||||
smbios->version =
|
||||
SMBIOS_VERSION ( smbios_entry->major, smbios_entry->minor );
|
||||
DBG ( "Found SMBIOS v%d.%d entry point at %p (%x+%zx)\n",
|
||||
smbios_entry->major, smbios_entry->minor, smbios_entry,
|
||||
smbios_entry->smbios_address, smbios->len );
|
||||
|
||||
@@ -179,3 +179,20 @@ int read_smbios_string ( struct smbios_structure *structure,
|
||||
DBG ( "SMBIOS string index %d not found\n", index );
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SMBIOS version
|
||||
*
|
||||
* @ret version Version, or negative error
|
||||
*/
|
||||
int smbios_version ( void ) {
|
||||
int rc;
|
||||
|
||||
/* Find SMBIOS */
|
||||
if ( ( smbios.address == UNULL ) &&
|
||||
( ( rc = find_smbios ( &smbios ) ) != 0 ) )
|
||||
return rc;
|
||||
assert ( smbios.address != UNULL );
|
||||
|
||||
return smbios.version;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user