Skip to content
Snippets Groups Projects
Commit 2a979ba2 authored by Richard Hellwig's avatar Richard Hellwig
Browse files

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
parent f15586cb
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
......@@ -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
......@@ -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
......
......@@ -22,6 +22,7 @@
// Miscellaneous
#cmakedefine CONFIG_STFU
#cmakedefine CONFIG_SUPPRESS_INTERRUPTS
#cmakedefine CONFIG_FIRE_INTERRUPTS
#cmakedefine CONFIG_DISABLE_KEYB_INTERRUPTS
// Fault injection
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment