| 726 | #endif |
| 727 | |
| 728 | static void |
| 729 | db_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 | |
| 758 | static void |
| 759 | db_watchdog(db_expr_t dummy1, bool dummy2, db_expr_t dummy3, char *dummy4) |
nothing calls this directly
no test coverage detected