Subject: kern/7622: dev_name2blk changes
To: None <gnats-bugs@gnats.netbsd.org>
From: None <itohy@netbsd.org>
List: netbsd-bugs
Date: 05/21/1999 23:06:48
>Number:         7622
>Category:       kern
>Synopsis:       dev_name2blk changes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri May 21 23:05:00 1999
>Last-Modified:
>Originator:     ITOH Yasufumi
>Organization:
>Release:        1.4B (May 8, 1999)
>Environment:
System: NetBSD pino.my.domain 1.4B NetBSD 1.4B (PINO) #0: Fri May 21 07:45:44 JST 1999 itohy@pino.my.domain:/usr/src/sys/arch/i386/compile/PINO i386


>Description:

    Use dev_name2blk[] generated by current config(8), not home grown.

>How-To-Repeat:

>Fix:

    Patch below, but not tested....

diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/alpha/alpha/autoconf.c.orig sys/arch/alpha/alpha/autoconf.c
--- sys/arch/alpha/alpha/autoconf.c.orig	Tue Feb 23 12:20:00 1999
+++ sys/arch/alpha/alpha/autoconf.c	Thu May 20 09:15:17 1999
@@ -69,16 +69,6 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 void	parse_prom_bootdev __P((void));
 int	atoi __P((char *));
 
-struct devnametobdevmaj alpha_nam2blk[] = {
-	{ "st",		2 },
-	{ "cd",		3 },
-	{ "md",		6 },
-	{ "sd",		8 },
-	{ "fd",		0 },
-	{ "wd",		4 },
-	{ NULL,		0 },
-};
-
 /*
  * configure:
  * called at boot time, configure all devices on system
@@ -115,7 +105,7 @@ cpu_rootconf()
 	if (booted_device == NULL)
 		printf("WARNING: can't figure what device matches \"%s\"\n",
 		    bootinfo.booted_dev);
-	setroot(booted_device, booted_partition, alpha_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 void
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/amiga/amiga/autoconf.c.orig sys/arch/amiga/amiga/autoconf.c
--- sys/arch/amiga/amiga/autoconf.c.orig	Thu Apr  1 09:17:46 1999
+++ sys/arch/amiga/amiga/autoconf.c	Thu May 20 09:15:18 1999
@@ -50,13 +50,6 @@ int mbmatch __P((struct device *, struct
 int cold;	/* 1 if still booting */
 #include <sys/kernel.h>
 
-struct devnametobdevmaj amiga_nam2blk[] = {
-	{ "fd",		2 },
-	{ "sd",		4 },
-	{ "cd",		7 },
-	{ "md",		15 },
-	{ NULL,		0 },
-};
 u_long boot_partition;
 
 /*
@@ -126,7 +119,7 @@ cpu_rootconf()
 #ifdef DEBUG_KERNEL_START
 	printf("survived findroot()\n");
 #endif
-	setroot(booted_device, booted_partition, amiga_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 #ifdef DEBUG_KERNEL_START
 	printf("survived setroot()\n");
 #endif
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/arm32/arm32/autoconf.c.orig sys/arch/arm32/arm32/autoconf.c
--- sys/arch/arm32/arm32/autoconf.c.orig	Sun Feb  7 18:34:58 1999
+++ sys/arch/arm32/arm32/autoconf.c	Thu May 20 09:15:18 1999
@@ -86,15 +86,6 @@ static void set_root_device __P((void));
 
 /* Table major numbers for the device names, NULL terminated */
 
-struct devnametobdevmaj arm32_nam2blk[] = {
-	{ "wd",		16 },
-	{ "fd",		17 },
-	{ "md",		18 },
-	{ "sd",		24 },
-	{ "cd",		26 },
-	{ NULL,		0 },
-};
-
 #ifndef MEMORY_DISK_IS_ROOT
 /* Decode a device name to a major and minor number */
 
@@ -114,10 +105,10 @@ get_device(name, devpp, partp)
 	if (strncmp(name, "/dev/", 5) == 0)
 		name += 5;
 
