Module Name: src Committed By: pooka Date: Thu Sep 19 17:55:22 UTC 2013
Modified Files: src/sys/rump/dev/lib/libugenhc: Makefile src/sys/rump/librump/rumpdev: Makefile.rumpdev Added Files: src/sys/rump/dev/lib/libugenhc: ugenhc_dma.c Removed Files: src/sys/rump/librump/rumpdev: rumpdma.c Log Message: Move the bus_dma implementation that works only with ugenhc into the ugenhc component itself. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/rump/dev/lib/libugenhc/Makefile cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/lib/libugenhc/ugenhc_dma.c cvs rdiff -u -r1.6 -r1.7 src/sys/rump/librump/rumpdev/Makefile.rumpdev cvs rdiff -u -r1.3 -r0 src/sys/rump/librump/rumpdev/rumpdma.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/dev/lib/libugenhc/Makefile diff -u src/sys/rump/dev/lib/libugenhc/Makefile:1.6 src/sys/rump/dev/lib/libugenhc/Makefile:1.7 --- src/sys/rump/dev/lib/libugenhc/Makefile:1.6 Sun Apr 28 10:25:41 2013 +++ src/sys/rump/dev/lib/libugenhc/Makefile Thu Sep 19 17:55:22 2013 @@ -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 Index: src/sys/rump/librump/rumpdev/Makefile.rumpdev diff -u src/sys/rump/librump/rumpdev/Makefile.rumpdev:1.6 src/sys/rump/librump/rumpdev/Makefile.rumpdev:1.7 --- src/sys/rump/librump/rumpdev/Makefile.rumpdev:1.6 Fri Mar 15 12:09:58 2013 +++ src/sys/rump/librump/rumpdev/Makefile.rumpdev Thu Sep 19 17:55:22 2013 @@ -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 @@ LIB= rumpdev .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 Added files: Index: src/sys/rump/dev/lib/libugenhc/ugenhc_dma.c diff -u /dev/null src/sys/rump/dev/lib/libugenhc/ugenhc_dma.c:1.1 --- /dev/null Thu Sep 19 17:55:22 2013 +++ src/sys/rump/dev/lib/libugenhc/ugenhc_dma.c Thu Sep 19 17:55:22 2013 @@ -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); +}