From cf6b28d41bc944c3b498489ee916a3d8c72ff6be Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Wed, 13 Sep 2023 11:25:09 +0200 Subject: target/hppa: Wire up diag instruction to support BTLB Wire up the hppa diag instruction to support Block-TLBs when called with the 0x100 value. The diag_btlb() helper function does all necessary steps to emulate the PDC BTLB firmware function, which includes providing BTLB info, adding a new BTLB, deleting a BTLB and removing all BTLBs. Signed-off-by: Helge Deller --- target/hppa/translate.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'target/hppa/translate.c') diff --git a/target/hppa/translate.c b/target/hppa/translate.c index c04dc15228..650bbcfe95 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4042,9 +4042,18 @@ static bool trans_fmpyfadd_d(DisasContext *ctx, arg_fmpyfadd_d *a) static bool trans_diag(DisasContext *ctx, arg_diag *a) { - qemu_log_mask(LOG_UNIMP, "DIAG opcode ignored\n"); - cond_free(&ctx->null_cond); - return true; + nullify_over(ctx); + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); +#ifndef CONFIG_USER_ONLY + if (a->i == 0x100) { + /* emulate PDC BTLB, called by SeaBIOS-hppa */ + gen_helper_diag_btlb(cpu_env); + } else +#endif + { + qemu_log_mask(LOG_UNIMP, "DIAG opcode 0x%04x ignored\n", a->i); + } + return nullify_end(ctx); } static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) -- cgit v1.2.3