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:
hellwig
2012-04-18 13:25:33 +00:00
parent 5f6d1f5e0a
commit d96d3c4c5b
5 changed files with 21 additions and 11 deletions

View File

@ -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);

View File

@ -10,7 +10,7 @@ bx_bool restore_bochs_request = false;
bx_bool save_bochs_request = false;
bx_bool reboot_bochs_request = false;
bx_bool interrupt_injection_request = false;
unsigned interrupt_to_fire = 0;
int interrupt_to_fire = -1;
std::string sr_path = "";
BochsController::BochsController()

View File

@ -16,7 +16,6 @@ aspect Interrupt_FI
advice execution (interrupt_method()) : around ()
{
unsigned vector = *(tjp->arg<0>());
if(!sal::simulator.isSuppressedInterrupt(vector)){
tjp->proceed();
}

View File

@ -13,7 +13,7 @@ namespace sal{
extern bx_bool save_bochs_request;
extern bx_bool reboot_bochs_request;
extern bx_bool interrupt_injection_request;
extern unsigned interrupt_to_fire;
extern int interrupt_to_fire;
extern std::string sr_path;
#endif

View File

@ -7,6 +7,7 @@
#include "../../../bochs/bochs.h"
#include "../../../bochs/cpu/cpu.h"
#include "../../../bochs/iodev/iodev.h"
#include "../SALInst.hpp"
aspect fireInterrupt
@ -36,7 +37,6 @@ aspect InterruptDone
}else{
if(*(tjp->arg<0>()) == 32 + sal::interrupt_to_fire){
DEV_pic_lower_irq(sal::interrupt_to_fire);
sal::simulator.fireInterruptDone();
}
}