-	for (loop = 0; arm32_nam2blk[loop].d_name != NULL; ++loop) {
-		if (strncmp(name, arm32_nam2blk[loop].d_name,
-		    strlen(arm32_nam2blk[loop].d_name)) == 0) {
-			name += strlen(arm32_nam2blk[loop].d_name);
+	for (loop = 0; dev_name2blk[loop].d_name != NULL; ++loop) {
+		if (strncmp(name, dev_name2blk[loop].d_name,
+		    strlen(dev_name2blk[loop].d_name)) == 0) {
+			name += strlen(dev_name2blk[loop].d_name);
 			unit = part = 0;
 
 			cp = name;
@@ -130,7 +121,7 @@ get_device(name, devpp, partp)
 				part = *cp - 'a';
 			else if (*cp != '\0' && *cp != ' ')
 				return;
-			sprintf(buf, "%s%d", arm32_nam2blk[loop].d_name, unit);
+			sprintf(buf, "%s%d", dev_name2blk[loop].d_name, unit);
 			for (dv = alldevs.tqh_first; dv != NULL;
 			    dv = dv->dv_list.tqe_next) {
 				if (strcmp(buf, dv->dv_xname) == 0) {
@@ -175,7 +166,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 	    booted_device != NULL ? booted_device->dv_xname : "<unknown>");
 #endif
-	setroot(booted_device, booted_partition, arm32_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/atari/atari/autoconf.c.orig sys/arch/atari/atari/autoconf.c
--- sys/arch/atari/atari/autoconf.c.orig	Wed Sep  2 20:24:16 1998
+++ sys/arch/atari/atari/autoconf.c	Thu May 20 09:15:18 1999
@@ -51,15 +51,6 @@ int mbmatch __P((struct device *, struct
 int atari_realconfig;
 #include <sys/kernel.h>
 
-struct devnametobdevmaj atari_nam2blk[] = {
-	{ "md",		1 },
-	{ "fd",		2 },
-	{ "sd",		4 },
-	{ "cd",		6 },
-	{ "wd",		14 },
-	{ NULL,		0 },
-};
-
 /*
  * called at boot time, configure all devices on system
  */
@@ -83,7 +74,7 @@ cpu_rootconf()
 	int booted_partition;
 
 	findroot(&booted_device, &booted_partition);
-	setroot(booted_device, booted_partition, atari_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 /*ARGSUSED*/
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/bebox/bebox/autoconf.c.orig sys/arch/bebox/bebox/autoconf.c
--- sys/arch/bebox/bebox/autoconf.c.orig	Tue Oct 14 15:47:20 1997
+++ sys/arch/bebox/bebox/autoconf.c	Thu May 20 09:15:18 1999
@@ -68,16 +68,6 @@ void findroot __P((struct device **, int
  */
 extern int	cold;		/* cold start flag initialized in locore.s */
 
-struct devnametobdevmaj bebox_nam2blk[] = {
-	{ "wd",		0 },
-	{ "sd",		4 },
-	{ "cd",		6 },
-	{ "mcd",	7 },
-	{ "fd",		2 },
-	{ "md",		17 },
-	{ NULL,		0 },
-};
-
 /*
  * Determine i/o configuration for a machine.
  */
@@ -108,7 +98,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 	    booted_device ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, booted_partition, bebox_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 u_long	bootdev = 0;		/* should be dev_t, but not until 32 bits */
@@ -141,16 +131,16 @@ findroot(devpp, partp)
 		return;
 
 	majdev = (bootdev >> B_TYPESHIFT) & B_TYPEMASK;
-	for (i = 0; bebox_nam2blk[i].d_name != NULL; i++)
-		if (majdev == bebox_nam2blk[i].d_maj)
+	for (i = 0; dev_name2blk[i].d_name != NULL; i++)
+		if (majdev == dev_name2blk[i].d_maj)
 			break;
-	if (bebox_nam2blk[i].d_name == NULL)
+	if (dev_name2blk[i].d_name == NULL)
 		return;
 
 	part = (bootdev >> B_PARTITIONSHIFT) & B_PARTITIONMASK;
 	unit = (bootdev >> B_UNITSHIFT) & B_UNITMASK;
 
-	sprintf(buf, "%s%d", bebox_nam2blk[i].d_name, unit);
+	sprintf(buf, "%s%d", dev_name2blk[i].d_name, unit);
 	for (dv = alldevs.tqh_first; dv != NULL;
 	    dv = dv->dv_list.tqe_next) {
 		if (strcmp(buf, dv->dv_xname) == 0) {
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/hp300/hp300/autoconf.c.orig sys/arch/hp300/hp300/autoconf.c
--- sys/arch/hp300/hp300/autoconf.c.orig	Sat Apr 17 12:59:59 1999
+++ sys/arch/hp300/hp300/autoconf.c	Thu May 20 09:15:18 1999
@@ -255,14 +255,6 @@ mainbussearch(parent, cf, aux)
 	return (0);
 }
 
-struct devnametobdevmaj hp300_nam2blk[] = {
-	{ "ct",		 0 },
-	{ "rd",		 2 },
-	{ "sd",		 4 },
-	{ "md",		14 },
-	{ NULL,		 0 },
-};
-
 /*
  * Determine the device configuration for the running system.
  */
@@ -369,7 +361,7 @@ cpu_rootconf()
 	if (booted_device != NULL && booted_device->dv_class == DV_TAPE)
 		boothowto |= RB_ASKNAME;
 
-	setroot(dv, booted_partition, hp300_nam2blk);
+	setroot(dv, booted_partition, dev_name2blk);
 
 	/*
 	 * Set bootdev based on what we found as the root.
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/i386/i386/autoconf.c.orig sys/arch/i386/i386/autoconf.c
--- sys/arch/i386/i386/autoconf.c.orig	Thu Apr  1 09:37:50 1999
+++ sys/arch/i386/i386/autoconf.c	Thu May 20 09:15:18 1999
@@ -78,16 +78,6 @@ void findroot __P((struct device **, int
  */
 extern int	cold;		/* cold start flag initialized in locore.s */
 
-struct devnametobdevmaj i386_nam2blk[] = {
-	{ "wd",		0 },
-	{ "sd",		4 },
-	{ "cd",		6 },
-	{ "mcd",	7 },
-	{ "fd",		2 },
-	{ "md",		17 },
-	{ NULL,		0 },
-};
-
 /*
  * Determine i/o configuration for a machine.
  */
@@ -126,7 +116,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 	    booted_device ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, booted_partition, i386_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 /*
@@ -197,7 +187,7 @@ matchbiosdisks()
 			    "%s%d", dv->dv_cfdata->cf_driver->cd_name,
 			    dv->dv_unit);
 
-			for (d = i386_nam2blk; d->d_name &&
+			for (d = dev_name2blk; d->d_name &&
 			   strcmp(d->d_name, dv->dv_cfdata->cf_driver->cd_name);
 			   d++);
 			if (d->d_name == NULL)
@@ -282,7 +272,7 @@ match_harddisk(dv, bid)
 	/*
 	 * lookup major number for disk block device
 	 */
-	i = i386_nam2blk;
+	i = dev_name2blk;
 	while (i->d_name &&
 	       strcmp(i->d_name, dv->dv_cfdata->cf_driver->cd_name))
 		i++;
@@ -437,16 +427,16 @@ findroot(devpp, partp)
 		return;
 
 	majdev = (bootdev >> B_TYPESHIFT) & B_TYPEMASK;
-	for (i = 0; i386_nam2blk[i].d_name != NULL; i++)
-		if (majdev == i386_nam2blk[i].d_maj)
+	for (i = 0; dev_name2blk[i].d_name != NULL; i++)
+		if (majdev == dev_name2blk[i].d_maj)
 			break;
-	if (i386_nam2blk[i].d_name == NULL)
+	if (dev_name2blk[i].d_name == NULL)
 		return;
 
 	part = (bootdev >> B_PARTITIONSHIFT) & B_PARTITIONMASK;
 	unit = (bootdev >> B_UNITSHIFT) & B_UNITMASK;
 
-	sprintf(buf, "%s%d", i386_nam2blk[i].d_name, unit);
+	sprintf(buf, "%s%d", dev_name2blk[i].d_name, unit);
 	for (dv = alldevs.tqh_first; dv != NULL;
 	    dv = dv->dv_list.tqe_next) {
 		if (strcmp(buf, dv->dv_xname) == 0) {
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/mac68k/mac68k/autoconf.c.orig sys/arch/mac68k/mac68k/autoconf.c
--- sys/arch/mac68k/mac68k/autoconf.c.orig	Thu Feb 18 16:32:56 1999
+++ sys/arch/mac68k/mac68k/autoconf.c	Thu May 20 09:15:18 1999
@@ -76,14 +76,6 @@
 static void findbootdev __P((void));
 static int target_to_unit __P((u_long, u_long, u_long));
 
-struct devnametobdevmaj mac68k_nam2blk[] = {
-	{ "sd",		4 },
-	{ "cd",		6 },
-	{ "md",		13 },
-	{ "fd",		21 },
-	{ NULL,		0 },
-};
-
 /*
  * configure:
  * called at boot time, configure all devices on the system
@@ -111,7 +103,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 	    booted_device ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, booted_partition, mac68k_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 /*
@@ -131,10 +123,10 @@ findbootdev()
 	booted_partition = 0;	/* Assume root is on partition a */
 
 	major = B_TYPE(bootdev);
-	for (i = 0; mac68k_nam2blk[i].d_name != NULL; i++)
-		if (major == mac68k_nam2blk[i].d_maj)
+	for (i = 0; dev_name2blk[i].d_name != NULL; i++)
+		if (major == dev_name2blk[i].d_maj)
 			break;
-	if (mac68k_nam2blk[i].d_name == NULL)
+	if (dev_name2blk[i].d_name == NULL)
 		return;
 
 	unit = B_UNIT(bootdev);
@@ -143,7 +135,7 @@ findbootdev()
 	unit = target_to_unit(-1, unit, 0);
 	bootdev |= (unit << B_UNITSHIFT);
 
-	sprintf(buf, "%s%d", mac68k_nam2blk[i].d_name, unit);
+	sprintf(buf, "%s%d", dev_name2blk[i].d_name, unit);
 	for (dv = alldevs.tqh_first; dv != NULL;
 	    dv = dv->dv_list.tqe_next) {
 		if (strcmp(buf, dv->dv_xname) == 0) {
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/mvme68k/mvme68k/autoconf.c.orig sys/arch/mvme68k/mvme68k/autoconf.c
--- sys/arch/mvme68k/mvme68k/autoconf.c.orig	Sat Feb 20 09:12:02 1999
+++ sys/arch/mvme68k/mvme68k/autoconf.c	Thu May 20 09:15:20 1999
@@ -176,14 +176,6 @@ mainbus_print(aux, cp)
 	return (UNCONF);
 }
 
-struct devnametobdevmaj mvme68k_nam2blk[] = {
-	{ "sd",		4 },
-	{ "st",		7 },
-	{ "cd",		8 },
-	{ "md",		9 },
-	{ NULL,		0 },
-};
-
 /*
  * Determine mass storage and memory configuration for a machine.
  */
@@ -208,7 +200,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 		(booted_device) ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, 0, mvme68k_nam2blk);
+	setroot(booted_device, 0, dev_name2blk);
 }
 
 /*
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/next68k/next68k/autoconf.c.orig sys/arch/next68k/next68k/autoconf.c
--- sys/arch/next68k/next68k/autoconf.c.orig	Sun Jan 31 15:59:30 1999
+++ sys/arch/next68k/next68k/autoconf.c	Thu May 20 09:15:20 1999
@@ -147,14 +147,6 @@ mainbus_print(aux, cp)
 	return (UNCONF);
 }
 
-struct devnametobdevmaj next68k_nam2blk[] = {
-	{ "sd",		4 },
-	{ "st",		5 },
-	{ "cd",		6 },
-	{ "md",		13 },
-	{ NULL,		0 },
-};
-
 /*
  * Determine mass storage and memory configuration for a machine.
  */
@@ -184,7 +176,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 		(booted_device) ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, 0, next68k_nam2blk);
+	setroot(booted_device, 0, dev_name2blk);
 }
 
 #if 0 /* @@@ Does anything use this? Is it a required interface? */
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/ofppc/ofppc/autoconf.c.orig sys/arch/ofppc/ofppc/autoconf.c
--- sys/arch/ofppc/ofppc/autoconf.c.orig	Tue Feb 24 14:49:28 1998
+++ sys/arch/ofppc/ofppc/autoconf.c	Thu May 20 09:15:24 1999
@@ -47,14 +47,6 @@ void findroot __P((void));
 struct device *booted_device;	/* boot device */
 int booted_partition;		/* ...and partition on that device */
 
-struct devnametobdevmaj powerpc_nam2blk[] = {
-	{ "ofdisk",	0 },
-#ifdef notyet
-	{ "md",		XXX },
-#endif
-	{ NULL,		0 },
-};
-
 /*
  * Determine device configuration for a machine.
  */
@@ -81,7 +73,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 	    booted_device ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, booted_partition, powerpc_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 /*
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/pc532/pc532/autoconf.c.orig sys/arch/pc532/pc532/autoconf.c
--- sys/arch/pc532/pc532/autoconf.c.orig	Thu Mar 27 07:39:07 1997
+++ sys/arch/pc532/pc532/autoconf.c	Thu May 20 09:15:35 1999
@@ -63,14 +63,6 @@
 u_long bootdev = 0;		/* should be dev_t, but not until 32 bits */
 struct device *booted_device;	/* boot device, set by dk_establish */
 
-struct devnametobdevmaj pc532_nam2blk[] = {
-	{ "sd",		0 },
-	{ "st",		2 },
-	{ "md",		3 },
-	{ "cd",		4 },
-	{ NULL,		0 },
-};
-
 /*
  * Determine i/o configuration for a machine.
  */
@@ -106,5 +98,5 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 	    booted_device ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, booted_partition, pc532_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/pica/pica/autoconf.c.orig sys/arch/pica/pica/autoconf.c
--- sys/arch/pica/pica/autoconf.c.orig	Mon Jun 16 16:35:46 1997
+++ sys/arch/pica/pica/autoconf.c	Thu May 20 09:21:24 1999
@@ -73,18 +73,6 @@ void	findroot __P((struct device **devpp
 int	getpno __P((char **cp));
 
 
-struct devnametobdevmaj pica_nam2blk[] = {
-	{ "sd",		0 },
-	{ "cd",		3 },
-	{ "fd",		7 },
-#ifdef notyet
-	{ "md",		XXX },
-#endif
-	{ NULL,		0 },
-};
-
-
-
 /*
  *  Configure all devices found that we know about.
  *  This is done at boot time.
@@ -111,7 +99,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 	    booted_device ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, booted_partition, pica_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 u_long	bootdev;		/* should be dev_t, but not until 32 bits */
@@ -144,16 +132,16 @@ findroot(devpp, partp)
 		return;
 
 	majdev = B_TYPE(bootdev);
-	for (i = 0; pica_nam2blk[i].d_name != NULL; i++)
-		if (majdev == pica_nam2blk[i].d_maj)
+	for (i = 0; dev_name2blk[i].d_name != NULL; i++)
+		if (majdev == dev_name2blk[i].d_maj)
 			break;
-	if (pica_nam2blk[i].d_name == NULL)
+	if (dev_name2blk[i].d_name == NULL)
 		return;
 
 	part = B_PARTITION(bootdev);
 	unit = B_UNIT(bootdev);
 
-	sprintf(buf, "%s%d", pica_nam2blk[i].d_name, unit);
+	sprintf(buf, "%s%d", dev_name2blk[i].d_name, unit);
 	for (dv = alldevs.tqh_first; dv != NULL;
 	    dv = dv->dv_list.tqe_next) {
 		if (strcmp(buf, dv->dv_xname) == 0) {
@@ -185,9 +173,9 @@ makebootdev(cp)
 		dv[1] = *cp;
 		unit = getpno(&cp);
 
-		for (majdev = 0; majdev < sizeof(pica_nam2blk)/sizeof(pica_nam2blk[0]); majdev++)
-			if (dv[0] == pica_nam2blk[majdev].d_name[0] &&
-			    dv[1] == pica_nam2blk[majdev].d_name[1] &&
+		for (majdev = 0; dev_name2blk[majdev].d_name != NULL; majdev++)
+			if (dv[0] == dev_name2blk[majdev].d_name[0] &&
+			    dv[1] == dev_name2blk[majdev].d_name[1] &&
 			    cp[0] == ')')
 				bootdev = MAKEBOOTDEV(majdev, 0, ctrl, unit,0);
 	}
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/pmax/pmax/autoconf.c.orig sys/arch/pmax/pmax/autoconf.c
--- sys/arch/pmax/pmax/autoconf.c.orig	Tue May  4 15:03:14 1999
+++ sys/arch/pmax/pmax/autoconf.c	Thu May 20 09:21:24 1999
@@ -90,12 +90,6 @@ void configure_scsi __P((void));
 
 void	findroot __P((struct device **, int *));
 
-struct devnametobdevmaj pmax_nam2blk[] = {
-	{ "rz",		21 },
-	{ "md",		17 },
-	{ NULL,		0 },
-};
-
 
 /*
  * Determine mass storage and memory configuration for a machine.
@@ -147,7 +141,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 	    booted_device ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, booted_partition, pmax_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 u_long	bootdev = 0;		/* should be dev_t, but not until 32 bits */
@@ -175,9 +169,9 @@ findroot(devpp, partp)
 		return;
 
 	majdev = B_TYPE(bootdev);
-	for (i = 0; pmax_nam2blk[i].d_name != NULL; i++) {
-		if (majdev == pmax_nam2blk[i].d_maj) {
-			bootdv_name = pmax_nam2blk[i].d_name;
+	for (i = 0; dev_name2blk[i].d_name != NULL; i++) {
+		if (majdev == dev_name2blk[i].d_maj) {
+			bootdv_name = dev_name2blk[i].d_name;
 			break;
 		}
 	}
@@ -228,21 +222,21 @@ makebootdev(cp)
 		else
 			part = 0;
 		cp += 2;
-		for (majdev = 0; pmax_nam2blk[majdev].d_name != NULL;
+		for (majdev = 0; dev_name2blk[majdev].d_name != NULL;
 		    majdev++) {
-			if (cp[0] == pmax_nam2blk[majdev].d_name[0] &&
-			    cp[1] == pmax_nam2blk[majdev].d_name[1]) {
+			if (cp[0] == dev_name2blk[majdev].d_name[0] &&
+			    cp[1] == dev_name2blk[majdev].d_name[1]) {
 				bootdev = MAKEBOOTDEV(
-				    pmax_nam2blk[majdev].d_maj, 0, 0,
+				    dev_name2blk[majdev].d_maj, 0, 0,
 				    unit, part);
 				return;
 			}
 		}
 		goto defdev;
 	}
-	for (majdev = 0; pmax_nam2blk[majdev].d_name != NULL; majdev++)
-		if (cp[0] == pmax_nam2blk[majdev].d_name[0] &&
-		    cp[1] == pmax_nam2blk[majdev].d_name[1] &&
+	for (majdev = 0; dev_name2blk[majdev].d_name != NULL; majdev++)
+		if (cp[0] == dev_name2blk[majdev].d_name[0] &&
+		    cp[1] == dev_name2blk[majdev].d_name[1] &&
 		    cp[2] == '(')
 			goto fndmaj;
 defdev:
@@ -250,7 +244,7 @@ makebootdev(cp)
 	return;
 
 fndmaj:
-	majdev = pmax_nam2blk[majdev].d_maj;
+	majdev = dev_name2blk[majdev].d_maj;
 	for (ctrl = 0, cp += 3; *cp >= '0' && *cp <= '9'; )
 		ctrl = ctrl * 10 + *cp++ - '0';
 	if (*cp == ',')
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/sun3/sun3/autoconf.c.orig sys/arch/sun3/sun3/autoconf.c
--- sys/arch/sun3/sun3/autoconf.c.orig	Sun Feb  8 14:02:51 1998
+++ sys/arch/sun3/sun3/autoconf.c	Thu May 20 09:21:24 1999
@@ -166,15 +166,6 @@ bus_print(args, name)
  * Support code to find the boot device.
  */
 
-static struct devnametobdevmaj nam2blk[] = {
-	{ "xy",		3 },
-	{ "sd",		7 },
-	{ "xd",		10 },
-	{ "md",		13 },
-	{ "cd",		18 },
-	{ NULL,		0 },
-};
-
 /* This takes the args: name, ctlr, unit */
 typedef struct device * (*findfunc_t) __P((char *, int, int));
 
@@ -248,7 +239,7 @@ cpu_rootconf()
 	}
 
 	printf("boot device: %s%s\n", devname, partname);
-	setroot(boot_device, boot_partition, nam2blk);
+	setroot(boot_device, boot_partition, dev_name2blk);
 }
 
 /*
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/vax/vax/autoconf.c.orig sys/arch/vax/vax/autoconf.c
--- sys/arch/vax/vax/autoconf.c.orig	Wed Feb  3 03:37:20 1999
+++ sys/arch/vax/vax/autoconf.c	Thu May 20 09:21:24 1999
@@ -64,17 +64,6 @@ void	gencnslask __P((void));
 
 #define MAINBUS	0
 
-struct devnametobdevmaj vax_nam2blk[] = {
-	{ "hp",		0 },
-	{ "ra",		9 },
-	{ "rx",		12 },
-	{ "rd",		19 },
-	{ "sd",		20 },
-	{ "cd",		22 },
-	{ "md",		23 },
-	{ NULL,		0 },
-};
-
 void
 configure()
 {
@@ -108,7 +97,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 	    booted_device ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, booted_partition, vax_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 int	mainbus_print __P((void *, const char *));
diff -uF^[a-zA-Z_][a-z 	A-Z0-9_]*(.*[^;]$ sys/arch/x68k/x68k/autoconf.c.orig sys/arch/x68k/x68k/autoconf.c
--- sys/arch/x68k/x68k/autoconf.c.orig	Tue Mar 30 13:25:36 1999
+++ sys/arch/x68k/x68k/autoconf.c	Thu May 20 09:21:24 1999
@@ -63,11 +63,6 @@ static int simple_devprint __P((void *, 
 int x68k_realconfig;
 #include <sys/kernel.h>
 
-struct devnametobdevmaj x68k_nam2blk[] = {
-	X68K_BOOT_DEV_LIST,
-	{ NULL,		0 },
-};
-
 /*
  * called at boot time, configure all devices on system
  */
@@ -98,7 +93,7 @@ cpu_rootconf()
 	printf("boot device: %s\n",
 	    booted_device ? booted_device->dv_xname : "<unknown>");
 
-	setroot(booted_device, booted_partition, x68k_nam2blk);
+	setroot(booted_device, booted_partition, dev_name2blk);
 }
 
 /*ARGSUSED*/
@@ -194,16 +189,16 @@ findroot(devpp, partp)
 			*partp = B_X68K_SCSI_PART(bootdev);
 		return;
 	}
-	for (i = 0; x68k_nam2blk[i].d_name != NULL; i++)
-		if (majdev == x68k_nam2blk[i].d_maj)
+	for (i = 0; dev_name2blk[i].d_name != NULL; i++)
+		if (majdev == dev_name2blk[i].d_maj)
 			break;
-	if (x68k_nam2blk[i].d_name == NULL)
+	if (dev_name2blk[i].d_name == NULL)
 		return;
 
 	part = B_PARTITION(bootdev);
 	unit = B_UNIT(bootdev);
 
-	sprintf(buf, "%s%d", x68k_nam2blk[i].d_name, unit);
+	sprintf(buf, "%s%d", dev_name2blk[i].d_name, unit);
 
 	if ((*devpp = find_dev_byname(buf)) != NULL)
 		*partp = part;
>Audit-Trail:
>Unformatted: