FIXMEs and comments updated due to last architecture-related changes

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@2005 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
adrian
2013-01-17 13:41:03 +00:00
parent c4e5ab4f58
commit d3cf2359a4
4 changed files with 12 additions and 11 deletions

View File

@ -2,9 +2,6 @@
namespace fail { namespace fail {
// FIXME: Bochs specific? If not, at least get rid of this global variable.
int interrupt_to_fire = -1;
void CPUArchitecture::addRegister(Register* reg) void CPUArchitecture::addRegister(Register* reg)
{ {
assert(!reg->isAssigned() && "FATAL ERROR: The register is already assigned!"); assert(!reg->isAssigned() && "FATAL ERROR: The register is already assigned!");

View File

@ -2,7 +2,6 @@
namespace fail { namespace fail {
// FIXME: Bochs specific? If not, at least get rid of this global variable.
int interrupt_to_fire = -1; int interrupt_to_fire = -1;
bool CPUState::isSuppressedInterrupt(unsigned interruptNum) bool CPUState::isSuppressedInterrupt(unsigned interruptNum)
@ -11,12 +10,14 @@ bool CPUState::isSuppressedInterrupt(unsigned interruptNum)
if ((m_SuppressedInterrupts[i] == interruptNum || if ((m_SuppressedInterrupts[i] == interruptNum ||
m_SuppressedInterrupts[i] == ANY_INTERRUPT) && m_SuppressedInterrupts[i] == ANY_INTERRUPT) &&
interruptNum != (unsigned)interrupt_to_fire + 32) { interruptNum != (unsigned)interrupt_to_fire + 32) {
// FIXME: This should be dead code...(?)
if ((int)interruptNum == interrupt_to_fire + 32) { if ((int)interruptNum == interrupt_to_fire + 32) {
interrupt_to_fire = -1; interrupt_to_fire = -1;
return true; return true;
} }
return true; return true;
} }
// FIXME: This is simulator-(x86)-specific stuff... (?)
return false; return false;
} }
@ -26,6 +27,8 @@ bool CPUState::addSuppressedInterrupt(unsigned interruptNum)
if (isSuppressedInterrupt(interruptNum+32)) if (isSuppressedInterrupt(interruptNum+32))
return false; // already added: nothing to do here return false; // already added: nothing to do here
// FIXME: addSuppressedInterrupt(ANY_INTERRUPT) can still be called more
// than once. This is not handled by the if-statement above.
if (interruptNum == ANY_INTERRUPT) if (interruptNum == ANY_INTERRUPT)
m_SuppressedInterrupts.push_back(interruptNum); m_SuppressedInterrupts.push_back(interruptNum);
else else

View File

@ -19,10 +19,11 @@ namespace fail {
* about an event reported by the simulator backend. * about an event reported by the simulator backend.
*/ */
class BaseEvent { class BaseEvent {
protected:
ConcreteCPU* m_CPU; //!< the CPU object that triggered the event
public: public:
BaseEvent(ConcreteCPU* cpu = NULL) : m_CPU(cpu) { } BaseEvent(ConcreteCPU* cpu = NULL) : m_CPU(cpu) { }
virtual ~BaseEvent() { } virtual ~BaseEvent() { }
/** /**
* Returns a pointer to the CPU that triggered this event. * Returns a pointer to the CPU that triggered this event.
* @return triggering CPU * @return triggering CPU
@ -33,8 +34,6 @@ public:
* @param cpu new CPU which caused this event * @param cpu new CPU which caused this event
*/ */
void setTriggerCPU(ConcreteCPU* cpu) { m_CPU = cpu; } void setTriggerCPU(ConcreteCPU* cpu) { m_CPU = cpu; }
protected:
ConcreteCPU* m_CPU;
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Specialized events: // Specialized events:
@ -54,6 +53,7 @@ public:
* the subclasses. * the subclasses.
* @param trigger the triggering address of the breakpoint event * @param trigger the triggering address of the breakpoint event
* @param address_space the address space identifier for this event * @param address_space the address space identifier for this event
* @param cpu the Fail* CPU object that triggered the breakpoint
*/ */
BPEvent(address_t trigger, address_t address_space, ConcreteCPU* cpu = NULL) BPEvent(address_t trigger, address_t address_space, ConcreteCPU* cpu = NULL)
: BaseEvent(cpu), m_TriggerInstrPtr(trigger), m_AddressSpace(address_space) { } : BaseEvent(cpu), m_TriggerInstrPtr(trigger), m_AddressSpace(address_space) { }
@ -114,7 +114,7 @@ public:
* @param width width of memory access (= # Bytes) * @param width width of memory access (= # Bytes)
* @param triggerIP the instruction pointer that actually triggered the memory access * @param triggerIP the instruction pointer that actually triggered the memory access
* @param type the type of memory access (r, w, rw) * @param type the type of memory access (r, w, rw)
* @param cpu the cpu that triggered the event * @param cpu the CPU that triggered the event
*/ */
MemAccessEvent(address_t triggerAddr, size_t width, address_t triggerIP, access_type_t type, MemAccessEvent(address_t triggerAddr, size_t width, address_t triggerIP, access_type_t type,
ConcreteCPU* cpu = NULL) ConcreteCPU* cpu = NULL)
@ -221,7 +221,7 @@ public:
* @param nmi the new NMI (non maskable interrupt) flag state * @param nmi the new NMI (non maskable interrupt) flag state
* @param triggerNum system and type specific number identifying the requestet * @param triggerNum system and type specific number identifying the requestet
* "trouble-type" * "trouble-type"
* @param cpu the cpu that triggered the event * @param cpu the CPU that triggered the event
*/ */
InterruptEvent(bool nmi, int triggerNum, ConcreteCPU* cpu = NULL) InterruptEvent(bool nmi, int triggerNum, ConcreteCPU* cpu = NULL)
: TroubleEvent(triggerNum, cpu), m_IsNMI(nmi) { } : TroubleEvent(triggerNum, cpu), m_IsNMI(nmi) { }
@ -277,7 +277,7 @@ public:
/** /**
* Initialises an IOPortEvent * Initialises an IOPortEvent
* @param data the data which has been communicated through the I/O port * @param data the data which has been communicated through the I/O port
* @param cpu the cpu that triggered the event * @param cpu the CPU that triggered the event
*/ */
IOPortEvent(unsigned char data = 0, ConcreteCPU* cpu = NULL) : BaseEvent(cpu), m_Data(data) { } IOPortEvent(unsigned char data = 0, ConcreteCPU* cpu = NULL) : BaseEvent(cpu), m_Data(data) { }
/** /**

View File

@ -105,6 +105,7 @@ public:
* @param port the port used for communications * @param port the port used for communications
*/ */
void onGuestSystem(char data, unsigned port); void onGuestSystem(char data, unsigned port);
// FIXME: ConcreteCPU* cpu is missing here...
/** /**
* (Conditional) Jump-instruction handler. * (Conditional) Jump-instruction handler.
* @param cpu the CPU that did the jump * @param cpu the CPU that did the jump