summaryrefslogtreecommitdiff
path: root/sys/arch/arc
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1997-04-13 11:53:27 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1997-04-13 11:53:27 +0000
commitaab789203464cef522ee13e6b3d5c5f3e3f70ab8 (patch)
treea4bbd4bd845cef358f42661b40244f3d6e0434ed /sys/arch/arc
parent138a38dd288af8da58b26f04e98399e9c6822a4f (diff)
Make it compile after disklabel changes
Diffstat (limited to 'sys/arch/arc')
-rw-r--r--sys/arch/arc/arc/autoconf.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/sys/arch/arc/arc/autoconf.c b/sys/arch/arc/arc/autoconf.c
index fa66ba531ec..77eb3af4b50 100644
--- a/sys/arch/arc/arc/autoconf.c
+++ b/sys/arch/arc/arc/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.6 1997/01/04 12:59:49 niklas Exp $ */
+/* $OpenBSD: autoconf.c,v 1.7 1997/04/13 11:53:26 pefo Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
* Copyright (c) 1995 Theo de Raadt
@@ -41,7 +41,7 @@
* from: Utah Hdr: autoconf.c 1.31 91/01/21
*
* from: @(#)autoconf.c 8.1 (Berkeley) 6/10/93
- * $Id: autoconf.c,v 1.6 1997/01/04 12:59:49 niklas Exp $
+ * $Id: autoconf.c,v 1.7 1997/04/13 11:53:26 pefo Exp $
*/
/*
@@ -177,7 +177,7 @@ parsedisk(str, len, defpart, devp)
return (NULL);
cp = str + len - 1;
c = *cp;
- if (c >= 'a' && c <= 'h') {
+ if (c >= 'a' && (c - 'a') < MAXPARTITIONS) {
part = c - 'a';
*cp = '\0';
} else
@@ -189,8 +189,7 @@ parsedisk(str, len, defpart, devp)
majdev = findblkmajor(dv);
if (majdev < 0)
panic("parsedisk");
- mindev = (dv->dv_unit << PARTITIONSHIFT) + part;
- *devp = makedev(majdev, mindev);
+ *devp = MAKEDISKDEV(majdev, dv->dv_unit, part);
break;
}
#ifdef NFSCLIENT
@@ -287,9 +286,8 @@ setroot()
nswapdev = NODEV;
break;
case DV_DISK:
- nswapdev = makedev(major(nrootdev),
- (minor(nrootdev) & ~ PARTITIONMASK)
-| 1);
+ nswapdev = MAKEDISKDEV(major(nrootdev),
+ DISKUNIT(nrootdev), 1);
break;
case DV_TAPE:
case DV_TTY:
@@ -360,8 +358,9 @@ gotswap:
mountroot = dk_mountroot;
majdev = major(rootdev);
mindev = minor(rootdev);
- printf("root on %s%c\n", bootdv->dv_xname,
- (mindev & PARTITIONMASK) + 'a');
+ unit = DISKUNIT(rootdev);
+ part = DISKPART(rootdev);
+ printf("root on %s%c\n", bootdv->dv_xname, part + 'a');
break;
default:
printf("can't figure root, hope your kernel is right\n");
@@ -371,11 +370,10 @@ gotswap:
/*
* XXX: What is this doing?
*/
- mindev &= ~PARTITIONMASK;
temp = NODEV;
for (swp = swdevt; swp->sw_dev != NODEV; swp++) {
if (majdev == major(swp->sw_dev) &&
- mindev == (minor(swp->sw_dev) & ~PARTITIONMASK)) {
+ unit == DISKUNIT(swp->sw_dev)) {
temp = swdevt[0].sw_dev;
swdevt[0].sw_dev = swp->sw_dev;
swp->sw_dev = temp;