Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64 Add a bootinfo node to allow the loader to ...



details:   https://anonhg.NetBSD.org/src/rev/a8ba7d880d9e
branches:  trunk
changeset: 753580:a8ba7d880d9e
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Apr 02 18:34:16 2010 +0000

description:
Add a bootinfo node to allow the loader to override the boot device

diffstat:

 sys/arch/sparc64/include/bootinfo.h |   8 +++++++-
 sys/arch/sparc64/sparc64/autoconf.c |  17 ++++++++++++-----
 2 files changed, 19 insertions(+), 6 deletions(-)

diffs (73 lines):

diff -r 6d823ae7f12b -r a8ba7d880d9e sys/arch/sparc64/include/bootinfo.h
--- a/sys/arch/sparc64/include/bootinfo.h       Fri Apr 02 15:40:14 2010 +0000
+++ b/sys/arch/sparc64/include/bootinfo.h       Fri Apr 02 18:34:16 2010 +0000
@@ -1,4 +1,4 @@
-/*       $NetBSD: bootinfo.h,v 1.4 2008/04/28 20:23:36 martin Exp $        */
+/*       $NetBSD: bootinfo.h,v 1.5 2010/04/02 18:34:16 martin Exp $        */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -97,6 +97,7 @@
 #define BTINFO_DTLB                    102
 #define BTINFO_ITLB                    103
 #define BTINFO_KERNEND                 104
+#define BTINFO_BOOTDEV                 105
 
 #define LOOKUP_BOOTINFO(btp, info) \
 do { \
@@ -125,4 +126,9 @@
        uint64_t addr;
 };
 
+struct btinfo_bootdev {
+       struct btinfo_common common;
+       char name[1];
+};
+
 #endif /* _BOOTINFO_H_ */
diff -r 6d823ae7f12b -r a8ba7d880d9e sys/arch/sparc64/sparc64/autoconf.c
--- a/sys/arch/sparc64/sparc64/autoconf.c       Fri Apr 02 15:40:14 2010 +0000
+++ b/sys/arch/sparc64/sparc64/autoconf.c       Fri Apr 02 18:34:16 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.173 2010/03/11 03:54:56 mrg Exp $ */
+/*     $NetBSD: autoconf.c,v 1.174 2010/04/02 18:34:16 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.173 2010/03/11 03:54:56 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.174 2010/04/02 18:34:16 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -346,17 +346,24 @@
 static void
 get_bootpath_from_prom(void)
 {
+       struct btinfo_bootdev *bdev = NULL;
        char sbuf[OFPATHLEN], *cp;
        int chosen;
 
        /*
         * Grab boot path from PROM
         */
-       if ((chosen = OF_finddevice("/chosen")) == -1 ||
-           OF_getprop(chosen, "bootpath", sbuf, sizeof(sbuf)) < 0)
+       if ((chosen = OF_finddevice("/chosen")) == -1)
                return;
 
-       strcpy(ofbootpath, sbuf);
+       LOOKUP_BOOTINFO(bdev, BTINFO_BOOTDEV);
+       if (bdev) {
+               strcpy(ofbootpath, bdev->name);
+       } else {
+               if (OF_getprop(chosen, "bootpath", sbuf, sizeof(sbuf)) < 0)
+                       return;
+               strcpy(ofbootpath, sbuf);
+       }
        DPRINTF(ACDB_BOOTDEV, ("bootpath: %s\n", ofbootpath));
        ofbootpackage = prom_finddevice(ofbootpath);
 



Home | Main Index | Thread Index | Old Index