gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
X86ISA::Interrupts Class Reference

#include <interrupts.hh>

Inheritance diagram for X86ISA::Interrupts:
BasicPioDevice X86ISA::IntDevice PioDevice MemObject ClockedObject SimObject Clocked EventManager Serializable Drainable

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 Paramsparams () 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
 
BaseMasterPortgetMasterPort (const std::string &if_name, PortID idx=InvalidPortID) override
 Get a master port with a given name and index. More...
 
BaseSlavePortgetSlavePort (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 Paramsparams () 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 Paramsparams () const
 
- Public Member Functions inherited from MemObject
const Paramsparams () const
 
 MemObject (const Params *params)
 
- Public Member Functions inherited from ClockedObject
 ClockedObject (const ClockedObjectParams *p)
 
const Paramsparams () 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 Paramsparams () 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...
 
ProbeManagergetProbeManager ()
 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)
 
EventQueueeventQueue () 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
 
BaseCPUcpu
 
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
 
Clockedoperator= (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
Systemsys
 
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
EventQueueeventq
 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 SimObjectfind (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
 

Detailed Description

Definition at line 75 of file interrupts.hh.

Member Typedef Documentation

typedef X86LocalApicParams X86ISA::Interrupts::Params

Definition at line 202 of file interrupts.hh.

Constructor & Destructor Documentation

X86ISA::Interrupts::Interrupts ( Params p)

Definition at line 589 of file interrupts.cc.

References X86ISA::APIC_DESTINATION_FORMAT, IRRV, ISRV, and regs.

Member Function Documentation

X86ISA::Interrupts::ApicTimerEvent ( Interrupts _localApic)
inline

Definition at line 100 of file interrupts.hh.

X86ISA::Interrupts::BitUnion32 ( LVTEntry  )
protected
bool X86ISA::Interrupts::checkInterrupts ( ThreadContext tc) const
bool X86ISA::Interrupts::checkInterruptsRaw ( ) const

Check if there are pending interrupts without ignoring the interrupts disabled flag.

Returns
true if there are interrupts pending.

Definition at line 632 of file interrupts.cc.

References X86ISA::APIC_TASK_PRIORITY, and bits().

void X86ISA::Interrupts::clear ( int  int_num,
int  index 
)
inline

Definition at line 310 of file interrupts.hh.

References panic.

void X86ISA::Interrupts::clearAll ( )
inline

Definition at line 316 of file interrupts.hh.

References panic.

void X86ISA::Interrupts::clearRegArrayBit ( ApicRegIndex  base,
uint8_t  vector 
)
inline

Definition at line 175 of file interrupts.hh.

References regs.

int X86ISA::Interrupts::findRegArrayMSB ( ApicRegIndex  base)
inline

Definition at line 145 of file interrupts.hh.

References findMsbSet(), X86ISA::offset, and regs.

Referenced by updateIRRV(), and updateISRV().

int X86ISA::Interrupts::getInitialApicId ( )
inline

Definition at line 197 of file interrupts.hh.

References initialApicId.

Referenced by X86ISA::I82094AA::signalInterrupt().

AddrRangeList X86ISA::Interrupts::getIntAddrRange ( ) const
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.

References DPRINTF, NoFault, and panic.

BaseMasterPort& X86ISA::Interrupts::getMasterPort ( const std::string &  if_name,
PortID  idx = InvalidPortID 
)
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.

Parameters
if_namePort name
idxIndex in the case of a VectorPort
Returns
A reference to the given port

Reimplemented from MemObject.

Definition at line 236 of file interrupts.hh.

References MemObject::getMasterPort(), and X86ISA::IntDevice::intMasterPort.

bool X86ISA::Interrupts::getRegArrayBit ( ApicRegIndex  base,
uint8_t  vector 
)
inline

Definition at line 181 of file interrupts.hh.

References bits(), and regs.

BaseSlavePort& X86ISA::Interrupts::getSlavePort ( const std::string &  if_name,
PortID  idx = InvalidPortID 
)
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.

Parameters
if_namePort name
idxIndex in the case of a VectorPort
Returns
A reference to the given port

Reimplemented from PioDevice.

Definition at line 245 of file interrupts.hh.

References PioDevice::getSlavePort(), and intSlavePort.

bool X86ISA::Interrupts::hasPendingUnmaskable ( ) const
inline

Check if there are pending unmaskable interrupts.

Returns
true there are unmaskable interrupts pending.

Definition at line 289 of file interrupts.hh.

References pendingUnmaskableInt.

void X86ISA::Interrupts::init ( )
overridevirtual

Reimplemented from X86ISA::IntDevice.

Definition at line 290 of file interrupts.cc.

References X86ISA::IntDevice::init(), and PioDevice::init().

const Params* X86ISA::Interrupts::params ( ) const
inline

Definition at line 207 of file interrupts.hh.

References SimObject::_params.

void X86ISA::Interrupts::post ( int  int_num,
int  index 
)
inline

Definition at line 304 of file interrupts.hh.

References panic.

void X86ISA::Interrupts::process ( )
inline
Tick X86ISA::Interrupts::read ( PacketPtr  pkt)
overridevirtual

Pure virtual function that the device must implement.

Called when a read command is recieved by the port.

Parameters
pktPacket describing this request
Returns
number of ticks it took to complete

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)
Tick X86ISA::Interrupts::recvMessage ( PacketPtr  pkt)
overridevirtual
Tick X86ISA::Interrupts::recvResponse ( PacketPtr  pkt)
overridevirtual
void X86ISA::Interrupts::requestInterrupt ( uint8_t  vector,
uint8_t  deliveryMode,
bool  level 
)
void X86ISA::Interrupts::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint 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 
)
void X86ISA::Interrupts::setRegArrayBit ( ApicRegIndex  base,
uint8_t  vector 
)
inline

