kern_shutdown.c (93935) | kern_shutdown.c (94169) |
---|---|
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 93935 2002-04-06 06:41:54Z nyan $ | 39 * $FreeBSD: head/sys/kern/kern_shutdown.c 94169 2002-04-08 06:59:13Z phk $ |
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> --- 11 unchanged lines hidden (view full) --- 59#include <sys/proc.h> 60#include <sys/reboot.h> 61#include <sys/resourcevar.h> 62#include <sys/smp.h> /* smp_active */ 63#include <sys/sysctl.h> 64#include <sys/sysproto.h> 65#include <sys/vnode.h> 66 | 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> --- 11 unchanged lines hidden (view full) --- 59#include <sys/proc.h> 60#include <sys/reboot.h> 61#include <sys/resourcevar.h> 62#include <sys/smp.h> /* smp_active */ 63#include <sys/sysctl.h> 64#include <sys/sysproto.h> 65#include <sys/vnode.h> 66 |
67#include <machine/pcb.h> |
|
67#include <machine/md_var.h> 68#include <machine/smp.h> 69 70#include <sys/signalvar.h> 71#ifdef DDB 72#include <ddb/ddb.h> 73#endif 74 --- 37 unchanged lines hidden (view full) --- 112/* 113 * Variable panicstr contains argument to first call to panic; used as flag 114 * to indicate that the kernel has already called panic. 115 */ 116const char *panicstr; 117 118int dumping; /* system is dumping */ 119static struct dumperinfo dumper; /* our selected dumper */ | 68#include <machine/md_var.h> 69#include <machine/smp.h> 70 71#include <sys/signalvar.h> 72#ifdef DDB 73#include <ddb/ddb.h> 74#endif 75 --- 37 unchanged lines hidden (view full) --- 113/* 114 * Variable panicstr contains argument to first call to panic; used as flag 115 * to indicate that the kernel has already called panic. 116 */ 117const char *panicstr; 118 119int dumping; /* system is dumping */ 120static struct dumperinfo dumper; /* our selected dumper */ |
121static struct pcb dumppcb; /* "You Are Here" sign for dump-debuggers */ |
|
120 121static void boot(int) __dead2; 122static void poweroff_wait(void *, int); 123static void shutdown_halt(void *junk, int howto); 124static void shutdown_panic(void *junk, int howto); 125static void shutdown_reset(void *junk, int howto); 126 127/* register various local shutdown events */ --- 71 unchanged lines hidden (view full) --- 199 if (f || ts.tv_sec >= 60) { 200 printf("%ldm", (long)ts.tv_sec / 60); 201 ts.tv_sec %= 60; 202 f = 1; 203 } 204 printf("%lds\n", (long)ts.tv_sec); 205} 206 | 122 123static void boot(int) __dead2; 124static void poweroff_wait(void *, int); 125static void shutdown_halt(void *junk, int howto); 126static void shutdown_panic(void *junk, int howto); 127static void shutdown_reset(void *junk, int howto); 128 129/* register various local shutdown events */ --- 71 unchanged lines hidden (view full) --- 201 if (f || ts.tv_sec >= 60) { 202 printf("%ldm", (long)ts.tv_sec / 60); 203 ts.tv_sec %= 60; 204 f = 1; 205 } 206 printf("%lds\n", (long)ts.tv_sec); 207} 208 |
209static void 210doadump(void) 211{ 212 savectx(&dumppcb); 213 dumping++; 214 dumpsys(&dumper); 215} 216 |
|
207/* 208 * Go through the rigmarole of shutting down.. 209 * this used to be in machdep.c but I'll be dammned if I could see 210 * anything machine dependant in it. 211 */ 212static void 213boot(int howto) 214{ --- 112 unchanged lines hidden (view full) --- 327 328 /* 329 * Ok, now do things that assume all filesystem activity has 330 * been completed. 331 */ 332 EVENTHANDLER_INVOKE(shutdown_post_sync, howto); 333 splhigh(); 334 if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP && | 217/* 218 * Go through the rigmarole of shutting down.. 219 * this used to be in machdep.c but I'll be dammned if I could see 220 * anything machine dependant in it. 221 */ 222static void 223boot(int howto) 224{ --- 112 unchanged lines hidden (view full) --- 337 338 /* 339 * Ok, now do things that assume all filesystem activity has 340 * been completed. 341 */ 342 EVENTHANDLER_INVOKE(shutdown_post_sync, howto); 343 splhigh(); 344 if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP && |
335 !cold && dumper.dumper != NULL && !dumping) { 336 dumping++; 337 dumpsys(&dumper); 338 } | 345 !cold && dumper.dumper != NULL && !dumping) 346 doadump(); |
339 340 /* Now that we're going to really halt the system... */ 341 EVENTHANDLER_INVOKE(shutdown_final, howto); 342 343 for(;;) ; /* safety against shutdown_reset not working */ 344 /* NOTREACHED */ 345} 346 --- 210 unchanged lines hidden --- | 347 348 /* Now that we're going to really halt the system... */ 349 EVENTHANDLER_INVOKE(shutdown_final, howto); 350 351 for(;;) ; /* safety against shutdown_reset not working */ 352 /* NOTREACHED */ 353} 354 --- 210 unchanged lines hidden --- |