Deleted Added
full compact
kern_shutdown.c (81688) kern_shutdown.c (82115)
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 81688 2001-08-15 11:35:45Z bde $
39 * $FreeBSD: head/sys/kern/kern_shutdown.c 82115 2001-08-21 22:55:20Z jhb $
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>

--- 513 unchanged lines hidden (view full) ---

561void
562panic(const char *fmt, ...)
563{
564 int bootopt;
565 va_list ap;
566 static char buf[256];
567
568#ifdef SMP
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>

--- 513 unchanged lines hidden (view full) ---

561void
562panic(const char *fmt, ...)
563{
564 int bootopt;
565 va_list ap;
566 static char buf[256];
567
568#ifdef SMP
569 /* Only 1 CPU can panic at a time */
570 if (panic_cpu != PCPU_GET(cpuid) &&
571 atomic_cmpset_int(&panic_cpu, NOCPU, PCPU_GET(cpuid)) == 0) {
572 for (;;)
573 ; /* nothing */
574 }
569 /*
570 * We don't want multiple CPU's to panic at the same time, so we
571 * use panic_cpu as a simple spinlock. We have to keep checking
572 * panic_cpu if we are spinning in case the panic on the first
573 * CPU is canceled.
574 */
575 if (panic_cpu != PCPU_GET(cpuid))
576 while (atomic_cmpset_int(&panic_cpu, NOCPU,
577 PCPU_GET(cpuid)) == 0)
578 while (panic_cpu != NOCPU)
579 ; /* nothing */
575#endif
576
577 bootopt = RB_AUTOBOOT | RB_DUMP;
578 if (panicstr)
579 bootopt |= RB_NOSYNC;
580 else
581 panicstr = fmt;
582

--- 9 unchanged lines hidden (view full) ---

592#ifdef APIC_IO
593 printf("lapic.id = %08x\n", lapic.id);
594#endif
595#endif
596
597#if defined(DDB)
598 if (debugger_on_panic)
599 Debugger ("panic");
580#endif
581
582 bootopt = RB_AUTOBOOT | RB_DUMP;
583 if (panicstr)
584 bootopt |= RB_NOSYNC;
585 else
586 panicstr = fmt;
587

--- 9 unchanged lines hidden (view full) ---

597#ifdef APIC_IO
598 printf("lapic.id = %08x\n", lapic.id);
599#endif
600#endif
601
602#if defined(DDB)
603 if (debugger_on_panic)
604 Debugger ("panic");
605 /* See if the user aborted the panic, in which case we continue. */
606 if (panicstr == NULL) {
607#ifdef SMP
608 atomic_store_rel_int(&panic_cpu, NOCPU);
600#endif
609#endif
610 return;
611 }
612#endif
601 boot(bootopt);
602}
603
604/*
605 * Support for poweroff delay.
606 */
607#ifndef POWEROFF_DELAY
608# define POWEROFF_DELAY 5000

--- 44 unchanged lines hidden ---
613 boot(bootopt);
614}
615
616/*
617 * Support for poweroff delay.
618 */
619#ifndef POWEROFF_DELAY
620# define POWEROFF_DELAY 5000

--- 44 unchanged lines hidden ---