summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-12-10 12:32:37 -0500
committerKevin O'Connor <kevin@koconnor.net>2021-12-18 11:39:13 -0500
commit34c3fce6e7361c2e38f22a3d973d72b994285313 (patch)
tree3ddfb3bca4e348d205350a0db63698cc2f82e3a3
parent33fa7082b870c387e839eb8b5a29738442a991ae (diff)
downloadqemu-seabios-34c3fce6e7361c2e38f22a3d973d72b994285313.tar.gz
smbios: Use smbios_next() at smbios_romfile_setup()
Use smbios_next() instead of smbios_21_next(), to make the code more generic and reusable for SMBIOS 3.0 support. Note that `qtables_len` is initialized to `ftables->size` instead of `ep.structure_table_length` now, but both fields are guaranteed to have exactly the same value. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--src/fw/biostables.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/fw/biostables.c b/src/fw/biostables.c
index 47463be..11eaeae 100644
--- a/src/fw/biostables.c
+++ b/src/fw/biostables.c
@@ -477,16 +477,17 @@ smbios_romfile_setup(void)
return 0;
}
f_tables->copy(f_tables, qtables, f_tables->size);
- ep.structure_table_address = (u32)qtables; /* for smbios_21_next(), below */
+ qtables_len = f_tables->size;
/* did we get a type 0 structure ? */
- for (t0 = smbios_21_next(&ep, NULL); t0; t0 = smbios_21_next(&ep, t0))
+ for (t0 = smbios_next(qtables, qtables_len, NULL); t0;
+ t0 = smbios_next(qtables, qtables_len, t0)) {
if (t0->header.type == 0) {
need_t0 = 0;
break;
}
+ }
- qtables_len = ep.structure_table_length;
if (need_t0) {
/* common case: add our own type 0, with 3 strings and 4 '\0's */
u16 t0_len = sizeof(struct smbios_type_0) + strlen(BIOS_NAME) +