1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup rtems_bsd_machine |
---|
5 | * |
---|
6 | * @brief TODO. |
---|
7 | * |
---|
8 | * File origin from FreeBSD "sys/powerpc/powerpc/busdma_machdep.c". |
---|
9 | */ |
---|
10 | |
---|
11 | /*- |
---|
12 | * Copyright (c) 2009-2012 embedded brains GmbH. All rights reserved. |
---|
13 | * |
---|
14 | * embedded brains GmbH |
---|
15 | * Obere Lagerstr. 30 |
---|
16 | * 82178 Puchheim |
---|
17 | * Germany |
---|
18 | * <rtems@embedded-brains.de> |
---|
19 | * |
---|
20 | * Copyright (c) 2004 Olivier Houchard |
---|
21 | * Copyright (c) 2002 Peter Grehan |
---|
22 | * Copyright (c) 1997, 1998 Justin T. Gibbs. |
---|
23 | * All rights reserved. |
---|
24 | * |
---|
25 | * Redistribution and use in source and binary forms, with or without |
---|
26 | * modification, are permitted provided that the following conditions |
---|
27 | * are met: |
---|
28 | * 1. Redistributions of source code must retain the above copyright |
---|
29 | * notice, this list of conditions, and the following disclaimer, |
---|
30 | * without modification, immediately at the beginning of the file. |
---|
31 | * 2. The name of the author may not be used to endorse or promote products |
---|
32 | * derived from this software without specific prior written permission. |
---|
33 | * |
---|
34 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
---|
35 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
36 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
37 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR |
---|
38 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
39 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
---|
40 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
---|
41 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
---|
42 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
---|
43 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
44 | * SUCH DAMAGE. |
---|
45 | */ |
---|
46 | |
---|
47 | #ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_BUS_DMA_H_ |
---|
48 | #define _RTEMS_BSD_MACHINE_RTEMS_BSD_BUS_DMA_H_ |
---|
49 | |
---|
50 | #include <freebsd/sys/param.h> |
---|
51 | #include <freebsd/sys/types.h> |
---|
52 | #include <freebsd/sys/lock.h> |
---|
53 | #include <freebsd/sys/mutex.h> |
---|
54 | #include <freebsd/sys/systm.h> |
---|
55 | #include <freebsd/machine/bus.h> |
---|
56 | |
---|
57 | struct bus_dma_tag { |
---|
58 | bus_dma_tag_t parent; |
---|
59 | bus_size_t alignment; |
---|
60 | bus_size_t boundary; |
---|
61 | bus_addr_t lowaddr; |
---|
62 | bus_addr_t highaddr; |
---|
63 | bus_dma_filter_t *filter; |
---|
64 | void *filterarg; |
---|
65 | bus_size_t maxsize; |
---|
66 | int nsegments; |
---|
67 | bus_size_t maxsegsz; |
---|
68 | int flags; |
---|
69 | int ref_count; |
---|
70 | int map_count; |
---|
71 | bus_dma_lock_t *lockfunc; |
---|
72 | void *lockfuncarg; |
---|
73 | }; |
---|
74 | |
---|
75 | struct bus_dmamap { |
---|
76 | void *buffer_begin; |
---|
77 | bus_size_t buffer_size; |
---|
78 | }; |
---|
79 | |
---|
80 | int |
---|
81 | bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t segs[], |
---|
82 | void *buf, bus_size_t buflen, struct thread *td, int flags, |
---|
83 | vm_offset_t *lastaddrp, int *segp, int first); |
---|
84 | |
---|
85 | #endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_BUS_DMA_H_ */ |
---|