Keep Notifier firing after FPGA rollover (fixes artf3582), simulation may still have an issue with counter rollover

Change-Id: I11d86bd65c1e0db123d93aa143b8c8c3b823737a
This commit is contained in:
Kevin O'Connor
2014-10-22 13:36:17 -04:00
parent f108853e1b
commit f3fe64a60e
3 changed files with 8 additions and 4 deletions

View File

@@ -138,7 +138,7 @@ void Notifier::ProcessQueue(uint32_t mask, void *params)
* Insert this Notifier into the timer queue in right place.
* WARNING: this method does not do synchronization! It must be called from somewhere
* that is taking care of synchronizing access to the queue.
* @param reschedule If false, the scheduled alarm is based on the curent time and UpdateAlarm
* @param reschedule If false, the scheduled alarm is based on the current time and UpdateAlarm
* method is called which will enable the alarm if necessary.
* If true, update the time by adding the period (no drift) when rescheduled periodic from ProcessQueue.
* This ensures that the public methods only update the queue after finishing inserting.
@@ -153,6 +153,10 @@ void Notifier::InsertInQueue(bool reschedule)
{
m_expirationTime = GetClock() + m_period;
}
if (m_expirationTime > Timer::kRolloverTime)
{
m_expirationTime -= Timer::kRolloverTime;
}
if (timerQueueHead == NULL || timerQueueHead->m_expirationTime >= this->m_expirationTime)
{
// the queue is empty or greater than the new entry