Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/vme x[yd]_dmamem_alloc() takes a bus_addr_t *. don'...



details:   https://anonhg.NetBSD.org/src/rev/6d57d44f2012
branches:  trunk
changeset: 551021:6d57d44f2012
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Aug 27 15:41:03 2003 +0000

description:
x[yd]_dmamem_alloc() takes a bus_addr_t *.  don't pass the address of a
long!  found by GCC3.

diffstat:

 sys/dev/vme/xd.c |  17 ++++++++++++-----
 sys/dev/vme/xy.c |  17 ++++++++++++-----
 2 files changed, 24 insertions(+), 10 deletions(-)

diffs (158 lines):

diff -r ffde635475f0 -r 6d57d44f2012 sys/dev/vme/xd.c
--- a/sys/dev/vme/xd.c  Wed Aug 27 15:15:13 2003 +0000
+++ b/sys/dev/vme/xd.c  Wed Aug 27 15:41:03 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xd.c,v 1.51 2003/06/29 22:31:00 fvdl Exp $     */
+/*     $NetBSD: xd.c,v 1.52 2003/08/27 15:41:03 mrg Exp $      */
 
 /*
  *
@@ -51,7 +51,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.51 2003/06/29 22:31:00 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.52 2003/08/27 15:41:03 mrg Exp $");
 
 #undef XDC_DEBUG               /* full debug */
 #define XDC_DIAG               /* extra sanity checks */
@@ -510,6 +510,7 @@
        bus_dma_segment_t       seg;
        int                     rseg;
        vme_mapresc_t resc;
+       bus_addr_t              busaddr;
 
        xdc_md_setup();
 
@@ -582,11 +583,12 @@
        if ((error = xd_dmamem_alloc(xdc->dmatag, xdc->iopmap, &seg, &rseg,
                                     XDC_MAXIOPB * sizeof(struct xd_iopb),
                                     (caddr_t *)&xdc->iopbase,
-                                    (bus_addr_t *)&xdc->dvmaiopb)) != 0) {
+                                    &busaddr)) != 0) {
                printf("%s: DMA buffer alloc error %d\n",
                        xdc->sc_dev.dv_xname, error);
                return;
        }
+       xdc->dvmaiopb = BUS_ADDR_PADDR(busaddr);
 
        bzero(xdc->iopbase, XDC_MAXIOPB * sizeof(struct xd_iopb));
 
@@ -731,6 +733,7 @@
        struct dkbad *dkb;
        int                     rseg, error;
        bus_dma_segment_t       seg;
+       bus_addr_t              busaddr;
        caddr_t                 dmaddr;
        caddr_t                 buf;
 
@@ -776,11 +779,12 @@
        if ((error = xd_dmamem_alloc(xdc->dmatag, xdc->auxmap, &seg, &rseg,
                                     XDFM_BPS,
                                     (caddr_t *)&buf,
-                                    (bus_addr_t *)&dmaddr)) != 0) {
+                                    &busaddr)) != 0) {
                printf("%s: DMA buffer alloc error %d\n",
                        xdc->sc_dev.dv_xname, error);
                return;
        }
+       dmaddr = BUS_ADDR_PADDR(busaddr);
 
        /* first try and reset the drive */
 
@@ -2472,12 +2476,15 @@
 
        /* create DVMA buffer for request if needed */
        if (xio->dlen) {
+               bus_addr_t busbuf;
+
                if ((error = xd_dmamem_alloc(xdcsc->dmatag, xdcsc->auxmap,
                                             &seg, &rseg,
                                             xio->dlen, &buf,
-                                            (bus_addr_t *)&dvmabuf)) != 0) {
+                                            &busbuf)) != 0) {
                        return (error);
                }
+               dvmabuf = BUS_ADDR_PADDR(busbuf);
 
                if (xio->cmd == XDCMD_WR || xio->cmd == XDCMD_XWR) {
                        if ((error = copyin(xio->dptr, buf, xio->dlen)) != 0) {
diff -r ffde635475f0 -r 6d57d44f2012 sys/dev/vme/xy.c
--- a/sys/dev/vme/xy.c  Wed Aug 27 15:15:13 2003 +0000
+++ b/sys/dev/vme/xy.c  Wed Aug 27 15:41:03 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xy.c,v 1.51 2003/06/29 22:31:01 fvdl Exp $     */
+/*     $NetBSD: xy.c,v 1.52 2003/08/27 15:41:04 mrg Exp $      */
 
 /*
  *
@@ -51,7 +51,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.51 2003/06/29 22:31:01 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.52 2003/08/27 15:41:04 mrg Exp $");
 
 #undef XYC_DEBUG               /* full debug */
 #undef XYC_DIAG                        /* extra sanity checks */
@@ -419,6 +419,7 @@
        bus_dma_segment_t       seg;
        int                     rseg;
        vme_mapresc_t resc;
+       bus_addr_t              busaddr;
 
        /* get addressing and intr level stuff from autoconfig and load it
         * into our xyc_softc. */
@@ -486,11 +487,12 @@
        if ((error = xy_dmamem_alloc(xyc->dmatag, xyc->iopmap, &seg, &rseg,
                                     XYC_MAXIOPB * sizeof(struct xy_iopb),
                                     (caddr_t *)&xyc->iopbase,
-                                    (bus_addr_t *)&xyc->dvmaiopb)) != 0) {
+                                    &busaddr)) != 0) {
                printf("%s: DMA buffer alloc error %d\n",
                        xyc->sc_dev.dv_xname, error);
                return;
        }
+       xyc->dvmaiopb = BUS_ADDR_PADDR(busaddr);
 
        bzero(xyc->iopbase, XYC_MAXIOPB * sizeof(struct xy_iopb));
 
@@ -627,6 +629,7 @@
        struct dkbad *dkb;
        int                     rseg, error;
        bus_dma_segment_t       seg;
+       bus_addr_t              busaddr;
        caddr_t                 dmaddr;
        caddr_t                 buf;
 
@@ -679,11 +682,12 @@
        if ((error = xy_dmamem_alloc(xyc->dmatag, xyc->auxmap, &seg, &rseg,
                                     XYFM_BPS,
                                     (caddr_t *)&buf,
-                                    (bus_addr_t *)&dmaddr)) != 0) {
+                                    &busaddr)) != 0) {
                printf("%s: DMA buffer alloc error %d\n",
                        xyc->sc_dev.dv_xname, error);
                return;
        }
+       dmaddr = BUS_ADDR_PADDR(busaddr);
 
        /* first try and reset the drive */
        error = xyc_cmd(xyc, XYCMD_RST, 0, xy->xy_drive, 0, 0, 0, fmode);
@@ -2237,12 +2241,15 @@
 
        /* create DVMA buffer for request if needed */
        if (xio->dlen) {
+               bus_addr_t busbuf;
+
                if ((error = xy_dmamem_alloc(xycsc->dmatag, xycsc->auxmap,
                                             &seg, &rseg,
                                             xio->dlen, &buf,
-                                            (bus_addr_t *)&dvmabuf)) != 0) {
+                                            &busbuf)) != 0) {
                        return (error);
                }
+               dvmabuf = BUS_ADDR_PADDR(busbuf);
 
                if (xio->cmd == XYCMD_WR) {
                        if ((error = copyin(xio->dptr, buf, xio->dlen)) != 0) {



Home | Main Index | Thread Index | Old Index