summaryrefslogtreecommitdiff
path: root/src/acpi
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2023-06-29 20:26:39 +0200
committerLean Sheng Tan <sheng.tan@9elements.com>2023-08-02 15:53:02 +0000
commit8473e8fd5fd861da1e511dc143d9cf199d9dd89a (patch)
treea09c5b8d920def9dfbc1a0ebcaa59af80a846ff1 /src/acpi
parent28857ce317b446a5bd7517dd0976b88354b05101 (diff)
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>
Diffstat (limited to 'src/acpi')
-rw-r--r--src/acpi/acpi.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c
index 0bb49f6ff7..dea4c27a70 100644
--- a/src/acpi/acpi.c
+++ b/src/acpi/acpi.c
@@ -1086,13 +1086,17 @@ static void acpi_create_fadt(acpi_header_t *header, void *arg1)
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;