1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-01-25 19:46:10 +00:00

Provide debug access to SPRs in loadstore1 and mmu

They are accessible as GSPR 0x3c - PID, 0x3d - PTCR, 0x3e - DSISR
and 0x3f - DAR.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
This commit is contained in:
Paul Mackerras
2022-02-24 11:37:17 +11:00
parent d0f319290f
commit af814a0d5e
6 changed files with 96 additions and 29 deletions

View File

@@ -551,6 +551,10 @@ static const char *fast_spr_names[] =
"hsprg0", "hsprg1", "xer", "tar",
};
static const char *ldst_spr_names[] = {
"pidr", "ptcr", "dsisr", "dar"
};
static void gpr_read(uint64_t reg, uint64_t count)
{
uint64_t data;
@@ -566,8 +570,10 @@ static void gpr_read(uint64_t reg, uint64_t count)
printf("r%"PRId64, reg);
else if ((reg - 32) < sizeof(fast_spr_names) / sizeof(fast_spr_names[0]))
printf("%s", fast_spr_names[reg - 32]);
else if (reg < 64)
else if (reg < 60)
printf("gspr%"PRId64, reg);
else if (reg < 64)
printf("%s", ldst_spr_names[reg - 60]);
else
printf("FPR%"PRId64, reg - 64);
printf(":\t%016"PRIx64"\n", data);