41 #ifndef __ARCH_ARM_INTERRUPT_HH__
42 #define __ARCH_ARM_INTERRUPT_HH__
49 #include "debug/Interrupt.hh"
50 #include "params/ArmInterrupts.hh"
91 panic(
"int_num out of bounds\n");
94 panic(
"No support for other interrupt indexes\n");
106 panic(
"int_num out of bounds\n");
109 panic(
"No support for other interrupt indexes\n");
137 if (!(
intStatus || hcr.va || hcr.vi || hcr.vf))
145 amo = (no_vhe || hcr.e2h == 0);
146 fmo = (no_vhe || hcr.e2h == 0);
147 imo = (no_vhe || hcr.e2h == 0);
156 bool allowVIrq = !cpsr.i &&
imo && !
isSecure && !isHypMode;
157 bool allowVFiq = !cpsr.f &&
fmo && !
isSecure && !isHypMode;
158 bool allowVAbort = !cpsr.a &&
amo && !
isSecure && !isHypMode;
160 if ( !(
intStatus || (hcr.vi && allowVIrq) || (hcr.vf && allowVFiq) ||
161 (hcr.va && allowVAbort)) )
173 (hcr.va && allowVAbort) ||
187 uint64_t maskedIntStatus;
194 virtWake |= hcr.va && hcr.amo;
196 return maskedIntStatus || virtWake;
228 panic(
"Interrupt number out of range.\n");
244 amo = (no_vhe || hcr.e2h == 0);
245 fmo = (no_vhe || hcr.e2h == 0);
246 imo = (no_vhe || hcr.e2h == 0);
258 bool allowVIrq = !cpsr.i &&
imo && !
isSecure && !isHypMode;
259 bool allowVFiq = !cpsr.f &&
fmo && !
isSecure && !isHypMode;
260 bool allowVAbort = !cpsr.a &&
amo && !
isSecure && !isHypMode;
267 return std::make_shared<Interrupt>();
269 return std::make_shared<VirtualInterrupt>();
271 return std::make_shared<FastInterrupt>();
273 return std::make_shared<VirtualFastInterrupt>();
275 return std::make_shared<SystemError>();
276 if (hcr.va && allowVAbort)
277 return std::make_shared<VirtualDataAbort>(
281 return std::make_shared<Reset>();
283 return std::make_shared<ArmSev>();
285 panic(
"intStatus and interrupts not in sync\n");
308 #endif // __ARCH_ARM_INTERRUPT_HH__