Deleted Added
full compact
kern_shutdown.c (76117) kern_shutdown.c (78767)
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 76117 2001-04-29 02:45:39Z grog $
39 * $FreeBSD: head/sys/kern/kern_shutdown.c 78767 2001-06-25 18:30:42Z 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>
48#include <sys/systm.h>
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>
48#include <sys/systm.h>
49#include <sys/eventhandler.h>
50#include <sys/bio.h>
51#include <sys/buf.h>
49#include <sys/bio.h>
50#include <sys/buf.h>
52#include <sys/reboot.h>
53#include <sys/proc.h>
54#include <sys/vnode.h>
51#include <sys/conf.h>
52#include <sys/cons.h>
53#include <sys/eventhandler.h>
55#include <sys/kernel.h>
56#include <sys/kthread.h>
57#include <sys/mount.h>
54#include <sys/kernel.h>
55#include <sys/kthread.h>
56#include <sys/mount.h>
58#include <sys/mutex.h>
59#include <sys/queue.h>
60#include <sys/smp.h> /* smp_active, cpuid */
57#include <sys/proc.h>
58#include <sys/reboot.h>
59#include <sys/resourcevar.h>
60#include <sys/smp.h> /* smp_active */
61#include <sys/sysctl.h>
61#include <sys/sysctl.h>
62#include <sys/conf.h>
63#include <sys/sysproto.h>
62#include <sys/sysproto.h>
64#include <sys/cons.h>
63#include <sys/vnode.h>
65
66#include <machine/pcb.h>
67#include <machine/md_var.h>
68
69#include <sys/signalvar.h>
70
71#ifndef PANIC_REBOOT_WAIT_TIME
72#define PANIC_REBOOT_WAIT_TIME 15 /* default to 15 seconds */

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

254 iter = 0;
255 pbusy = nbusy;
256 sync(&proc0, NULL);
257 if (curproc != NULL) {
258 DROP_GIANT_NOSWITCH();
259 for (subiter = 0; subiter < 50 * iter; subiter++) {
260 mtx_lock_spin(&sched_lock);
261 setrunqueue(curproc);
64
65#include <machine/pcb.h>
66#include <machine/md_var.h>
67
68#include <sys/signalvar.h>
69
70#ifndef PANIC_REBOOT_WAIT_TIME
71#define PANIC_REBOOT_WAIT_TIME 15 /* default to 15 seconds */

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

253 iter = 0;
254 pbusy = nbusy;
255 sync(&proc0, NULL);
256 if (curproc != NULL) {
257 DROP_GIANT_NOSWITCH();
258 for (subiter = 0; subiter < 50 * iter; subiter++) {
259 mtx_lock_spin(&sched_lock);
260 setrunqueue(curproc);
261 curproc->p_stats->p_ru.ru_nvcsw++;
262 mi_switch(); /* Allow interrupt threads to run */
263 mtx_unlock_spin(&sched_lock);
264 DELAY(1000);
265 }
266 PICKUP_GIANT();
267 } else
268 DELAY(50000 * iter);
269 }

--- 382 unchanged lines hidden ---
262 mi_switch(); /* Allow interrupt threads to run */
263 mtx_unlock_spin(&sched_lock);
264 DELAY(1000);
265 }
266 PICKUP_GIANT();
267 } else
268 DELAY(50000 * iter);
269 }

--- 382 unchanged lines hidden ---