Date: Mon, 25 Jan 2016 12:49:09 +0000 (UTC) From: Svatopluk Kraus <skra@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294723 - head/sys/arm/arm Message-ID: <201601251249.u0PCn9Nw089308@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: skra Date: Mon Jan 25 12:49:08 2016 New Revision: 294723 URL: https://svnweb.freebsd.org/changeset/base/294723 Log: Make minidump more like its i386 original back as with new pmap dump interface all used physical addresses are PAGE_SIZE aligned. Add missing copyright. This is a follow up to r294722. Modified: head/sys/arm/arm/minidump_machdep.c Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:43:07 2016 (r294722) +++ head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:49:08 2016 (r294723) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2006 Peter Wemm * Copyright (c) 2008 Semihalf, Grzegorz Bernacki * All rights reserved. * @@ -66,7 +67,7 @@ static struct kerneldumpheader kdh; static off_t dumplo; /* Handle chunked writes. */ -static size_t fragsz, offset; +static size_t fragsz; static void *dump_va; static uint64_t counter, progress; @@ -94,10 +95,9 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_write(di, (char*)dump_va + offset, 0, dumplo, fragsz - offset); - dumplo += (fragsz - offset); + error = dump_write(di, dump_va, 0, dumplo, fragsz); + dumplo += fragsz; fragsz = 0; - offset = 0; return (error); } @@ -108,36 +108,36 @@ blk_write(struct dumperinfo *di, char *p int error, i, c; u_int maxdumpsz; - maxdumpsz = di->maxiosize; - + maxdumpsz = min(di->maxiosize, MAXDUMPPGS * PAGE_SIZE); if (maxdumpsz == 0) /* seatbelt */ maxdumpsz = PAGE_SIZE; - error = 0; - if (ptr != NULL && pa != 0) { printf("cant have both va and pa!\n"); return (EINVAL); } - + if (pa != 0) { + if ((sz % PAGE_SIZE) != 0) { + printf("size not page aligned\n"); + return (EINVAL); + } + if ((pa & PAGE_MASK) != 0) { + printf("address not page aligned\n"); + return (EINVAL); + } + } if (ptr != NULL) { /* If we're doing a virtual dump, flush any pre-existing pa pages */ error = blk_flush(di); if (error) return (error); } - while (sz) { - if (fragsz == 0) { - offset = pa & PAGE_MASK; - fragsz += offset; - } len = maxdumpsz - fragsz; if (len > sz) len = sz; counter += len; progress -= len; - if (counter >> 22) { printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); counter &= (1<<22) - 1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601251249.u0PCn9Nw089308>