Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Sleep 10 seconds before rebooting due to panic()



details:   https://anonhg.NetBSD.org/src/rev/c71714b4e277
branches:  trunk
changeset: 325916:c71714b4e277
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 11 17:07:45 2014 +0000

description:
Sleep 10 seconds before rebooting due to panic()
To give an opportunity to screencap a panic(), or pause a VM to attach
a debugger.  (Richard Hansen)

diffstat:

 sys/kern/subr_prf.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r e23107fd14f7 -r c71714b4e277 sys/kern/subr_prf.c
--- a/sys/kern/subr_prf.c       Sat Jan 11 17:06:15 2014 +0000
+++ b/sys/kern/subr_prf.c       Sat Jan 11 17:07:45 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_prf.c,v 1.150 2013/02/10 11:04:19 apb Exp $       */
+/*     $NetBSD: subr_prf.c,v 1.151 2014/01/11 17:07:45 christos Exp $  */
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.150 2013/02/10 11:04:19 apb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.151 2014/01/11 17:07:45 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipkdb.h"
@@ -281,6 +281,19 @@
 #ifdef DDB
        db_panic();
 #endif
+       printf("rebooting in");
+       for (int i = 10; i >= 0; --i) {
+               printf(" %u", i);
+               /*
+                * sleep 10ms 100 times instead of 1s once to give a
+                * VM hypervisor an opportunity to redraw part of the
+                * screen during each call
+                */
+               for (int j=0; i && j < 100; ++j) {
+                       DELAY(10000);
+               }
+       }
+       printf("\n");
        cpu_reboot(bootopt, NULL);
 }
 



Home | Main Index | Thread Index | Old Index