panda: comment fix & remove unimplemented functions

Change-Id: Ibe533a41871bbf186272d6df43966dabb692dede
This commit is contained in:
Lars Rademacher
2013-10-21 18:30:14 +02:00
parent e8eebb69ba
commit 0d2a5175cf
2 changed files with 12 additions and 39 deletions

View File

@ -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<IOPortListener*>(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;

View File

@ -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;
}