mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
57a3e4f9b5
commit
3b9468ef28
|
@ -131,8 +131,10 @@ IsDebugTimerTimeout (
|
||||||
|
|
||||||
//
|
//
|
||||||
// This timer counter counts down. Check for roll over condition.
|
// 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;
|
Delta = Timer - CurrentTimer;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue