Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sgimips/sgimips Since we can get boot device inform...



details:   https://anonhg.NetBSD.org/src/rev/6d70f03aa476
branches:  trunk
changeset: 517810:6d70f03aa476
user:      soren <soren%NetBSD.org@localhost>
date:      Mon Nov 19 17:35:15 2001 +0000

description:
Since we can get boot device information from both the boot loader
and the firmware, we allow it to be set only once, so the boot
loader is given highest priority.

diffstat:

 sys/arch/sgimips/sgimips/autoconf.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (52 lines):

diff -r 8a269c17a068 -r 6d70f03aa476 sys/arch/sgimips/sgimips/autoconf.c
--- a/sys/arch/sgimips/sgimips/autoconf.c       Mon Nov 19 17:33:02 2001 +0000
+++ b/sys/arch/sgimips/sgimips/autoconf.c       Mon Nov 19 17:35:15 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.4 2001/10/18 02:25:34 mhitch Exp $      */
+/*     $NetBSD: autoconf.c,v 1.5 2001/11/19 17:35:15 soren Exp $       */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -49,7 +49,7 @@
 #include <dev/scsipi/scsipi_all.h>
 #include <dev/scsipi/scsiconf.h>
 
-struct device *booted_device;
+struct device *booted_device = NULL;
 static struct device *booted_controller;
 static int     booted_slot, booted_unit, booted_partition;
 static char    *booted_protocol;
@@ -89,10 +89,12 @@
 makebootdev(cp)
        char *cp;
 {
-       booted_device = NULL;
        booted_slot = booted_unit = booted_partition = 0;
        booted_protocol = NULL;
 
+       if (booted_device != NULL)
+               return;
+
        if (strncmp(cp, "scsi(", 5) == NULL) {
                cp += 5;
                if (*cp >= '0' && *cp <= '9')
@@ -106,7 +108,8 @@
                if (strncmp(cp, ")rdisk(0)partition(", 19) == NULL) {
                        cp += 19;
                        while (*cp >= '0' && *cp <= '9')
-                               booted_partition = booted_partition * 10 + *cp++ - '0';
+                               booted_partition =
+                                       booted_partition * 10 + *cp++ - '0';
                }
                if (*cp != ')')
                        return; /* XXX ? */
@@ -133,7 +136,8 @@
                return;
        }
        if (strncmp(cp, "bootp(", 6) == 0) {
-               /* XXX controller number?  Needed to handle > 1 network controller */
+               /* XXX controller number?  Needed to
+                  handle > 1 network controller */
                booted_protocol = "BOOTP";
                return;
        }



Home | Main Index | Thread Index | Old Index