summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2008-01-28 19:04:07 +0000
committerru <ru@FreeBSD.org>2008-01-28 19:04:07 +0000
commit910410640b71f7191c0274d5d3b0e0c0c9bbbcfd (patch)
tree24ae1ec0d6cc8d44c3bb559ec2e9d089bbcaed5c /sys/amd64
parent2a2d8bde46c97ae60e359d207227f8a1c97e6b53 (diff)
downloadFreeBSD-src-910410640b71f7191c0274d5d3b0e0c0c9bbbcfd.zip
FreeBSD-src-910410640b71f7191c0274d5d3b0e0c0c9bbbcfd.tar.gz
Add a wrapper function that bound checks writes to the dump device.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/dump_machdep.c12
-rw-r--r--sys/amd64/amd64/minidump_machdep.c10
2 files changed, 11 insertions, 11 deletions
diff --git a/sys/amd64/amd64/dump_machdep.c b/sys/amd64/amd64/dump_machdep.c
index b3ad765..9130139 100644
--- a/sys/amd64/amd64/dump_machdep.c
+++ b/sys/amd64/amd64/dump_machdep.c
@@ -140,7 +140,7 @@ buf_write(struct dumperinfo *di, char *ptr, size_t sz)
ptr += len;
sz -= len;
if (fragsz == DEV_BSIZE) {
- error = di->dumper(di->priv, buffer, 0, dumplo,
+ error = dump_write(di, buffer, 0, dumplo,
DEV_BSIZE);
if (error)
return error;
@@ -160,7 +160,7 @@ buf_flush(struct dumperinfo *di)
if (fragsz == 0)
return (0);
- error = di->dumper(di->priv, buffer, 0, dumplo, DEV_BSIZE);
+ error = dump_write(di, buffer, 0, dumplo, DEV_BSIZE);
dumplo += DEV_BSIZE;
fragsz = 0;
return (error);
@@ -201,7 +201,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg)
a = pa + i * PAGE_SIZE;
va = pmap_kenter_temporary(trunc_page(a), i);
}
- error = di->dumper(di->priv, va, 0, dumplo, sz);
+ error = dump_write(di, va, 0, dumplo, sz);
if (error)
break;
dumplo += sz;
@@ -327,7 +327,7 @@ dumpsys(struct dumperinfo *di)
ehdr.e_phnum);
/* Dump leader */
- error = di->dumper(di->priv, &kdh, 0, dumplo, sizeof(kdh));
+ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh));
if (error)
goto fail;
dumplo += sizeof(kdh);
@@ -358,12 +358,12 @@ dumpsys(struct dumperinfo *di)
goto fail;
/* Dump trailer */
- error = di->dumper(di->priv, &kdh, 0, dumplo, sizeof(kdh));
+ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh));
if (error)
goto fail;
/* Signal completion, signoff and exit stage left. */
- di->dumper(di->priv, NULL, 0, 0, 0);
+ dump_write(di, NULL, 0, 0, 0);
printf("\nDump complete\n");
return;
diff --git a/sys/amd64/amd64/minidump_machdep.c b/sys/amd64/amd64/minidump_machdep.c
index 6ad8092..943c5e6 100644
--- a/sys/amd64/amd64/minidump_machdep.c
+++ b/sys/amd64/amd64/minidump_machdep.c
@@ -111,7 +111,7 @@ blk_flush(struct dumperinfo *di)
if (fragsz == 0)
return (0);
- error = di->dumper(di->priv, dump_va, 0, dumplo, fragsz);
+ error = dump_write(di, dump_va, 0, dumplo, fragsz);
dumplo += fragsz;
fragsz = 0;
return (error);
@@ -153,7 +153,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
counter &= (1<<24) - 1;
}
if (ptr) {
- error = di->dumper(di->priv, ptr, 0, dumplo, len);
+ error = dump_write(di, ptr, 0, dumplo, len);
if (error)
return (error);
dumplo += len;
@@ -284,7 +284,7 @@ minidumpsys(struct dumperinfo *di)
printf("Dumping %llu MB:", (long long)dumpsize >> 20);
/* Dump leader */
- error = di->dumper(di->priv, &kdh, 0, dumplo, sizeof(kdh));
+ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh));
if (error)
goto fail;
dumplo += sizeof(kdh);
@@ -375,13 +375,13 @@ minidumpsys(struct dumperinfo *di)
goto fail;
/* Dump trailer */
- error = di->dumper(di->priv, &kdh, 0, dumplo, sizeof(kdh));
+ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh));
if (error)
goto fail;
dumplo += sizeof(kdh);
/* Signal completion, signoff and exit stage left. */
- di->dumper(di->priv, NULL, 0, 0, 0);
+ dump_write(di, NULL, 0, 0, 0);
printf("\nDump complete\n");
return;
OpenPOWER on IntegriCloud