mw_debug: Extend to handle FPRs
authorPaul Mackerras <paulus@ozlabs.org>
Tue, 22 Sep 2020 10:22:24 +0000 (20:22 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 15 Jan 2021 01:40:09 +0000 (12:40 +1100)
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
scripts/mw_debug/mw_debug.c

index 28e43b4f0b85162a353ce09fc4b0b3ac705ded7f..75b51af8695b32b3c3eb4349fc1488d8c4d899bb 100644 (file)
@@ -443,9 +443,9 @@ static void gpr_read(uint64_t reg, uint64_t count)
 {
        uint64_t data;
 
-       reg &= 0x3f;
-       if (reg + count > 64)
-               count = 64 - reg;
+       reg &= 0x7f;
+       if (reg + count > 96)
+               count = 96 - reg;
        for (; count != 0; --count, ++reg) {
                check(dmi_write(DBG_CORE_GSPR_INDEX, reg), "setting GPR index");
                data = 0xdeadbeef;
@@ -454,8 +454,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
+               else if (reg < 64)
                        printf("gspr%"PRId64, reg);
+               else
+                       printf("FPR%"PRId64, reg - 64);
                printf(":\t%016"PRIx64"\n", data);
        }
 }