summaryrefslogtreecommitdiff
path: root/SourceLevelDebugPkg
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2015-08-27 02:05:20 +0000
committervanjeff <vanjeff@Edk2>2015-08-27 02:05:20 +0000
commit3b9468ef28c5cc0cd7d1d1f58368fdd92b7da8bf (patch)
tree1ff59757436e8f6aaba96d8431d8c2f79e5cda2b /SourceLevelDebugPkg
parent57a3e4f9b5805e5443c7c1b0814d76abe8bcfa11 (diff)
downloadedk2-platforms-3b9468ef28c5cc0cd7d1d1f58368fdd92b7da8bf.tar.xz
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 <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
Diffstat (limited to 'SourceLevelDebugPkg')
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c
index 4a6ccdb7da..bf965cb3c9 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c
@@ -131,8 +131,10 @@ IsDebugTimerTimeout (
//
// 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 {
//