aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2018-08-27 22:18:48 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2018-10-01 11:08:35 -0700
commit4c6ec5f3cd88cb27a4e40a480b34e433a725dc05 (patch)
tree970d4c7ffa4c88046e7872beaf64e7eee823d809
parent21a2dad5c40d9f1b3f82e73c9fcc35166ef4d57c (diff)
target/xtensa: extract test for syscall instruction
- mark syscall instruction; - put syscall exception check right after privileged exception check; Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
-rw-r--r--target/xtensa/translate.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 6b5edfd0c2..69d3c583e8 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -1047,6 +1047,11 @@ static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc)
return;
}
+ if (op_flags & XTENSA_OP_SYSCALL) {
+ gen_exception_cause(dc, SYSCALL_CAUSE);
+ return;
+ }
+
for (slot = 0; slot < slots; ++slot) {
XtensaOpcodeOps *ops = slot_prop[slot].ops;
@@ -2557,12 +2562,6 @@ static void translate_subx(DisasContext *dc, const uint32_t arg[],
}
}
-static void translate_syscall(DisasContext *dc, const uint32_t arg[],
- const uint32_t par[])
-{
- gen_exception_cause(dc, SYSCALL_CAUSE);
-}
-
static void translate_waiti(DisasContext *dc, const uint32_t arg[],
const uint32_t par[])
{
@@ -4094,7 +4093,7 @@ static const XtensaOpcodeOps core_ops[] = {
.par = (const uint32_t[]){3},
}, {
.name = "syscall",
- .translate = translate_syscall,
+ .op_flags = XTENSA_OP_SYSCALL,
}, {
.name = "umul.aa.hh",
.translate = translate_mac16,