]> Git Repo - qemu.git/blobdiff - target-arm/cpu.h
target-arm: Break out exception masking to a separate func
[qemu.git] / target-arm / cpu.h
index a3ba624b747da2a6324999f0ac5a5c9db4e0b93f..cc2c2100b3f6b0987373369342545f5e5cc2a0af 100644 (file)
@@ -1172,6 +1172,21 @@ bool write_cpustate_to_list(ARMCPU *cpu);
 #  define TARGET_VIRT_ADDR_SPACE_BITS 32
 #endif
 
+static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx)
+{
+    CPUARMState *env = cs->env_ptr;
+
+    switch (excp_idx) {
+    case EXCP_FIQ:
+        return !(env->daif & PSTATE_F);
+    case EXCP_IRQ:
+        return !(env->daif & PSTATE_I)
+               && (!IS_M(env) || env->regs[15] < 0xfffffff0);
+    default:
+        g_assert_not_reached();
+    }
+}
+
 static inline CPUARMState *cpu_init(const char *cpu_model)
 {
     ARMCPU *cpu = cpu_arm_init(cpu_model);
This page took 0.020534 seconds and 4 git commands to generate.