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

#include <interrupts.hh>

Inheritance diagram for X86ISA::Interrupts:
BaseInterrupts SimObject EventManager Serializable Drainable Stats::Group

Public Types

typedef X86LocalApicParams Params
 
- Public Types inherited from BaseInterrupts
typedef BaseInterruptsParams Params
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 

Public Member Functions

int getInitialApicId ()
 
void setCPU (BaseCPU *newCPU) override
 
const Paramsparams () const
 
void init () override
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
Tick read (PacketPtr pkt)
 
Tick write (PacketPtr pkt)
 
Tick recvMessage (PacketPtr pkt)
 
void completeIPI (PacketPtr pkt)
 
bool triggerTimerInterrupt ()
 
AddrRangeList getAddrRanges () const
 
AddrRangeList getIntAddrRange () const
 
PortgetPort (const std::string &if_name, PortID idx=InvalidPortID) override
 Get a 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 override
 
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) override
 
void updateIntrInfo (ThreadContext *tc) override
 
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) override
 
void clear (int int_num, int index) override
 
void clearAll () override
 
- Public Member Functions inherited from BaseInterrupts
 BaseInterrupts (Params *p)
 
const Paramsparams () const
 
- Public Member Functions inherited from SimObject
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 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...
 
const Paramsparams () const
 
 SimObject (const Params *_params)
 
- Public Member Functions inherited from EventManager
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)
 
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
- 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 Stats::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group. More...
 
virtual ~Group ()
 
virtual void regStats ()
 Callback to set stat parameters. More...
 
virtual void resetStats ()
 Callback to reset stats. More...
 
virtual void preDumpStats ()
 Callback before stats are dumped. More...
 
void addStat (Stats::Info *info)
 Register a stat with this group. More...
 
const std::map< std::string, Group * > & getStatGroups () const
 Get all child groups associated with this object. More...
 
const std::vector< Info * > & getStats () const
 Get all stats associated with this object. More...
 
void addStatGroup (const char *name, Group *block)
 Add a stat block as a child of this block. More...
 
const InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 

Protected Member Functions

 BitUnion32 (LVTEntry) Bitfield< 7
 
 EndBitUnion (LVTEntry) EventFunctionWrapper apicTimerEvent
 
void processApicTimerEvent ()
 
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)
 
Tick clockPeriod () const
 
void requestInterrupt (uint8_t vector, uint8_t deliveryMode, bool level)
 
- 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 Attributes

Systemsys
 
ClockDomainclockDomain
 
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
 
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< InterruptsintSlavePort
 
IntMasterPort< InterruptsintMasterPort
 
PioPort< InterruptspioPort
 
Tick pioDelay
 
Addr pioAddr = MaxAddr
 
- Protected Attributes inherited from BaseInterrupts
BaseCPUcpu
 
- 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 ()
 Gets the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 

Detailed Description

Definition at line 73 of file interrupts.hh.

Member Typedef Documentation

◆ Params

typedef X86LocalApicParams X86ISA::Interrupts::Params

Definition at line 194 of file interrupts.hh.

Constructor & Destructor Documentation

◆ Interrupts()

X86ISA::Interrupts::Interrupts ( Params p)

Member Function Documentation

◆ BitUnion32()

X86ISA::Interrupts::BitUnion32 ( LVTEntry  )
protected

◆ checkInterrupts()

bool X86ISA::Interrupts::checkInterrupts ( ThreadContext tc) const
overridevirtual

◆ checkInterruptsRaw()

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 643 of file interrupts.cc.

References X86ISA::APIC_TASK_PRIORITY, bits(), IRRV, ISRV, pendingExtInt, pendingUnmaskableInt, and regs.

Referenced by setRegNoEffect().

◆ clear()

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

Reimplemented from BaseInterrupts.

Definition at line 298 of file interrupts.hh.

References panic.

◆ clearAll()

void X86ISA::Interrupts::clearAll ( )
inlineoverridevirtual

