Source-Changes-HG archive

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

[src/netbsd-6]: src/sys Pull up following revision(s) (requested by mlelstv i...



details:   https://anonhg.NetBSD.org/src/rev/7d8e625f3be1
branches:  netbsd-6
changeset: 774314:7d8e625f3be1
user:      riz <riz%NetBSD.org@localhost>
date:      Thu Jul 05 18:12:46 2012 +0000

description:
Pull up following revision(s) (requested by mlelstv in ticket #402):
        sys/dev/vnd.c: revision 1.221
        sys/kern/init_main.c: revision 1.443
        sys/kern/init_main.c: revision 1.444
        sys/dev/dkwedge/dk.c: revision 1.64
        sys/arch/x86/x86/x86_autoconf.c: revision 1.63
        sys/arch/sparc64/sparc64/autoconf.c: revision 1.187
        sys/sys/device.h: revision 1.141
        sys/dev/dkwedge/dkwedge_bsdlabel.c: revision 1.17
        sys/kern/kern_subr.c: revision 1.213
        sys/arch/zaurus/zaurus/autoconf.c: revision 1.11
        sys/arch/xen/x86/autoconf.c: revision 1.14
        sys/sys/disk.h: revision 1.57
Use the label's packname to create wedge names instead of the classic
device names. Fall back to classic device names when the label has an
empty name or the default name 'fictitious'.
autodiscover wedges
Make detection of root on wedges (dk(4)) machine independent. Remove
MD code for x86, xen, sparc64.
Make detection of root on wedges (dk(4)) machine independent. Remove
MD code for zaurus.
Do not try to find the wedge we booted from if opendisk(booted_device)
failed.

diffstat:

 sys/arch/sparc64/sparc64/autoconf.c |    9 +-
 sys/arch/x86/x86/x86_autoconf.c     |   42 ++++------
 sys/arch/xen/x86/autoconf.c         |   29 +------
 sys/arch/zaurus/zaurus/autoconf.c   |   22 +----
 sys/dev/dkwedge/dk.c                |  129 ++++++++---------------------------
 sys/dev/dkwedge/dkwedge_bsdlabel.c  |   19 +++-
 sys/dev/vnd.c                       |   51 +++++++++----
 sys/kern/init_main.c                |   79 +++++++++++++++++++++-
 sys/kern/kern_subr.c                |   10 +-
 sys/sys/device.h                    |    8 +-
 sys/sys/disk.h                      |    4 +-
 11 files changed, 199 insertions(+), 203 deletions(-)

diffs (truncated from 759 to 300 lines):

diff -r bd924dd25afb -r 7d8e625f3be1 sys/arch/sparc64/sparc64/autoconf.c
--- a/sys/arch/sparc64/sparc64/autoconf.c       Thu Jul 05 17:59:12 2012 +0000
+++ b/sys/arch/sparc64/sparc64/autoconf.c       Thu Jul 05 18:12:46 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.185.2.1 2012/06/05 16:22:24 jdc Exp $ */
+/*     $NetBSD: autoconf.c,v 1.185.2.2 2012/07/05 18:12:48 riz Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.185.2.1 2012/06/05 16:22:24 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.185.2.2 2012/07/05 18:12:48 riz Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -508,10 +508,7 @@
                return;
        }
 
-       if (config_handle_wedges(booted_device, booted_partition) == 0)
-               setroot(booted_wedge, 0);
-       else
-               setroot(booted_device, booted_partition);
+       setroot(booted_device, booted_partition);
 }
 
 char *
diff -r bd924dd25afb -r 7d8e625f3be1 sys/arch/x86/x86/x86_autoconf.c
--- a/sys/arch/x86/x86/x86_autoconf.c   Thu Jul 05 17:59:12 2012 +0000
+++ b/sys/arch/x86/x86/x86_autoconf.c   Thu Jul 05 18:12:46 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: x86_autoconf.c,v 1.62 2011/10/18 23:43:36 dyoung Exp $ */
+/*     $NetBSD: x86_autoconf.c,v 1.62.8.1 2012/07/05 18:12:47 riz Exp $        */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.62 2011/10/18 23:43:36 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.62.8.1 2012/07/05 18:12:47 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -64,15 +64,6 @@
 struct disklist *x86_alldisks;
 int x86_ndisks;
 
-static void
-handle_wedges(device_t dv, int par)
-{
-       if (config_handle_wedges(dv, par) == 0)
-               return;
-       booted_device = dv;
-       booted_partition = par;
-}
-
 static int
 is_valid_disk(device_t dv)
 {
@@ -344,7 +335,9 @@
 
                        if (strncmp(cd->cf_name, biv->devname, len) == 0 &&
                            biv->devname[len] - '0' == device_unit(dv)) {
-                               handle_wedges(dv, biv->devname[len + 1] - 'a');
+                               booted_device = dv;
+                               booted_partition = biv->devname[len + 1] - 'a';
+                               booted_nblks = 0;
                                break;
                        }
                }
@@ -388,11 +381,14 @@
                                    device_xname(dv));
                                continue;
                        }
