| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: subr_prf.c,v 1.151 2014/01/11 17:07:45 christos Exp $ */ | | 1 | /* $NetBSD: subr_prf.c,v 1.152 2014/01/12 00:29:15 joerg Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1986, 1988, 1991, 1993 | | 4 | * Copyright (c) 1986, 1988, 1991, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * (c) UNIX System Laboratories, Inc. | | 6 | * (c) UNIX System Laboratories, Inc. |
7 | * All or some portions of this file are derived from material licensed | | 7 | * All or some portions of this file are derived from material licensed |
8 | * to the University of California by American Telephone and Telegraph | | 8 | * to the University of California by American Telephone and Telegraph |
9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | | 9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with |
10 | * the permission of UNIX System Laboratories, Inc. | | 10 | * the permission of UNIX System Laboratories, Inc. |
11 | * | | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | | 12 | * Redistribution and use in source and binary forms, with or without |
13 | * modification, are permitted provided that the following conditions | | 13 | * modification, are permitted provided that the following conditions |
14 | * are met: | | 14 | * are met: |
| @@ -27,27 +27,27 @@ | | | @@ -27,27 +27,27 @@ |
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | * SUCH DAMAGE. | | 34 | * SUCH DAMAGE. |
35 | * | | 35 | * |
36 | * @(#)subr_prf.c 8.4 (Berkeley) 5/4/95 | | 36 | * @(#)subr_prf.c 8.4 (Berkeley) 5/4/95 |
37 | */ | | 37 | */ |
38 | | | 38 | |
39 | #include <sys/cdefs.h> | | 39 | #include <sys/cdefs.h> |
40 | __KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.151 2014/01/11 17:07:45 christos Exp $"); | | 40 | __KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.152 2014/01/12 00:29:15 joerg Exp $"); |
41 | | | 41 | |
42 | #include "opt_ddb.h" | | 42 | #include "opt_ddb.h" |
43 | #include "opt_ipkdb.h" | | 43 | #include "opt_ipkdb.h" |
44 | #include "opt_kgdb.h" | | 44 | #include "opt_kgdb.h" |
45 | #include "opt_dump.h" | | 45 | #include "opt_dump.h" |
46 | | | 46 | |
47 | #include <sys/param.h> | | 47 | #include <sys/param.h> |
48 | #include <sys/stdint.h> | | 48 | #include <sys/stdint.h> |
49 | #include <sys/systm.h> | | 49 | #include <sys/systm.h> |
50 | #include <sys/buf.h> | | 50 | #include <sys/buf.h> |
51 | #include <sys/device.h> | | 51 | #include <sys/device.h> |
52 | #include <sys/reboot.h> | | 52 | #include <sys/reboot.h> |
53 | #include <sys/msgbuf.h> | | 53 | #include <sys/msgbuf.h> |
| @@ -271,39 +271,26 @@ vpanic(const char *fmt, va_list ap) | | | @@ -271,39 +271,26 @@ vpanic(const char *fmt, va_list ap) |
271 | #ifdef IPKDB | | 271 | #ifdef IPKDB |
272 | ipkdb_panic(); | | 272 | ipkdb_panic(); |
273 | #endif | | 273 | #endif |
274 | #ifdef KGDB | | 274 | #ifdef KGDB |
275 | kgdb_panic(); | | 275 | kgdb_panic(); |
276 | #endif | | 276 | #endif |
277 | #ifdef KADB | | 277 | #ifdef KADB |
278 | if (boothowto & RB_KDB) | | 278 | if (boothowto & RB_KDB) |
279 | kdbpanic(); | | 279 | kdbpanic(); |
280 | #endif | | 280 | #endif |
281 | #ifdef DDB | | 281 | #ifdef DDB |
282 | db_panic(); | | 282 | db_panic(); |
283 | #endif | | 283 | #endif |
284 | printf("rebooting in"); | | | |
285 | for (int i = 10; i >= 0; --i) { | | | |
286 | printf(" %u", i); | | | |
287 | /* | | | |
288 | * sleep 10ms 100 times instead of 1s once to give a | | | |
289 | * VM hypervisor an opportunity to redraw part of the | | | |
290 | * screen during each call | | | |
291 | */ | | | |
292 | for (int j=0; i && j < 100; ++j) { | | | |
293 | DELAY(10000); | | | |
294 | } | | | |
295 | } | | | |
296 | printf("\n"); | | | |
297 | cpu_reboot(bootopt, NULL); | | 284 | cpu_reboot(bootopt, NULL); |
298 | } | | 285 | } |
299 | | | 286 | |
300 | /* | | 287 | /* |
301 | * kernel logging functions: log, logpri, addlog | | 288 | * kernel logging functions: log, logpri, addlog |
302 | */ | | 289 | */ |
303 | | | 290 | |
304 | /* | | 291 | /* |
305 | * log: write to the log buffer | | 292 | * log: write to the log buffer |
306 | * | | 293 | * |
307 | * => will not sleep [so safe to call from interrupt] | | 294 | * => will not sleep [so safe to call from interrupt] |
308 | * => will log to console if /dev/klog isn't open | | 295 | * => will log to console if /dev/klog isn't open |
309 | */ | | 296 | */ |