summaryrefslogtreecommitdiff
path: root/sys/arch/alpha
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-10-27 04:55:05 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-10-27 04:55:05 +0000
commitd49fbca3fca592ec18648e7fbc12b3d9ab80831f (patch)
tree6d6b0c1f050cbab7d85e1dd3be18cc762e843f7f /sys/arch/alpha
parentd4885e376afaf8f0a92eacb4ee39a99f548b5ca8 (diff)
Pull out the device crap for now as it prevents paths like 2.2/alpha/bsd.
Diffstat (limited to 'sys/arch/alpha')
-rw-r--r--sys/arch/alpha/stand/boot/devopen.c86
1 files changed, 3 insertions, 83 deletions
diff --git a/sys/arch/alpha/stand/boot/devopen.c b/sys/arch/alpha/stand/boot/devopen.c
index fc6de09d56c..bac90dab979 100644
--- a/sys/arch/alpha/stand/boot/devopen.c
+++ b/sys/arch/alpha/stand/boot/devopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: devopen.c,v 1.4 1997/05/05 06:01:51 millert Exp $ */
+/* $OpenBSD: devopen.c,v 1.5 1997/10/27 04:55:04 millert Exp $ */
/* $NetBSD: devopen.c,v 1.1 1995/11/23 02:39:37 cgd Exp $ */
/*-
@@ -60,89 +60,9 @@ devopen(f, fname, file)
cp = (char *)fname;
ncp = namebuf;
+ dp = devsw;
+ ctlr = unit = part = 0;
- /* look for a string like '5/rz0/vmunix' or '5/rz3f/vmunix */
- if ((c = *cp) >= '0' && c <= '9') {
- ctlr = c - '0';
- /* skip the '/' */
- if (*++cp != '/')
- return (ENXIO);
- cp++;
- while ((c = *cp) != '\0') {
- if (c == '/')
- break;
- if (c >= '0' && c <= '9') {
- /* read unit number */
- unit = c - '0';
-
- /* look for a partition */
- if ((c = *++cp) >= 'a' && c <= 'h') {
- part = c - 'a';
- c = *++cp;
- }
- if (c != '/')
- return (ENXIO);
- break;
- }
- if (ncp < namebuf + sizeof(namebuf) - 1)
- *ncp++ = c;
- cp++;
- }
- *ncp = '\0';
- } else if (strchr(cp, '(')) {
- /* expect a string like 'rz(0,0,0)vmunix' */
- while ((c = *cp) != '\0') {
- if (c == '(') {
- cp++;
- break;
- }
- if (ncp < namebuf + sizeof(namebuf) - 1)
- *ncp++ = c;
- cp++;
- }
-
- /* get controller number */
- if ((c = *cp) >= '0' && c <= '9') {
- ctlr = c - '0';
- c = *++cp;
- }
-
- if (c == ',') {
- /* get SCSI device number */
- if ((c = *++cp) >= '0' && c <= '9') {
- unit = c - '0';
- c = *++cp;
- }
-
- if (c == ',') {
- /* get partition number */
- if ((c = *++cp) >= '0' && c <= '9') {
- part = c - '0';
- c = *++cp;
- }
- }
- }
- if (c != ')')
- return (ENXIO);
- cp++;
- *ncp = '\0';
- } else {
- dp = devsw;
- ctlr = unit = part = 0;
- goto fnd;
- }
-
- for (dp = devsw, i = 0; i < ndevs; dp++, i++)
- if (dp->dv_name && strcmp(namebuf, dp->dv_name) == 0)
- goto fnd;
- printf("Unknown device '%s'\nKnown devices are:", namebuf);
- for (dp = devsw, i = 0; i < ndevs; dp++, i++)
- if (dp->dv_name)
- printf(" %s", dp->dv_name);
- printf("\n");
- return (ENXIO);
-
-fnd:
rc = (dp->dv_open)(f, ctlr, unit, part);
if (rc)
return (rc);