summaryrefslogtreecommitdiff
path: root/target-arm/op_helper.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-04-15 19:18:38 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-04-17 21:34:03 +0100
commitd4a2dc675bde36443c3a73051ca863d878d8bc31 (patch)
tree2b46df0c72d662b29bd63e393dbeab125f716533 /target-arm/op_helper.c
parent8bcbf37caa87ba89bc391bad70039f942a98c7e3 (diff)
downloadqemu-d4a2dc675bde36443c3a73051ca863d878d8bc31.tar.gz
target-arm: Add support for generating exceptions with syndrome information
Add new helpers exception_with_syndrome (for generating an exception with syndrome information) and exception_uncategorized (for generating an exception with "Unknown or Uncategorized Reason", which have a syndrome register value of zero), and use them to generate the correct syndrome information for exceptions which are raised directly from generated code. This patch includes moving the A32/T32 gen_exception_insn functions further up in the source file; they will be needed for "VFP/Neon disabled" exception generation later. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Diffstat (limited to 'target-arm/op_helper.c')
-rw-r--r--target-arm/op_helper.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
index bacfbc0c59..51edd9076c 100644
--- a/target-arm/op_helper.c
+++ b/target-arm/op_helper.c
@@ -244,11 +244,30 @@ void HELPER(wfe)(CPUARMState *env)
cpu_loop_exit(cs);
}
-void HELPER(exception)(CPUARMState *env, uint32_t excp)
+/* Raise an internal-to-QEMU exception. This is limited to only
+ * those EXCP values which are special cases for QEMU to interrupt
+ * execution and not to be used for exceptions which are passed to
+ * the guest (those must all have syndrome information and thus should
+ * use exception_with_syndrome).
+ */
+void HELPER(exception_internal)(CPUARMState *env, uint32_t excp)
+{
+ CPUState *cs = CPU(arm_env_get_cpu(env));
+
+ assert(excp_is_internal(excp));
+ cs->exception_index = excp;
+ cpu_loop_exit(cs);
+}
+
+/* Raise an exception with the specified syndrome register value */
+void HELPER(exception_with_syndrome)(CPUARMState *env, uint32_t excp,
+ uint32_t syndrome)
{
CPUState *cs = CPU(arm_env_get_cpu(env));
+ assert(!excp_is_internal(excp));
cs->exception_index = excp;
+ env->exception.syndrome = syndrome;
cpu_loop_exit(cs);
}