aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2008-02-15 06:26:25 +0000
committerScott Long <scottl@FreeBSD.org>2008-02-15 06:26:25 +0000
commit7bbd40c57e7d858b804bb4d7420526f9ab07cee0 (patch)
tree4958c512865fe26e6b17b30580c14079b103b657 /sys/amd64
parentb0cfa3c432d02c9c9d681dab43f73740a0a9b6ec (diff)
Notes
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/dump_machdep.c8
-rw-r--r--sys/amd64/amd64/minidump_machdep.c8
2 files changed, 12 insertions, 4 deletions
diff --git a/sys/amd64/amd64/dump_machdep.c b/sys/amd64/amd64/dump_machdep.c
index 9130139049a8..e80489ff755b 100644
--- a/sys/amd64/amd64/dump_machdep.c
+++ b/sys/amd64/amd64/dump_machdep.c
@@ -177,6 +177,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg)
uint64_t pgs;
size_t counter, sz, chunk;
int i, c, error, twiddle;
+ u_int maxdumppgs;
error = 0; /* catch case in which chunk size is 0 */
counter = 0; /* Update twiddle every 16MB */
@@ -184,13 +185,16 @@ cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg)
va = 0;
pgs = mdp->md_size / PAGE_SIZE;
pa = mdp->md_start;
+ maxdumppgs = di->maxiosize / PAGE_SIZE;
+ if (maxdumppgs == 0) /* seatbelt */
+ maxdumppgs = 1;
printf(" chunk %d: %ldMB (%ld pages)", seqnr, PG2MB(pgs), pgs);
while (pgs) {
chunk = pgs;
- if (chunk > MAXDUMPPGS)
- chunk = MAXDUMPPGS;
+ if (chunk > maxdumppgs)
+ chunk = maxdumppgs;
sz = chunk << PAGE_SHIFT;
counter += sz;
if (counter >> 24) {
diff --git a/sys/amd64/amd64/minidump_machdep.c b/sys/amd64/amd64/minidump_machdep.c
index 943c5e66a557..4c3333dc0978 100644
--- a/sys/amd64/amd64/minidump_machdep.c
+++ b/sys/amd64/amd64/minidump_machdep.c
@@ -122,7 +122,11 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
{
size_t len;
int error, i, c;
+ u_int maxdumpsz;
+ maxdumpsz = di->maxiosize;
+ if (maxdumpsz == 0) /* seatbelt */
+ maxdumpsz = PAGE_SIZE;
error = 0;
if ((sz % PAGE_SIZE) != 0) {
printf("size not page aligned\n");
@@ -143,7 +147,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
return (error);
}
while (sz) {
- len = (MAXDUMPPGS * PAGE_SIZE) - fragsz;
+ len = maxdumpsz - fragsz;
if (len > sz)
len = sz;
counter += len;
@@ -165,7 +169,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
fragsz += len;
pa += len;
sz -= len;
- if (fragsz == (MAXDUMPPGS * PAGE_SIZE)) {
+ if (fragsz == maxdumpsz) {
error = blk_flush(di);
if (error)
return (error);