gem5
|
#include <interrupts.hh>
Public Types | |
typedef X86LocalApicParams | Params |
Public Types inherited from BasicPioDevice | |
typedef BasicPioDeviceParams | Params |
Public Types inherited from PioDevice | |
typedef PioDeviceParams | Params |
Public Types inherited from MemObject | |
typedef MemObjectParams | Params |
Public Types inherited from ClockedObject | |
typedef ClockedObjectParams | Params |
Parameters of ClockedObject. More... | |
Public Types inherited from SimObject | |
typedef SimObjectParams | Params |
Public Member Functions | |
ApicTimerEvent (Interrupts *_localApic) | |
void | process () |
int | findRegArrayMSB (ApicRegIndex base) |
void | updateIRRV () |
void | updateISRV () |
void | setRegArrayBit (ApicRegIndex base, uint8_t vector) |
void | clearRegArrayBit (ApicRegIndex base, uint8_t vector) |
bool | getRegArrayBit (ApicRegIndex base, uint8_t vector) |
void | requestInterrupt (uint8_t vector, uint8_t deliveryMode, bool level) |
int | getInitialApicId () |
void | setCPU (BaseCPU *newCPU) |
const Params * | params () const |
void | init () override |
Tick | read (PacketPtr pkt) override |
Pure virtual function that the device must implement. More... | |
Tick | write (PacketPtr pkt) override |
Pure virtual function that the device must implement. More... | |
Tick | recvMessage (PacketPtr pkt) override |
Tick | recvResponse (PacketPtr pkt) override |
bool | triggerTimerInterrupt () |
AddrRangeList | getIntAddrRange () const override |
BaseMasterPort & | getMasterPort (const std::string &if_name, PortID idx=InvalidPortID) override |
Get a master port with a given name and index. More... | |
BaseSlavePort & | getSlavePort (const std::string &if_name, PortID idx=InvalidPortID) override |
Get a slave port with a given name and index. More... | |
uint32_t | readReg (ApicRegIndex miscReg) |
void | setReg (ApicRegIndex reg, uint32_t val) |
void | setRegNoEffect (ApicRegIndex reg, uint32_t val) |
Interrupts (Params *p) | |
bool | checkInterrupts (ThreadContext *tc) const |
bool | checkInterruptsRaw () const |
Check if there are pending interrupts without ignoring the interrupts disabled flag. More... | |
bool | hasPendingUnmaskable () const |
Check if there are pending unmaskable interrupts. More... | |
Fault | getInterrupt (ThreadContext *tc) |
void | updateIntrInfo (ThreadContext *tc) |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
void | post (int int_num, int index) |
void | clear (int int_num, int index) |
void | clearAll () |
Public Member Functions inherited from BasicPioDevice | |
BasicPioDevice (const Params *p, Addr size) | |
const Params * | params () const |
virtual AddrRangeList | getAddrRanges () const |
Determine the address ranges that this device responds to. More... | |
Public Member Functions inherited from PioDevice | |
PioDevice (const Params *p) | |
virtual | ~PioDevice () |
const Params * | params () const |
Public Member Functions inherited from MemObject | |
const Params * | params () const |
MemObject (const Params *params) | |
Public Member Functions inherited from ClockedObject | |
ClockedObject (const ClockedObjectParams *p) | |
const Params * | params () const |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Enums::PwrState | pwrState () const |
std::string | pwrStateName () const |
std::vector< double > | pwrStateWeights () const |
Returns the percentage residency for each power state. More... | |
void | computeStats () |
Record stats values like state residency by computing the time difference from previous update. More... | |
void | pwrState (Enums::PwrState) |
void | regStats () override |
Register statistics for this object. More... | |
Public Member Functions inherited from SimObject | |
const Params * | params () const |
SimObject (const Params *_params) | |
virtual | ~SimObject () |
virtual const std::string | name () const |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. More... | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. More... | |
virtual void | resetStats () |
Reset statistics associated with this object. More... | |
virtual void | regProbePoints () |
Register probe points for this object. More... | |
virtual void | regProbeListeners () |
Register probe listeners for this object. More... | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. More... | |
virtual void | startup () |
startup() is the final initialization call before simulation. More... | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. More... | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. More... | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. More... | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from EventManager | |
EventManager (EventManager &em) | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick)-1) |
void | setCurTick (Tick newVal) |
Public Member Functions inherited from Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. More... | |
virtual void | notifyFork () |
Notify a child process of a fork. More... | |
Public Member Functions inherited from Clocked | |
void | updateClockPeriod () const |
Update the tick to the current tick. More... | |
Tick | clockEdge (Cycles cycles=Cycles(0)) const |
Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. More... | |
Cycles | curCycle () const |
Determine the current cycle, corresponding to a tick aligned to a clock edge. More... | |
Tick | nextCycle () const |
Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More... | |
uint64_t | frequency () const |
Tick | clockPeriod () const |
double | voltage () const |
Cycles | ticksToCycles (Tick t) const |
Tick | cyclesToTicks (Cycles c) const |
Public Attributes | |
ApicTimerEvent | apicTimerEvent |
bool | pendingSmi |
uint8_t | smiVector |
bool | pendingNmi |
uint8_t | nmiVector |
bool | pendingExtInt |
uint8_t | extIntVector |
bool | pendingInit |
uint8_t | initVector |
bool | pendingStartup |
uint8_t | startupVector |
bool | startedUp |
bool | pendingUnmaskableInt |
int | pendingIPIs |
uint8_t | IRRV |
uint8_t | ISRV |
BaseCPU * | cpu |
int | initialApicId |
IntSlavePort | intSlavePort |
Protected Member Functions | |
BitUnion32 (LVTEntry) Bitfield<7 | |
Protected Member Functions inherited from Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. More... | |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
Protected Member Functions inherited from Clocked | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. More... | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (Clocked &)=delete |
virtual | ~Clocked () |
Virtual destructor due to inheritance. More... | |
void | resetClock () const |
Reset the object's clock using the current global tick value. More... | |
Protected Attributes | |
uint32_t | regs [NUM_APIC_REGS] |
vector | |
Bitfield< 10, 8 > | deliveryMode |
Bitfield< 12 > | status |
Bitfield< 13 > | polarity |
Bitfield< 14 > | remoteIRR |
Bitfield< 15 > | trigger |
Bitfield< 16 > | masked |
Bitfield< 17 > | periodic |
Protected Attributes inherited from BasicPioDevice | |
Addr | pioAddr |
Address that the device listens to. More... | |
Addr | pioSize |
Size that the device's address range. More... | |
Tick | pioDelay |
Delay that the device experinces on an access. More... | |
Protected Attributes inherited from PioDevice | |
System * | sys |
PioPort | pioPort |
The pioPort that handles the requests for us and provides us requests that it sees. More... | |
Protected Attributes inherited from ClockedObject | |
Enums::PwrState | _currPwrState |
To keep track of the current power state. More... | |
Tick | prvEvalTick |
Stats::Scalar | numPwrStateTransitions |
Stats::Distribution | pwrStateClkGateDist |
Stats::Vector | pwrStateResidencyTicks |
Protected Attributes inherited from SimObject | |
const SimObjectParams * | _params |
Cached copy of the object parameters. More... | |
Protected Attributes inherited from EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from SimObject | |
static void | serializeAll (CheckpointOut &cp) |
Serialize all SimObjects in the system. More... | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. More... | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Get the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
static void | unserializeGlobals (CheckpointIn &cp) |
Static Public Attributes inherited from Serializable | |
static int | ckptCount = 0 |
static int | ckptMaxCount = 0 |
static int | ckptPrevCount = -1 |
Private Member Functions inherited from X86ISA::IntDevice | |
IntDevice (MemObject *parent, Tick latency=0) | |
virtual | ~IntDevice () |
virtual void | signalInterrupt (int line) |
virtual void | raiseInterruptPin (int number) |
virtual void | lowerInterruptPin (int number) |
Private Attributes inherited from X86ISA::IntDevice | |
IntMasterPort | intMasterPort |
Definition at line 75 of file interrupts.hh.
typedef X86LocalApicParams X86ISA::Interrupts::Params |
Definition at line 202 of file interrupts.hh.
X86ISA::Interrupts::Interrupts | ( | Params * | p | ) |
Definition at line 589 of file interrupts.cc.
References X86ISA::APIC_DESTINATION_FORMAT, IRRV, ISRV, and regs.
|
inline |
Definition at line 100 of file interrupts.hh.
|
protected |
bool X86ISA::Interrupts::checkInterrupts | ( | ThreadContext * | tc | ) | const |
Definition at line 610 of file interrupts.cc.
References X86ISA::APIC_TASK_PRIORITY, bits(), DPRINTF, X86ISA::MISCREG_RFLAGS, and ThreadContext::readMiscRegNoEffect().
bool X86ISA::Interrupts::checkInterruptsRaw | ( | ) | const |
Check if there are pending interrupts without ignoring the interrupts disabled flag.
Definition at line 632 of file interrupts.cc.
References X86ISA::APIC_TASK_PRIORITY, and bits().
|
inline |
Definition at line 310 of file interrupts.hh.
References panic.
|
inline |
Definition at line 316 of file interrupts.hh.
References panic.
|
inline |
Definition at line 175 of file interrupts.hh.
References regs.
|
inline |
Definition at line 145 of file interrupts.hh.
References findMsbSet(), X86ISA::offset, and regs.
Referenced by updateIRRV(), and updateISRV().
|
inline |
Definition at line 197 of file interrupts.hh.
References initialApicId.
Referenced by X86ISA::I82094AA::signalInterrupt().
|
overridevirtual |
Reimplemented from X86ISA::IntDevice.
Definition at line 351 of file interrupts.cc.
References X86ISA::PhysAddrAPICRangeSize, RangeEx(), and X86ISA::x86InterruptAddress().
Fault X86ISA::Interrupts::getInterrupt | ( | ThreadContext * | tc | ) |
Definition at line 640 of file interrupts.cc.
|
inlineoverridevirtual |
Get a master port with a given name and index.
This is used at binding time and returns a reference to a protocol-agnostic base master port.
if_name | Port name |
idx | Index in the case of a VectorPort |
Reimplemented from MemObject.
Definition at line 236 of file interrupts.hh.
References MemObject::getMasterPort(), and X86ISA::IntDevice::intMasterPort.
|
inline |
Definition at line 181 of file interrupts.hh.
|
inlineoverridevirtual |
Get a slave port with a given name and index.
This is used at binding time and returns a reference to a protocol-agnostic base master port.
if_name | Port name |
idx | Index in the case of a VectorPort |
Reimplemented from PioDevice.
Definition at line 245 of file interrupts.hh.
References PioDevice::getSlavePort(), and intSlavePort.
|
inline |
Check if there are pending unmaskable interrupts.
Definition at line 289 of file interrupts.hh.
References pendingUnmaskableInt.
|
overridevirtual |
Reimplemented from X86ISA::IntDevice.
Definition at line 290 of file interrupts.cc.
References X86ISA::IntDevice::init(), and PioDevice::init().
|
inline |
Definition at line 207 of file interrupts.hh.
References SimObject::_params.
|
inline |
Definition at line 304 of file interrupts.hh.
References panic.
|
inline |
Definition at line 104 of file interrupts.hh.
References X86ISA::APIC_INITIAL_COUNT, readReg(), setReg(), and triggerTimerInterrupt().
Pure virtual function that the device must implement.
Called when a read command is recieved by the port.
pkt | Packet describing this request |
Implements PioDevice.
Definition at line 191 of file interrupts.cc.
References X86ISA::decodeAddr(), DPRINTF, Packet::getAddr(), Packet::getSize(), BigEndianGuest::htog(), Packet::makeAtomicResponse(), X86ISA::mask, X86ISA::offset, panic, BasicPioDevice::pioAddr, BasicPioDevice::pioDelay, readReg(), X86ISA::reg, Packet::setData(), and X86ISA::val.
uint32_t X86ISA::Interrupts::readReg | ( | ApicRegIndex | miscReg | ) |
Definition at line 362 of file interrupts.cc.
References X86ISA::APIC_ARBITRATION_PRIORITY, X86ISA::APIC_CURRENT_COUNT, X86ISA::APIC_DIVIDE_CONFIGURATION, X86ISA::APIC_ERROR_STATUS, X86ISA::APIC_INTERNAL_STATE, X86ISA::APIC_PROCESSOR_PRIORITY, X86ISA::APIC_TRIGGER_MODE(), curTick(), divideFromConf(), panic, X86ISA::reg, ULL, and X86ISA::val.
Referenced by process(), read(), and X86ISA::I82094AA::signalInterrupt().
Reimplemented from X86ISA::IntDevice.
Definition at line 307 of file interrupts.cc.
References Packet::cmd, DPRINTF, Packet::get(), Packet::getAddr(), Packet::makeAtomicResponse(), MemCmd::MessageReq, X86ISA::offset, panic, and X86ISA::x86InterruptAddress().
Reimplemented from X86ISA::IntDevice.
Definition at line 335 of file interrupts.cc.
References X86ISA::APIC_INTERRUPT_COMMAND_LOW, Packet::cmd, DPRINTF, Packet::isError(), and MemCmd::MessageResp.
void X86ISA::Interrupts::requestInterrupt | ( | uint8_t | vector, |
uint8_t | deliveryMode, | ||
bool | level | ||
) |
Definition at line 225 of file interrupts.cc.
References X86ISA::APIC_INTERRUPT_REQUEST_BASE, X86ISA::APIC_TRIGGER_MODE_BASE, DPRINTF, FullSystem, and X86ISA::vector.
Referenced by triggerTimerInterrupt().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 709 of file interrupts.cc.
References X86ISA::NUM_APIC_REGS, SERIALIZE_ARRAY, and SERIALIZE_SCALAR.
void X86ISA::Interrupts::setCPU | ( | BaseCPU * | newCPU | ) |
Definition at line 275 of file interrupts.cc.
References X86ISA::APIC_ID, panic, and X86ISA::x86LocalAPICAddress().
void X86ISA::Interrupts::setReg | ( | ApicRegIndex | reg, |
uint32_t | val | ||
) |
Definition at line 400 of file interrupts.cc.
References X86ISA::APIC_ARBITRATION_PRIORITY, X86ISA::APIC_CURRENT_COUNT, X86ISA::APIC_DESTINATION_FORMAT, X86ISA::APIC_DIVIDE_CONFIGURATION, X86ISA::APIC_EOI, X86ISA::APIC_ERROR_STATUS, X86ISA::APIC_ID, X86ISA::APIC_IN_SERVICE(), X86ISA::APIC_IN_SERVICE_BASE, X86ISA::APIC_INITIAL_COUNT, X86ISA::APIC_INTERNAL_STATE, X86ISA::APIC_INTERRUPT_COMMAND_HIGH, X86ISA::APIC_INTERRUPT_COMMAND_LOW, X86ISA::APIC_INTERRUPT_REQUEST(), X86ISA::APIC_LOGICAL_DESTINATION, X86ISA::APIC_LVT_ERROR, X86ISA::APIC_LVT_LINT0, X86ISA::APIC_LVT_LINT1, X86ISA::APIC_LVT_PERFORMANCE_MONITORING_COUNTERS, X86ISA::APIC_LVT_THERMAL_SENSOR, X86ISA::APIC_LVT_TIMER, X86ISA::APIC_PROCESSOR_PRIORITY, X86ISA::APIC_SPURIOUS_INTERRUPT_VECTOR, X86ISA::APIC_TASK_PRIORITY, X86ISA::APIC_TRIGGER_MODE(), X86ISA::APIC_VERSION, bits(), curTick(), divideFromConf(), hack_once, ArmISA::i, X86ISA::offset, panic, X86ISA::reg, ULL, X86ISA::val, and warn.
Referenced by process().
|
inline |
Definition at line 169 of file interrupts.hh.
References regs.
|
inline |
Definition at line 261 of file interrupts.hh.
References X86ISA::reg, regs, and X86ISA::val.
Referenced by X86ISA::initCPU().
|
inline |
Definition at line 226 of file interrupts.hh.
References X86ISA::APIC_LVT_TIMER, regs, and requestInterrupt().
Referenced by process().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 734 of file interrupts.cc.
References X86ISA::NUM_APIC_REGS, UNSERIALIZE_ARRAY, and UNSERIALIZE_SCALAR.
void X86ISA::Interrupts::updateIntrInfo | ( | ThreadContext * | tc | ) |
Definition at line 674 of file interrupts.cc.
References X86ISA::APIC_IN_SERVICE_BASE, X86ISA::APIC_INTERRUPT_REQUEST_BASE, and DPRINTF.
|
inline |
Definition at line 157 of file interrupts.hh.
References X86ISA::APIC_INTERRUPT_REQUEST_BASE, findRegArrayMSB(), and IRRV.
|
inline |
Definition at line 163 of file interrupts.hh.
References X86ISA::APIC_IN_SERVICE_BASE, findRegArrayMSB(), and ISRV.
Pure virtual function that the device must implement.
Called when a write command is recieved by the port.
pkt | Packet describing this request |
Implements PioDevice.
Definition at line 208 of file interrupts.cc.
References X86ISA::decodeAddr(), DPRINTF, Packet::getAddr(), Packet::getSize(), BigEndianGuest::gtoh(), Packet::makeAtomicResponse(), X86ISA::mask, X86ISA::offset, panic, X86ISA::reg, X86ISA::val, and Packet::writeData().
ApicTimerEvent X86ISA::Interrupts::apicTimerEvent |
Definition at line 112 of file interrupts.hh.
BaseCPU* X86ISA::Interrupts::cpu |
Definition at line 188 of file interrupts.hh.
|
protected |
Definition at line 83 of file interrupts.hh.
uint8_t X86ISA::Interrupts::extIntVector |
Definition at line 125 of file interrupts.hh.
int X86ISA::Interrupts::initialApicId |
Definition at line 190 of file interrupts.hh.
Referenced by getInitialApicId().
uint8_t X86ISA::Interrupts::initVector |
Definition at line 127 of file interrupts.hh.
IntSlavePort X86ISA::Interrupts::intSlavePort |
Definition at line 193 of file interrupts.hh.
Referenced by getSlavePort().
uint8_t X86ISA::Interrupts::IRRV |
Definition at line 141 of file interrupts.hh.
Referenced by Interrupts(), and updateIRRV().
uint8_t X86ISA::Interrupts::ISRV |
Definition at line 142 of file interrupts.hh.
Referenced by Interrupts(), and updateISRV().
|
protected |
Definition at line 88 of file interrupts.hh.
uint8_t X86ISA::Interrupts::nmiVector |
Definition at line 123 of file interrupts.hh.
bool X86ISA::Interrupts::pendingExtInt |
Definition at line 124 of file interrupts.hh.
bool X86ISA::Interrupts::pendingInit |
Definition at line 126 of file interrupts.hh.
int X86ISA::Interrupts::pendingIPIs |
Definition at line 136 of file interrupts.hh.
bool X86ISA::Interrupts::pendingNmi |
Definition at line 122 of file interrupts.hh.
bool X86ISA::Interrupts::pendingSmi |
Definition at line 120 of file interrupts.hh.
bool X86ISA::Interrupts::pendingStartup |
Definition at line 128 of file interrupts.hh.
bool X86ISA::Interrupts::pendingUnmaskableInt |
Definition at line 133 of file interrupts.hh.
Referenced by hasPendingUnmaskable().
|
protected |
Definition at line 89 of file interrupts.hh.
|
protected |
Definition at line 85 of file interrupts.hh.
|
protected |
Definition at line 79 of file interrupts.hh.
Referenced by clearRegArrayBit(), findRegArrayMSB(), getRegArrayBit(), Interrupts(), setRegArrayBit(), setRegNoEffect(), and triggerTimerInterrupt().
|
protected |
Definition at line 86 of file interrupts.hh.
uint8_t X86ISA::Interrupts::smiVector |
Definition at line 121 of file interrupts.hh.
bool X86ISA::Interrupts::startedUp |
Definition at line 130 of file interrupts.hh.
uint8_t X86ISA::Interrupts::startupVector |
Definition at line 129 of file interrupts.hh.
|
protected |
Definition at line 84 of file interrupts.hh.
|
protected |
Definition at line 87 of file interrupts.hh.
|
protected |
Definition at line 82 of file interrupts.hh.