aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-01-31 23:49:34 +0100
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-02-02 19:57:45 +0100
commit406c410ef747d66e16f2f5494cbf88ba1307224f (patch)
treed1d299e98db982d1379cb1d2a009e1c437dbb454 /lib
parente494258deddcae4a6805abfbb643b2fdc8ac3736 (diff)
smbios: correctly name Structure Table Maximum Size field
In the SMBIOS 3 entry point the Structure Table Maximum Size field was incorrectly named max_struct_size. A Maximum Structure Size field only exists in the SMBIOS 2.1 entry point and has a different meaning. Call the Structure Table Length field table_maximum_size. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_tcg2.c4
-rw-r--r--lib/efi_loader/smbiosdump.c6
-rw-r--r--lib/smbios-parser.c2
-rw-r--r--lib/smbios.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index b5d4aa7be5..b07e0099c2 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -1098,7 +1098,7 @@ tcg2_measure_smbios(struct udevice *dev,
*/
event_size = sizeof(struct smbios_handoff_table_pointers2) +
FIELD_SIZEOF(struct efi_configuration_table, guid) +
- entry->max_struct_size;
+ entry->table_maximum_size;
event = calloc(1, event_size);
if (!event) {
ret = EFI_OUT_OF_RESOURCES;
@@ -1113,7 +1113,7 @@ tcg2_measure_smbios(struct udevice *dev,
smbios_copy = (struct smbios_header *)((uintptr_t)&event->table_entry[0].table);
memcpy(&event->table_entry[0].table,
(void *)((uintptr_t)entry->struct_table_address),
- entry->max_struct_size);
+ entry->table_maximum_size);
smbios_prepare_measurement(entry, smbios_copy);
diff --git a/lib/efi_loader/smbiosdump.c b/lib/efi_loader/smbiosdump.c
index f0b901897e..2f0b91a353 100644
--- a/lib/efi_loader/smbiosdump.c
+++ b/lib/efi_loader/smbiosdump.c
@@ -329,7 +329,7 @@ efi_status_t do_check(void)
return EFI_LOAD_ERROR;
}
table = (void *)(uintptr_t)smbios3_anchor->struct_table_address;
- len = smbios3_anchor->max_struct_size;
+ len = smbios3_anchor->table_maximum_size;
} else {
struct smbios_entry *smbios_anchor;
int r;
@@ -469,7 +469,7 @@ static efi_status_t do_save(u16 *filename)
smbios3_anchor = get_config_table(&smbios3_guid);
if (smbios3_anchor) {
- size = 0x20 + smbios3_anchor->max_struct_size;
+ size = 0x20 + smbios3_anchor->table_maximum_size;
ret = bs->allocate_pool(EFI_LOADER_DATA, size, (void **)&buf);
if (ret != EFI_SUCCESS) {
error(u"Out of memory\n");
@@ -480,7 +480,7 @@ static efi_status_t do_save(u16 *filename)
memcpy(buf, smbios3_anchor, smbios3_anchor->length);
memcpy(buf + 0x20,
(void *)(uintptr_t)smbios3_anchor->struct_table_address,
- smbios3_anchor->max_struct_size);
+ smbios3_anchor->table_maximum_size);
smbios3_anchor = (struct smbios3_entry *)buf;
smbios3_anchor->struct_table_address = 0x20;
diff --git a/lib/smbios-parser.c b/lib/smbios-parser.c
index 0d1ac781b3..9a62b3c760 100644
--- a/lib/smbios-parser.c
+++ b/lib/smbios-parser.c
@@ -230,7 +230,7 @@ void smbios_prepare_measurement(const struct smbios3_entry *entry,
void *table_end;
struct smbios_header *header;
- table_end = (void *)((u8 *)smbios_copy + entry->max_struct_size);
+ table_end = (void *)((u8 *)smbios_copy + entry->table_maximum_size);
for (i = 0; i < ARRAY_SIZE(smbios_filter_tables); i++) {
header = smbios_copy;
diff --git a/lib/smbios.c b/lib/smbios.c
index 327f78c8b0..c83af730a9 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -615,7 +615,7 @@ ulong write_smbios_table(ulong addr)
se->minor_ver = SMBIOS_MINOR_VER;
se->doc_rev = 0;
se->entry_point_rev = 1;
- se->max_struct_size = len;
+ se->table_maximum_size = len;
se->struct_table_address = table_addr;
se->checksum = table_compute_checksum(se, sizeof(struct smbios3_entry));
unmap_sysmem(se);