aboutsummaryrefslogtreecommitdiff
path: root/target/hppa/translate.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-03-26 07:08:53 -1000
committerRichard Henderson <richard.henderson@linaro.org>2024-03-29 07:51:42 -1000
commit381931275a9e09fb832bd6be0b41ebd6ce415099 (patch)
tree8748e60c6a83c8ca88cd6b911205daea8c63f041 /target/hppa/translate.c
parent558c09bef87cfa891f0eb12651208cb46212815d (diff)
target/hppa: Move diag argument handling to decodetree
Split trans_diag into per-operation functions. Reviewed-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/hppa/translate.c')
-rw-r--r--target/hppa/translate.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 29e4a64e40..42dd3f2c8d 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -4572,23 +4572,31 @@ static bool trans_fmpyfadd_d(DisasContext *ctx, arg_fmpyfadd_d *a)
return nullify_end(ctx);
}
-static bool trans_diag(DisasContext *ctx, arg_diag *a)
+/* Emulate PDC BTLB, called by SeaBIOS-hppa */
+static bool trans_diag_btlb(DisasContext *ctx, arg_diag_btlb *a)
{
CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR);
#ifndef CONFIG_USER_ONLY
- if (a->i == 0x100) {
- /* emulate PDC BTLB, called by SeaBIOS-hppa */
- nullify_over(ctx);
- gen_helper_diag_btlb(tcg_env);
- return nullify_end(ctx);
- }
- if (a->i == 0x101) {
- /* print char in %r26 to first serial console, used by SeaBIOS-hppa */
- nullify_over(ctx);
- gen_helper_diag_console_output(tcg_env);
- return nullify_end(ctx);
- }
+ nullify_over(ctx);
+ gen_helper_diag_btlb(tcg_env);
+ return nullify_end(ctx);
+#endif
+}
+
+/* Print char in %r26 to first serial console, used by SeaBIOS-hppa */
+static bool trans_diag_cout(DisasContext *ctx, arg_diag_cout *a)
+{
+ CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR);
+#ifndef CONFIG_USER_ONLY
+ nullify_over(ctx);
+ gen_helper_diag_console_output(tcg_env);
+ return nullify_end(ctx);
#endif
+}
+
+static bool trans_diag_unimp(DisasContext *ctx, arg_diag_unimp *a)
+{
+ CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR);
qemu_log_mask(LOG_UNIMP, "DIAG opcode 0x%04x ignored\n", a->i);
return true;
}