diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2018-02-12 19:46:08 -0800 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2019-02-12 08:59:21 -0800 |
commit | 96927adb8d66650c38eadc619559ad50adba73e4 (patch) | |
tree | 26e8fa664ae447584b1b89275ef26390351134ef /target/hppa | |
parent | e8777db7aa04b66db9bb7b254e56c51acf8f1aec (diff) | |
download | qemu-96927adb8d66650c38eadc619559ad50adba73e4.zip qemu-96927adb8d66650c38eadc619559ad50adba73e4.tar.gz qemu-96927adb8d66650c38eadc619559ad50adba73e4.tar.bz2 |
target/hppa: Convert halt/reset insns
Tested-by: Helge Deller <deller@gmx.de>
Tested-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/hppa')
-rw-r--r-- | target/hppa/insns.decode | 5 | ||||
-rw-r--r-- | target/hppa/translate.c | 47 |
2 files changed, 19 insertions, 33 deletions
diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 935100b..669ccdc 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -103,6 +103,11 @@ ssm 000000 .......... 000 01101011 t:5 i=%sm_imm rfi 000000 ----- ----- --- 01100000 00000 rfi_r 000000 ----- ----- --- 01100101 00000 +# These are artificial instructions used by QEMU firmware. +# They are allocated from the unassigned instruction space. +halt 1111 1111 1111 1101 1110 1010 1101 0000 +reset 1111 1111 1111 1101 1110 1010 1101 0001 + #### # Memory Management #### diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4ecd522..c73a7ab 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2376,20 +2376,27 @@ static bool trans_rfi_r(DisasContext *ctx, arg_rfi_r *a) return do_rfi(ctx, true); } +static bool trans_halt(DisasContext *ctx, arg_halt *a) +{ + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY -static bool gen_hlt(DisasContext *ctx, int reset) + nullify_over(ctx); + gen_helper_halt(cpu_env); + ctx->base.is_jmp = DISAS_NORETURN; + return nullify_end(ctx); +#endif +} + +static bool trans_reset(DisasContext *ctx, arg_reset *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); +#ifndef CONFIG_USER_ONLY nullify_over(ctx); - if (reset) { - gen_helper_reset(cpu_env); - } else { - gen_helper_halt(cpu_env); - } + gen_helper_reset(cpu_env); ctx->base.is_jmp = DISAS_NORETURN; return nullify_end(ctx); +#endif } -#endif /* !CONFIG_USER_ONLY */ static bool trans_nop_addrx(DisasContext *ctx, arg_ldst *a) { @@ -4134,32 +4141,6 @@ static void translate_one(DisasContext *ctx, uint32_t insn) case 0x2E: translate_table(ctx, insn, table_fp_fused); return; - - case 0x04: /* spopn */ - case 0x05: /* diag */ - case 0x0F: /* product specific */ - break; - - case 0x07: /* unassigned */ - case 0x15: /* unassigned */ - case 0x1D: /* unassigned */ - case 0x37: /* unassigned */ - break; - case 0x3F: -#ifndef CONFIG_USER_ONLY - /* Unassigned, but use as system-halt. */ - if (insn == 0xfffdead0) { - gen_hlt(ctx, 0); /* halt system */ - return; - } - if (insn == 0xfffdead1) { - gen_hlt(ctx, 1); /* reset system */ - return; - } -#endif - break; - default: - break; } gen_illegal(ctx); } |