diff --git a/core/SAL/SimulatorController.cc b/core/SAL/SimulatorController.cc index 04d031e067b92c1e6191fbd50ddec7481e84c112..03284f2cc8084f5efd9de7b27f38678a4d353529 100644 --- a/core/SAL/SimulatorController.cc +++ b/core/SAL/SimulatorController.cc @@ -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); diff --git a/core/SAL/bochs/BochsController.cc b/core/SAL/bochs/BochsController.cc index db03559c6fd2bd5f40899d30c7e371cc9a076a24..23b255ab8e8915de8a325eb2d91846c35541fae6 100644 --- a/core/SAL/bochs/BochsController.cc +++ b/core/SAL/bochs/BochsController.cc @@ -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() diff --git a/core/SAL/bochs/Interrupt_suppression.ah b/core/SAL/bochs/Interrupt_suppression.ah index e0d876e942b373cec8a33e4fa9c2996dc057a30f..cc62d4b3c7bd19b248b81b9c95d17fc9ceb157a4 100644 --- a/core/SAL/bochs/Interrupt_suppression.ah +++ b/core/SAL/bochs/Interrupt_suppression.ah @@ -16,7 +16,6 @@ aspect Interrupt_FI advice execution (interrupt_method()) : around () { unsigned vector = *(tjp->arg<0>()); - if(!sal::simulator.isSuppressedInterrupt(vector)){ tjp->proceed(); } diff --git a/core/SAL/bochs/failbochs.hpp b/core/SAL/bochs/failbochs.hpp index 925028c256a462795e1aa8814f2aca42a5dd0c91..4d18ca88e16152049e7e18de469e504ee1c47fd0 100644 --- a/core/SAL/bochs/failbochs.hpp +++ b/core/SAL/bochs/failbochs.hpp @@ -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 diff --git a/core/SAL/bochs/fireInterrupt.ah b/core/SAL/bochs/fireInterrupt.ah index 6039f5e77f581cddf420e436fff082569ed039c3..68b60bb55ee7b47d26035e41b9155024745304d3 100644 --- a/core/SAL/bochs/fireInterrupt.ah +++ b/core/SAL/bochs/fireInterrupt.ah @@ -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(); } }