aboutsummaryrefslogtreecommitdiff
path: root/target-arm
diff options
context:
space:
mode:
authorAdam Lackorzynski <adam@os.inf.tu-dresden.de>2010-12-07 12:01:44 +0000
committerPeter Maydell <peter.maydell@linaro.org>2010-12-07 12:01:44 +0000
commit49e14940adeea797abd2be4ccda97d0349b22aae (patch)
treed7aacc378cfb5d919193801871ce4d759658d75f /target-arm
parent4809c612bc5eabf158d7a4656a98f5601c6bf104 (diff)
target-arm: Handle 'smc' as an undefined instruction
Refine check on bkpt so that smc and undefined instruction encodings are handled as an undefined instruction and trap. Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
Diffstat (limited to 'target-arm')
-rw-r--r--target-arm/translate.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/target-arm/translate.c b/target-arm/translate.c
index 947de6d18a..bf1e643b53 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -6346,7 +6346,14 @@ static void disas_arm_insn(CPUState * env, DisasContext *s)
dead_tmp(tmp2);
store_reg(s, rd, tmp);
break;
- case 7: /* bkpt */
+ case 7:
+ /* SMC instruction (op1 == 3)
+ and undefined instructions (op1 == 0 || op1 == 2)
+ will trap */
+ if (op1 != 1) {
+ goto illegal_op;
+ }
+ /* bkpt */
gen_set_condexec(s);
gen_set_pc_im(s->pc - 4);
gen_exception(EXCP_BKPT);