diff options
Diffstat (limited to 'sys/ddb/db_command.c')
-rw-r--r-- | sys/ddb/db_command.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 0ddbf5f49629..02f79ca949c2 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -745,7 +745,7 @@ out: static void db_reset(db_expr_t addr, bool have_addr, db_expr_t count __unused, - char *modif __unused) + char *modif) { int delay, loop; @@ -770,6 +770,18 @@ db_reset(db_expr_t addr, bool have_addr, db_expr_t count __unused, } } + /* + * Conditionally try the standard reboot path, so any registered + * shutdown/reset handlers have a chance to run first. Some platforms + * may not support the machine-dependent mechanism used by cpu_reset() + * and rely on some other non-standard mechanism to perform the reset. + * For example, the BCM2835 watchdog driver or gpio-poweroff driver. + */ + if (modif[0] != 's') { + kern_reboot(RB_NOSYNC); + /* NOTREACHED */ + } + cpu_reset(); } |