From 0d2a5175cf1343110e46e4e9068ff67039228b05 Mon Sep 17 00:00:00 2001 From: Lars Rademacher Date: Mon, 21 Oct 2013 18:30:14 +0200 Subject: [PATCH] panda: comment fix & remove unimplemented functions Change-Id: Ibe533a41871bbf186272d6df43966dabb692dede --- src/core/sal/panda/PandaController.cc | 26 +++++--------------------- src/core/sal/panda/PandaController.hpp | 25 +++++++------------------ 2 files changed, 12 insertions(+), 39 deletions(-) diff --git a/src/core/sal/panda/PandaController.cc b/src/core/sal/panda/PandaController.cc index 1f89ced8..5b47d829 100644 --- a/src/core/sal/panda/PandaController.cc +++ b/src/core/sal/panda/PandaController.cc @@ -15,13 +15,16 @@ #error Save/Restore is not yet implemented for Pandaboard #endif +#if defined(CONFIG_EVENT_IOPORT) + #error IoPort events not implemented for pandaboard +#endif + namespace fail { PandaController::PandaController() : SimulatorController(new PandaMemoryManager()), m_CurrFlow(NULL) { - // ToDo: Multiple CPUs? => for (unsigned i = 0; i < BX_SMP_PROCESSORS; i++) addCPU(new ConcreteCPU(0)); } @@ -51,31 +54,12 @@ void PandaController::onTimerTrigger(void* thisPtr) simulator.m_LstList.triggerActiveListeners(); } -void PandaController::onIOPort(ConcreteCPU* cpu, unsigned char data, unsigned port, bool out) { - // Check for active IOPortListeners: - ListenerManager::iterator it = m_LstList.begin(); - while (it != m_LstList.end()) { - BaseListener* pLi = *it; - IOPortListener* pIOPt = dynamic_cast(pLi); - if (pIOPt != NULL && pIOPt->isMatching(port, out)) { - pIOPt->setData(data); - pIOPt->setTriggerCPU(cpu); - it = m_LstList.makeActive(it); - // "it" has already been set to the next element (by calling - // makeActive()): - continue; // -> skip iterator increment - } - it++; - } - m_LstList.triggerActiveListeners(); -} - bool PandaController::save(const std::string& path) { // ToDo (PORT): Save /*int stat; - + stat = mkdir(path.c_str(), 0777); if (!(stat == 0 || errno == EEXIST)) { return false; diff --git a/src/core/sal/panda/PandaController.hpp b/src/core/sal/panda/PandaController.hpp index 8d4ee6a5..efb9219a 100644 --- a/src/core/sal/panda/PandaController.hpp +++ b/src/core/sal/panda/PandaController.hpp @@ -34,39 +34,30 @@ public: /* ******************************************************************** * Standard Listener Handler API: * ********************************************************************/ - /** - * I/O port communication handler. This method is called (from - * the IOPortCom aspect) every time when pandaboard performs a port I/O operation. - * @param cpu the CPU that caused the IO port access - * @param data the data transmitted - * @param port the port it was transmitted on - * @param out \c true if the I/O traffic has been outbound, \c false otherwise - */ - void onIOPort(ConcreteCPU* cpu, unsigned char data, unsigned port, bool out); /** * Internal handler for TimerListeners. This method is called when a previously - * registered (openocd-wrapper) timer triggers. It searches for the provided - * TimerListener object within the ListenerManager and fires such an event - * by calling \c triggerActiveListeners(). - * @param thisPtr a pointer to the TimerListener-object triggered + * registered timer in openocd main loop triggers. It searches for the + * provided TimerListener object within the ListenerManager and fires + * such an event by calling * \c triggerActiveListeners(). + * @param thisPtr a pointer to the TimerListener-object triggered. */ void onTimerTrigger(void *thisPtr); /* ******************************************************************** * Simulator Controller & Access API: * ********************************************************************/ /** - * Save device state. + * Save simulator state. * @param path Location to store state information * @return \c true if the state has been successfully saved, \c false otherwise */ bool save(const std::string& path); /** - * Restore device state. Clears all Listeners. + * Restore simulator state. Clears all Listeners. * @param path Location to previously saved state information */ void restore(const std::string& path); /** - * Reboot pandaboard. Clears all Listeners. + * Reboot simulator. Clears all Listeners. */ void reboot(); /** @@ -76,12 +67,10 @@ public: //void fireInterrupt(unsigned irq); virtual simtime_t getTimerTicks() { - // return bx_pc_system.time_ticks(); // ToDo (PORT) return 0; } virtual simtime_t getTimerTicksPerSecond() { - // return bx_pc_system.time_ticks() / bx_pc_system.time_usec() * 1000000; /* imprecise hack */ // ToDo (PORT) return 0; }