Reimplemented from BaseInterrupts.

Definition at line 304 of file interrupts.hh.

References panic.

◆ clearRegArrayBit()

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

Definition at line 158 of file interrupts.hh.

Referenced by updateIntrInfo().

◆ clockPeriod()

Tick X86ISA::Interrupts::clockPeriod ( ) const
inlineprotected

◆ completeIPI()

void X86ISA::Interrupts::completeIPI ( PacketPtr  pkt)

Definition at line 330 of file interrupts.cc.

References X86ISA::APIC_INTERRUPT_COMMAND_LOW, and DPRINTF.

Referenced by params().

◆ EndBitUnion()

X86ISA::Interrupts::EndBitUnion ( LVTEntry  )
protected

◆ findRegArrayMSB()

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

Definition at line 128 of file interrupts.hh.

References findMsbSet(), and X86ISA::offset.

Referenced by updateIRRV(), and updateISRV().

◆ getAddrRanges()

AddrRangeList X86ISA::Interrupts::getAddrRanges ( ) const

Definition at line 344 of file interrupts.cc.

References X86ISA::PageBytes, and RangeSize().

Referenced by triggerTimerInterrupt().

◆ getInitialApicId()

int X86ISA::Interrupts::getInitialApicId ( )
inline

Definition at line 189 of file interrupts.hh.

References initialApicId.

◆ getIntAddrRange()

AddrRangeList X86ISA::Interrupts::getIntAddrRange ( ) const

◆ getInterrupt()

Fault X86ISA::Interrupts::getInterrupt ( ThreadContext tc)
overridevirtual

◆ getPort()

Port& X86ISA::Interrupts::getPort ( const std::string &  if_name,
PortID  idx = InvalidPortID 
)
inlineoverridevirtual

Get a port with a given name and index.

This is used at binding time and returns a reference to a protocol-agnostic port.

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

Reimplemented from SimObject.

Definition at line 229 of file interrupts.hh.

References SimObject::getPort(), intMasterPort, intSlavePort, pioPort, readReg(), X86ISA::reg, setReg(), and X86ISA::val.

◆ getRegArrayBit()

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

Definition at line 164 of file interrupts.hh.

References bits().

◆ hasPendingUnmaskable()

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

Check if there are pending unmaskable interrupts.

Returns
true there are unmaskable interrupts pending.

Definition at line 277 of file interrupts.hh.

References getInterrupt(), pendingUnmaskableInt, serialize(), unserialize(), and updateIntrInfo().

◆ init()

void X86ISA::Interrupts::init ( )
overridevirtual

init() is called after all C++ SimObjects have been created and all ports are connected.

Initializations that are independent of unserialization but rely on a fully instantiated and connected SimObject graph should be done here.

Reimplemented from SimObject.

Definition at line 289 of file interrupts.cc.

References name(), and panic_if.

Referenced by params().

◆ params()

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

Definition at line 199 of file interrupts.hh.

References SimObject::_params, completeIPI(), init(), read(), recvMessage(), and write().

◆ post()

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

Reimplemented from BaseInterrupts.

Definition at line 292 of file interrupts.hh.

References panic.

◆ processApicTimerEvent()

void X86ISA::Interrupts::processApicTimerEvent ( )
protected

Definition at line 783 of file interrupts.cc.

References X86ISA::APIC_INITIAL_COUNT, readReg(), setReg(), and triggerTimerInterrupt().

Referenced by Interrupts().

◆ read()

Tick X86ISA::Interrupts::read ( PacketPtr  pkt)

◆ readReg()

uint32_t X86ISA::Interrupts::readReg ( ApicRegIndex  miscReg)

◆ recvMessage()

Tick X86ISA::Interrupts::recvMessage ( PacketPtr  pkt)

◆ requestInterrupt()

void X86ISA::Interrupts::requestInterrupt ( uint8_t  vector,
uint8_t  deliveryMode,
bool  level 
)
protected

◆ serialize()

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 720 of file interrupts.cc.

