some changes on interrupt triggering and suppression
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1100 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -127,26 +127,37 @@ void SimulatorController::onInterruptEvent(unsigned interruptNum, bool nmi)
|
||||
bool SimulatorController::isSuppressedInterrupt(unsigned interruptNum)
|
||||
{
|
||||
for(size_t i = 0; i < m_SuppressedInterrupts.size(); i++)
|
||||
if(m_SuppressedInterrupts[i] == interruptNum ||
|
||||
m_SuppressedInterrupts[i] == fi::ANY_INTERRUPT)
|
||||
if((m_SuppressedInterrupts[i] == interruptNum ||
|
||||
m_SuppressedInterrupts[i] == fi::ANY_INTERRUPT) && interruptNum != interrupt_to_fire+32 ){
|
||||
if(interruptNum == interrupt_to_fire+32){
|
||||
interrupt_to_fire = -1;
|
||||
return(true);
|
||||
}
|
||||
return (true);
|
||||
}
|
||||
return (false);
|
||||
}
|
||||
|
||||
bool SimulatorController::addSuppressedInterrupt(unsigned interruptNum)
|
||||
{
|
||||
// Check if already existing:
|
||||
if(isSuppressedInterrupt(interruptNum))
|
||||
if(isSuppressedInterrupt(interruptNum+32))
|
||||
return (false); // already added: nothing to do here
|
||||
m_SuppressedInterrupts.push_back(interruptNum);
|
||||
return (true);
|
||||
|
||||
if(interruptNum == fi::ANY_INTERRUPT){
|
||||
m_SuppressedInterrupts.push_back(interruptNum);
|
||||
return (true);
|
||||
}else{
|
||||
m_SuppressedInterrupts.push_back(interruptNum+32);
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
|
||||
bool SimulatorController::removeSuppressedInterrupt(unsigned interruptNum)
|
||||
{
|
||||
for(size_t i = 0; i < m_SuppressedInterrupts.size(); i++)
|
||||
{
|
||||
if(m_SuppressedInterrupts[i] == interruptNum)
|
||||
{
|
||||
if(m_SuppressedInterrupts[i] == interruptNum+32 || m_SuppressedInterrupts[i] == fi::ANY_INTERRUPT)
|
||||
{
|
||||
m_SuppressedInterrupts.erase(m_SuppressedInterrupts.begin() + i);
|
||||
return (true);
|
||||
|
||||
Reference in New Issue
Block a user