Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump Move the bus_dma implementation that works only wit...
details: https://anonhg.NetBSD.org/src/rev/6a24d079bd1a
branches: trunk
changeset: 790114:6a24d079bd1a
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Sep 19 17:55:22 2013 +0000
description:
Move the bus_dma implementation that works only with ugenhc into the
ugenhc component itself.
diffstat:
sys/rump/dev/lib/libugenhc/Makefile | 4 +-
sys/rump/dev/lib/libugenhc/ugenhc_dma.c | 110 +++++++++++++++++++++++++++++
sys/rump/librump/rumpdev/Makefile.rumpdev | 4 +-
sys/rump/librump/rumpdev/rumpdma.c | 112 ------------------------------
4 files changed, 114 insertions(+), 116 deletions(-)
diffs (264 lines):
diff -r ef1fc8856fcb -r 6a24d079bd1a sys/rump/dev/lib/libugenhc/Makefile
--- a/sys/rump/dev/lib/libugenhc/Makefile Thu Sep 19 17:29:06 2013 +0000
+++ b/sys/rump/dev/lib/libugenhc/Makefile Thu Sep 19 17:55:22 2013 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.6 2013/04/28 10:25:41 pooka Exp $
+# $NetBSD: Makefile,v 1.7 2013/09/19 17:55:22 pooka Exp $
#
LIB= rumpdev_ugenhc
IOCONF= UGENHC.ioconf
-SRCS= ugenhc.c ugenhc_at_mainbus.c
+SRCS= ugenhc.c ugenhc_at_mainbus.c ugenhc_dma.c
CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern
diff -r ef1fc8856fcb -r 6a24d079bd1a sys/rump/dev/lib/libugenhc/ugenhc_dma.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libugenhc/ugenhc_dma.c Thu Sep 19 17:55:22 2013 +0000
@@ -0,0 +1,110 @@
+/* $NetBSD: ugenhc_dma.c,v 1.1 2013/09/19 17:55:22 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 <sys/bus.h>
+
+/*
+ * bus_dma(9) that works for 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)
+{
+
+ kmem_free(kva, b);
+}
diff -r ef1fc8856fcb -r 6a24d079bd1a sys/rump/librump/rumpdev/Makefile.rumpdev
--- a/sys/rump/librump/rumpdev/Makefile.rumpdev Thu Sep 19 17:29:06 2013 +0000
+++ b/sys/rump/librump/rumpdev/Makefile.rumpdev Thu Sep 19 17:55:22 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.rumpdev,v 1.6 2013/03/15 12:09:58 pooka Exp $
+# $NetBSD: Makefile.rumpdev,v 1.7 2013/09/19 17:55:22 pooka Exp $
#
LIB= rumpdev
@@ -6,7 +6,7 @@
.PATH: ${RUMPTOP}/librump/rumpdev \
${RUMPTOP}/../kern
-SRCS= rump_dev.c autoconf.c rumpdma.c
+SRCS= rump_dev.c autoconf.c
# sys/kern
SRCS+= kern_pmf.c subr_autoconf.c
diff -r ef1fc8856fcb -r 6a24d079bd1a sys/rump/librump/rumpdev/rumpdma.c
--- a/sys/rump/librump/rumpdev/rumpdma.c Thu Sep 19 17:29:06 2013 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/* $NetBSD: rumpdma.c,v 1.3 2011/07/15 23:40:56 dyoung 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 <sys/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)
-{
-
- kmem_free(kva, b);
-}
Home |
Main Index |
Thread Index |
Old Index