diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2022-02-23 17:37:27 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-02-25 17:41:58 +0000 |
commit | 7f8c737fe97487704f533ac48c7a03233d956869 (patch) | |
tree | 83afdcaab34c949800c6d9330bf2dbb88e50e663 | |
parent | ce876aaa8f3ca687822711eabf31d2ff0626a7fa (diff) |
acpi/acpi: use read32p instead of pointer dereferencing
Using read32p to get the contents of the first 4 bytes of the HPET MMIO
region instead of a pointer dereference should clarify what's done in
that piece of code.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Iecf5452c63635666d7d6b17e07a1bc6aa52e72fa
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62297
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Lance Zhao
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/acpi/acpi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 456fd332dc..26552982e2 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -18,6 +18,7 @@ #include <acpi/acpi.h> #include <acpi/acpi_ivrs.h> #include <acpi/acpigen.h> +#include <arch/mmio.h> #include <device/pci.h> #include <cbmem.h> #include <commonlib/helpers.h> @@ -850,7 +851,7 @@ void acpi_create_hpet(acpi_hpet_t *hpet) addr->addrl = CONFIG_HPET_ADDRESS & 0xffffffff; addr->addrh = ((unsigned long long)CONFIG_HPET_ADDRESS) >> 32; - hpet->id = *(unsigned int *)CONFIG_HPET_ADDRESS; + hpet->id = read32p(CONFIG_HPET_ADDRESS); hpet->number = 0; hpet->min_tick = CONFIG_HPET_MIN_TICKS; |