arch/x86/smbios: Update memory_array_handle for SMBIOS type 19

Update memory array handle for SMBIOS type 19.

TEST=Execute "dmidecode -t 19" to check if memory array handle is correct.

Signed-off-by: Tim Chu <Tim.Chu@quantatw.com>
Change-Id: I49078b870bac3c6162913b91651ec09632800f1f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47156
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Tim Chu 2020-11-02 21:33:52 -08:00 committed by Patrick Georgi
parent 726504a61a
commit e41f595310
1 changed files with 3 additions and 2 deletions

View File

@ -1068,7 +1068,7 @@ static int smbios_write_type17(unsigned long *current, int *handle, int type16)
return totallen;
}
static int smbios_write_type19(unsigned long *current, int *handle)
static int smbios_write_type19(unsigned long *current, int *handle, int type16)
{
struct smbios_type19 *t = (struct smbios_type19 *)*current;
int len = sizeof(struct smbios_type19);
@ -1084,6 +1084,7 @@ static int smbios_write_type19(unsigned long *current, int *handle)
t->type = SMBIOS_MEMORY_ARRAY_MAPPED_ADDRESS;
t->length = len - 2;
t->handle = *handle;
t->memory_array_handle = type16;
for (i = 0; i < meminfo->dimm_cnt && i < ARRAY_SIZE(meminfo->dimm); i++) {
if (meminfo->dimm[i].dimm_size > 0) {
@ -1335,7 +1336,7 @@ unsigned long smbios_write_tables(unsigned long current)
const int type16 = handle;
update_max(len, max_struct_size, smbios_write_type16(&current, &handle));
update_max(len, max_struct_size, smbios_write_type17(&current, &handle, type16));
update_max(len, max_struct_size, smbios_write_type19(&current, &handle));
update_max(len, max_struct_size, smbios_write_type19(&current, &handle, type16));
update_max(len, max_struct_size, smbios_write_type32(&current, handle++));
update_max(len, max_struct_size, smbios_walk_device_tree(all_devices,