UefiCpuPkg: CpuTimerDxeRiscV64: Fix timer event not working correctly

The timer notify function should be called with timer period, not the
value read from timer register.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
This commit is contained in:
Tuan Phan 2023-06-27 18:15:57 -07:00 committed by mergify[bot]
parent 5a13f5c2fa
commit ad7d3ace1a
1 changed files with 7 additions and 1 deletions

View File

@ -9,6 +9,7 @@
#include <Library/BaseLib.h>
#include <Library/BaseRiscVSbiLib.h>
#include <Library/UefiLib.h>
#include "Timer.h"
//
@ -71,7 +72,12 @@ TimerInterruptHandler (
// time to increment slower. So when we take an interrupt,
// account for the actual time passed.
//
mTimerNotifyFunction (PeriodStart - mLastPeriodStart);
mTimerNotifyFunction (
DivU64x32 (
EFI_TIMER_PERIOD_SECONDS (PeriodStart - mLastPeriodStart),
PcdGet64 (PcdCpuCoreCrystalClockFrequency)
)
);
}
if (mTimerPeriod == 0) {