53 bool cpsr_mask_bit, scr_routing_bit, scr_fwaw_bit, hcr_mask_override_bit;
58 cpsr_mask_bit = cpsr.f;
59 scr_routing_bit = scr.fiq;
60 scr_fwaw_bit = scr.fw;
61 hcr_mask_override_bit = hcr.fmo;
64 cpsr_mask_bit = cpsr.i;
65 scr_routing_bit = scr.irq;
67 hcr_mask_override_bit = hcr.imo;
70 cpsr_mask_bit = cpsr.a;
71 scr_routing_bit = scr.ea;
72 scr_fwaw_bit = scr.aw;
73 hcr_mask_override_bit = hcr.amo;
76 panic(
"Unhandled interrupt type!");
80 hcr_mask_override_bit = 1;
82 if (!scr_routing_bit) {
84 if (!hcr_mask_override_bit)
95 (hcr_mask_override_bit ||
96 (!scr_fwaw_bit && !hcr_mask_override_bit)))
115 bool cpsr_mask_bit, scr_routing_bit, hcr_mask_override_bit;
120 cpsr_mask_bit = cpsr.f;
121 scr_routing_bit = scr.fiq;
122 hcr_mask_override_bit = hcr.fmo;
125 cpsr_mask_bit = cpsr.i;
126 scr_routing_bit = scr.irq;
127 hcr_mask_override_bit = hcr.imo;
130 cpsr_mask_bit = cpsr.a;
131 scr_routing_bit = scr.ea;
132 hcr_mask_override_bit = hcr.amo;
135 panic(
"Unhandled interrupt type!");
140 if (!scr_routing_bit) {
154 if (!scr_routing_bit) {
156 if (!hcr_mask_override_bit) {
205 if (!scr_routing_bit) {
208 if (!hcr_mask_override_bit) {
234 if (!hcr_mask_override_bit) {
274 return ((
mask == INT_MASK_T) ||
275 ((
mask == INT_MASK_M) && !cpsr_mask_bit)) &&
276 (
mask != INT_MASK_P);
292 takeVirtualInt32(int_type);
302 bool no_vhe = !
HaveExt(tc, ArmExtension::FEAT_VHE);
304 bool cpsr_mask_bit, hcr_mask_override_bit;
307 amo = (no_vhe || hcr.e2h == 0);
308 fmo = (no_vhe || hcr.e2h == 0);
309 imo = (no_vhe || hcr.e2h == 0);
321 cpsr_mask_bit = cpsr.f;
322 hcr_mask_override_bit =
fmo;
325 cpsr_mask_bit = cpsr.i;
326 hcr_mask_override_bit =
imo;
329 cpsr_mask_bit = cpsr.a;
330 hcr_mask_override_bit =
amo;
333 panic(
"Unhandled interrupt type!");
335 return !cpsr_mask_bit && hcr_mask_override_bit &&
336 !is_secure && !is_hyp_mode;
348 bool cpsr_mask_bit, hcr_mask_override_bit;
353 cpsr_mask_bit = cpsr.f;
354 hcr_mask_override_bit = hcr.fmo;
357 cpsr_mask_bit = cpsr.i;
358 hcr_mask_override_bit = hcr.imo;
361 cpsr_mask_bit = cpsr.a;
362 hcr_mask_override_bit = hcr.amo;
365 panic(
"Unhandled interrupt type!");
374 if (!hcr_mask_override_bit) {
391 if (!hcr_mask_override_bit) {
407 return ((
mask == INT_MASK_T) ||
408 ((
mask == INT_MASK_M) && !cpsr_mask_bit)) &&
409 (
mask != INT_MASK_P);
bool takeInt64(InterruptTypes int_type) const
bool takeInt(InterruptTypes int_type) const
bool takeInt32(InterruptTypes int_type) const
bool takeVirtualInt64(InterruptTypes int_type) const
bool takeVirtualInt(InterruptTypes int_type) const
bool takeVirtualInt32(InterruptTypes int_type) const
bool highestELIs64() const
Returns true if the register width of the highest implemented exception level is 64 bits (ARMv8)
virtual RegVal readMiscReg(RegIndex misc_reg)=0
#define panic(...)
This implements a cprintf based panic() function.
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
bool isSecure(ThreadContext *tc)
bool isSecureBelowEL3(ThreadContext *tc)
bool HaveExt(ThreadContext *tc, ArmExtension ext)
Returns true if the provided ThreadContext supports the ArmExtension passed as a second argument.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.