summaryrefslogtreecommitdiff
path: root/sys/arch/hppa64
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-05-29 20:36:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-05-29 20:36:49 +0000
commit872493b3d04d0610e955d5256f8e65565f16136e (patch)
treeca0588a08483e9a36a08ab241369ed1a6abd4760 /sys/arch/hppa64
parent4b2a151dba5d4d95104e374323f36ed02f52034f (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/hppa64')
-rw-r--r--sys/arch/hppa64/hppa64/autoconf.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/sys/arch/hppa64/hppa64/autoconf.c b/sys/arch/hppa64/hppa64/autoconf.c
index 867c32f3876..b6157615ba7 100644
--- a/sys/arch/hppa64/hppa64/autoconf.c
+++ b/sys/arch/hppa64/hppa64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.7 2007/05/04 19:30:55 deraadt Exp $ */
+/* $OpenBSD: autoconf.c,v 1.8 2007/05/29 20:36:47 deraadt Exp $ */
/*
* Copyright (c) 1998-2005 Michael Shalayeff
@@ -180,37 +180,27 @@ dumpconf(void)
{
extern int dumpsize;
int nblks, dumpblks; /* size of dump area */
- int maj;
-
- if (dumpdev == NODEV)
- goto bad;
- maj = major(dumpdev);
- if (maj < 0 || maj >= nblkdev)
- panic("dumpconf: bad dumpdev=0x%x", dumpdev);
- if (bdevsw[maj].d_psize == NULL)
- goto bad;
- nblks = (*bdevsw[maj].d_psize)(dumpdev);
+
+ if (dumpdev == NODEV ||
+ (nblks = (bdevsw[major(dumpdev)].d_psize)(dumpdev)) == 0)
+ return;
if (nblks <= ctod(1))
- goto bad;
+ return;
+
dumpblks = cpu_dumpsize();
if (dumpblks < 0)
- goto bad;
+ return;
dumpblks += ctod(physmem);
/* If dump won't fit (incl. room for possible label), punt. */
if (dumpblks > (nblks - ctod(1)))
- goto bad;
+ return;
/* Put dump at end of partition */
dumplo = nblks - dumpblks;
/* dumpsize is in page units, and doesn't include headers. */
dumpsize = physmem;
- return;
-
-bad:
- dumpsize = 0;
- return;
}