References extIntVector, initVector, IRRV, ISRV, nmiVector, X86ISA::NUM_APIC_REGS, pendingExtInt, pendingInit, pendingIPIs, pendingNmi, pendingSmi, pendingStartup, pendingUnmaskableInt, regs, SERIALIZE_ARRAY, SERIALIZE_SCALAR, smiVector, startedUp, and startupVector.

Referenced by hasPendingUnmaskable().

◆ setCPU()

void X86ISA::Interrupts::setCPU ( BaseCPU newCPU)
overridevirtual

Implements BaseInterrupts.

Definition at line 274 of file interrupts.cc.

References X86ISA::APIC_ID, BaseCPU::cpuId(), panic, and X86ISA::x86LocalAPICAddress().

◆ setReg()

void X86ISA::Interrupts::setReg ( ApicRegIndex  reg,
uint32_t  val 
)

◆ setRegArrayBit()

void X86ISA::Interrupts::setRegArrayBit ( ApicRegIndex  base,
uint8_t  vector 
)
inlineprotected

Definition at line 152 of file interrupts.hh.

Referenced by updateIntrInfo().

◆ setRegNoEffect()

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

◆ triggerTimerInterrupt()

bool X86ISA::Interrupts::triggerTimerInterrupt ( )
inline

◆ unserialize()

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 745 of file interrupts.cc.

References extIntVector, initVector, IRRV, ISRV, nmiVector, X86ISA::NUM_APIC_REGS, pendingExtInt, pendingInit, pendingIPIs, pendingNmi, pendingSmi, pendingStartup, pendingUnmaskableInt, regs, EventManager::reschedule(), EventManager::schedule(), smiVector, startedUp, startupVector, UNSERIALIZE_ARRAY, and UNSERIALIZE_SCALAR.

Referenced by hasPendingUnmaskable().

◆ updateIntrInfo()

void X86ISA::Interrupts::updateIntrInfo ( ThreadContext tc)
overridevirtual

◆ updateIRRV()

void X86ISA::Interrupts::updateIRRV ( )
inlineprotected

Definition at line 140 of file interrupts.hh.

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

Referenced by updateIntrInfo().

◆ updateISRV()

void X86ISA::Interrupts::updateISRV ( )
inlineprotected

Definition at line 146 of file interrupts.hh.

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

◆ write()

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

Member Data Documentation

◆ clockDomain

ClockDomain& X86ISA::Interrupts::clockDomain
protected

Definition at line 77 of file interrupts.hh.

◆ cpu

BaseCPU* X86ISA::Interrupts::cpu
protected

Definition at line 173 of file interrupts.hh.

Referenced by Interrupts().

◆ deliveryMode

Bitfield<10, 8> X86ISA::Interrupts::deliveryMode
protected

Definition at line 84 of file interrupts.hh.

Referenced by clockPeriod().

◆ extIntVector

uint8_t X86ISA::Interrupts::extIntVector
protected

Definition at line 108 of file interrupts.hh.

Referenced by getInterrupt(), Interrupts(), serialize(), and unserialize().

◆ initialApicId

int X86ISA::Interrupts::initialApicId
protected

Definition at line 175 of file interrupts.hh.

Referenced by getInitialApicId().

◆ initVector

uint8_t X86ISA::Interrupts::initVector
protected

Definition at line 110 of file interrupts.hh.

Referenced by getInterrupt(), Interrupts(), serialize(), and unserialize().

◆ intMasterPort

IntMasterPort<Interrupts> X86ISA::Interrupts::intMasterPort
protected

Definition at line 179 of file interrupts.hh.

Referenced by getPort(), and Interrupts().

◆ intSlavePort

IntSlavePort<Interrupts> X86ISA::Interrupts::intSlavePort
protected

Definition at line 178 of file interrupts.hh.

Referenced by getPort(), and Interrupts().

◆ IRRV

uint8_t X86ISA::Interrupts::IRRV
protected

