diff options
-rw-r--r-- | sys/conf/NOTES | 10 | ||||
-rw-r--r-- | sys/conf/options | 1 | ||||
-rw-r--r-- | sys/i386/conf/NOTES | 10 | ||||
-rw-r--r-- | sys/kern/kern_shutdown.c | 2 | ||||
-rw-r--r-- | sys/sys/param.h | 4 |
5 files changed, 27 insertions, 0 deletions
diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 41434c4..405cbc2 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -388,6 +388,16 @@ options DIAGNOSTIC options REGRESSION # +# RESTARTABLE_PANICS allows one to continue from a panic as if it were +# a call to the debugger via the Debugger() function instead. It is only +# useful if a kernel debugger is present. To restart from a panic, reset +# the panicstr variable to NULL and continue execution. This option is +# for development use only and should NOT be used in production systems +# to "workaround" a panic. +# +options RESTARTABLE_PANICS + +# # PERFMON causes the driver for Pentium/Pentium Pro performance counters # to be compiled. See perfmon(4) for more information. # diff --git a/sys/conf/options b/sys/conf/options index 6e62f52..f43d3d6 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -387,6 +387,7 @@ ENABLE_VFS_IOOPT opt_global.h INVARIANT_SUPPORT opt_global.h INVARIANTS opt_global.h REGRESSION opt_global.h +RESTARTABLE_PANICS opt_global.h SIMPLELOCK_DEBUG opt_global.h VFS_BIO_DEBUG opt_global.h diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 41434c4..405cbc2 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -388,6 +388,16 @@ options DIAGNOSTIC options REGRESSION # +# RESTARTABLE_PANICS allows one to continue from a panic as if it were +# a call to the debugger via the Debugger() function instead. It is only +# useful if a kernel debugger is present. To restart from a panic, reset +# the panicstr variable to NULL and continue execution. This option is +# for development use only and should NOT be used in production systems +# to "workaround" a panic. +# +options RESTARTABLE_PANICS + +# # PERFMON causes the driver for Pentium/Pentium Pro performance counters # to be compiled. See perfmon(4) for more information. # diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 3b83723..1afa80f 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -610,6 +610,7 @@ panic(const char *fmt, ...) #if defined(DDB) if (debugger_on_panic) Debugger ("panic"); +#ifdef RESTARTABLE_PANICS /* See if the user aborted the panic, in which case we continue. */ if (panicstr == NULL) { #ifdef SMP @@ -618,6 +619,7 @@ panic(const char *fmt, ...) return; } #endif +#endif boot(bootopt); } diff --git a/sys/sys/param.h b/sys/sys/param.h index 984735f..59da5f0 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -236,6 +236,10 @@ * things that included sys/systm.h just for panic(). */ #ifdef _KERNEL +#ifdef RESTARTABLE_PANICS +void panic __P((const char *, ...)) __printflike(1, 2); +#else void panic __P((const char *, ...)) __dead2 __printflike(1, 2); #endif +#endif #endif /* _SYS_PARAM_H_ */ |