Add a new kernel option RESTARTABLE_PANICS. If this option is present,

then one can restart from a panic by resetting the panicstr variable to
NULL.  This commit conditionalizes the previously committed functionality
on this variable.  It also removes the __dead2 attribute from the panic()
function so that when one continues from a panic() the behavior will
be predictable.
This commit is contained in:
jhb 2001-08-23 20:32:21 +00:00
parent 7e0c531a0d
commit 1383792740
5 changed files with 27 additions and 0 deletions

View File

@ -387,6 +387,16 @@ options DIAGNOSTIC
# #
options REGRESSION 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 # PERFMON causes the driver for Pentium/Pentium Pro performance counters
# to be compiled. See perfmon(4) for more information. # to be compiled. See perfmon(4) for more information.

View File

@ -387,6 +387,7 @@ ENABLE_VFS_IOOPT opt_global.h
INVARIANT_SUPPORT opt_global.h INVARIANT_SUPPORT opt_global.h
INVARIANTS opt_global.h INVARIANTS opt_global.h
REGRESSION opt_global.h REGRESSION opt_global.h
RESTARTABLE_PANICS opt_global.h
SIMPLELOCK_DEBUG opt_global.h SIMPLELOCK_DEBUG opt_global.h
VFS_BIO_DEBUG opt_global.h VFS_BIO_DEBUG opt_global.h

View File

@ -387,6 +387,16 @@ options DIAGNOSTIC
# #
options REGRESSION 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 # PERFMON causes the driver for Pentium/Pentium Pro performance counters
# to be compiled. See perfmon(4) for more information. # to be compiled. See perfmon(4) for more information.

View File

@ -610,6 +610,7 @@ panic(const char *fmt, ...)
#if defined(DDB) #if defined(DDB)
if (debugger_on_panic) if (debugger_on_panic)
Debugger ("panic"); Debugger ("panic");
#ifdef RESTARTABLE_PANICS
/* See if the user aborted the panic, in which case we continue. */ /* See if the user aborted the panic, in which case we continue. */
if (panicstr == NULL) { if (panicstr == NULL) {
#ifdef SMP #ifdef SMP
@ -617,6 +618,7 @@ panic(const char *fmt, ...)
#endif #endif
return; return;
} }
#endif
#endif #endif
boot(bootopt); boot(bootopt);
} }

View File

@ -236,6 +236,10 @@
* things that included sys/systm.h just for panic(). * things that included sys/systm.h just for panic().
*/ */
#ifdef _KERNEL #ifdef _KERNEL
#ifdef RESTARTABLE_PANICS
void panic __P((const char *, ...)) __printflike(1, 2);
#else
void panic __P((const char *, ...)) __dead2 __printflike(1, 2); void panic __P((const char *, ...)) __dead2 __printflike(1, 2);
#endif #endif
#endif
#endif /* _SYS_PARAM_H_ */ #endif /* _SYS_PARAM_H_ */