Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/newsmips/newsmips Add one more bootdev check.



details:   https://anonhg.NetBSD.org/src/rev/58ad485e5a1d
branches:  trunk
changeset: 474494:58ad485e5a1d
user:      tsubai <tsubai%NetBSD.org@localhost>
date:      Thu Jul 08 12:28:06 1999 +0000

description:
Add one more bootdev check.

diffstat:

 sys/arch/newsmips/newsmips/autoconf.c |  21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diffs (60 lines):

diff -r e7479413920d -r 58ad485e5a1d sys/arch/newsmips/newsmips/autoconf.c
--- a/sys/arch/newsmips/newsmips/autoconf.c     Thu Jul 08 12:13:18 1999 +0000
+++ b/sys/arch/newsmips/newsmips/autoconf.c     Thu Jul 08 12:28:06 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.4 1999/06/07 20:16:12 thorpej Exp $     */
+/*     $NetBSD: autoconf.c,v 1.5 1999/07/08 12:28:06 tsubai Exp $      */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -66,6 +66,7 @@
 
 #include <machine/cpu.h>
 #include <machine/adrsmap.h>
+#include <machine/romcall.h>
 
 #include <newsmips/newsmips/machid.h>
 
@@ -137,7 +138,7 @@
        struct device **devpp;
        int *partp;
 {
-       int unit, part, controller;
+       int ctlr, unit, part, type;
        struct device *dv;
 
        /*
@@ -146,12 +147,16 @@
        *devpp = NULL;
        *partp = 0;
 
-       if ((bootdev & B_MAGICMASK) != 0x50000000) /* NEWS-OS's B_DEVMAGIC */
+       if (BOOTDEV_MAG(bootdev) != 5)  /* NEWS-OS's B_DEVMAGIC */
                return;
 
-       controller = B_CONTROLLER(bootdev);
-       part = (bootdev >> 8) & 0x0f;
-       unit = (bootdev >> 20) & 0x0f;
+       ctlr = BOOTDEV_CTLR(bootdev);   /* SCSI ID */
+       unit = BOOTDEV_UNIT(bootdev);
+       part = BOOTDEV_PART(bootdev);   /* LUN */
+       type = BOOTDEV_TYPE(bootdev);
+
+       if (type != BOOTDEV_SD)
+               return;
 
        /*
         * XXX assumes only one controller exists.
@@ -160,10 +165,10 @@
                if (strcmp(dv->dv_xname, "scsibus0") == 0) {
                        struct scsibus_softc *sdv = (void *)dv;
 
-                       if (sdv->sc_link[unit][0] == NULL)
+                       if (sdv->sc_link[ctlr][0] == NULL)
                                continue;
 
-                       *devpp = sdv->sc_link[unit][0]->device_softc;
+                       *devpp = sdv->sc_link[ctlr][0]->device_softc;
                        *partp = part;
                        return;
                }



Home | Main Index | Thread Index | Old Index