coreboot-kgpe-d16/payloads/libpayload/drivers
Yidi Lin eabdd0252a libpayload/libc/time: Fix possible overflow in multiplication
The value from raw_read_cntfrq_el0() could be large enough to cause
overflow when multiplied by USECS_PER_SEC. To prevent this, both
USECS_PER_SEC and hz can be reduced by dividing them by their GCD.

This patch also modifies the return type of `timer_hz()` from
`uint64_t` to `uint32_t`, assuming that in practice the timestamp
counter should never be that fast.

BUG=b:307790895
TEST=boot to kernel and check the timestamps from `cbmem`

Change-Id: Ia55532490651fcf47128b83a8554751f050bcc89
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78888
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-11-07 19:25:23 +00:00
..
i8042 libpayload: Fix clang fallthrough warning 2023-08-28 02:12:25 +00:00
serial libpayload: Fix compiler warnings 2022-11-21 21:08:30 +00:00
storage
timer libpayload/libc/time: Fix possible overflow in multiplication 2023-11-07 19:25:23 +00:00
udc libpayload: Fix compiler warnings 2022-11-21 21:08:30 +00:00
usb libpayload: Add after an if conditional on the next line 2023-09-07 13:33:39 +00:00
video libpayload/drivers/video: Add cursor movement support in console 2023-09-18 13:15:44 +00:00
Makefile.inc libpayload/pci: Add pci_map_bus function for Qualcomm platform 2022-08-01 18:04:54 +00:00
cbmem_console.c libpayload/drivers/cbmem_console: Use C99 flexible arrays 2023-08-01 12:40:07 +00:00
hid.c
mouse_cursor.c
nvram.c
options.c
pci_io_ops.c
pci_map_bus_ops.c
pci_ops.c
pci_qcom.c libpayload/pci: Add pci_map_bus function for Qualcomm platform 2022-08-01 18:04:54 +00:00
pcie_mediatek.c
speaker.c