socsvn commit: r289497 - soc2013/def/crashdump-head/sys/sparc64/sparc64

def at FreeBSD.org def at FreeBSD.org
Sun Aug 9 23:25:42 UTC 2015


Author: def
Date: Sun Aug  9 23:25:41 2015
New Revision: 289497
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=289497

Log:
  Add EKCD support on SPARC64.

Modified:
  soc2013/def/crashdump-head/sys/sparc64/sparc64/dump_machdep.c

Modified: soc2013/def/crashdump-head/sys/sparc64/sparc64/dump_machdep.c
==============================================================================
--- soc2013/def/crashdump-head/sys/sparc64/sparc64/dump_machdep.c	Sun Aug  9 23:23:06 2015	(r289496)
+++ soc2013/def/crashdump-head/sys/sparc64/sparc64/dump_machdep.c	Sun Aug  9 23:25:41 2015	(r289497)
@@ -104,7 +104,7 @@
 	    DEV_BSIZE);
 	size += hdrsize;
 
-	totsize = size + 2 * sizeof(kdh);
+	totsize = size + 2 * sizeof(kdh) + kerneldumpkey_size(di->kdk);
 	if (totsize > di->mediasize) {
 		printf("Insufficient space on device (need %ld, have %ld), "
 		    "refusing to dump.\n", (long)totsize,
@@ -117,16 +117,22 @@
 	dumplo = di->mediaoffset + di->mediasize - totsize;
 
 	mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size,
-	    di->blocksize);
+	    kerneldumpkey_size(di->kdk), di->blocksize);
 
 	printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg);
 
 	/* Dump leader */
-	error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh));
+	error = dump_write_header(di, &kdh, 0, dumplo);
 	if (error)
 		goto fail;
 	dumplo += sizeof(kdh);
 
+	/* Dump key */
+	error = dump_write_key(di, di->kdk, 0, dumplo);
+	if (error)
+		goto fail;
+	dumplo += kerneldumpkey_size(di->kdk);
+
 	/* Dump the private header. */
 	hdr.dh_hdr_size = hdrsize;
 	hdr.dh_tsb_pa = tsb_kernel_phys;
@@ -153,7 +159,7 @@
 		goto fail;
 
 	/* Dump trailer */
-	error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh));
+	error = dump_write_header(di, &kdh, 0, dumplo);
 	if (error)
 		goto fail;
 


More information about the svn-soc-all mailing list