48 #ifndef __DEV_ARM_GIC_PL390_H__
49 #define __DEV_ARM_GIC_PL390_H__
59 #include "params/Pl390.hh"
184 intEnabled(0), pendingInt(0), activeInt(0), intPriority {0}
256 assert(ctx < sys->numRunningContexts());
267 ctx_mask =
power(2, ctx);
355 const char *
description()
const {
return "Post Interrupt to CPU"; }
388 void sendInt(uint32_t number)
override;
389 void clearInt(uint32_t number)
override;
391 void sendPPInt(uint32_t num, uint32_t cpu)
override;
392 void clearPPInt(uint32_t num, uint32_t cpu)
override;
425 uint32_t
data,
size_t data_sz);
427 uint32_t
data)
override {
438 #endif //__DEV_ARM_GIC_H__
Tick write(PacketPtr pkt) override
A PIO read to the device, immediately split up into writeDistributor() or writeCpu() ...
uint32_t iccrpr[CPU_MAX]
read only running priority register, 1 per cpu
void clearInt(uint32_t number) override
Clear an interrupt from a device that is connected to the GIC.
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
uint8_t & getIntPriority(ContextID ctx, uint32_t ix)
std::vector< BankedRegs * > bankedRegs
DrainState
Object drain/handover states.
uint32_t intEnabled[INT_BITS_MAX-1]
GICD_I{S,C}ENABLER{1..31} interrupt enable bits for global interrupts 1b per interrupt, 32 bits per word, 31 words.
static const AddrRange GICD_ITARGETSR
void serialize(CheckpointOut &cp) const override
Serialize an object.
Bitfield< 25, 24 > list_type
uint32_t itLines
Number of itLines enabled.
const char * description() const
Return a C string describing the event.
EndBitUnion(IAR) protected const AddrRange cpuRange
Address range for the distributor interface.
uint8_t getCpuPriority(unsigned cpu)
Tick writeCpu(PacketPtr pkt)
Handle a write to the cpu portion of the GIC.
bool gem5ExtensionsEnabled
gem5 many-core extension enabled by driver
static const AddrRange GICD_ISACTIVER
static const int SPURIOUS_INT
static const int INT_BITS_MAX
Bitfield< 23, 16 > cpu_list
uint32_t pendingInt
GICD_I{S,C}PENDR0 interrupt pending bits for first 32 interrupts, 1b per interrupt.
const Tick intLatency
Latency for a interrupt to get to CPU.
EndBitUnion(SWI) BitUnion32(IAR) Bitfield<9
uint32_t readDistributor(ContextID ctx, Addr daddr) override
Tick read(PacketPtr pkt) override
A PIO read to the device, immediately split up into readDistributor() or readCpu() ...
static const AddrRange GICD_ISENABLER
static const AddrRange GICD_ISPENDR
const Tick distPioDelay
Latency for a distributor operation.
static const AddrRange GICD_ICACTIVER
void clearPPInt(uint32_t num, uint32_t cpu) override
const bool haveGem5Extensions
Are gem5 extensions available?
PostIntEvent(Pl390 &_parent, uint32_t _cpu)
uint32_t & getIntEnabled(ContextID ctx, uint32_t ix)
int intNumToBit(int num) const
uint32_t activeInt
GICD_I{S,C}ACTIVER0 interrupt active bits for first 32 interrupts, 1b per interrupt.
uint32_t intEnabled
GICD_I{S,C}ENABLER0 interrupt enable bits for first 32 interrupts, 1b per interrupt.
void updateRunPri()
Update the register that records priority of the highest priority active interrupt.
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
uint32_t cpuPpiPending[CPU_MAX]
One bit per private peripheral interrupt.
static const int NN_CONFIG_MASK
Mask for bits that config N:N mode in GICD_ICFGR's.
uint32_t cpuHighestInt[CPU_MAX]
highest interrupt that is interrupting CPU
uint32_t & getPendingInt(ContextID ctx, uint32_t ix)
BitUnion32(SWI) Bitfield<3
void driveLegFIQ(bool state)
uint8_t cpuTarget[GLOBAL_INT_LINES]
GICD_ITARGETSR{8..255} an 8 bit cpu target id for each global interrupt.
void driveLegIRQ(bool state)
void sendInt(uint32_t number) override
Post an interrupt from a device that is connected to the GIC.
uint64_t Tick
Tick count type.
uint64_t power(uint32_t n, uint32_t e)
uint32_t pendingInt[INT_BITS_MAX-1]
GICD_I{S,C}PENDR{1..31} interrupt pending bits for global interrupts 1b per interrupt, 32 bits per word, 31 words.
uint32_t cpuSgiActiveExt[CPU_MAX]
uint32_t cpuSgiPendingExt[CPU_MAX]
SGI pending arrays for gem5 GIC extension mode, which instead keeps 16 SGI pending bits for each of t...
void driveSPI(uint32_t spi)
Event definition to post interrupt to CPU after a delay.
void writeDistributor(ContextID ctx, Addr daddr, uint32_t data) override
static const AddrRange GICD_ICPENDR
uint8_t getCpuTarget(ContextID ctx, uint32_t ix)
uint8_t intPriority[GLOBAL_INT_LINES]
GICD_IPRIORITYR{8..255} an 8 bit priority (lower is higher priority) for each of the global (not repl...
Registers "banked for each connected processor" per ARM IHI0048B.
uint32_t cpuPpiActive[CPU_MAX]
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint8_t cpuBpr[CPU_MAX]
Binary point registers.
struct BaseGicParams Params
DrainState drain() override
Notify an object that it needs to drain its state.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
bool cpuEnabled[CPU_MAX]
CPU enabled.
Basic support for object serialization.
void postInt(uint32_t cpu, Tick when)
Post an interrupt to a CPU with a delay.
const Params * params() const
uint8_t cpuPriority[CPU_MAX]
CPU priority.
static const int INT_LINES_MAX
uint32_t & getActiveInt(ContextID ctx, uint32_t ix)
int intNumToWord(int num) const
uint32_t intConfig[INT_BITS_MAX *2]
2 bit per interrupt signaling if it's level or edge sensitive and if it is 1:N or N:N ...
static const int SGI_MASK
Mask off SGI's when setting/clearing pending bits.
Base class for ARM GIC implementations.
std::ostream CheckpointOut
uint64_t cpuSgiPending[SGI_MAX]
One bit per cpu per software interrupt that is pending for each possible sgi source.
static const AddrRange GICD_ICFGR
Bitfield< 12, 10 > cpu_id
uint8_t intPriority[SGI_MAX+PPI_MAX]
GICD_IPRIORITYR{0..7} interrupt priority for SGIs and PPIs.
uint32_t activeInt[INT_BITS_MAX-1]
GICD_I{S,C}ACTIVER{1..31} interrupt active bits for global interrupts 1b per interrupt, 32 bits per word, 31 words.
Tick writeDistributor(PacketPtr pkt)
Handle a write to the distributor portion of the GIC.
static const AddrRange GICD_IPRIORITYR
uint64_t cpuSgiActive[SGI_MAX]
const SimObjectParams * _params
Cached copy of the object parameters.
void driveIrqEn(bool state)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
bool irqEnable
IRQ Enable Used for debug.
Tick readDistributor(PacketPtr pkt)
Handle a read to the distributor portion of the GIC.
static const AddrRange GICD_IGROUPR
static const AddrRange GICD_ICENABLER
uint64_t genSwiMask(int cpu)
generate a bit mask to check cpuSgi for an interrupt.
static const int GLOBAL_INT_LINES
const AddrRangeList addrRanges
All address ranges used by this GIC.
int pendingDelayedInterrupts
PostIntEvent * postIntEvent[CPU_MAX]
void sendPPInt(uint32_t num, uint32_t cpu) override
Interface call for private peripheral interrupts.
static const int GICC_BPR_MINIMUM
minimum value for Binary Point Register ("IMPLEMENTATION DEFINED"); chosen for consistency with Lin...
void softInt(ContextID ctx, SWI swi)
software generated interrupt
Tick readCpu(PacketPtr pkt)
Handle a read to the cpu portion of the GIC.
void postDelayedInt(uint32_t cpu)
Deliver a delayed interrupt to the target CPU.
int ContextID
Globally unique thread context ID.
BankedRegs & getBankedRegs(ContextID)
const Tick cpuPioDelay
Latency for a cpu operation.
void updateIntState(int hint)
See if some processor interrupt flags need to be enabled/disabled.