qemu: TimerListeners

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1639 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hsc
2012-09-13 20:08:42 +00:00
parent 4e321409b7
commit dc5ce33fc1
7 changed files with 53 additions and 7 deletions

View File

@ -40,4 +40,20 @@ void QEMUController::onIOPort(unsigned char data, unsigned port, bool out) {
m_LstList.triggerActiveListeners();
}
void QEMUController::onTimerTrigger(TimerListener *pli)
{
// FIXME: The timer logic can be modified to use only one timer in QEMU.
// (For now, this suffices.)
// Check for a matching TimerListener. (In fact, we are only
// interessted in the iterator pointing at pli.)
ListenerManager::iterator it = std::find(m_LstList.begin(),
simulator.m_LstList.end(), pli);
// TODO: This has O(|m_LstList|) time complexity. We can further improve this
// by creating a method such that makeActive(pli) works as well,
// reducing the time complexity to O(1).
m_LstList.makeActive(it);
m_LstList.triggerActiveListeners();
}
} // end-of-namespace: fail