diff --git a/src/core/sal/SimulatorController.cc b/src/core/sal/SimulatorController.cc index e99826f6..2a672eea 100644 --- a/src/core/sal/SimulatorController.cc +++ b/src/core/sal/SimulatorController.cc @@ -6,6 +6,8 @@ namespace fail { // External reference declared in SALInst.hpp ConcreteSimulatorController simulator; +// FIXME: Bochs specific? If not, at least get rid of this global variable. +int interrupt_to_fire = -1; bool SimulatorController::addListener(BaseListener* li) { diff --git a/src/core/sal/SimulatorController.hpp b/src/core/sal/SimulatorController.hpp index 3e056edb..b0361fa3 100644 --- a/src/core/sal/SimulatorController.hpp +++ b/src/core/sal/SimulatorController.hpp @@ -229,6 +229,9 @@ public: unsigned getListenerCount() const { return m_LstList.getListenerCount(); } }; +// FIXME (see SimulatorController.cc): Weird, homeless global variable +extern int interrupt_to_fire; + } // end-of-namespace: fail #endif // __SIMULATOR_CONTROLLER_HPP__ diff --git a/src/core/sal/bochs/BochsController.cc b/src/core/sal/bochs/BochsController.cc index 9c3e3be2..c6d13b88 100644 --- a/src/core/sal/bochs/BochsController.cc +++ b/src/core/sal/bochs/BochsController.cc @@ -16,7 +16,6 @@ std::string sr_path = ""; bx_bool reboot_bochs_request = false; bx_bool interrupt_injection_request = false; -int interrupt_to_fire = -1; BochsController::BochsController() : SimulatorController(new BochsRegisterManager(), new BochsMemoryManager()), diff --git a/src/core/sal/bochs/FailBochsGlobals.hpp b/src/core/sal/bochs/FailBochsGlobals.hpp index 0241fdcb..df32201d 100644 --- a/src/core/sal/bochs/FailBochsGlobals.hpp +++ b/src/core/sal/bochs/FailBochsGlobals.hpp @@ -15,7 +15,6 @@ namespace fail { extern bx_bool reboot_bochs_request; extern bx_bool interrupt_injection_request; -extern int interrupt_to_fire; } // end-of-namespace: fail diff --git a/src/core/sal/gem5/Gem5Controller.cc b/src/core/sal/gem5/Gem5Controller.cc index cb86aa85..d5490d42 100644 --- a/src/core/sal/gem5/Gem5Controller.cc +++ b/src/core/sal/gem5/Gem5Controller.cc @@ -8,8 +8,6 @@ namespace fail { -int interrupt_to_fire = -1; - void Gem5Controller::save(const std::string &path) { // Takes a snapshot in the m5out dir diff --git a/src/core/sal/gem5/Gem5Controller.hpp b/src/core/sal/gem5/Gem5Controller.hpp index fc1ed551..f7fe168d 100644 --- a/src/core/sal/gem5/Gem5Controller.hpp +++ b/src/core/sal/gem5/Gem5Controller.hpp @@ -7,8 +7,6 @@ namespace fail { -extern int interrupt_to_fire; - class Gem5Controller : public SimulatorController { public: void onBreakpoint(address_t instrPtr, address_t address_space);