qemu: IOPortListener

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1622 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hsc
2012-09-12 16:05:18 +00:00
parent 095adbc7e5
commit f795bf63c4
5 changed files with 61 additions and 49 deletions

View File

@ -21,4 +21,23 @@ QEMUController::~QEMUController()
delete m_Mem;
}
// FIXME: copied from BochsController; remove redundancy!
void QEMUController::onIOPort(unsigned char data, unsigned port, bool out) {
// Check for active IOPortListeners:
io_cache_t &buffer_cache = m_LstList.getIOBuffer();
io_cache_t::iterator it = buffer_cache.begin();
while (it != buffer_cache.end()) {
IOPortListener* pIOPt = (*it);
if (pIOPt->isMatching(port, out)) {
pIOPt->setData(data);
it = buffer_cache.makeActive(m_LstList, it);
// "it" has already been set to the next element (by calling
// makeActive()):
continue; // -> skip iterator increment
}
it++;
}
m_LstList.triggerActiveListeners();
}
} // end-of-namespace: fail