mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
ArmPkg: TimerDxe: Use 64bit operation for timer ticks
The current implementation operates on 64bit value with implicit value truncation. This change updates the involved frequencies to use 64 bit based operations. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Kun Qin <kun.qin@microsoft.com>
This commit is contained in:
parent
957fcbe7a3
commit
77d32b1796
@ -143,8 +143,7 @@ TimerDriverSetTimerPeriod (
|
||||
// mTimerTicks = TimerPeriod in 1ms unit x Frequency.10^-3
|
||||
// = TimerPeriod.10^-4 x Frequency.10^-3
|
||||
// = (TimerPeriod x Frequency) x 10^-7
|
||||
TimerTicks = MultU64x32 (TimerPeriod, ArmGenericTimerGetTimerFreq ());
|
||||
TimerTicks = DivU64x32 (TimerTicks, 10000000U);
|
||||
TimerTicks = TimerPeriod * ArmGenericTimerGetTimerFreq () / 10000000U;
|
||||
|
||||
// Raise TPL to update the mTimerTicks and mTimerPeriod to ensure these values
|
||||
// are coherent in the interrupt handler
|
||||
|
Loading…
x
Reference in New Issue
Block a user