kern_shutdown.c (62573) | kern_shutdown.c (65268) |
---|---|
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 62573 2000-07-04 11:25:35Z phk $ | 39 * $FreeBSD: head/sys/kern/kern_shutdown.c 65268 2000-08-31 00:08:50Z msmith $ |
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> --- 97 unchanged lines hidden (view full) --- 145 146 boot(uap->opt); 147 return (0); 148} 149 150/* 151 * Called by events that want to shut down.. e.g <CTL><ALT><DEL> on a PC 152 */ | 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> --- 97 unchanged lines hidden (view full) --- 145 146 boot(uap->opt); 147 return (0); 148} 149 150/* 151 * Called by events that want to shut down.. e.g <CTL><ALT><DEL> on a PC 152 */ |
153static int shutdown_howto = 0; 154 |
|
153void | 155void |
154shutdown_nice() | 156shutdown_nice(int howto) |
155{ | 157{ |
158 shutdown_howto = howto; 159 |
|
156 /* Send a signal to init(8) and have it shutdown the world */ 157 if (initproc != NULL) { 158 psignal(initproc, SIGINT); 159 } else { 160 /* No init(8) running, so simply reboot */ 161 boot(RB_NOSYNC); 162 } 163 return; --- 33 unchanged lines hidden (view full) --- 197 * this used to be in machdep.c but I'll be dammned if I could see 198 * anything machine dependant in it. 199 */ 200static void 201boot(howto) 202 int howto; 203{ 204 | 160 /* Send a signal to init(8) and have it shutdown the world */ 161 if (initproc != NULL) { 162 psignal(initproc, SIGINT); 163 } else { 164 /* No init(8) running, so simply reboot */ 165 boot(RB_NOSYNC); 166 } 167 return; --- 33 unchanged lines hidden (view full) --- 201 * this used to be in machdep.c but I'll be dammned if I could see 202 * anything machine dependant in it. 203 */ 204static void 205boot(howto) 206 int howto; 207{ 208 |
209 /* collect extra flags that shutdown_nice might have set */ 210 howto |= shutdown_howto; 211 |
|
205#ifdef SMP 206 if (smp_active) { 207 printf("boot() called on cpu#%d\n", cpuid); 208 } 209#endif 210 /* 211 * Do any callouts that should be done BEFORE syncing the filesystems. 212 */ --- 392 unchanged lines hidden --- | 212#ifdef SMP 213 if (smp_active) { 214 printf("boot() called on cpu#%d\n", cpuid); 215 } 216#endif 217 /* 218 * Do any callouts that should be done BEFORE syncing the filesystems. 219 */ --- 392 unchanged lines hidden --- |