]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SourceLevelDebugPkg/DebugTimer: Fix the issue if CurrentTimer = Timer
authorJeff Fan <jeff.fan@intel.com>
Thu, 27 Aug 2015 02:05:20 +0000 (02:05 +0000)
committervanjeff <vanjeff@Edk2>
Thu, 27 Aug 2015 02:05:20 +0000 (02:05 +0000)
If CPU runs fast and timer runs slow, two GetApicTimerCurrentCount() may return
the same timer count value. We need to consider timer roll-over not happened.
Otherwise, one false timeout flag will be set.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18328 6f19259b-4bc3-4df7-8a09-765794883524

SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c

index 4a6ccdb7da1f90f62517ce7c0dce58ba24d97754..bf965cb3c94e22fc8e4d0af40a921751aee91568 100644 (file)
@@ -131,8 +131,10 @@ IsDebugTimerTimeout (
 \r
   //\r
   // This timer counter counts down.  Check for roll over condition.\r
+  // If CurrentTimer is equal to Timer, it does not mean that roll over\r
+  // happened.\r
   //\r
-  if (CurrentTimer < Timer) {\r
+  if (CurrentTimer <= Timer) {\r
     Delta = Timer - CurrentTimer;\r
   } else {\r
     //\r