Fix PPC32 fault when timer-spr access

Access to TB, DEC registers was lead to crash
spr_read_decr and others are changed to spr_read_generic
spr_write_decr and others are changed to spr_write_generic
This commit is contained in:
dotcirill
2023-12-06 01:58:50 +03:00
parent c0adcfb5e5
commit b0ea433772
2 changed files with 40 additions and 0 deletions

View File

@@ -171,6 +171,7 @@ static void spr_write_ureg(DisasContext *ctx, int sprn, int gprn)
/* SPR common to all non-embedded PowerPC */
/* DECR */
#if 0
static void spr_read_decr(DisasContext *ctx, int gprn, int sprn)
{
TCGContext *tcg_ctx = ctx->uc->tcg_ctx;
@@ -182,7 +183,11 @@ static void spr_read_decr(DisasContext *ctx, int gprn, int sprn)
gen_stop_exception(ctx);
}
}
#else
#define spr_read_decr spr_read_generic
#endif
#if 0
static void spr_write_decr(DisasContext *ctx, int sprn, int gprn)
{
TCGContext *tcg_ctx = ctx->uc->tcg_ctx;
@@ -194,9 +199,13 @@ static void spr_write_decr(DisasContext *ctx, int sprn, int gprn)
gen_stop_exception(ctx);
}
}
#else
#define spr_write_decr spr_write_generic
#endif
/* SPR common to all non-embedded PowerPC, except 601 */
/* Time base */
#if 0
static void spr_read_tbl(DisasContext *ctx, int gprn, int sprn)
{
TCGContext *tcg_ctx = ctx->uc->tcg_ctx;
@@ -209,7 +218,11 @@ static void spr_read_tbl(DisasContext *ctx, int gprn, int sprn)
gen_stop_exception(ctx);
}
}
#else
#define spr_read_tbl spr_read_generic
#endif
#if 0
static void spr_read_tbu(DisasContext *ctx, int gprn, int sprn)
{
TCGContext *tcg_ctx = ctx->uc->tcg_ctx;
@@ -222,6 +235,9 @@ static void spr_read_tbu(DisasContext *ctx, int gprn, int sprn)
gen_stop_exception(ctx);
}
}
#else
#define spr_read_tbu spr_read_generic
#endif
#if 0
// ATTRIBUTE_UNUSED
@@ -239,6 +255,7 @@ static void spr_read_atbu(DisasContext *ctx, int gprn, int sprn)
}
#endif
#if 0
static void spr_write_tbl(DisasContext *ctx, int sprn, int gprn)
{
TCGContext *tcg_ctx = ctx->uc->tcg_ctx;
@@ -251,7 +268,12 @@ static void spr_write_tbl(DisasContext *ctx, int sprn, int gprn)
gen_stop_exception(ctx);
}
}
#else
#define spr_write_tbl spr_write_generic
#endif
#if 0
static void spr_write_tbu(DisasContext *ctx, int sprn, int gprn)
{
TCGContext *tcg_ctx = ctx->uc->tcg_ctx;
@@ -264,6 +286,9 @@ static void spr_write_tbu(DisasContext *ctx, int sprn, int gprn)
gen_stop_exception(ctx);
}
}
#else
#define spr_write_tbu spr_write_generic
#endif
#if 0
// ATTRIBUTE_UNUSED