diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-12-10 14:07:16 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-12-18 11:39:13 -0500 |
commit | ddd0f7b877695bc15a88f5f0077868329518d7bf (patch) | |
tree | c5ec70385ecf4db6040355d61c0cdf922c885523 | |
parent | 6290dcede4d6a7de9d30e42f325aaf0c8d8baaee (diff) | |
download | seabios-ddd0f7b877695bc15a88f5f0077868329518d7bf.tar.gz |
smbios: Make smbios_build_tables() ready for 64-bit tables
Make smbios_build_tables() get u64 address and u32 length
arguments, making it usable for SMBIOS 3.0. Adapt
smbios_21_setup_entry_point() to use intermediate variables when
calling smbios_build_tables().
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r-- | src/fw/biostables.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/fw/biostables.c b/src/fw/biostables.c index d65d91ab..91fe7470 100644 --- a/src/fw/biostables.c +++ b/src/fw/biostables.c @@ -462,7 +462,7 @@ smbios_new_type_0(void *start, */ static int smbios_build_tables(struct romfile_s *f_tables, - u32 *address, u16 *length, + u64 *address, u32 *length, u16 *max_structure_size, u16 *number_of_structures) { @@ -531,14 +531,24 @@ static int smbios_21_setup_entry_point(struct romfile_s *f_tables, struct smbios_21_entry_point *ep) { + u64 address = ep->structure_table_address; + u32 length = ep->structure_table_length; + if (!smbios_build_tables(f_tables, - &ep->structure_table_address, - &ep->structure_table_length, + &address, + &length, &ep->max_structure_size, &ep->number_of_structures)) return 0; + if ((u32)address != address || (u16)length != length) { + warn_internalerror(); + return 0; + } + /* finalize entry point */ + ep->structure_table_address = address; + ep->structure_table_length = length; ep->checksum -= checksum(ep, 0x10); ep->intermediate_checksum -= checksum((void *)ep + 0x10, ep->length - 0x10); |