summaryrefslogtreecommitdiff
path: root/target/arm/translate.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-02-07 18:30:00 +0000
committerPeter Maydell <peter.maydell@linaro.org>2017-02-07 18:30:00 +0000
commit9bb6558a218bf7e466e5ac1100639517d8a30d33 (patch)
tree92a80c45a293cae2d2034e7be9e0c7916c719b6c /target/arm/translate.h
parent63f26fcfda8e19f94ce23336726d14805250a5b6 (diff)
downloadqemu-9bb6558a218bf7e466e5ac1100639517d8a30d33.tar.gz
target/arm: A32, T32: Create Instruction Syndromes for Data Aborts
Add support for generating the ISS (Instruction Specific Syndrome) for Data Abort exceptions taken from AArch32. These syndromes are used by hypervisors for example to trap and emulate memory accesses. This is the equivalent for AArch32 guests of the work done for AArch64 guests in commit aaa1f954d4cab243. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Diffstat (limited to 'target/arm/translate.h')
-rw-r--r--target/arm/translate.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/target/arm/translate.h b/target/arm/translate.h
index 285e96f087..abb0760158 100644
--- a/target/arm/translate.h
+++ b/target/arm/translate.h
@@ -104,6 +104,20 @@ static inline int default_exception_el(DisasContext *s)
? 3 : MAX(1, s->current_el);
}
+static void disas_set_insn_syndrome(DisasContext *s, uint32_t syn)
+{
+ /* We don't need to save all of the syndrome so we mask and shift
+ * out unneeded bits to help the sleb128 encoder do a better job.
+ */
+ syn &= ARM_INSN_START_WORD2_MASK;
+ syn >>= ARM_INSN_START_WORD2_SHIFT;
+
+ /* We check and clear insn_start_idx to catch multiple updates. */
+ assert(s->insn_start_idx != 0);
+ tcg_set_insn_param(s->insn_start_idx, 2, syn);
+ s->insn_start_idx = 0;
+}
+
/* target-specific extra values for is_jmp */
/* These instructions trap after executing, so the A32/T32 decoder must
* defer them until after the conditional execution state has been updated.