Source-Changes-HG archive

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

[src/trunk]: src/sys/rump Now that there is a working bus.h for all architect...



details:   https://anonhg.NetBSD.org/src/rev/531313f20a29
branches:  trunk
changeset: 751958:531313f20a29
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Feb 09 18:57:03 2010 +0000

description:
Now that there is a working bus.h for all architectures, move rump
bus dma out of a wip place and into rumpdev where it belongs.

diffstat:

 sys/rump/dev/wip/libusb/Makefile          |    5 +-
 sys/rump/dev/wip/libusb/bus_dma.c         |   85 ----------------------
 sys/rump/librump/rumpdev/Makefile.rumpdev |    4 +-
 sys/rump/librump/rumpdev/rumpdma.c        |  112 ++++++++++++++++++++++++++++++
 4 files changed, 115 insertions(+), 91 deletions(-)

diffs (242 lines):

diff -r a121da9745a1 -r 531313f20a29 sys/rump/dev/wip/libusb/Makefile
--- a/sys/rump/dev/wip/libusb/Makefile  Tue Feb 09 18:27:17 2010 +0000
+++ b/sys/rump/dev/wip/libusb/Makefile  Tue Feb 09 18:57:03 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.3 2010/02/03 21:18:38 pooka Exp $
+#      $NetBSD: Makefile,v 1.4 2010/02/09 18:57:03 pooka Exp $
 #
 
 .PATH: ${.CURDIR}/../../../../dev/usb
@@ -8,9 +8,6 @@
 SRCS=  usb.c usbdi.c usbdi_util.c usb_mem.c usb_subr.c usb_quirks.c    \
        uhub.c usbroothub_subr.c
 
-# XXX: doesn't belong here by a longshot, but it's the easy choice for now
-SRCS+= bus_dma.c
-
 #CPPFLAGS+= -DUHUB_DEBUG
 
 CFLAGS+=       -Wno-pointer-sign
diff -r a121da9745a1 -r 531313f20a29 sys/rump/dev/wip/libusb/bus_dma.c
--- a/sys/rump/dev/wip/libusb/bus_dma.c Tue Feb 09 18:27:17 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*     $NetBSD: bus_dma.c,v 1.1 2009/10/01 21:46:31 pooka Exp $        */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/conf.h>
-#include <sys/device.h>
-#include <sys/kmem.h>
-
-#include <machine/bus.h>
-
-/*
- * bus dma "implementation" for rump.  needs "a little" more work
- */
-
-int
-bus_dmamap_create(bus_dma_tag_t tag, bus_size_t sz, int flag, bus_size_t bsz,
-       bus_size_t bsz2, int i, bus_dmamap_t *ptr)
-{
-
-       return 0;
-}
-
-void
-bus_dmamap_destroy(bus_dma_tag_t tag, bus_dmamap_t map)
-{
-
-       panic("unimplemented %s", __func__);
-}
-
-int
-bus_dmamap_load(bus_dma_tag_t t, bus_dmamap_t a, void *b, bus_size_t c,
-       struct proc *d, int e)
-{
-
-       return 0;
-}
-
-void
-bus_dmamap_unload(bus_dma_tag_t a, bus_dmamap_t b)
-{
-
-       panic("unimplemented %s", __func__);
-}
-
-void
-bus_dmamap_sync(bus_dma_tag_t a, bus_dmamap_t b, bus_addr_t c,
-       bus_size_t d, int e)
-{
-
-       panic("unimplemented %s", __func__);
-}
-
-int
-bus_dmamem_alloc(bus_dma_tag_t tag, bus_size_t size, bus_size_t align,
-       bus_size_t boundary, bus_dma_segment_t *segs, int nsegs,
-       int *rsegs, int flags)
-{
-
-       *rsegs = nsegs;
-       return 0;
-}
-
-void
-bus_dmamem_free(bus_dma_tag_t a, bus_dma_segment_t *b, int c)
-{
-
-       panic("unimplemented %s", __func__);
-}
-
-int
-bus_dmamem_map(bus_dma_tag_t tag, bus_dma_segment_t *segs, int nsegs,
-                       size_t size, void **kvap, int flags)
-{
-
-       KASSERT(nsegs == 1);
-       *kvap = kmem_alloc(size, KM_SLEEP);
-       return 0;
-}
-
-void
-bus_dmamem_unmap(bus_dma_tag_t a, void *kva, size_t b)
-{
-
-       panic("unimplemented %s", __func__);
-}
diff -r a121da9745a1 -r 531313f20a29 sys/rump/librump/rumpdev/Makefile.rumpdev
--- a/sys/rump/librump/rumpdev/Makefile.rumpdev Tue Feb 09 18:27:17 2010 +0000
+++ b/sys/rump/librump/rumpdev/Makefile.rumpdev Tue Feb 09 18:57:03 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rumpdev,v 1.3 2010/01/09 16:29:32 pooka Exp $
+#      $NetBSD: Makefile.rumpdev,v 1.4 2010/02/09 18:57:03 pooka Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -8,7 +8,7 @@
 .PATH: ${RUMPTOP}/librump/rumpdev                              \
        ${RUMPTOP}/../kern
 
