Deleted Added
full compact
kern_shutdown.c (183412) kern_shutdown.c (183527)
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 183412 2008-09-27 15:45:54Z kib $");
38__FBSDID("$FreeBSD: head/sys/kern/kern_shutdown.c 183527 2008-10-01 22:08:53Z peter $");
39
40#include "opt_ddb.h"
41#include "opt_kdb.h"
42#include "opt_mac.h"
43#include "opt_panic.h"
44#include "opt_show_busybufs.h"
45#include "opt_sched.h"
46
47#include <sys/param.h>
48#include <sys/systm.h>
49#include <sys/bio.h>
50#include <sys/buf.h>
51#include <sys/conf.h>
52#include <sys/cons.h>
53#include <sys/eventhandler.h>
54#include <sys/kdb.h>
55#include <sys/kernel.h>
39
40#include "opt_ddb.h"
41#include "opt_kdb.h"
42#include "opt_mac.h"
43#include "opt_panic.h"
44#include "opt_show_busybufs.h"
45#include "opt_sched.h"
46
47#include <sys/param.h>
48#include <sys/systm.h>
49#include <sys/bio.h>
50#include <sys/buf.h>
51#include <sys/conf.h>
52#include <sys/cons.h>
53#include <sys/eventhandler.h>
54#include <sys/kdb.h>
55#include <sys/kernel.h>
56#include <sys/kerneldump.h>
56#include <sys/kthread.h>
57#include <sys/malloc.h>
58#include <sys/mount.h>
59#include <sys/priv.h>
60#include <sys/proc.h>
61#include <sys/reboot.h>
62#include <sys/resourcevar.h>
63#include <sys/sched.h>
64#include <sys/smp.h> /* smp_active */
65#include <sys/sysctl.h>
66#include <sys/sysproto.h>
57#include <sys/kthread.h>
58#include <sys/malloc.h>
59#include <sys/mount.h>
60#include <sys/priv.h>
61#include <sys/proc.h>
62#include <sys/reboot.h>
63#include <sys/resourcevar.h>
64#include <sys/sched.h>
65#include <sys/smp.h> /* smp_active */
66#include <sys/sysctl.h>
67#include <sys/sysproto.h>
68#include <sys/vimage.h>
67
68#include <ddb/ddb.h>
69
70#include <machine/cpu.h>
71#include <machine/pcb.h>
72#include <machine/smp.h>
73
74#include <security/mac/mac_framework.h>

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

681#if defined(__powerpc__)
682void
683dumpsys(struct dumperinfo *di __unused)
684{
685
686 printf("Kernel dumps not implemented on this architecture\n");
687}
688#endif
69
70#include <ddb/ddb.h>
71
72#include <machine/cpu.h>
73#include <machine/pcb.h>
74#include <machine/smp.h>
75
76#include <security/mac/mac_framework.h>

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

683#if defined(__powerpc__)
684void
685dumpsys(struct dumperinfo *di __unused)
686{
687
688 printf("Kernel dumps not implemented on this architecture\n");
689}
690#endif
691
692void
693mkdumpheader(struct kerneldumpheader *kdh, char *magic, uint32_t archver,
694 uint64_t dumplen, uint32_t blksz)
695{
696
697 bzero(kdh, sizeof(*kdh));
698 strncpy(kdh->magic, magic, sizeof(kdh->magic));
699 strncpy(kdh->architecture, MACHINE_ARCH, sizeof(kdh->architecture));
700 kdh->version = htod32(KERNELDUMPVERSION);
701 kdh->architectureversion = htod32(archver);
702 kdh->dumplength = htod64(dumplen);
703 kdh->dumptime = htod64(time_second);
704 kdh->blocksize = htod32(blksz);
705 strncpy(kdh->hostname, G_hostname, sizeof(kdh->hostname));
706 strncpy(kdh->versionstring, version, sizeof(kdh->versionstring));
707 if (panicstr != NULL)
708 strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
709 kdh->parity = kerneldump_parity(kdh);
710}