Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/arch/sparc Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/3597cdb1cdc1
branches:  netbsd-6
changeset: 775364:3597cdb1cdc1
user:      riz <riz%NetBSD.org@localhost>
date:      Wed Oct 17 22:30:08 2012 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #602):
        sys/arch/sparc/dev/fd.c: revision 1.151
        sys/arch/sparc/sparc/memecc.c: revision 1.15
Fix device_t/softc split botches that could be fatal.  From
Chuck Silvers' patch posted current-users and tech-kern:
http://mail-index.netbsd.org/current-users/2012/10/09/msg021233.html
Should be pulled up to netbsd-6.

diffstat:

 sys/arch/sparc/dev/fd.c       |  20 ++++++++++----------
 sys/arch/sparc/sparc/memecc.c |   6 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)

diffs (117 lines):

diff -r df6fa1e3f0f9 -r 3597cdb1cdc1 sys/arch/sparc/dev/fd.c
--- a/sys/arch/sparc/dev/fd.c   Wed Oct 17 22:26:05 2012 +0000
+++ b/sys/arch/sparc/dev/fd.c   Wed Oct 17 22:30:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.150 2011/07/17 23:18:23 mrg Exp $     */
+/*     $NetBSD: fd.c,v 1.150.8.1 2012/10/17 22:30:08 riz Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.150 2011/07/17 23:18:23 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.150.8.1 2012/10/17 22:30:08 riz Exp $");
 
 #include "opt_ddb.h"
 #include "opt_md.h"
@@ -174,7 +174,7 @@
 
 /* software state, per controller */
 struct fdc_softc {
-       struct device   *sc_dev;
+       device_t        sc_dev;
        bus_space_tag_t sc_bustag;
 
        struct callout sc_timo_ch;      /* timeout callout */
@@ -259,7 +259,7 @@
 
 /* software state, per disk (with up to 4 disks per ctlr) */
 struct fd_softc {
-       struct device   *sc_dv;         /* generic device info */
+       device_t        sc_dv;          /* generic device info */
        struct disk     sc_dk;          /* generic disk info */
 
        struct fd_type *sc_deftype;     /* default type descriptor */
@@ -342,7 +342,7 @@
 void   fdfinish(struct fd_softc *, struct buf *);
 int    fdformat(dev_t, struct ne7_fd_formb *, struct proc *);
 void   fd_do_eject(struct fd_softc *);
-void   fd_mountroot_hook(struct device *);
+void   fd_mountroot_hook(device_t);
 static int fdconf(struct fdc_softc *);
 static void establish_chip_type(
                struct fdc_softc *,
@@ -547,7 +547,7 @@
                        ma->ma_size,
                        BUS_SPACE_MAP_LINEAR,
                        &fdc->sc_handle) != 0) {
-               printf("%s: cannot map registers\n", self->dv_xname);
+               printf("%s: cannot map registers\n", device_xname(self));
                return;
        }
 
@@ -580,7 +580,7 @@
                         sa->sa_slot, sa->sa_offset, sa->sa_size,
                         BUS_SPACE_MAP_LINEAR, &fdc->sc_handle) != 0) {
                printf("%s: cannot map control registers\n",
-                       self->dv_xname);
+                       device_xname(self));
                return;
        }
 
@@ -890,7 +890,7 @@
                fdstart(fd);
 #ifdef DIAGNOSTIC
        else {
-               struct fdc_softc *fdc = (void *)device_parent(fd->sc_dv);
+               struct fdc_softc *fdc = device_private(device_parent(fd->sc_dv));
                if (fdc->sc_state == DEVIDLE) {
                        printf("fdstrategy: controller inactive\n");
                        fdcstart(fdc);
@@ -1012,7 +1012,7 @@
 
        s = splbio();
        fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
-       fd_set_motor((struct fdc_softc *)device_parent(fd->sc_dv));
+       fd_set_motor(device_private(device_parent(fd->sc_dv)));
        splx(s);
 }
 
@@ -2305,7 +2305,7 @@
 
 /* ARGSUSED */
 void
-fd_mountroot_hook(struct device *dev)
+fd_mountroot_hook(device_t dev)
 {
        int c;
 
diff -r df6fa1e3f0f9 -r 3597cdb1cdc1 sys/arch/sparc/sparc/memecc.c
--- a/sys/arch/sparc/sparc/memecc.c     Wed Oct 17 22:26:05 2012 +0000
+++ b/sys/arch/sparc/sparc/memecc.c     Wed Oct 17 22:30:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memecc.c,v 1.13 2011/07/17 23:18:23 mrg Exp $  */
+/*     $NetBSD: memecc.c,v 1.13.8.1 2012/10/17 22:30:09 riz Exp $      */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: memecc.c,v 1.13 2011/07/17 23:18:23 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: memecc.c,v 1.13.8.1 2012/10/17 22:30:09 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -75,7 +75,7 @@
 void
 memecc_attach(device_t parent, device_t self, void *aux)
 {
-       struct memecc_softc *sc = (struct memecc_softc *)self;
+       struct memecc_softc *sc = device_private(self);
        struct mainbus_attach_args *ma = aux;
        int node;
        uint32_t reg;



Home | Main Index | Thread Index | Old Index