mirror of
https://github.com/ipxe/ipxe
synced 2025-12-31 15:25:23 +03:00
[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:
@@ -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 ) ) {
|
||||
|
||||
Reference in New Issue
Block a user