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");
309 #endif // __ARCH_ARM_INTERRUPT_HH__