SourceLevelDebugPkg/DebugTimer: Timer count value 0 not calculated
Actually, TimerCycle is APIC timer's initial count. Timer count value 0 is missed when calculating Delta value. 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@18329 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -109,7 +109,7 @@ SaveAndSetDebugTimerInterrupt (
|
|||||||
/**
|
/**
|
||||||
Check if the timer is time out.
|
Check if the timer is time out.
|
||||||
|
|
||||||
@param[in] TimerCycle Timer total count.
|
@param[in] TimerCycle Timer initial count.
|
||||||
@param[in] Timer The start timer from the begin.
|
@param[in] Timer The start timer from the begin.
|
||||||
@param[in] TimeoutTicker Ticker number need time out.
|
@param[in] TimeoutTicker Ticker number need time out.
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ IsDebugTimerTimeout (
|
|||||||
//
|
//
|
||||||
// Handle one roll-over.
|
// Handle one roll-over.
|
||||||
//
|
//
|
||||||
Delta = TimerCycle - (CurrentTimer - Timer);
|
Delta = TimerCycle - (CurrentTimer - Timer) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (BOOLEAN) (Delta >= TimeoutTicker);
|
return (BOOLEAN) (Delta >= TimeoutTicker);
|
||||||
|
@@ -32,7 +32,7 @@ InitializeDebugTimer (
|
|||||||
/**
|
/**
|
||||||
Check if the timer is time out.
|
Check if the timer is time out.
|
||||||
|
|
||||||
@param[in] TimerCycle Timer total count.
|
@param[in] TimerCycle Timer initial count.
|
||||||
@param[in] Timer The start timer from the begin.
|
@param[in] Timer The start timer from the begin.
|
||||||
@param[in] TimeoutTicker Ticker number need time out.
|
@param[in] TimeoutTicker Ticker number need time out.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user