Use the system counter to compute the watchdog compare
value as the watchdog compare value is compared to the
system counter to check if the watchdog timeout expired or not.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16513
6f19259b-4bc3-4df7-8a09-
765794883524
IN UINT64 TimerPeriod // In 100ns units\r
)\r
{\r
- UINTN TimerVal;\r
+ UINTN SystemCount;\r
EFI_STATUS Status;\r
\r
// if TimerPerdiod is 0, this is a request to stop the watchdog.\r
return Status;\r
}\r
WatchdogEnable ();\r
- TimerVal = ArmGenericTimerGetTimerVal ();\r
- Status = WatchdogWriteCompareRegister (TimerVal + mNumTimerTicks);\r
+ SystemCount = ArmGenericTimerGetSystemCount ();\r
+ Status = WatchdogWriteCompareRegister (SystemCount + mNumTimerTicks);\r
} else {\r
Status = WatchdogWriteOffsetRegister ((UINT32)mNumTimerTicks);\r
WatchdogEnable ();\r