Deleted Added
full compact
kern_shutdown.c (206878) kern_shutdown.c (206897)
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.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
35 */
36
37#include <sys/cdefs.h>
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.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/kern/kern_shutdown.c 206878 2010-04-19 23:27:54Z attilio $");
38__FBSDID("$FreeBSD: head/sys/kern/kern_shutdown.c 206897 2010-04-20 12:22:06Z attilio $");
39
40#include "opt_ddb.h"
41#include "opt_kdb.h"
42#include "opt_panic.h"
43#include "opt_show_busybufs.h"
44#include "opt_sched.h"
45
46#include <sys/param.h>

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

491 /*
492 * Acquiring smp_ipi_mtx here has a double effect:
493 * - it disables interrupts avoiding CPU0 preemption
494 * by fast handlers (thus deadlocking against other CPUs)
495 * - it avoids deadlocks against smp_rendezvous() or, more
496 * generally, threads busy-waiting, with this spinlock held,
497 * and waiting for responses by threads on other CPUs
498 * (ie. smp_tlb_shootdown()).
39
40#include "opt_ddb.h"
41#include "opt_kdb.h"
42#include "opt_panic.h"
43#include "opt_show_busybufs.h"
44#include "opt_sched.h"
45
46#include <sys/param.h>

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

491 /*
492 * Acquiring smp_ipi_mtx here has a double effect:
493 * - it disables interrupts avoiding CPU0 preemption
494 * by fast handlers (thus deadlocking against other CPUs)
495 * - it avoids deadlocks against smp_rendezvous() or, more
496 * generally, threads busy-waiting, with this spinlock held,
497 * and waiting for responses by threads on other CPUs
498 * (ie. smp_tlb_shootdown()).
499 *
500 * For the !SMP case it just needs to handle the former problem.
499 */
501 */
502#ifdef SMP
500 mtx_lock_spin(&smp_ipi_mtx);
503 mtx_lock_spin(&smp_ipi_mtx);
504#else
505 spinlock_enter();
506#endif
501
502 /* cpu_boot(howto); */ /* doesn't do anything at the moment */
503 cpu_reset();
504 /* NOTREACHED */ /* assuming reset worked */
505}
506
507#ifdef SMP
508static u_int panic_cpu = NOCPU;

--- 201 unchanged lines hidden ---
507
508 /* cpu_boot(howto); */ /* doesn't do anything at the moment */
509 cpu_reset();
510 /* NOTREACHED */ /* assuming reset worked */
511}
512
513#ifdef SMP
514static u_int panic_cpu = NOCPU;

--- 201 unchanged lines hidden ---