ANDROID: ARM: fiq_debugger: add support for reboot commands
authorColin Cross <ccross@android.com>
Wed, 14 Mar 2012 23:29:47 +0000 (16:29 -0700)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 18 Dec 2017 15:41:22 +0000 (21:11 +0530)
Pass the rest of the reboot command to kernel_restart to allow
reboot bootloader to work from FIQ debugger.

Change-Id: I4e7b366a69268dda17ffcf4c84f2373d15cb1271
Signed-off-by: Colin Cross <ccross@android.com>
arch/arm/common/fiq_debugger.c

index 67bb9e6e1b4af65f45eff6f04103eadd618bd4d2..9949bd7ef3d71b4ea651b100211845db8a914774 100644 (file)
@@ -573,8 +573,17 @@ static bool debug_fiq_exec(struct fiq_debugger_state *state,
                dump_allregs(state, regs);
        } else if (!strcmp(cmd, "bt")) {
                dump_stacktrace(state, (struct pt_regs *)regs, 100, svc_sp);
-       } else if (!strcmp(cmd, "reboot")) {
-               kernel_restart(NULL);
+       } else if (!strncmp(cmd, "reboot", 6)) {
+               cmd += 6;
+               while (*cmd == ' ')
+                       cmd++;
+               if (*cmd) {
+                       char tmp_cmd[32];
+                       strlcpy(tmp_cmd, cmd, sizeof(tmp_cmd));
+                       kernel_restart(tmp_cmd);
+               } else {
+                       kernel_restart(NULL);
+               }
        } else if (!strcmp(cmd, "irqs")) {
                dump_irqs(state);
        } else if (!strcmp(cmd, "kmsg")) {