diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-12-10 13:52:14 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-12-18 11:39:13 -0500 |
commit | 1daafc8ba89c2494c330804d7c1d8a4dfc158b35 (patch) | |
tree | c01b4486c966c351f2d715f9bea341db921757a8 | |
parent | 4e99229e326c7643b7c488d0a0690071d6a8c8ec (diff) | |
download | seabios-1daafc8ba89c2494c330804d7c1d8a4dfc158b35.tar.gz |
smbios: smbios_21_setup_entry_point() function
Extract the code specific for building the SMBIOS 2.1 entry point
from smbios_romfile_setup() to a new
smbios_21_setup_entry_point() function.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r-- | src/fw/biostables.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/fw/biostables.c b/src/fw/biostables.c index f0aa7ed3..559a5867 100644 --- a/src/fw/biostables.c +++ b/src/fw/biostables.c @@ -524,6 +524,25 @@ smbios_build_tables(struct romfile_s *f_tables, } static int +smbios_21_setup_entry_point(struct romfile_s *f_tables, + struct smbios_21_entry_point *ep) +{ + if (!smbios_build_tables(f_tables, + &ep->structure_table_address, + &ep->structure_table_length, + &ep->max_structure_size, + &ep->number_of_structures)) + return 0; + + /* finalize entry point */ + ep->checksum -= checksum(ep, 0x10); + ep->intermediate_checksum -= checksum((void *)ep + 0x10, ep->length - 0x10); + + copy_smbios_21(ep); + return 1; +} + +static int smbios_romfile_setup(void) { struct romfile_s *f_anchor = romfile_find("etc/smbios/smbios-anchor"); @@ -535,19 +554,7 @@ smbios_romfile_setup(void) f_anchor->copy(f_anchor, &ep, f_anchor->size); - if (!smbios_build_tables(f_tables, - &ep.structure_table_address, - &ep.structure_table_length, - &ep.max_structure_size, - &ep.number_of_structures)) - return 0; - - /* finalize entry point */ - ep.checksum -= checksum(&ep, 0x10); - ep.intermediate_checksum -= checksum((void *)&ep + 0x10, ep.length - 0x10); - - copy_smbios_21(&ep); - return 1; + return smbios_21_setup_entry_point(f_tables, &ep); } void |