ppcmmu: verbose MMU state with mmu_print_regs().

This commit is contained in:
Maxim Poliakovski 2021-10-06 23:40:48 +02:00
parent bde5b71167
commit 3eb2d3cba7

View File

@ -935,6 +935,36 @@ void mmu_pat_ctx_changed()
}
}
void mmu_print_regs()
{
LOG_SCOPE_FUNCTION(INFO);
LOG_F(INFO, "MSR = 0x%X\n", ppc_state.msr);
LOG_F(INFO, "BAT registers:");
for (int i = 0; i < 4; i++) {
LOG_F(INFO, "IBAT%dU = 0x%X, IBAT%dL = 0x%X",
i, ppc_state.spr[528+i*2],
i, ppc_state.spr[529+i*2]);
}
if (!is_601_MMU) {
for (int i = 0; i < 4; i++) {
LOG_F(INFO, "DBAT%dU = 0x%X, DBAT%dL = 0x%X",
i, ppc_state.spr[536+i*2],
i, ppc_state.spr[537+i*2]);
}
}
LOG_F(INFO, "");
LOG_F(INFO, "SDR1 = 0x%X\n", ppc_state.spr[SPR::SDR1]);
LOG_F(INFO, "Segment registers:");
for (int i = 0; i < 16; i++) {
LOG_F(INFO, "SR%d = 0x%X", i, ppc_state.sr[i]);
}
}
// Forward declarations.
static uint32_t read_unaligned(uint32_t guest_va, uint8_t *host_va, uint32_t size);
static void write_unaligned(uint32_t guest_va, uint8_t *host_va, uint32_t value,