MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_reset

Function db_reset

freebsd/ddb/db_command.c:728–756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726#endif
727
728static void
729db_reset(db_expr_t addr, bool have_addr, db_expr_t count __unused,
730 char *modif __unused)
731{
732 int delay, loop;
733
734 if (have_addr) {
735 delay = (int)db_hex2dec(addr);
736
737 /* If we parse to fail, use 15s. */
738 if (delay == -1)
739 delay = 15;
740
741 /* Cap at one week. */
742 if ((uintmax_t)delay > (uintmax_t)DB_RESET_MAXDELAY)
743 delay = DB_RESET_MAXDELAY;
744
745 db_printf("Automatic reboot in %d seconds - "
746 "press a key on the console to abort\n", delay);
747 for (loop = delay * 10; loop > 0; --loop) {
748 DELAY(1000 * 100); /* 1/10th second */
749 /* Did user type a key? */
750 if (cncheckc() != -1)
751 return;
752 }
753 }
754
755 cpu_reset();
756}
757
758static void
759db_watchdog(db_expr_t dummy1, bool dummy2, db_expr_t dummy3, char *dummy4)

Callers

nothing calls this directly

Calls 5

db_hex2decFunction · 0.85
db_printfFunction · 0.85
cncheckcFunction · 0.85
DELAYFunction · 0.50
cpu_resetFunction · 0.50

Tested by

no test coverage detected