kern_shutdown.c (99828) | kern_shutdown.c (100209) |
---|---|
1/*- 2 * Copyright (c) 1986, 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 | 1/*- 2 * Copyright (c) 1986, 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 |
39 * $FreeBSD: head/sys/kern/kern_shutdown.c 99828 2002-07-11 21:56:37Z jhb $ | 39 * $FreeBSD: head/sys/kern/kern_shutdown.c 100209 2002-07-17 02:23:44Z gallatin $ |
40 */ 41 42#include "opt_ddb.h" 43#include "opt_hw_wdog.h" 44#include "opt_panic.h" 45#include "opt_show_busybufs.h" 46 47#include <sys/param.h> --- 380 unchanged lines hidden (view full) --- 428 * and then reboots. If we are called twice, then we avoid trying to sync 429 * the disks as this often leads to recursive panics. 430 * 431 * MPSAFE 432 */ 433void 434panic(const char *fmt, ...) 435{ | 40 */ 41 42#include "opt_ddb.h" 43#include "opt_hw_wdog.h" 44#include "opt_panic.h" 45#include "opt_show_busybufs.h" 46 47#include <sys/param.h> --- 380 unchanged lines hidden (view full) --- 428 * and then reboots. If we are called twice, then we avoid trying to sync 429 * the disks as this often leads to recursive panics. 430 * 431 * MPSAFE 432 */ 433void 434panic(const char *fmt, ...) 435{ |
436 struct thread *td = curthread; |
|
436 int bootopt; 437 va_list ap; 438 static char buf[256]; 439 440#ifdef SMP 441 /* 442 * We don't want multiple CPU's to panic at the same time, so we 443 * use panic_cpu as a simple spinlock. We have to keep checking --- 37 unchanged lines hidden (view full) --- 481 if (panicstr == NULL) { 482#ifdef SMP 483 atomic_store_rel_int(&panic_cpu, NOCPU); 484#endif 485 return; 486 } 487#endif 488#endif | 437 int bootopt; 438 va_list ap; 439 static char buf[256]; 440 441#ifdef SMP 442 /* 443 * We don't want multiple CPU's to panic at the same time, so we 444 * use panic_cpu as a simple spinlock. We have to keep checking --- 37 unchanged lines hidden (view full) --- 482 if (panicstr == NULL) { 483#ifdef SMP 484 atomic_store_rel_int(&panic_cpu, NOCPU); 485#endif 486 return; 487 } 488#endif 489#endif |
490 td->td_flags |= TDF_INPANIC; |
|
489 if (!sync_on_panic) 490 bootopt |= RB_NOSYNC; 491 boot(bootopt); 492} 493 494/* 495 * Support for poweroff delay. 496 */ --- 69 unchanged lines hidden --- | 491 if (!sync_on_panic) 492 bootopt |= RB_NOSYNC; 493 boot(bootopt); 494} 495 496/* 497 * Support for poweroff delay. 498 */ --- 69 unchanged lines hidden --- |