-SRCS=  rump_dev.c autoconf.c
+SRCS=  rump_dev.c autoconf.c rumpdma.c
 
 # sys/kern
 SRCS+= kern_pmf.c subr_autoconf.c
diff -r a121da9745a1 -r 531313f20a29 sys/rump/librump/rumpdev/rumpdma.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/librump/rumpdev/rumpdma.c        Tue Feb 09 18:57:03 2010 +0000
@@ -0,0 +1,112 @@
+/*     $NetBSD: rumpdma.c,v 1.1 2010/02/09 18:57:03 pooka Exp $        */
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/kmem.h>
+
+#include <machine/bus.h>
+
+/*
+ * bus dma "implementation" for rump.
+ *
+ * In it's current sorry state, this functions with USB drivers.
+ */
+
+int
+bus_dmamap_create(bus_dma_tag_t tag, bus_size_t sz, int flag, bus_size_t bsz,
+       bus_size_t bsz2, int i, bus_dmamap_t *ptr)
+{
+
+       return 0;
+}
+
+void
+bus_dmamap_destroy(bus_dma_tag_t tag, bus_dmamap_t map)
+{
+
+       panic("unimplemented %s", __func__);
+}
+
+int
+bus_dmamap_load(bus_dma_tag_t t, bus_dmamap_t a, void *b, bus_size_t c,
+       struct proc *d, int e)
+{
+
+       return 0;
+}
+
+void
+bus_dmamap_unload(bus_dma_tag_t a, bus_dmamap_t b)
+{
+
+       panic("unimplemented %s", __func__);
+}
+
+void
+bus_dmamap_sync(bus_dma_tag_t a, bus_dmamap_t b, bus_addr_t c,
+       bus_size_t d, int e)
+{
+
+       panic("unimplemented %s", __func__);
+}
+
+int
+bus_dmamem_alloc(bus_dma_tag_t tag, bus_size_t size, bus_size_t align,
+       bus_size_t boundary, bus_dma_segment_t *segs, int nsegs,
+       int *rsegs, int flags)
+{
+
+       *rsegs = nsegs;
+       return 0;
+}
+
+void
+bus_dmamem_free(bus_dma_tag_t a, bus_dma_segment_t *b, int c)
+{
+
+       panic("unimplemented %s", __func__);
+}
+
+int
+bus_dmamem_map(bus_dma_tag_t tag, bus_dma_segment_t *segs, int nsegs,
+                       size_t size, void **kvap, int flags)
+{
+
+       KASSERT(nsegs == 1);
+       *kvap = kmem_alloc(size, KM_SLEEP);
+       return 0;
+}
+
+void
+bus_dmamem_unmap(bus_dma_tag_t a, void *kva, size_t b)
+{
+
+       panic("unimplemented %s", __func__);
+}



Home | Main Index | Thread Index | Old Index