It shares the same COPROC_ISS encoding as the other CP traps although
not all the fields are used.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
target/arm/syndrome.h | 16 ++++++++++++++++
target/arm/tcg/vfp_helper.c | 5 +----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h
index 2e3121aec9c..4fbc35ce7b0 100644
--- a/target/arm/syndrome.h
+++ b/target/arm/syndrome.h
@@ -251,6 +251,22 @@ FIELD(COPROC_ISS, OP2, 17, 3)
FIELD(COPROC_ISS, COND, 20, 4)
FIELD(COPROC_ISS, CV, 24, 1)
+static inline uint32_t syn_cp10_rt_trap(int cv, int cond, int opc1,
+ int crn, int rt, int isread)
+{
+ uint32_t res = syn_set_ec(0, EC_FPIDTRAP);
+ res = FIELD_DP32(res, SYNDROME, IL, 1);
+
+ res = FIELD_DP32(res, COPROC_ISS, CV, cv);
+ res = FIELD_DP32(res, COPROC_ISS, COND, cond);
+ res = FIELD_DP32(res, COPROC_ISS, OP1, opc1);
+ res = FIELD_DP32(res, COPROC_ISS, CRN, crn);
+ res = FIELD_DP32(res, COPROC_ISS, RT, rt);
+ res = FIELD_DP32(res, COPROC_ISS, ISREAD, isread);
+
+ return res;
+}
+
static inline uint32_t syn_cp14_rt_trap(int cv, int cond, int opc1, int opc2,
int crn, int crm, int rt, int isread,
bool is_16bit)
diff --git a/target/arm/tcg/vfp_helper.c b/target/arm/tcg/vfp_helper.c
index 45f2eb0930f..e692bc568bd 100644
--- a/target/arm/tcg/vfp_helper.c
+++ b/target/arm/tcg/vfp_helper.c
@@ -1359,10 +1359,7 @@ void HELPER(check_hcr_el2_trap)(CPUARMState *env, uint32_t rt, uint32_t reg)
g_assert_not_reached();
}
- syndrome = ((EC_FPIDTRAP << ARM_EL_EC_SHIFT)
- | ARM_EL_IL
- | (1 << 24) | (0xe << 20) | (7 << 14)
- | (reg << 10) | (rt << 5) | 1);
+ syndrome = syn_cp10_rt_trap(1, 0xe, 7, reg, rt, 1);
raise_exception(env, EXCP_HYP_TRAP, syndrome, 2);
}
--
2.47.3