interrupts can now be fired

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1010 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hellwig
2012-03-30 14:32:26 +00:00
parent f15586cb60
commit 2a979ba25c
5 changed files with 30 additions and 1 deletions

View File

@ -18,6 +18,7 @@
#include "../../../bochs/bochs.h"
#include "../../../bochs/cpu/cpu.h"
#include "../../../bochs/config.h"
#include "../../../bochs/iodev/iodev.h"
using namespace std;
@ -91,6 +92,15 @@ class BochsController : public SimulatorController
* @param exCode Individual exit code
*/
void terminate(int exCode = EXIT_SUCCESS);
/**
* Fire an interrupt.
* @param irq Interrupt to be fired
*/
void fireInterrupt(unsigned irq);
/**
* Fire done: Callback from Simulator
*/
void fireInterruptDone();
#ifdef DEBUG
/**
* Enables instruction pointer debugging output.

View File

@ -9,6 +9,8 @@ namespace sal
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;
std::string sr_path = "";
BochsController::BochsController()
@ -176,4 +178,18 @@ void BochsController::terminate(int exCode)
exit(exCode);
}
void BochsController::fireInterrupt(unsigned irq)
{
interrupt_injection_request = true;
interrupt_to_fire = irq;
m_CurrFlow = m_Flows.getCurrent();
m_Flows.resume();
}
void BochsController::fireInterruptDone()
{
interrupt_injection_request = false;
m_Flows.toggle(m_CurrFlow);
}
} // end-of-namespace: sal

View File

@ -8,11 +8,12 @@
namespace sal{
//DanceOS Richard Hellwig
#ifdef DANCEOS_RESTORE
extern bx_bool restore_bochs_request;
extern bx_bool save_bochs_request;
extern bx_bool reboot_bochs_request;
extern bx_bool interrupt_injection_request;
extern unsigned interrupt_to_fire;
extern std::string sr_path;
#endif

View File

@ -22,6 +22,7 @@
// Miscellaneous
#cmakedefine CONFIG_STFU
#cmakedefine CONFIG_SUPPRESS_INTERRUPTS
#cmakedefine CONFIG_FIRE_INTERRUPTS
#cmakedefine CONFIG_DISABLE_KEYB_INTERRUPTS
// Fault injection

View File

@ -14,6 +14,7 @@ OPTION(CONFIG_SR_SAVE "Target backend: State saving" OFF)
OPTION(CONFIG_SR_REBOOT "Target backend: Reboot" OFF)
OPTION(CONFIG_STFU "Misc: Reduced verbosity" OFF)
OPTION(CONFIG_SUPPRESS_INTERRUPTS "Target backend: Suppress interrupts" OFF)
OPTION(CONFIG_FIRE_INTERRUPTS "Target backend: Fire interrupts" OFF)
OPTION(CONFIG_DISABLE_KEYB_INTERRUPTS "Target backend: Suppress keyboard interrupts" OFF)
OPTION(CONFIG_FI_MEM_ACCESS_BITFLIP "deprecated something" OFF)