mirror of https://github.com/xemu-project/xemu.git
taget-ppc: Fix read access to IBAT registers higher than IBAT3
Fix the index used to read the IBAT's vector which results in IBAT0..3 instead of IBAT4..N. The bug appeared by saving/restoring contexts including IBATs values. Signed-off-by: Julio Guerra <julio@farjump.io> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
68851b98e5
commit
3ede8f6996
|
@ -305,7 +305,7 @@ static void spr_read_ibat (DisasContext *ctx, int gprn, int sprn)
|
|||
|
||||
static void spr_read_ibat_h (DisasContext *ctx, int gprn, int sprn)
|
||||
{
|
||||
tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, IBAT[sprn & 1][(sprn - SPR_IBAT4U) / 2]));
|
||||
tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, IBAT[sprn & 1][((sprn - SPR_IBAT4U) / 2) + 4]));
|
||||
}
|
||||
|
||||
static void spr_write_ibatu (DisasContext *ctx, int sprn, int gprn)
|
||||
|
|
Loading…
Reference in New Issue