From owner-svn-src-all@FreeBSD.ORG Tue Oct 26 12:46:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59F0E1065697; Tue, 26 Oct 2010 12:46:27 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46F848FC21; Tue, 26 Oct 2010 12:46:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9QCkRiB025361; Tue, 26 Oct 2010 12:46:27 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QCkRSg025356; Tue, 26 Oct 2010 12:46:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010261246.o9QCkRSg025356@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 12:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214373 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 12:46:27 -0000 Author: attilio Date: Tue Oct 26 12:46:26 2010 New Revision: 214373 URL: http://svn.freebsd.org/changeset/base/214373 Log: Merge dump_machdep.c i386/amd64 under the x86 subtree. Sponsored by: Sandvine Incorporated Tested by: gianni Added: head/sys/x86/x86/dump_machdep.c - copied, changed from r214370, head/sys/amd64/amd64/dump_machdep.c Deleted: head/sys/amd64/amd64/dump_machdep.c head/sys/i386/i386/dump_machdep.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Oct 26 10:23:49 2010 (r214372) +++ head/sys/conf/files.amd64 Tue Oct 26 12:46:26 2010 (r214373) @@ -104,7 +104,6 @@ amd64/amd64/cpu_switch.S standard amd64/amd64/db_disasm.c optional ddb amd64/amd64/db_interface.c optional ddb amd64/amd64/db_trace.c optional ddb -amd64/amd64/dump_machdep.c standard amd64/amd64/elf_machdep.c standard amd64/amd64/exception.S standard amd64/amd64/fpu.c standard @@ -321,6 +320,7 @@ x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/qpi.c standard +x86/x86/dump_machdep.c standard x86/x86/io_apic.c standard x86/x86/local_apic.c standard x86/x86/mca.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Oct 26 10:23:49 2010 (r214372) +++ head/sys/conf/files.i386 Tue Oct 26 12:46:26 2010 (r214373) @@ -263,7 +263,6 @@ i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb -i386/i386/dump_machdep.c standard i386/i386/elan-mmcr.c optional cpu_elan | cpu_soekris i386/i386/elf_machdep.c standard i386/i386/exception.s optional native @@ -395,6 +394,7 @@ x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/qpi.c standard +x86/x86/dump_machdep.c standard x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic x86/x86/mca.c standard Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Tue Oct 26 10:23:49 2010 (r214372) +++ head/sys/conf/files.pc98 Tue Oct 26 12:46:26 2010 (r214373) @@ -138,7 +138,6 @@ i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb -i386/i386/dump_machdep.c standard i386/i386/elf_machdep.c standard i386/i386/exception.s standard i386/i386/gdb_machdep.c optional gdb @@ -255,6 +254,7 @@ pc98/pc98/pc98_machdep.c standard x86/isa/atpic.c optional atpic x86/isa/clock.c standard x86/isa/isa.c optional isa +x86/x86/dump_machdep.c standard x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic x86/x86/mca.c standard Copied and modified: head/sys/x86/x86/dump_machdep.c (from r214370, head/sys/amd64/amd64/dump_machdep.c) ============================================================================== --- head/sys/amd64/amd64/dump_machdep.c Tue Oct 26 08:50:09 2010 (r214370, copy source) +++ head/sys/x86/x86/dump_machdep.c Tue Oct 26 12:46:26 2010 (r214373) @@ -36,9 +36,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#ifdef __amd64__ +#define KERNELDUMP_VERSION KERNELDUMP_AMD64_VERSION +#define EM_VALUE EM_X86_64 +#else +#define KERNELDUMP_VERSION KERNELDUMP_I386_VERSION +#define EM_VALUE EM_386 +#endif + CTASSERT(sizeof(struct kerneldumpheader) == 512); int do_minidump = 1; @@ -168,7 +177,8 @@ cb_dumpdata(struct md_pa *mdp, int seqnr if (maxdumppgs == 0) /* seatbelt */ maxdumppgs = 1; - printf(" chunk %d: %ldMB (%ld pages)", seqnr, PG2MB(pgs), pgs); + printf(" chunk %d: %"PRIu64"MB (%"PRIu64" pages)", seqnr, PG2MB(pgs), + pgs); while (pgs) { chunk = pgs; @@ -177,7 +187,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr sz = chunk << PAGE_SHIFT; counter += sz; if (counter >> 24) { - printf(" %ld", PG2MB(pgs)); + printf(" %"PRIu64, PG2MB(pgs)); counter &= (1<<24) - 1; } for (i = 0; i < chunk; i++) { @@ -279,7 +289,7 @@ dumpsys(struct dumperinfo *di) ehdr.e_ident[EI_VERSION] = EV_CURRENT; ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ ehdr.e_type = ET_CORE; - ehdr.e_machine = EM_X86_64; + ehdr.e_machine = EM_VALUE; ehdr.e_phoff = sizeof(ehdr); ehdr.e_flags = 0; ehdr.e_ehsize = sizeof(ehdr); @@ -304,7 +314,8 @@ dumpsys(struct dumperinfo *di) dumplo = di->mediaoffset + di->mediasize - dumpsize; dumplo -= sizeof(kdh) * 2; - mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, dumpsize, di->blocksize); + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_VERSION, dumpsize, + di->blocksize); printf("Dumping %llu MB (%d chunks)\n", (long long)dumpsize >> 20, ehdr.e_phnum);