Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sandpoint Change BTINFO_ROOTDEV to include boot dev...



details:   https://anonhg.NetBSD.org/src/rev/a2f5dd61bb09
branches:  trunk
changeset: 772865:a2f5dd61bb09
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Thu Jan 19 07:38:05 2012 +0000

description:
Change BTINFO_ROOTDEV to include boot device partition number in
its cookie field to allow a kernel to determine rootdev correctly
when kernel image is loaded from other than 'a' partition.

diffstat:

 sys/arch/sandpoint/sandpoint/autoconf.c |  8 ++++----
 sys/arch/sandpoint/stand/altboot/dsk.c  |  4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (47 lines):

diff -r 3d1e60eacd9a -r a2f5dd61bb09 sys/arch/sandpoint/sandpoint/autoconf.c
--- a/sys/arch/sandpoint/sandpoint/autoconf.c   Thu Jan 19 02:42:53 2012 +0000
+++ b/sys/arch/sandpoint/sandpoint/autoconf.c   Thu Jan 19 07:38:05 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.23 2011/06/18 08:08:30 matt Exp $       */
+/*     $NetBSD: autoconf.c,v 1.24 2012/01/19 07:38:06 nisimura Exp $   */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.23 2011/06/18 08:08:30 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.24 2012/01/19 07:38:06 nisimura Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -138,8 +138,8 @@
        }
        if (bi_rdev != NULL && device_class(dev) == DV_DISK
            && device_is_a(dev, bi_rdev->devname)
-           && device_unit(dev) == bi_rdev->cookie) {
+           && device_unit(dev) == (bi_rdev->cookie >> 8)) {
                booted_device = dev;
-               booted_partition = 0;
+               booted_partition = bi_rdev->cookie & 0xff;
        }
 }
diff -r 3d1e60eacd9a -r a2f5dd61bb09 sys/arch/sandpoint/stand/altboot/dsk.c
--- a/sys/arch/sandpoint/stand/altboot/dsk.c    Thu Jan 19 02:42:53 2012 +0000
+++ b/sys/arch/sandpoint/stand/altboot/dsk.c    Thu Jan 19 07:38:05 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dsk.c,v 1.11 2011/11/12 16:56:12 phx Exp $ */
+/* $NetBSD: dsk.c,v 1.12 2012/01/19 07:38:05 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -498,7 +498,7 @@
 
        /* build btinfo to identify disk device */
        snprintf(bi_rdev.devname, sizeof(bi_rdev.devname), "wd");
-       bi_rdev.cookie = d->unittag; /* disk unit number */
+       bi_rdev.cookie = (d->unittag << 8) | d->part;
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index