Architecture changes (only gem5 implementation right now):
- The register manager is gone. It's functionality is now encapsulated in the CPU classes. - For the client, there is the ConcreteCPU class that encapsulates the access to the CPU state (including registers) and architecture details. The correspondig objects for the CPUs inside the simulator can be accessed through the SimulatorController.getCPU() function. - Listener got a new ConcreteCPU* member to filter for which CPU the events should fire. The default NULL is used as wildcard for all aviable CPUs. The events respectively got a ConcreteCPU* member to indicate which CPU really fired the event. - For the server, there is CPUArchitecture to access the architecture details. git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1966 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
47
src/core/sal/CPUState.cc
Normal file
47
src/core/sal/CPUState.cc
Normal file
@ -0,0 +1,47 @@
|
||||
#include "CPUState.hpp"
|
||||
|
||||
namespace fail {
|
||||
|
||||
// FIXME: Bochs specific? If not, at least get rid of this global variable.
|
||||
int interrupt_to_fire = -1;
|
||||
|
||||
bool CPUState::isSuppressedInterrupt(unsigned interruptNum)
|
||||
{
|
||||
for (size_t i = 0; i < m_SuppressedInterrupts.size(); i++)
|
||||
if ((m_SuppressedInterrupts[i] == interruptNum ||
|
||||
m_SuppressedInterrupts[i] == ANY_INTERRUPT) &&
|
||||
interruptNum != (unsigned)interrupt_to_fire + 32) {
|
||||
if ((int)interruptNum == interrupt_to_fire + 32) {
|
||||
interrupt_to_fire = -1;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CPUState::addSuppressedInterrupt(unsigned interruptNum)
|
||||
{
|
||||
// Check if already existing:
|
||||
if (isSuppressedInterrupt(interruptNum+32))
|
||||
return false; // already added: nothing to do here
|
||||
|
||||
if (interruptNum == ANY_INTERRUPT)
|
||||
m_SuppressedInterrupts.push_back(interruptNum);
|
||||
else
|
||||
m_SuppressedInterrupts.push_back(interruptNum+32);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPUState::removeSuppressedInterrupt(unsigned interruptNum)
|
||||
{
|
||||
for (size_t i = 0; i < m_SuppressedInterrupts.size(); i++) {
|
||||
if (m_SuppressedInterrupts[i] == interruptNum+32 ||
|
||||
m_SuppressedInterrupts[i] == ANY_INTERRUPT)
|
||||
m_SuppressedInterrupts.erase(m_SuppressedInterrupts.begin() + i);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // end-of-namespace: fail
|
||||
Reference in New Issue
Block a user