◆ ISRV

uint8_t X86ISA::Interrupts::ISRV
protected

◆ masked

Bitfield<16> X86ISA::Interrupts::masked
protected

Definition at line 89 of file interrupts.hh.

◆ nmiVector

uint8_t X86ISA::Interrupts::nmiVector
protected

Definition at line 106 of file interrupts.hh.

Referenced by getInterrupt(), Interrupts(), serialize(), and unserialize().

◆ pendingExtInt

bool X86ISA::Interrupts::pendingExtInt
protected

◆ pendingInit

bool X86ISA::Interrupts::pendingInit
protected

Definition at line 109 of file interrupts.hh.

Referenced by getInterrupt(), Interrupts(), serialize(), unserialize(), and updateIntrInfo().

◆ pendingIPIs

int X86ISA::Interrupts::pendingIPIs
protected

Definition at line 119 of file interrupts.hh.

Referenced by Interrupts(), serialize(), and unserialize().

◆ pendingNmi

bool X86ISA::Interrupts::pendingNmi
protected

Definition at line 105 of file interrupts.hh.

Referenced by getInterrupt(), Interrupts(), serialize(), unserialize(), and updateIntrInfo().

◆ pendingSmi

bool X86ISA::Interrupts::pendingSmi
protected

Definition at line 103 of file interrupts.hh.

Referenced by getInterrupt(), Interrupts(), serialize(), unserialize(), and updateIntrInfo().

◆ pendingStartup

bool X86ISA::Interrupts::pendingStartup
protected

Definition at line 111 of file interrupts.hh.

Referenced by getInterrupt(), Interrupts(), serialize(), unserialize(), and updateIntrInfo().

◆ pendingUnmaskableInt

bool X86ISA::Interrupts::pendingUnmaskableInt
protected

◆ periodic

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

Definition at line 90 of file interrupts.hh.

◆ pioAddr

Addr X86ISA::Interrupts::pioAddr = MaxAddr
protected

Definition at line 185 of file interrupts.hh.

◆ pioDelay

Tick X86ISA::Interrupts::pioDelay
protected

Definition at line 184 of file interrupts.hh.

Referenced by Interrupts().

◆ pioPort

PioPort<Interrupts> X86ISA::Interrupts::pioPort
protected

Definition at line 182 of file interrupts.hh.

Referenced by getPort(), and Interrupts().

◆ polarity

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

Definition at line 86 of file interrupts.hh.

◆ regs

uint32_t X86ISA::Interrupts::regs[NUM_APIC_REGS]
protected

Definition at line 80 of file interrupts.hh.

Referenced by checkInterrupts(), checkInterruptsRaw(), Interrupts(), serialize(), and unserialize().

◆ remoteIRR

Bitfield<14> X86ISA::Interrupts::remoteIRR
protected

Definition at line 87 of file interrupts.hh.

◆ smiVector

uint8_t X86ISA::Interrupts::smiVector
protected

Definition at line 104 of file interrupts.hh.

Referenced by Interrupts(), serialize(), and unserialize().

◆ startedUp

bool X86ISA::Interrupts::startedUp
protected

Definition at line 113 of file interrupts.hh.

Referenced by Interrupts(), serialize(), unserialize(), and updateIntrInfo().

◆ startupVector

uint8_t X86ISA::Interrupts::startupVector
protected

Definition at line 112 of file interrupts.hh.

Referenced by getInterrupt(), Interrupts(), serialize(), and unserialize().

◆ status

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

Definition at line 85 of file interrupts.hh.

◆ sys

System* X86ISA::Interrupts::sys
protected

Definition at line 76 of file interrupts.hh.

◆ trigger

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

Definition at line 88 of file interrupts.hh.

◆ vector

X86ISA::Interrupts::vector
protected

Definition at line 83 of file interrupts.hh.

Referenced by clockPeriod().


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

Generated on Thu May 28 2020 16:22:29 for gem5 by doxygen 1.8.13