]> Git Repo - qemu.git/commitdiff
target/xtensa: extract test for syscall instruction
authorMax Filippov <[email protected]>
Tue, 28 Aug 2018 05:18:48 +0000 (22:18 -0700)
committerMax Filippov <[email protected]>
Mon, 1 Oct 2018 18:08:35 +0000 (11:08 -0700)
- mark syscall instruction;
- put syscall exception check right after privileged exception check;

Signed-off-by: Max Filippov <[email protected]>
target/xtensa/translate.c

index 6b5edfd0c2bbaf5163cf728aaa08c61d426b396f..69d3c583e83e43c540ad5d97b576511aba32d7de 100644 (file)
@@ -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,
This page took 0.037863 seconds and 4 git commands to generate.