53 #ifndef __ARCH_X86_INTERRUPTS_HH__ 54 #define __ARCH_X86_INTERRUPTS_HH__ 64 #include "params/X86LocalApic.hh" 135 if (regs[base + offset] != 0) {
136 return offset * 32 +
findMsbSet(regs[base + offset]);
157 regs[base + (vector / 32)] |= (1 << (vector % 32));
163 regs[base + (vector / 32)] &= ~(1 << (vector % 32));
169 return bits(regs[base + (vector / 32)], vector % 32);
204 return dynamic_cast<const Params *
>(
_params);
210 void init()
override;
226 return entry.periodic;
235 if (if_name ==
"int_master") {
237 }
else if (if_name ==
"int_slave") {
239 }
else if (if_name ==
"pio") {
297 panic(
"Interrupts::post unimplemented!\n");
303 panic(
"Interrupts::clear unimplemented!\n");
309 panic(
"Interrupts::clearAll unimplemented!\n");
315 #endif // __ARCH_X86_INTERRUPTS_HH__
#define panic(...)
This implements a cprintf based panic() function.
Ports are used to interface objects to each other.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
bool pendingUnmaskableInt
void post(int int_num, int index) override
void setCPU(BaseCPU *newCPU) override
const PortID InvalidPortID
IntMasterPort< Interrupts > intMasterPort
Bitfield< 10, 8 > deliveryMode
void completeIPI(PacketPtr pkt)
uint32_t readReg(ApicRegIndex miscReg)
int findRegArrayMSB(ApicRegIndex base)
void setRegNoEffect(ApicRegIndex reg, uint32_t val)
void updateIntrInfo(ThreadContext *tc) override
void setReg(ApicRegIndex reg, uint32_t val)
bool hasPendingUnmaskable() const
Check if there are pending unmaskable interrupts.
AddrRangeList getAddrRanges() const
ThreadContext is the external interface to all thread state for anything outside of the CPU...
BitUnion32(LVTEntry) Bitfield< 7
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
EndBitUnion(LVTEntry) EventFunctionWrapper apicTimerEvent
bool checkInterrupts(ThreadContext *tc) const override
X86LocalApicParams Params
Fault getInterrupt(ThreadContext *tc) override
void setRegArrayBit(ApicRegIndex base, uint8_t vector)
uint64_t Tick
Tick count type.
bool getRegArrayBit(ApicRegIndex base, uint8_t vector)
PioPort< Interrupts > pioPort
void requestInterrupt(uint8_t vector, uint8_t deliveryMode, bool level)
ApicRegIndex decodeAddr(Addr paddr)
uint32_t regs[NUM_APIC_REGS]
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Tick recvMessage(PacketPtr pkt)
bool checkInterruptsRaw() const
Check if there are pending interrupts without ignoring the interrupts disabled flag.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void clear(int int_num, int index) override
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain...
std::ostream CheckpointOut
int divideFromConf(uint32_t conf)
This is exposed globally, independent of the ISA.
Tick write(PacketPtr pkt)
IntSlavePort< Interrupts > intSlavePort
const SimObjectParams * _params
Cached copy of the object parameters.
int findMsbSet(uint64_t val)
Returns the bit position of the MSB that is set in the input.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
const Params * params() const
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
bool triggerTimerInterrupt()
The PioPort class is a programmed i/o port that all devices that are sensitive to an address range us...
void processApicTimerEvent()
std::shared_ptr< FaultBase > Fault
void clearRegArrayBit(ApicRegIndex base, uint8_t vector)
ClockDomain & clockDomain
Tick clockPeriod() const
Get the clock period.
AddrRangeList getIntAddrRange() const