diff options
author | jhb <jhb@FreeBSD.org> | 2001-09-10 21:04:49 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-09-10 21:04:49 +0000 |
commit | fc670232424cc11febf72cb501b95bccfbe0e63e (patch) | |
tree | 71aacb116e7fc2d1a9f825a69f0a44bb94c9cf94 | |
parent | 786d3f851180d861352082e39d54a10a64f07c53 (diff) | |
download | FreeBSD-src-fc670232424cc11febf72cb501b95bccfbe0e63e.zip FreeBSD-src-fc670232424cc11febf72cb501b95bccfbe0e63e.tar.gz |
- Axe holding_giant as it is not used now anyways and was ok'd by
dillon in an earlier e-mail.
- We don't need to test the console right before we vfprintf() the panicstr
message. The printing of the panic message is a fine console test by
itself and doesn't make useful messages scroll off the screen or tick
developers off in quite the same.
Requested by: jlemon, imp, bmilekic, chris, gsutter, jake (2)
-rw-r--r-- | sys/kern/kern_shutdown.c | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 02eeceb..4dd9c62 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -143,9 +143,8 @@ reboot(struct proc *p, struct reboot_args *uap) int error; mtx_lock(&Giant); - if ((error = suser(p)) == 0) { + if ((error = suser(p)) == 0) boot(uap->opt); - } mtx_unlock(&Giant); return (error); } @@ -563,14 +562,6 @@ dumpstatus(vm_offset_t addr, long count) static u_int panic_cpu = NOCPU; #endif -/* This had probably better not go into a release. */ -static const char *face[4] = { - "\\|/ ____ \\|/", - "\"@'/ .. \\`@\"", - "/_| \\__/ |_\\", - " \\__U_/ " -}; - /* * Panic is called on unresolvable fatal errors. It prints "panic: mesg", * and then reboots. If we are called twice, then we avoid trying to sync @@ -581,23 +572,10 @@ static const char *face[4] = { void panic(const char *fmt, ...) { - int bootopt, i, offset; -#if defined(DDB) && defined(RESTARTABLE_PANICS) - int holding_giant = 0; -#endif + int bootopt; va_list ap; static char buf[256]; -#if 0 - /* - * We must hold Giant when entering a panic - */ - if (!mtx_owned(&Giant)) { - mtx_lock(&Giant); - holding_giant = 1; - } -#endif - #ifdef SMP /* * We don't want multiple CPU's to panic at the same time, so we @@ -605,13 +583,11 @@ panic(const char *fmt, ...) * panic_cpu if we are spinning in case the panic on the first * CPU is canceled. */ - if (panic_cpu != PCPU_GET(cpuid)) { + if (panic_cpu != PCPU_GET(cpuid)) while (atomic_cmpset_int(&panic_cpu, NOCPU, - PCPU_GET(cpuid)) == 0) { + PCPU_GET(cpuid)) == 0) while (panic_cpu != NOCPU) ; /* nothing */ - } - } #endif bootopt = RB_AUTOBOOT | RB_DUMP; @@ -620,11 +596,6 @@ panic(const char *fmt, ...) else panicstr = fmt; - /* Test that the console is still working. */ - offset = (60 + strlen(face[0])) / 2; - for (i = 0; i < 4; i++) - printf("%*s\n", offset, face[i]); - va_start(ap, fmt); (void)vsnprintf(buf, sizeof(buf), fmt, ap); if (panicstr == fmt) @@ -648,8 +619,6 @@ panic(const char *fmt, ...) #ifdef SMP atomic_store_rel_int(&panic_cpu, NOCPU); #endif - if (holding_giant) - mtx_unlock(&Giant); return; } #endif |