diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -743,6 +744,11 @@ #define DB_RESET_MAXDELAY (3600 * 24 * 7) #endif +static bool db_full_reboot = true; +SYSCTL_BOOL(_debug_ddb, OID_AUTO, full_reboot, CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &db_full_reboot, 0, + "Execute all shutdown handlers with 'reset' command"); + static void db_reset(db_expr_t addr, bool have_addr, db_expr_t count __unused, char *modif __unused) @@ -770,7 +776,15 @@ } } + /* + * Conditionally try the standard reboot path, so registered + * shutdown/reset handlers have a chance. + */ + if (db_full_reboot) + kern_reboot(RB_NOSYNC); + cpu_reset(); + __assert_unreachable(); } static void