41#include "params/ArmInterrupts.hh"
59 bool cpsr_mask_bit, scr_routing_bit, scr_fwaw_bit, hcr_mask_override_bit;
64 cpsr_mask_bit = cpsr.f;
65 scr_routing_bit = scr.fiq;
66 scr_fwaw_bit = scr.fw;
67 hcr_mask_override_bit = hcr.fmo;
70 cpsr_mask_bit = cpsr.i;
71 scr_routing_bit = scr.irq;
73 hcr_mask_override_bit = hcr.imo;
76 cpsr_mask_bit = cpsr.a;
77 scr_routing_bit = scr.ea;
78 scr_fwaw_bit = scr.aw;
79 hcr_mask_override_bit = hcr.amo;
82 panic(
"Unhandled interrupt type!");
86 hcr_mask_override_bit = 1;
88 if (!scr_routing_bit) {
90 if (!hcr_mask_override_bit)
101 (hcr_mask_override_bit ||
102 (!scr_fwaw_bit && !hcr_mask_override_bit)))
121 bool cpsr_mask_bit, scr_routing_bit, hcr_mask_override_bit;
126 cpsr_mask_bit = cpsr.f;
127 scr_routing_bit = scr.fiq;
128 hcr_mask_override_bit = hcr.fmo;
131 cpsr_mask_bit = cpsr.i;
132 scr_routing_bit = scr.irq;
133 hcr_mask_override_bit = hcr.imo;
136 cpsr_mask_bit = cpsr.a;
137 scr_routing_bit = scr.ea;
138 hcr_mask_override_bit = hcr.amo;
141 panic(
"Unhandled interrupt type!");
146 if (!scr_routing_bit) {
160 if (!scr_routing_bit) {
162 if (!hcr_mask_override_bit) {
211 if (!scr_routing_bit) {
214 if (!hcr_mask_override_bit) {
240 if (!hcr_mask_override_bit) {
308 bool no_vhe = !
HaveExt(
tc, ArmExtension::FEAT_VHE);
310 bool cpsr_mask_bit, hcr_mask_override_bit;
313 amo = (no_vhe || hcr.e2h == 0);
314 fmo = (no_vhe || hcr.e2h == 0);
315 imo = (no_vhe || hcr.e2h == 0);
327 cpsr_mask_bit = cpsr.f;
328 hcr_mask_override_bit =
fmo;
331 cpsr_mask_bit = cpsr.i;
332 hcr_mask_override_bit =
imo;
335 cpsr_mask_bit = cpsr.a;
336 hcr_mask_override_bit =
amo;
339 panic(
"Unhandled interrupt type!");
341 return !cpsr_mask_bit && hcr_mask_override_bit &&
342 !is_secure && !is_hyp_mode;
354 bool cpsr_mask_bit, hcr_mask_override_bit;
359 cpsr_mask_bit = cpsr.f;
360 hcr_mask_override_bit = hcr.fmo;
363 cpsr_mask_bit = cpsr.i;
364 hcr_mask_override_bit = hcr.imo;
367 cpsr_mask_bit = cpsr.a;
368 hcr_mask_override_bit = hcr.amo;
371 panic(
"Unhandled interrupt type!");
380 if (!hcr_mask_override_bit) {
397 if (!hcr_mask_override_bit) {
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
ArmInterruptsParams Params
bool takeVirtualInt32(InterruptTypes int_type) const
Interrupts(const Params &p)
bool highestELIs64() const
Returns true if the register width of the highest implemented exception level is 64 bits (ARMv8)
BaseInterrupts(const Params &p)
#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 Arm Limited All rights reserved.