diff options
author | peter <peter@FreeBSD.org> | 2008-10-01 22:08:53 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2008-10-01 22:08:53 +0000 |
commit | ed8d07f23214ae559c4d1e24298f7334368c1fa5 (patch) | |
tree | 63a9bf6e972762df141963f82c26829a6b8cb9b8 /sys/sun4v | |
parent | 17415143e3ea50776074328a4bc9b5e9aa942dba (diff) | |
download | FreeBSD-src-ed8d07f23214ae559c4d1e24298f7334368c1fa5.zip FreeBSD-src-ed8d07f23214ae559c4d1e24298f7334368c1fa5.tar.gz |
Collect N identical (or near identical) mkdumpheader() implementations into
one, as threatened in the comment. Textdump magic can be passed in.
Diffstat (limited to 'sys/sun4v')
-rw-r--r-- | sys/sun4v/sun4v/dump_machdep.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/sys/sun4v/sun4v/dump_machdep.c b/sys/sun4v/sun4v/dump_machdep.c index f3acdc6..3a5d134 100644 --- a/sys/sun4v/sun4v/dump_machdep.c +++ b/sys/sun4v/sun4v/dump_machdep.c @@ -57,27 +57,6 @@ static vm_size_t fragsz; #define MAXDUMPSZ (MAXDUMPPGS << PAGE_SHIFT) -/* XXX should be MI */ -static void -mkdumpheader(struct kerneldumpheader *kdh, uint32_t archver, uint64_t dumplen, - uint32_t blksz) -{ - - bzero(kdh, sizeof(*kdh)); - strncpy(kdh->magic, KERNELDUMPMAGIC, sizeof(kdh->magic)); - strncpy(kdh->architecture, MACHINE_ARCH, sizeof(kdh->architecture)); - kdh->version = htod32(KERNELDUMPVERSION); - kdh->architectureversion = htod32(archver); - kdh->dumplength = htod64(dumplen); - kdh->dumptime = htod64(time_second); - kdh->blocksize = htod32(blksz); - strncpy(kdh->hostname, G_hostname, sizeof(kdh->hostname)); - strncpy(kdh->versionstring, version, sizeof(kdh->versionstring)); - if (panicstr != NULL) - strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); - kdh->parity = kerneldump_parity(kdh); -} - static int buf_write(struct dumperinfo *di, char *ptr, size_t sz) { @@ -194,7 +173,7 @@ dumpsys(struct dumperinfo *di) /* Determine dump offset on device. */ dumplo = di->mediaoffset + di->mediasize - totsize; - mkdumpheader(&kdh, KERNELDUMP_SPARC64_VERSION, size, di->blocksize); + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size, di->blocksize); printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg); |