Revision: 18328
          http://sourceforge.net/p/edk2/code/18328
Author:   vanjeff
Date:     2015-08-27 02:05:20 +0000 (Thu, 27 Aug 2015)
Log Message:
-----------
SourceLevelDebugPkg/DebugTimer: Fix the issue if CurrentTimer = Timer

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 <[email protected]>
Reviewed-by: Ruiyu Ni <[email protected]>

Modified Paths:
--------------
    
trunk/edk2/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c

Modified: 
trunk/edk2/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c
===================================================================
--- 
trunk/edk2/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c 
    2015-08-27 01:23:55 UTC (rev 18327)
+++ 
trunk/edk2/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c 
    2015-08-27 02:05:20 UTC (rev 18328)
@@ -131,8 +131,10 @@
 
   //
   // This timer counter counts down.  Check for roll over condition.
+  // If CurrentTimer is equal to Timer, it does not mean that roll over
+  // happened.
   //
-  if (CurrentTimer < Timer) {
+  if (CurrentTimer <= Timer) {
     Delta = Timer - CurrentTimer;
   } else {
     //


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to