43 #ifndef __ARCH_ARM_INTERRUPT_HH__
44 #define __ARCH_ARM_INTERRUPT_HH__
52 #include "debug/Interrupt.hh"
53 #include "params/ArmInterrupts.hh"
95 panic(
"int_num out of bounds\n");
98 panic(
"No support for other interrupt indexes\n");
110 panic(
"int_num out of bounds\n");
113 panic(
"No support for other interrupt indexes\n");
140 if (!(
intStatus || hcr.va || hcr.vi || hcr.vf))
145 bool isHypMode = cpsr.mode ==
MODE_HYP;
147 bool allowVIrq = !cpsr.i && hcr.imo && !isSecure && !isHypMode;
148 bool allowVFiq = !cpsr.f && hcr.fmo && !isSecure && !isHypMode;
149 bool allowVAbort = !cpsr.a && hcr.amo && !isSecure && !isHypMode;
151 if ( !(
intStatus || (hcr.vi && allowVIrq) || (hcr.vf && allowVFiq) ||
152 (hcr.va && allowVAbort)) )
164 (hcr.va && allowVAbort) ||
178 uint64_t maskedIntStatus;
185 virtWake |= hcr.va && hcr.amo;
187 return maskedIntStatus || virtWake;
219 panic(
"Interrupt number out of range.\n");
235 bool isHypMode = cpsr.mode ==
MODE_HYP;
237 bool allowVIrq = !cpsr.i && hcr.imo && !isSecure && !isHypMode;
238 bool allowVFiq = !cpsr.f && hcr.fmo && !isSecure && !isHypMode;
239 bool allowVAbort = !cpsr.a && hcr.amo && !isSecure && !isHypMode;
246 return std::make_shared<Interrupt>();
248 return std::make_shared<VirtualInterrupt>();
250 return std::make_shared<FastInterrupt>();
252 return std::make_shared<VirtualFastInterrupt>();
254 return std::make_shared<SystemError>();
255 if (hcr.va && allowVAbort)
256 return std::make_shared<VirtualDataAbort>(
260 return std::make_shared<Reset>();
262 return std::make_shared<ArmSev>();
264 panic(
"intStatus and interrupts not in sync\n");
289 #endif // __ARCH_ARM_INTERRUPT_HH__
void post(int int_num, int index)
void clear(int int_num, int index)
bool interrupts[NumInterruptTypes]
void unserialize(CheckpointIn &cp)
Unserialize an object.
void setCPU(BaseCPU *_cpu)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
bool takeInt(ThreadContext *tc, InterruptTypes int_type) const
Fault getInterrupt(ThreadContext *tc)
#define UNSERIALIZE_SCALAR(scalar)
bool checkInterrupts(ThreadContext *tc) const
#define SERIALIZE_ARRAY(member, size)
bool checkRaw(InterruptTypes interrupt) const
Check the state of a particular interrupt, ignoring CPSR masks.
bool checkWfiWake(HCR hcr, CPSR cpsr, SCR scr) const
This function is used to check if a wfi operation should sleep.
#define ULL(N)
uint64_t constant
#define SERIALIZE_SCALAR(scalar)
virtual MiscReg readMiscReg(int misc_reg)=0
#define UNSERIALIZE_ARRAY(member, size)
void serialize(CheckpointOut &cp) const
Serialize an object.
std::ostream CheckpointOut
uint32_t getISR(HCR hcr, CPSR cpsr, SCR scr)
void updateIntrInfo(ThreadContext *tc)
const SimObjectParams * _params
Cached copy of the object parameters.
ArmInterruptsParams Params
const Params * params() const
bool inSecureState(ThreadContext *tc)
std::shared_ptr< FaultBase > Fault
Abstract superclass for simulation objects.