Definition at line 169 of file interrupts.hh.

References regs.

void X86ISA::Interrupts::setRegNoEffect ( ApicRegIndex  reg,
uint32_t  val 
)
inline

Definition at line 261 of file interrupts.hh.

References X86ISA::reg, regs, and X86ISA::val.

Referenced by X86ISA::initCPU().

bool X86ISA::Interrupts::triggerTimerInterrupt ( )
inline

Definition at line 226 of file interrupts.hh.

References X86ISA::APIC_LVT_TIMER, regs, and requestInterrupt().

Referenced by process().

void X86ISA::Interrupts::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint 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)
void X86ISA::Interrupts::updateIRRV ( )
inline

Definition at line 157 of file interrupts.hh.

References X86ISA::APIC_INTERRUPT_REQUEST_BASE, findRegArrayMSB(), and IRRV.

void X86ISA::Interrupts::updateISRV ( )
inline

Definition at line 163 of file interrupts.hh.

References X86ISA::APIC_IN_SERVICE_BASE, findRegArrayMSB(), and ISRV.

Tick X86ISA::Interrupts::write ( PacketPtr  pkt)
overridevirtual

Pure virtual function that the device must implement.

Called when a write command is recieved by the port.

Parameters
pktPacket describing this request
Returns
number of ticks it took to complete

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().

Member Data Documentation

ApicTimerEvent X86ISA::Interrupts::apicTimerEvent

Definition at line 112 of file interrupts.hh.

BaseCPU* X86ISA::Interrupts::cpu

Definition at line 188 of file interrupts.hh.

Bitfield<10, 8> X86ISA::Interrupts::deliveryMode
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().

Bitfield<16> X86ISA::Interrupts::masked
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().

Bitfield<17> X86ISA::Interrupts::periodic
protected

Definition at line 89 of file interrupts.hh.

Bitfield<13> X86ISA::Interrupts::polarity
protected

Definition at line 85 of file interrupts.hh.

uint32_t X86ISA::Interrupts::regs[NUM_APIC_REGS]
protected
Bitfield<14> X86ISA::Interrupts::remoteIRR
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.

Bitfield<12> X86ISA::Interrupts::status
protected

Definition at line 84 of file interrupts.hh.

Bitfield<15> X86ISA::Interrupts::trigger
protected

Definition at line 87 of file interrupts.hh.

X86ISA::Interrupts::vector
protected

Definition at line 82 of file interrupts.hh.


The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:42 for gem5 by doxygen 1.8.6