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)
|
bool SimulatorController::isSuppressedInterrupt(unsigned interruptNum)
|
||||||
{
|
{
|
||||||
for(size_t i = 0; i < m_SuppressedInterrupts.size(); i++)
|
for(size_t i = 0; i < m_SuppressedInterrupts.size(); i++)
|
||||||
if(m_SuppressedInterrupts[i] == interruptNum ||
|
if((m_SuppressedInterrupts[i] == interruptNum ||
|
||||||
m_SuppressedInterrupts[i] == fi::ANY_INTERRUPT)
|
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 (true);
|
||||||
|
}
|
||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SimulatorController::addSuppressedInterrupt(unsigned interruptNum)
|
bool SimulatorController::addSuppressedInterrupt(unsigned interruptNum)
|
||||||
{
|
{
|
||||||
// Check if already existing:
|
// Check if already existing:
|
||||||
if(isSuppressedInterrupt(interruptNum))
|
if(isSuppressedInterrupt(interruptNum+32))
|
||||||
return (false); // already added: nothing to do here
|
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)
|
bool SimulatorController::removeSuppressedInterrupt(unsigned interruptNum)
|
||||||
{
|
{
|
||||||
for(size_t i = 0; i < m_SuppressedInterrupts.size(); i++)
|
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);
|
m_SuppressedInterrupts.erase(m_SuppressedInterrupts.begin() + i);
|
||||||
return (true);
|
return (true);
|
||||||
|
|||||||
@ -10,7 +10,7 @@ bx_bool restore_bochs_request = false;
|
|||||||
bx_bool save_bochs_request = false;
|
bx_bool save_bochs_request = false;
|
||||||
bx_bool reboot_bochs_request = false;
|
bx_bool reboot_bochs_request = false;
|
||||||
bx_bool interrupt_injection_request = false;
|
bx_bool interrupt_injection_request = false;
|
||||||
unsigned interrupt_to_fire = 0;
|
int interrupt_to_fire = -1;
|
||||||
std::string sr_path = "";
|
std::string sr_path = "";
|
||||||
|
|
||||||
BochsController::BochsController()
|
BochsController::BochsController()
|
||||||
|
|||||||
@ -16,7 +16,6 @@ aspect Interrupt_FI
|
|||||||
advice execution (interrupt_method()) : around ()
|
advice execution (interrupt_method()) : around ()
|
||||||
{
|
{
|
||||||
unsigned vector = *(tjp->arg<0>());
|
unsigned vector = *(tjp->arg<0>());
|
||||||
|
|
||||||
if(!sal::simulator.isSuppressedInterrupt(vector)){
|
if(!sal::simulator.isSuppressedInterrupt(vector)){
|
||||||
tjp->proceed();
|
tjp->proceed();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ namespace sal{
|
|||||||
extern bx_bool save_bochs_request;
|
extern bx_bool save_bochs_request;
|
||||||
extern bx_bool reboot_bochs_request;
|
extern bx_bool reboot_bochs_request;
|
||||||
extern bx_bool interrupt_injection_request;
|
extern bx_bool interrupt_injection_request;
|
||||||
extern unsigned interrupt_to_fire;
|
extern int interrupt_to_fire;
|
||||||
extern std::string sr_path;
|
extern std::string sr_path;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "../../../bochs/bochs.h"
|
#include "../../../bochs/bochs.h"
|
||||||
#include "../../../bochs/cpu/cpu.h"
|
#include "../../../bochs/cpu/cpu.h"
|
||||||
|
#include "../../../bochs/iodev/iodev.h"
|
||||||
#include "../SALInst.hpp"
|
#include "../SALInst.hpp"
|
||||||
|
|
||||||
aspect fireInterrupt
|
aspect fireInterrupt
|
||||||
@ -36,7 +37,6 @@ aspect InterruptDone
|
|||||||
}else{
|
}else{
|
||||||
if(*(tjp->arg<0>()) == 32 + sal::interrupt_to_fire){
|
if(*(tjp->arg<0>()) == 32 + sal::interrupt_to_fire){
|
||||||
DEV_pic_lower_irq(sal::interrupt_to_fire);
|
DEV_pic_lower_irq(sal::interrupt_to_fire);
|
||||||
|
|
||||||
sal::simulator.fireInterruptDone();
|
sal::simulator.fireInterruptDone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user