Extract generic code from smbios_21_next(), so it can be reused for SMBIOS 3.0 support.
Signed-off-by: Eduardo Habkost ehabkost@redhat.com --- src/fw/biostables.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/fw/biostables.c b/src/fw/biostables.c index 8e53ae2e..3c30331e 100644 --- a/src/fw/biostables.c +++ b/src/fw/biostables.c @@ -265,12 +265,11 @@ find_acpi_features(void)
// Iterator for each sub-table in the smbios blob. void * -smbios_21_next(struct smbios_21_entry_point *smbios, void *prev) +smbios_next(void *start, u32 length, void *prev) { - if (!smbios) + if (!start) return NULL; - void *start = (void*)smbios->structure_table_address; - void *end = start + smbios->structure_table_length; + void *end = start + length;
if (!prev) { prev = start; @@ -288,6 +287,15 @@ smbios_21_next(struct smbios_21_entry_point *smbios, void *prev) return prev; }
+void * +smbios_21_next(struct smbios_21_entry_point *smbios, void *prev) +{ + if (!smbios) + return NULL; + return smbios_next((void*)smbios->structure_table_address, + smbios->structure_table_length, prev); +} + struct smbios_21_entry_point *SMBios21Addr;
void