acpi/acpi: fix invalid checksum

Incorrect size of the einj structure was being used, which created an
invalid checksum message by the OS. This patch fixes the issue.

Test=Booted to Linux on Deltalake mainboard and verified invalid checksum
message is not logged in syslog. Exact message -> 'ACPI BIOS Warning
(bug): Incorrect checksum in table [EINJ] - 0xDA, should be 0xD9'

Change-Id: I2b1722d6960d4a62d14fb02ac5e8838397e12f92
Signed-off-by: Rocky Phagura <rphagura@fb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54787
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Lance Zhao
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Rocky Phagura 2021-05-21 13:34:03 -07:00 committed by Felix Held
parent 07056feba0
commit b46a9e5ddb
1 changed files with 2 additions and 2 deletions

View File

@ -956,7 +956,7 @@ void acpi_create_einj(acpi_einj_t *einj, uintptr_t addr, u8 actions)
printk(BIOS_DEBUG, "default_actions[%d].reg.addr is %llx\n", i,
default_actions[i].reg.addr);
memset((void *)einj, 0, sizeof(einj));
memset((void *)einj, 0, sizeof(*einj));
/* Fill out header fields. */
memcpy(header->signature, "EINJ", 4);
@ -973,7 +973,7 @@ void acpi_create_einj(acpi_einj_t *einj, uintptr_t addr, u8 actions)
printk(BIOS_DEBUG, "%s einj->action_table = %p\n",
__func__, einj->action_table);
memcpy((void *)einj->action_table, (void *)default_actions, sizeof(einj->action_table));
header->checksum = acpi_checksum((void *)einj, sizeof(einj));
header->checksum = acpi_checksum((void *)einj, sizeof(*einj));
}
void acpi_create_vfct(const struct device *device,