[smbios] Add support for the 64-bit SMBIOS3 entry point

Support UEFI systems that provide only 64-bit versions of the SMBIOS
entry point.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2020-12-29 14:37:54 +00:00
parent 485f8ce554
commit dced22d6de
3 changed files with 82 additions and 22 deletions

View File

@@ -130,8 +130,8 @@ int find_smbios_structure ( unsigned int type, unsigned int instance,
assert ( smbios.address != UNULL );
/* Scan through list of structures */
while ( ( ( offset + sizeof ( structure->header ) ) < smbios.len )
&& ( count < smbios.count ) ) {
while ( ( ( offset + sizeof ( structure->header ) ) < smbios.len ) &&
( ( smbios.count == 0 ) || ( count < smbios.count ) ) ) {
/* Read next SMBIOS structure header */
copy_from_user ( &structure->header, smbios.address, offset,
@@ -157,6 +157,11 @@ int find_smbios_structure ( unsigned int type, unsigned int instance,
"strings length %zx\n", offset, structure->header.type,
structure->header.len, structure->strings_len );
/* Stop if we have reached an end-of-table marker */
if ( ( smbios.count == 0 ) &&
( structure->header.type == SMBIOS_TYPE_END ) )
break;
/* If this is the structure we want, return */
if ( ( structure->header.type == type ) &&
( instance-- == 0 ) ) {