Lean Sheng Tan has submitted this change. ( https://review.coreboot.org/c/coreboot/+/76179?usp=email )
Change subject: acpi.c: Fill in >4G FADT entries correctly ......................................................................
acpi.c: Fill in >4G FADT entries correctly
Signed-off-by: Arthur Heymans arthur@aheymans.xyz Change-Id: I84ab0068e8409a5e525ddc781347087680d80640 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76179 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/acpi/acpi.c 1 file changed, 10 insertions(+), 6 deletions(-)
Approvals: Kyösti Mälkki: Looks good to me, approved Nico Huber: Looks good to me, but someone else must approve build bot (Jenkins): Verified
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 0bb49f6..dea4c27 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -1086,13 +1086,17 @@ return;
fadt->FADT_MinorVersion = get_acpi_fadt_minor_version(); - fadt->firmware_ctrl = (unsigned long)facs; - fadt->x_firmware_ctl_l = (unsigned long)facs; - fadt->x_firmware_ctl_h = 0; + if ((uintptr_t)facs <= UINT32_MAX) + fadt->firmware_ctrl = (uintptr_t)facs; + else + fadt->x_firmware_ctl_h = (uint32_t)((uint64_t)(uintptr_t)facs >> 32); + fadt->x_firmware_ctl_l = (uint32_t)(uintptr_t)facs;
- fadt->dsdt = (unsigned long)dsdt; - fadt->x_dsdt_l = (unsigned long)dsdt; - fadt->x_dsdt_h = 0; + if ((uintptr_t)dsdt <= UINT32_MAX) + fadt->dsdt = (uintptr_t)dsdt; + else + fadt->x_dsdt_h = (uint32_t)((uint64_t)(uintptr_t)dsdt >> 32); + fadt->x_dsdt_l = (uint32_t)(uintptr_t)dsdt;
/* should be 0 ACPI 3.0 */ fadt->reserved = 0;