1 1.1 dyoung /* $NetBSD: bus_funcs.h,v 1.1 2011/07/01 17:10:00 dyoung Exp $ */ 2 1.1 dyoung 3 1.1 dyoung /*- 4 1.1 dyoung * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. 5 1.1 dyoung * All rights reserved. 6 1.1 dyoung * 7 1.1 dyoung * This code is derived from software contributed to The NetBSD Foundation 8 1.1 dyoung * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 9 1.1 dyoung * NASA Ames Research Center. 10 1.1 dyoung * 11 1.1 dyoung * Redistribution and use in source and binary forms, with or without 12 1.1 dyoung * modification, are permitted provided that the following conditions 13 1.1 dyoung * are met: 14 1.1 dyoung * 1. Redistributions of source code must retain the above copyright 15 1.1 dyoung * notice, this list of conditions and the following disclaimer. 16 1.1 dyoung * 2. Redistributions in binary form must reproduce the above copyright 17 1.1 dyoung * notice, this list of conditions and the following disclaimer in the 18 1.1 dyoung * documentation and/or other materials provided with the distribution. 19 1.1 dyoung * 20 1.1 dyoung * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21 1.1 dyoung * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 1.1 dyoung * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 1.1 dyoung * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24 1.1 dyoung * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 1.1 dyoung * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 1.1 dyoung * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 1.1 dyoung * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 1.1 dyoung * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 1.1 dyoung * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 1.1 dyoung * POSSIBILITY OF SUCH DAMAGE. 31 1.1 dyoung */ 32 1.1 dyoung 33 1.1 dyoung /* 34 1.1 dyoung * Copyright (c) 1996 Charles M. Hannum. All rights reserved. 35 1.1 dyoung * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 36 1.1 dyoung * 37 1.1 dyoung * Redistribution and use in source and binary forms, with or without 38 1.1 dyoung * modification, are permitted provided that the following conditions 39 1.1 dyoung * are met: 40 1.1 dyoung * 1. Redistributions of source code must retain the above copyright 41 1.1 dyoung * notice, this list of conditions and the following disclaimer. 42 1.1 dyoung * 2. Redistributions in binary form must reproduce the above copyright 43 1.1 dyoung * notice, this list of conditions and the following disclaimer in the 44 1.1 dyoung * documentation and/or other materials provided with the distribution. 45 1.1 dyoung * 3. All advertising materials mentioning features or use of this software 46 1.1 dyoung * must display the following acknowledgement: 47 1.1 dyoung * This product includes software developed by Christopher G. Demetriou 48 1.1 dyoung * for the NetBSD Project. 49 1.1 dyoung * 4. The name of the author may not be used to endorse or promote products 50 1.1 dyoung * derived from this software without specific prior written permission 51 1.1 dyoung * 52 1.1 dyoung * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 53 1.1 dyoung * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 54 1.1 dyoung * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 55 1.1 dyoung * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 56 1.1 dyoung * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 57 1.1 dyoung * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 58 1.1 dyoung * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 59 1.1 dyoung * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 60 1.1 dyoung * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 61 1.1 dyoung * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 62 1.1 dyoung */ 63 1.1 dyoung 64 1.1 dyoung #ifndef _LANDISK_BUS_FUNCS_H_ 65 1.1 dyoung #define _LANDISK_BUS_FUNCS_H_ 66 1.1 dyoung 67 1.1 dyoung #ifdef _KERNEL 68 1.1 dyoung /* 69 1.1 dyoung * Utility macros; INTERNAL USE ONLY. 70 1.1 dyoung */ 71 1.1 dyoung #define __bs_c(a,b) __CONCAT(a,b) 72 1.1 dyoung #define __bs_opname(op,size) __bs_c(__bs_c(__bs_c(bs_,op),_),size) 73 1.1 dyoung 74 1.1 dyoung #define __bs_rs(sz, tn, t, h, o) \ 75 1.1 dyoung (__BUS_SPACE_ADDRESS_SANITY((h) + (o), tn, "bus addr"), \ 76 1.1 dyoung (*(t)->__bs_opname(r,sz))((t)->bs_cookie, h, o)) 77 1.1 dyoung 78 1.1 dyoung #define __bs_ws(sz, tn, t, h, o, v) \ 79 1.1 dyoung do { \ 80 1.1 dyoung __BUS_SPACE_ADDRESS_SANITY((h) + (o), tn, "bus addr"); \ 81 1.1 dyoung (*(t)->__bs_opname(w,sz))((t)->bs_cookie, h, o, v); \ 82 1.1 dyoung } while (0) 83 1.1 dyoung 84 1.1 dyoung #define __bs_nonsingle(type, sz, tn, t, h, o, a, c) \ 85 1.1 dyoung do { \ 86 1.1 dyoung __BUS_SPACE_ADDRESS_SANITY((a), tn, "buffer"); \ 87 1.1 dyoung __BUS_SPACE_ADDRESS_SANITY((h) + (o), tn, "bus addr"); \ 88 1.1 dyoung (*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o, a, c); \ 89 1.1 dyoung } while (0) 90 1.1 dyoung 91 1.1 dyoung #define __bs_set(type, sz, tn, t, h, o, v, c) \ 92 1.1 dyoung do { \ 93 1.1 dyoung __BUS_SPACE_ADDRESS_SANITY((h) + (o), tn, "bus addr"); \ 94 1.1 dyoung (*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o, v, c); \ 95 1.1 dyoung } while (0) 96 1.1 dyoung 97 1.1 dyoung #define __bs_copy(sz, tn, t, h1, o1, h2, o2, cnt) \ 98 1.1 dyoung do { \ 99 1.1 dyoung __BUS_SPACE_ADDRESS_SANITY((h1) + (o1), tn, "bus addr 1"); \ 100 1.1 dyoung __BUS_SPACE_ADDRESS_SANITY((h2) + (o2), tn, "bus addr 2"); \ 101 1.1 dyoung (*(t)->__bs_opname(c,sz))((t)->bs_cookie, h1, o1, h2, o2, cnt); \ 102 1.1 dyoung } while (0) 103 1.1 dyoung 104 1.1 dyoung 105 1.1 dyoung /* 106 1.1 dyoung * Mapping and unmapping operations. 107 1.1 dyoung */ 108 1.1 dyoung #define bus_space_map(t, a, s, f, hp) \ 109 1.1 dyoung (*(t)->bs_map)((t)->bs_cookie, (a), (s), (f), (hp)) 110 1.1 dyoung #define bus_space_unmap(t, h, s) \ 111 1.1 dyoung (*(t)->bs_unmap)((t)->bs_cookie, (h), (s)) 112 1.1 dyoung #define bus_space_subregion(t, h, o, s, hp) \ 113 1.1 dyoung (*(t)->bs_subregion)((t)->bs_cookie, (h), (o), (s), (hp)) 114 1.1 dyoung 115 1.1 dyoung /* 116 1.1 dyoung * Allocation and deallocation operations. 117 1.1 dyoung */ 118 1.1 dyoung #define bus_space_alloc(t, rs, re, s, a, b, f, ap, hp) \ 119 1.1 dyoung (*(t)->bs_alloc)((t)->bs_cookie, (rs), (re), (s), (a), (b), \ 120 1.1 dyoung (f), (ap), (hp)) 121 1.1 dyoung #define bus_space_free(t, h, s) \ 122 1.1 dyoung (*(t)->bs_free)((t)->bs_cookie, (h), (s)) 123 1.1 dyoung 124 1.1 dyoung /* 125 1.1 dyoung * Get kernel virtual address for ranges mapped BUS_SPACE_MAP_LINEAR. 126 1.1 dyoung */ 127 1.1 dyoung #define bus_space_vaddr(t, h) \ 128 1.1 dyoung (*(t)->bs_vaddr)((t)->bs_cookie, (h)) 129 1.1 dyoung 130 1.1 dyoung /* 131 1.1 dyoung * MMap bus space for a user application. 132 1.1 dyoung */ 133 1.1 dyoung #define bus_space_mmap(t, a, o, p, f) \ 134 1.1 dyoung (*(t)->bs_mmap)((t)->bs_cookie, (a), (o), (p), (f)) 135 1.1 dyoung 136 1.1 dyoung /* 137 1.1 dyoung * Bus barrier operations. The SH3 does not currently require 138 1.1 dyoung * barriers, but we must provide the flags to MI code. 139 1.1 dyoung */ 140 1.1 dyoung #define bus_space_barrier(t, h, o, l, f) \ 141 1.1 dyoung ((void)((void)(t), (void)(h), (void)(o), (void)(l), (void)(f))) 142 1.1 dyoung 143 1.1 dyoung /* 144 1.1 dyoung * Bus read (single) operations. 145 1.1 dyoung */ 146 1.1 dyoung #define bus_space_read_1(t, h, o) __bs_rs(1,uint8_t,(t),(h),(o)) 147 1.1 dyoung #define bus_space_read_2(t, h, o) __bs_rs(2,uint16_t,(t),(h),(o)) 148 1.1 dyoung #define bus_space_read_4(t, h, o) __bs_rs(4,uint32_t,(t),(h),(o)) 149 1.1 dyoung #define bus_space_read_8(t, h, o) __bs_rs(8,uint64_t,(t),(h),(o)) 150 1.1 dyoung 151 1.1 dyoung 152 1.1 dyoung /* 153 1.1 dyoung * Bus read multiple operations. 154 1.1 dyoung */ 155 1.1 dyoung #define bus_space_read_multi_1(t, h, o, a, c) \ 156 1.1 dyoung __bs_nonsingle(rm,1,uint8_t,(t),(h),(o),(a),(c)) 157 1.1 dyoung #define bus_space_read_multi_2(t, h, o, a, c) \ 158 1.1 dyoung __bs_nonsingle(rm,2,uint16_t,(t),(h),(o),(a),(c)) 159 1.1 dyoung #define bus_space_read_multi_4(t, h, o, a, c) \ 160 1.1 dyoung __bs_nonsingle(rm,4,uint32_t,(t),(h),(o),(a),(c)) 161 1.1 dyoung #define bus_space_read_multi_8(t, h, o, a, c) \ 162 1.1 dyoung __bs_nonsingle(rm,8,uint64_t,(t),(h),(o),(a),(c)) 163 1.1 dyoung 164 1.1 dyoung 165 1.1 dyoung /* 166 1.1 dyoung * Bus read region operations. 167 1.1 dyoung */ 168 1.1 dyoung #define bus_space_read_region_1(t, h, o, a, c) \ 169 1.1 dyoung __bs_nonsingle(rr,1,uint8_t,(t),(h),(o),(a),(c)) 170 1.1 dyoung #define bus_space_read_region_2(t, h, o, a, c) \ 171 1.1 dyoung __bs_nonsingle(rr,2,uint16_t,(t),(h),(o),(a),(c)) 172 1.1 dyoung #define bus_space_read_region_4(t, h, o, a, c) \ 173 1.1 dyoung __bs_nonsingle(rr,4,uint32_t,(t),(h),(o),(a),(c)) 174 1.1 dyoung #define bus_space_read_region_8(t, h, o, a, c) \ 175 1.1 dyoung __bs_nonsingle(rr,8,uint64_t,(t),(h),(o),(a),(c)) 176 1.1 dyoung 177 1.1 dyoung 178 1.1 dyoung /* 179 1.1 dyoung * Bus write (single) operations. 180 1.1 dyoung */ 181 1.1 dyoung #define bus_space_write_1(t, h, o, v) __bs_ws(1,uint8_t,(t),(h),(o),(v)) 182 1.1 dyoung #define bus_space_write_2(t, h, o, v) __bs_ws(2,uint16_t,(t),(h),(o),(v)) 183 1.1 dyoung #define bus_space_write_4(t, h, o, v) __bs_ws(4,uint32_t,(t),(h),(o),(v)) 184 1.1 dyoung #define bus_space_write_8(t, h, o, v) __bs_ws(8,uint64_t,(t),(h),(o),(v)) 185 1.1 dyoung 186 1.1 dyoung 187 1.1 dyoung /* 188 1.1 dyoung * Bus write multiple operations. 189 1.1 dyoung */ 190 1.1 dyoung #define bus_space_write_multi_1(t, h, o, a, c) \ 191 1.1 dyoung __bs_nonsingle(wm,1,uint8_t,(t),(h),(o),(a),(c)) 192 1.1 dyoung #define bus_space_write_multi_2(t, h, o, a, c) \ 193 1.1 dyoung __bs_nonsingle(wm,2,uint16_t,(t),(h),(o),(a),(c)) 194 1.1 dyoung #define bus_space_write_multi_4(t, h, o, a, c) \ 195 1.1 dyoung __bs_nonsingle(wm,4,uint32_t,(t),(h),(o),(a),(c)) 196 1.1 dyoung #define bus_space_write_multi_8(t, h, o, a, c) \ 197 1.1 dyoung __bs_nonsingle(wm,8,uint64_t,(t),(h),(o),(a),(c)) 198 1.1 dyoung 199 1.1 dyoung 200 1.1 dyoung /* 201 1.1 dyoung * Bus write region operations. 202 1.1 dyoung */ 203 1.1 dyoung #define bus_space_write_region_1(t, h, o, a, c) \ 204 1.1 dyoung __bs_nonsingle(wr,1,uint8_t,(t),(h),(o),(a),(c)) 205 1.1 dyoung #define bus_space_write_region_2(t, h, o, a, c) \ 206 1.1 dyoung __bs_nonsingle(wr,2,uint16_t,(t),(h),(o),(a),(c)) 207 1.1 dyoung #define bus_space_write_region_4(t, h, o, a, c) \ 208 1.1 dyoung __bs_nonsingle(wr,4,uint32_t,(t),(h),(o),(a),(c)) 209 1.1 dyoung #define bus_space_write_region_8(t, h, o, a, c) \ 210 1.1 dyoung __bs_nonsingle(wr,8,uint64_t,(t),(h),(o),(a),(c)) 211 1.1 dyoung 212 1.1 dyoung 213 1.1 dyoung /* 214 1.1 dyoung * Set multiple operations. 215 1.1 dyoung */ 216 1.1 dyoung #define bus_space_set_multi_1(t, h, o, v, c) \ 217 1.1 dyoung __bs_set(sm,1,uint8_t,(t),(h),(o),(v),(c)) 218 1.1 dyoung #define bus_space_set_multi_2(t, h, o, v, c) \ 219 1.1 dyoung __bs_set(sm,2,uint16_t,(t),(h),(o),(v),(c)) 220 1.1 dyoung #define bus_space_set_multi_4(t, h, o, v, c) \ 221 1.1 dyoung __bs_set(sm,4,uint32_t,(t),(h),(o),(v),(c)) 222 1.1 dyoung #define bus_space_set_multi_8(t, h, o, v, c) \ 223 1.1 dyoung __bs_set(sm,8,uint64_t,(t),(h),(o),(v),(c)) 224 1.1 dyoung 225 1.1 dyoung 226 1.1 dyoung /* 227 1.1 dyoung * Set region operations. 228 1.1 dyoung */ 229 1.1 dyoung #define bus_space_set_region_1(t, h, o, v, c) \ 230 1.1 dyoung __bs_set(sr,1,uint8_t,(t),(h),(o),(v),(c)) 231 1.1 dyoung #define bus_space_set_region_2(t, h, o, v, c) \ 232 1.1 dyoung __bs_set(sr,2,uint16_t,(t),(h),(o),(v),(c)) 233 1.1 dyoung #define bus_space_set_region_4(t, h, o, v, c) \ 234 1.1 dyoung __bs_set(sr,4,uint32_t,(t),(h),(o),(v),(c)) 235 1.1 dyoung #define bus_space_set_region_8(t, h, o, v, c) \ 236 1.1 dyoung __bs_set(sr,8,uint64_t,(t),(h),(o),(v),(c)) 237 1.1 dyoung 238 1.1 dyoung 239 1.1 dyoung /* 240 1.1 dyoung * Copy region operations. 241 1.1 dyoung */ 242 1.1 dyoung #define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ 243 1.1 dyoung __bs_copy(1, uint8_t, (t), (h1), (o1), (h2), (o2), (c)) 244 1.1 dyoung #define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ 245 1.1 dyoung __bs_copy(2, uint16_t, (t), (h1), (o1), (h2), (o2), (c)) 246 1.1 dyoung #define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ 247 1.1 dyoung __bs_copy(4, uint32_t, (t), (h1), (o1), (h2), (o2), (c)) 248 1.1 dyoung #define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \ 249 1.1 dyoung __bs_copy(8, uint64_t, (t), (h1), (o1), (h2), (o2), (c)) 250 1.1 dyoung 251 1.1 dyoung /* 252 1.1 dyoung * Bus stream operations--defined in terms of non-stream counterparts 253 1.1 dyoung */ 254 1.1 dyoung #define bus_space_read_stream_1 bus_space_read_1 255 1.1 dyoung #define bus_space_read_stream_2 bus_space_read_2 256 1.1 dyoung #define bus_space_read_stream_4 bus_space_read_4 257 1.1 dyoung #define bus_space_read_stream_8 bus_space_read_8 258 1.1 dyoung #define bus_space_read_multi_stream_1 bus_space_read_multi_1 259 1.1 dyoung #define bus_space_read_multi_stream_2 bus_space_read_multi_2 260 1.1 dyoung #define bus_space_read_multi_stream_4 bus_space_read_multi_4 261 1.1 dyoung #define bus_space_read_multi_stream_8 bus_space_read_multi_8 262 1.1 dyoung #define bus_space_read_region_stream_1 bus_space_read_region_1 263 1.1 dyoung #define bus_space_read_region_stream_2 bus_space_read_region_2 264 1.1 dyoung #define bus_space_read_region_stream_4 bus_space_read_region_4 265 1.1 dyoung #define bus_space_read_region_stream_8 bus_space_read_region_8 266 1.1 dyoung #define bus_space_write_stream_1 bus_space_write_1 267 1.1 dyoung #define bus_space_write_stream_2 bus_space_write_2 268 1.1 dyoung #define bus_space_write_stream_4 bus_space_write_4 269 1.1 dyoung #define bus_space_write_stream_8 bus_space_write_8 270 1.1 dyoung #define bus_space_write_multi_stream_1 bus_space_write_multi_1 271 1.1 dyoung #define bus_space_write_multi_stream_2 bus_space_write_multi_2 272 1.1 dyoung #define bus_space_write_multi_stream_4 bus_space_write_multi_4 273 1.1 dyoung #define bus_space_write_multi_stream_8 bus_space_write_multi_8 274 1.1 dyoung #define bus_space_write_region_stream_1 bus_space_write_region_1 275 1.1 dyoung #define bus_space_write_region_stream_2 bus_space_write_region_2 276 1.1 dyoung #define bus_space_write_region_stream_4 bus_space_write_region_4 277 1.1 dyoung #define bus_space_write_region_stream_8 bus_space_write_region_8 278 1.1 dyoung 279 1.1 dyoung #endif /* _KERNEL */ 280 1.1 dyoung 281 1.1 dyoung /* Forwards needed by prototypes below. */ 282 1.1 dyoung struct mbuf; 283 1.1 dyoung struct uio; 284 1.1 dyoung 285 1.1 dyoung #define bus_dmamap_create(t, s, n, m, b, f, p) \ 286 1.1 dyoung (*(t)->_dmamap_create)((t), (s), (n), (m), (b), (f), (p)) 287 1.1 dyoung #define bus_dmamap_destroy(t, p) \ 288 1.1 dyoung (*(t)->_dmamap_destroy)((t), (p)) 289 1.1 dyoung #define bus_dmamap_load(t, m, b, s, p, f) \ 290 1.1 dyoung (*(t)->_dmamap_load)((t), (m), (b), (s), (p), (f)) 291 1.1 dyoung #define bus_dmamap_load_mbuf(t, m, b, f) \ 292 1.1 dyoung (*(t)->_dmamap_load_mbuf)((t), (m), (b), (f)) 293 1.1 dyoung #define bus_dmamap_load_uio(t, m, u, f) \ 294 1.1 dyoung (*(t)->_dmamap_load_uio)((t), (m), (u), (f)) 295 1.1 dyoung #define bus_dmamap_load_raw(t, m, sg, n, s, f) \ 296 1.1 dyoung (*(t)->_dmamap_load_raw)((t), (m), (sg), (n), (s), (f)) 297 1.1 dyoung #define bus_dmamap_unload(t, p) \ 298 1.1 dyoung (*(t)->_dmamap_unload)((t), (p)) 299 1.1 dyoung #define bus_dmamap_sync(t, m, o, l, op) \ 300 1.1 dyoung (void)((t)->_dmamap_sync ? \ 301 1.1 dyoung (*(t)->_dmamap_sync)((t), (m), (o), (l), (op)) : (void)0) 302 1.1 dyoung 303 1.1 dyoung #define bus_dmamem_alloc(t, s, a, b, sg, n, r, f) \ 304 1.1 dyoung (*(t)->_dmamem_alloc)((t), (s), (a), (b), (sg), (n), (r), (f)) 305 1.1 dyoung #define bus_dmamem_free(t, sg, n) \ 306 1.1 dyoung (*(t)->_dmamem_free)((t), (sg), (n)) 307 1.1 dyoung #define bus_dmamem_map(t, sg, n, s, k, f) \ 308 1.1 dyoung (*(t)->_dmamem_map)((t), (sg), (n), (s), (k), (f)) 309 1.1 dyoung #define bus_dmamem_unmap(t, k, s) \ 310 1.1 dyoung (*(t)->_dmamem_unmap)((t), (k), (s)) 311 1.1 dyoung #define bus_dmamem_mmap(t, sg, n, o, p, f) \ 312 1.1 dyoung (*(t)->_dmamem_mmap)((t), (sg), (n), (o), (p), (f)) 313 1.1 dyoung 314 1.1 dyoung #define bus_dmatag_subregion(t, mna, mxa, nt, f) EOPNOTSUPP 315 1.1 dyoung #define bus_dmatag_destroy(t) 316 1.1 dyoung 317 1.1 dyoung #if defined(_LANDISK_BUS_DMA_PRIVATE) 318 1.1 dyoung int _bus_dmamap_create(bus_dma_tag_t, bus_size_t, int, bus_size_t, 319 1.1 dyoung bus_size_t, int, bus_dmamap_t *); 320 1.1 dyoung void _bus_dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); 321 1.1 dyoung int _bus_dmamap_load(bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, 322 1.1 dyoung struct proc *, int); 323 1.1 dyoung int _bus_dmamap_load_mbuf(bus_dma_tag_t, bus_dmamap_t, struct mbuf *,int); 324 1.1 dyoung int _bus_dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t, struct uio *, int); 325 1.1 dyoung int _bus_dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, 326 1.1 dyoung int, bus_size_t, int); 327 1.1 dyoung void _bus_dmamap_unload(bus_dma_tag_t, bus_dmamap_t); 328 1.1 dyoung void _bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t, 329 1.1 dyoung bus_size_t, int); 330 1.1 dyoung 331 1.1 dyoung int _bus_dmamem_alloc(bus_dma_tag_t tag, bus_size_t size, 332 1.1 dyoung bus_size_t alignment, bus_size_t boundary, bus_dma_segment_t *segs, 333 1.1 dyoung int nsegs, int *rsegs, int flags); 334 1.1 dyoung void _bus_dmamem_free(bus_dma_tag_t tag, bus_dma_segment_t *segs, 335 1.1 dyoung int nsegs); 336 1.1 dyoung int _bus_dmamem_map(bus_dma_tag_t tag, bus_dma_segment_t *segs, int nsegs, 337 1.1 dyoung size_t size, void **kvap, int flags); 338 1.1 dyoung void _bus_dmamem_unmap(bus_dma_tag_t tag, void *kva, size_t size); 339 1.1 dyoung paddr_t _bus_dmamem_mmap(bus_dma_tag_t tag, bus_dma_segment_t *segs, 340 1.1 dyoung int nsegs, off_t off, int prot, int flags); 341 1.1 dyoung #endif /* _LANDISK_BUS_DMA_PRIVATE */ 342 1.1 dyoung 343 1.1 dyoung #endif /* _LANDISK_BUS_FUNCS_H_ */ 344