diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-05-29 20:36:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-05-29 20:36:49 +0000 |
commit | 872493b3d04d0610e955d5256f8e65565f16136e (patch) | |
tree | ca0588a08483e9a36a08ab241369ed1a6abd4760 /sys/arch/vax | |
parent | 4b2a151dba5d4d95104e374323f36ed02f52034f (diff) |
start of dumpconf() unification, which one day we can pray will be MI
(and part of setroot); ok miod
Diffstat (limited to 'sys/arch/vax')
-rw-r--r-- | sys/arch/vax/vax/machdep.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index 19b880d9196..c2ae7cfc0e0 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.90 2007/05/27 17:31:57 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.91 2007/05/29 20:36:48 deraadt Exp $ */ /* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */ /* @@ -266,21 +266,24 @@ long dumplo = 0; cpu_kcore_hdr_t cpu_kcore_hdr; void -dumpconf() +dumpconf(void) { int nblks; + if (dumpdev == NODEV || + (nblks = (bdevsw[major(dumpdev)].d_psize)(dumpdev)) == 0) + return; + if (nblks <= ctod(1)) + return; + /* * XXX include the final RAM page which is not included in physmem. */ dumpsize = physmem + 1; - if (dumpdev != NODEV && bdevsw[major(dumpdev)].d_psize) { - nblks = (*bdevsw[major(dumpdev)].d_psize) (dumpdev); - if (dumpsize > btoc(dbtob(nblks - dumplo))) - dumpsize = btoc(dbtob(nblks - dumplo)); - else if (dumplo == 0) - dumplo = nblks - btodb(ctob(dumpsize)); - } + if (dumpsize > btoc(dbtob(nblks - dumplo))) + dumpsize = btoc(dbtob(nblks - dumplo)); + else if (dumplo == 0) + dumplo = nblks - btodb(ctob(dumpsize)); /* * Don't dump on the first block in case the dump |