mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 10:26:10 +01:00 
			
		
		
		
	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>
This commit is contained in:
		| @@ -142,7 +142,7 @@ static int do_smbios(struct cmd_tbl *cmdtp, int flag, int argc, | |||||||
| 			 entry3->major_ver, entry3->minor_ver, entry3->doc_rev); | 			 entry3->major_ver, entry3->minor_ver, entry3->doc_rev); | ||||||
| 		table = (void *)(uintptr_t)entry3->struct_table_address; | 		table = (void *)(uintptr_t)entry3->struct_table_address; | ||||||
| 		size = entry3->length; | 		size = entry3->length; | ||||||
| 		table_maximum_size = entry3->max_struct_size; | 		table_maximum_size = entry3->table_maximum_size; | ||||||
| 	} else if (!memcmp(entry, smbios_sig, sizeof(smbios_sig) - 1)) { | 	} else if (!memcmp(entry, smbios_sig, sizeof(smbios_sig) - 1)) { | ||||||
| 		struct smbios_entry *entry2 = entry; | 		struct smbios_entry *entry2 = entry; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -90,7 +90,7 @@ static int qfw_parse_smbios_anchor(struct udevice *dev, | |||||||
| 		entry->length = sizeof(struct smbios3_entry); | 		entry->length = sizeof(struct smbios3_entry); | ||||||
| 		entry->major_ver = entry2->major_ver; | 		entry->major_ver = entry2->major_ver; | ||||||
| 		entry->minor_ver = entry2->minor_ver; | 		entry->minor_ver = entry2->minor_ver; | ||||||
| 		entry->max_struct_size = entry2->struct_table_length; | 		entry->table_maximum_size = entry2->struct_table_length; | ||||||
| 	} else { | 	} else { | ||||||
| 		ret = -ENOENT; | 		ret = -ENOENT; | ||||||
| 		goto out; | 		goto out; | ||||||
|   | |||||||
| @@ -75,7 +75,7 @@ struct __packed smbios3_entry { | |||||||
| 	/** @reserved: reserved */ | 	/** @reserved: reserved */ | ||||||
| 	u8 reserved; | 	u8 reserved; | ||||||
| 	/** maximum size of SMBIOS table */ | 	/** maximum size of SMBIOS table */ | ||||||
| 	u32 max_struct_size; | 	u32 table_maximum_size; | ||||||
| 	/** @struct_table_address: 64-bit physical starting address */ | 	/** @struct_table_address: 64-bit physical starting address */ | ||||||
| 	u64 struct_table_address; | 	u64 struct_table_address; | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -1098,7 +1098,7 @@ tcg2_measure_smbios(struct udevice *dev, | |||||||
| 	 */ | 	 */ | ||||||
| 	event_size = sizeof(struct smbios_handoff_table_pointers2) + | 	event_size = sizeof(struct smbios_handoff_table_pointers2) + | ||||||
| 		     FIELD_SIZEOF(struct efi_configuration_table, guid) + | 		     FIELD_SIZEOF(struct efi_configuration_table, guid) + | ||||||
| 		     entry->max_struct_size; | 		     entry->table_maximum_size; | ||||||
| 	event = calloc(1, event_size); | 	event = calloc(1, event_size); | ||||||
| 	if (!event) { | 	if (!event) { | ||||||
| 		ret = EFI_OUT_OF_RESOURCES; | 		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); | 	smbios_copy = (struct smbios_header *)((uintptr_t)&event->table_entry[0].table); | ||||||
| 	memcpy(&event->table_entry[0].table, | 	memcpy(&event->table_entry[0].table, | ||||||
| 	       (void *)((uintptr_t)entry->struct_table_address), | 	       (void *)((uintptr_t)entry->struct_table_address), | ||||||
| 	       entry->max_struct_size); | 	       entry->table_maximum_size); | ||||||
|  |  | ||||||
| 	smbios_prepare_measurement(entry, smbios_copy); | 	smbios_prepare_measurement(entry, smbios_copy); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -329,7 +329,7 @@ efi_status_t do_check(void) | |||||||
| 			return EFI_LOAD_ERROR; | 			return EFI_LOAD_ERROR; | ||||||
| 		} | 		} | ||||||
| 		table = (void *)(uintptr_t)smbios3_anchor->struct_table_address; | 		table = (void *)(uintptr_t)smbios3_anchor->struct_table_address; | ||||||
| 		len = smbios3_anchor->max_struct_size; | 		len = smbios3_anchor->table_maximum_size; | ||||||
| 	} else { | 	} else { | ||||||
| 		struct smbios_entry *smbios_anchor; | 		struct smbios_entry *smbios_anchor; | ||||||
| 		int r; | 		int r; | ||||||
| @@ -469,7 +469,7 @@ static efi_status_t do_save(u16 *filename) | |||||||
|  |  | ||||||
| 	smbios3_anchor = get_config_table(&smbios3_guid); | 	smbios3_anchor = get_config_table(&smbios3_guid); | ||||||
| 	if (smbios3_anchor) { | 	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); | 		ret = bs->allocate_pool(EFI_LOADER_DATA, size, (void **)&buf); | ||||||
| 		if (ret != EFI_SUCCESS) { | 		if (ret != EFI_SUCCESS) { | ||||||
| 			error(u"Out of memory\n"); | 			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, smbios3_anchor, smbios3_anchor->length); | ||||||
| 		memcpy(buf + 0x20, | 		memcpy(buf + 0x20, | ||||||
| 		       (void *)(uintptr_t)smbios3_anchor->struct_table_address, | 		       (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 smbios3_entry *)buf; | ||||||
| 		smbios3_anchor->struct_table_address = 0x20; | 		smbios3_anchor->struct_table_address = 0x20; | ||||||
|   | |||||||
| @@ -230,7 +230,7 @@ void smbios_prepare_measurement(const struct smbios3_entry *entry, | |||||||
| 	void *table_end; | 	void *table_end; | ||||||
| 	struct smbios_header *header; | 	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++) { | 	for (i = 0; i < ARRAY_SIZE(smbios_filter_tables); i++) { | ||||||
| 		header = smbios_copy; | 		header = smbios_copy; | ||||||
|   | |||||||
| @@ -615,7 +615,7 @@ ulong write_smbios_table(ulong addr) | |||||||
| 	se->minor_ver = SMBIOS_MINOR_VER; | 	se->minor_ver = SMBIOS_MINOR_VER; | ||||||
| 	se->doc_rev = 0; | 	se->doc_rev = 0; | ||||||
| 	se->entry_point_rev = 1; | 	se->entry_point_rev = 1; | ||||||
| 	se->max_struct_size = len; | 	se->table_maximum_size = len; | ||||||
| 	se->struct_table_address = table_addr; | 	se->struct_table_address = table_addr; | ||||||
| 	se->checksum = table_compute_checksum(se, sizeof(struct smbios3_entry)); | 	se->checksum = table_compute_checksum(se, sizeof(struct smbios3_entry)); | ||||||
| 	unmap_sysmem(se); | 	unmap_sysmem(se); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user