Date: Sun, 9 Aug 2015 23:20:44 GMT From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r289495 - soc2013/def/crashdump-head/sys/i386/i386 Message-ID: <201508092320.t79NKiAA094682@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: def Date: Sun Aug 9 23:20:44 2015 New Revision: 289495 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=289495 Log: Add EKCD support on i386. Modified: soc2013/def/crashdump-head/sys/i386/i386/minidump_machdep.c Modified: soc2013/def/crashdump-head/sys/i386/i386/minidump_machdep.c ============================================================================== --- soc2013/def/crashdump-head/sys/i386/i386/minidump_machdep.c Sun Aug 9 23:17:46 2015 (r289494) +++ soc2013/def/crashdump-head/sys/i386/i386/minidump_machdep.c Sun Aug 9 23:20:44 2015 (r289495) @@ -249,12 +249,14 @@ dumpsize += PAGE_SIZE; /* Determine dump offset on device. */ - if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2 + + kerneldumpkey_size(di->kdk)) { error = ENOSPC; goto fail; } dumplo = di->mediaoffset + di->mediasize - dumpsize; dumplo -= sizeof(kdh) * 2; + dumplo -= kerneldumpkey_size(di->kdk); progress = dumpsize; /* Initialize mdhdr */ @@ -269,17 +271,24 @@ mdhdr.paemode = 1; #endif - mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_I386_VERSION, dumpsize, di->blocksize); + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_I386_VERSION, dumpsize, + kerneldumpkey_size(di->kdk), di->blocksize); printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576); printf("Dumping %llu MB:", (long long)dumpsize >> 20); /* 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 my header */ bzero(&fakept, sizeof(fakept)); bcopy(&mdhdr, &fakept, sizeof(mdhdr)); @@ -369,7 +378,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; dumplo += sizeof(kdh);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508092320.t79NKiAA094682>