-                       dkwedge_set_bootwedge(dv, biw->startblk, biw->nblks);
+                       booted_device = dv;
+                       booted_partition = 0;
+                       booted_nblks = biw->nblks;
+                       booted_startblk = biw->startblk;
                }
                deviter_release(&di);
 
-               if (booted_wedge)
+               if (booted_nblks)
                        return;
        }
 
@@ -445,7 +441,9 @@
                                    device_xname(dv));
                                continue;
                        }
-                       handle_wedges(dv, bid->partition);
+                       booted_device = dv;
+                       booted_partition = bid->partition;
+                       booted_nblks = 0;
                }
                deviter_release(&di);
 
@@ -477,6 +475,7 @@
                                    device_is_a(dv, "cd")) {
                                        booted_device = dv;
                                        booted_partition = 0;
+                                       booted_nblks = 0;
                                        break;
                                }
                        }
@@ -492,16 +491,9 @@
        findroot();
        matchbiosdisks();
 
-       if (booted_wedge) {
-               KASSERT(booted_device != NULL);
-               aprint_normal("boot device: %s (%s)\n",
-                   device_xname(booted_wedge), device_xname(booted_device));
-               setroot(booted_wedge, 0);
-       } else {
-               aprint_normal("boot device: %s\n",
-                   booted_device ? device_xname(booted_device) : "<unknown>");
-               setroot(booted_device, booted_partition);
-       }
+       aprint_normal("boot device: %s\n",
+           booted_device ? device_xname(booted_device) : "<unknown>");
+       setroot(booted_device, booted_partition);
 }
 
 void
