summaryrefslogtreecommitdiffstats
path: root/src/interface/smbios/smbios.c
diff options
context:
space:
mode:
authorMichael Brown2020-12-29 15:37:54 +0100
committerMichael Brown2020-12-29 15:41:50 +0100
commitdced22d6dee346ac4d98502c9008fd3d5c6197d2 (patch)
tree6d01b40c5cafc6b1a9962b097ec54d439c8807ad /src/interface/smbios/smbios.c
parent[efi] Allow for longer device paths in debug messages (diff)
downloadipxe-dced22d6dee346ac4d98502c9008fd3d5c6197d2.tar.gz
ipxe-dced22d6dee346ac4d98502c9008fd3d5c6197d2.tar.xz
ipxe-dced22d6dee346ac4d98502c9008fd3d5c6197d2.zip
[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>
Diffstat (limited to 'src/interface/smbios/smbios.c')
-rw-r--r--src/interface/smbios/smbios.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/interface/smbios/smbios.c b/src/interface/smbios/smbios.c
index 1dcf819c2..5bd76f16a 100644
--- a/src/interface/smbios/smbios.c
+++ b/src/interface/smbios/smbios.c
@@ -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 ) ) {