powerpc: Update xmon to use ppc_breakpoint_available()
authorMichael Neuling <mikey@neuling.org>
Tue, 27 Mar 2018 04:37:19 +0000 (15:37 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 27 Mar 2018 12:55:11 +0000 (23:55 +1100)
The 'bd' command will now print an error and not set the breakpoint on
P9.

Signed-off-by: Michael Neuling <mikey@neuling.org>
[mpe: Unsplit quoted string]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/xmon/xmon.c

index 82e1a3ee6e0fc0e8bf53ea22e8dd986ab2de508b..b481f9f4848936085b436290adbcb28a78d97f0d 100644 (file)
@@ -1297,6 +1297,10 @@ bpt_cmds(void)
        static const char badaddr[] = "Only kernel addresses are permitted for breakpoints\n";
        int mode;
        case 'd':       /* bd - hardware data breakpoint */
+               if (!ppc_breakpoint_available()) {
+                       printf("Hardware data breakpoint not supported on this cpu\n");
+                       break;
+               }
                mode = 7;
                cmd = inchar();
                if (cmd == 'r')