diff -r bd924dd25afb -r 7d8e625f3be1 sys/arch/xen/x86/autoconf.c
--- a/sys/arch/xen/x86/autoconf.c       Thu Jul 05 17:59:12 2012 +0000
+++ b/sys/arch/xen/x86/autoconf.c       Thu Jul 05 18:12:46 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.13 2009/11/27 03:23:15 rmind Exp $      */
+/*     $NetBSD: autoconf.c,v 1.13.18.1 2012/07/05 18:12:49 riz Exp $   */
 /*     NetBSD: autoconf.c,v 1.75 2003/12/30 12:33:22 pk Exp    */
 
 /*-
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.13 2009/11/27 03:23:15 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.13.18.1 2012/07/05 18:12:49 riz Exp $");
 
 #include "opt_xen.h"
 #include "opt_compat_oldboot.h"
@@ -88,7 +88,6 @@
 
 static void findroot(void);
 static int is_valid_disk(device_t);
-static void handle_wedges(device_t, int);
 
 struct disklist *x86_alldisks;
 int x86_ndisks;
@@ -155,16 +154,9 @@
 {
        findroot();
 
-       if (booted_wedge) {
-               KASSERT(booted_device != NULL);
-               printf("boot device: %s (%s)\n",
-                   device_xname(booted_wedge), device_xname(booted_device));
-               setroot(booted_wedge, 0);
-       } else {
-               printf("boot device: %s\n",
-                   booted_device ? device_xname(booted_device) : "<unknown>");
-               setroot(booted_device, booted_partition);
-       }
+       printf("boot device: %s\n",
+           booted_device ? device_xname(booted_device) : "<unknown>");
+       setroot(booted_device, booted_partition);
 }
 
 
@@ -199,7 +191,7 @@
                        continue;
 
                if (is_disk && xcp.xcp_bootdev[0] == 0) {
-                       handle_wedges(dv, 0);
+                       booted_device = dv;
                        break;
                }
 
@@ -354,15 +346,6 @@
        booted_device = dev;
 }
 
-static void
-handle_wedges(device_t dv, int par)
-{
-       if (config_handle_wedges(dv, par) == 0)
-               return;
-       booted_device = dv;
-       booted_partition = par;
-}
-
 static int
 is_valid_disk(device_t dv)
 {
diff -r bd924dd25afb -r 7d8e625f3be1 sys/arch/zaurus/zaurus/autoconf.c
--- a/sys/arch/zaurus/zaurus/autoconf.c Thu Jul 05 17:59:12 2012 +0000
+++ b/sys/arch/zaurus/zaurus/autoconf.c Thu Jul 05 18:12:46 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.10 2011/05/05 08:46:12 nonaka Exp $     */
+/*     $NetBSD: autoconf.c,v 1.10.10.1 2012/07/05 18:12:49 riz Exp $   */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.10 2011/05/05 08:46:12 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.10.10.1 2012/07/05 18:12:49 riz Exp $");
 
 #include "opt_md.h"
 
@@ -48,7 +48,6 @@
 #include <machine/bootinfo.h>
 #include <machine/config_hook.h>
 
-static void handle_wedges(device_t dv, int par);
 static int is_valid_disk(device_t dv);
 static int match_bootdisk(device_t dv, struct btinfo_bootdisk *bid);
 static void findroot(void);
@@ -69,17 +68,6 @@
        spl0();
 }
 
-static void
-handle_wedges(device_t dv, int par)
-{
-
-       if (config_handle_wedges(dv, par) == 0)
-               return;
-
-       booted_device = dv;
-       booted_partition = par;
-}
-
 static int
 is_valid_disk(device_t dv)
 {
@@ -168,7 +156,8 @@
 
                        if (strncmp(cd->cf_name, biv->devname, len) == 0 &&
                            biv->devname[len] - '0' == cd->cf_unit) {
-                               handle_wedges(dv, biv->devname[len + 1] - 'a');
+                               booted_device = dv;
+                               booted_partition = biv->devname[len + 1] - 'a';
                                break;
                        }
                }
@@ -205,7 +194,8 @@
                                    device_xname(dv));
                                continue;
                        }
-                       handle_wedges(dv, bid->partition);
+                       booted_device = dv;
+                       booted_partition = bid->partition;
                }
                deviter_release(&di);
 
diff -r bd924dd25afb -r 7d8e625f3be1 sys/dev/dkwedge/dk.c
--- a/sys/dev/dkwedge/dk.c      Thu Jul 05 17:59:12 2012 +0000
+++ b/sys/dev/dkwedge/dk.c      Thu Jul 05 18:12:46 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dk.c,v 1.62 2011/07/30 12:08:36 jmcneill Exp $ */
+/*     $NetBSD: dk.c,v 1.62.8.1 2012/07/05 18:12:47 riz Exp $  */
 
 /*-
  * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.62 2011/07/30 12:08:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.62.8.1 2012/07/05 18:12:47 riz Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dkwedge.h"
@@ -747,44 +747,6 @@
 }
 
 /*
- * dkwedge_set_bootwedge
- *
- *     Set the booted_wedge global based on the specified parent name
- *     and offset/length.
- */
-void
-dkwedge_set_bootwedge(device_t parent, daddr_t startblk, uint64_t nblks)
-{
-       struct dkwedge_softc *sc;
-       int i;
-
-       rw_enter(&dkwedges_lock, RW_WRITER);



Home | Main Index | Thread Index | Old Index