41#ifndef __ARCH_ARM_INTERRUPT_HH__
42#define __ARCH_ARM_INTERRUPT_HH__
49#include "debug/Interrupt.hh"
50#include "enums/ArmExtension.hh"
51#include "params/ArmInterrupts.hh"
92 panic(
"int_num out of bounds\n");
95 panic(
"No support for other interrupt indexes\n");
107 panic(
"int_num out of bounds\n");
110 panic(
"No support for other interrupt indexes\n");
138 if (!(
intStatus || hcr.va || hcr.vi || hcr.vf))
143 bool no_vhe = !
HaveExt(
tc, ArmExtension::FEAT_VHE);
146 amo = (no_vhe || hcr.e2h == 0);
147 fmo = (no_vhe || hcr.e2h == 0);
148 imo = (no_vhe || hcr.e2h == 0);
157 bool allowVIrq = !cpsr.i &&
imo && !
isSecure && !isHypMode;
158 bool allowVFiq = !cpsr.f &&
fmo && !
isSecure && !isHypMode;
159 bool allowVAbort = !cpsr.a &&
amo && !
isSecure && !isHypMode;
161 if ( !(
intStatus || (hcr.vi && allowVIrq) || (hcr.vf && allowVFiq) ||
162 (hcr.va && allowVAbort)) )
174 (hcr.va && allowVAbort) ||
188 uint64_t maskedIntStatus;
195 virtWake |= hcr.va && hcr.amo;
197 return maskedIntStatus || virtWake;
229 panic(
"Interrupt number out of range.\n");
242 bool no_vhe = !
HaveExt(
tc, ArmExtension::FEAT_VHE);
245 amo = (no_vhe || hcr.e2h == 0);
246 fmo = (no_vhe || hcr.e2h == 0);
247 imo = (no_vhe || hcr.e2h == 0);
259 bool allowVIrq = !cpsr.i &&
imo && !
isSecure && !isHypMode;
260 bool allowVFiq = !cpsr.f &&
fmo && !
isSecure && !isHypMode;
261 bool allowVAbort = !cpsr.a &&
amo && !
isSecure && !isHypMode;
268 return std::make_shared<Interrupt>();
270 return std::make_shared<VirtualInterrupt>();
272 return std::make_shared<FastInterrupt>();
274 return std::make_shared<VirtualFastInterrupt>();
276 return std::make_shared<SystemError>();
277 if (hcr.va && allowVAbort)
278 return std::make_shared<VirtualDataAbort>(
282 return std::make_shared<Reset>();
284 return std::make_shared<ArmSev>();
286 panic(
"intStatus and interrupts not in sync\n");
@ AsynchronousExternalAbort
bool checkInterrupts() const override
uint32_t getISR(HCR hcr, CPSR cpsr, SCR scr)
void updateIntrInfo() override
bool takeInt(InterruptTypes int_type) const
void clear(int int_num, int index) override
bool interrupts[NumInterruptTypes]
void serialize(CheckpointOut &cp) const override
Serialize an object.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void post(int int_num, int index) override
bool checkRaw(InterruptTypes interrupt) const
Check the state of a particular interrupt, ignoring CPSR masks.
ArmInterruptsParams Params
bool checkWfiWake(HCR hcr, CPSR cpsr, SCR scr) const
This function is used to check if a wfi operation should sleep.
Fault getInterrupt() override
Interrupts(const Params &p)
virtual RegVal readMiscReg(RegIndex misc_reg)=0
#define panic(...)
This implements a cprintf based panic() function.
#define UNSERIALIZE_ARRAY(member, size)
#define SERIALIZE_ARRAY(member, size)
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
bool isSecure(ThreadContext *tc)
bool HaveExt(ThreadContext *tc, ArmExtension ext)
Returns true if the provided ThreadContext supports the ArmExtension passed as a second argument.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::shared_ptr< FaultBase > Fault
std::ostream CheckpointOut
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)