bus.h (77957) | bus.h (92842) |
---|---|
1/*- 2 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 7 * NASA Ames Research Center. 8 * --- 52 unchanged lines hidden (view full) --- 61 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 62 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 63 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 64 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 65 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 66 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 67 * 68 * $NetBSD: bus.h,v 1.9.4.1 2000/06/30 16:27:30 simonb Exp $ | 1/*- 2 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 7 * NASA Ames Research Center. 8 * --- 52 unchanged lines hidden (view full) --- 61 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 62 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 63 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 64 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 65 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 66 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 67 * 68 * $NetBSD: bus.h,v 1.9.4.1 2000/06/30 16:27:30 simonb Exp $ |
69 * $FreeBSD: head/sys/powerpc/include/bus.h 77957 2001-06-10 02:39:37Z benno $ | 69 * $FreeBSD: head/sys/powerpc/include/bus.h 92842 2002-03-20 23:17:50Z alfred $ |
70 */ 71 72#ifndef _MACPPC_BUS_H_ 73#define _MACPPC_BUS_H_ 74 75#include <machine/pio.h> 76 77/* --- 17 unchanged lines hidden (view full) --- 95 96/* 97 * Access methods for bus resources and address space. 98 */ 99typedef u_int32_t bus_space_tag_t; 100typedef u_int32_t bus_space_handle_t; 101 102/* | 70 */ 71 72#ifndef _MACPPC_BUS_H_ 73#define _MACPPC_BUS_H_ 74 75#include <machine/pio.h> 76 77/* --- 17 unchanged lines hidden (view full) --- 95 96/* 97 * Access methods for bus resources and address space. 98 */ 99typedef u_int32_t bus_space_tag_t; 100typedef u_int32_t bus_space_handle_t; 101 102/* |
103 * int bus_space_map __P((bus_space_tag_t t, bus_addr_t addr, | 103 * int bus_space_map(bus_space_tag_t t, bus_addr_t addr, |
104 * bus_size_t size, int flags, bus_space_handle_t *bshp)); 105 * 106 * Map a region of bus space. 107 */ 108 109#define BUS_SPACE_MAP_CACHEABLE 0x01 110#define BUS_SPACE_MAP_LINEAR 0x02 111#define BUS_SPACE_MAP_PREFETCHABLE 0x04 --- 8 unchanged lines hidden (view full) --- 120 int stride = t & MACPPC_BUS_STRIDE_MASK; 121 122 *bshp = (bus_space_handle_t) 123 mapiodev(base + (addr << stride), size << stride); 124 return 0; 125} 126 127/* | 104 * bus_size_t size, int flags, bus_space_handle_t *bshp)); 105 * 106 * Map a region of bus space. 107 */ 108 109#define BUS_SPACE_MAP_CACHEABLE 0x01 110#define BUS_SPACE_MAP_LINEAR 0x02 111#define BUS_SPACE_MAP_PREFETCHABLE 0x04 --- 8 unchanged lines hidden (view full) --- 120 int stride = t & MACPPC_BUS_STRIDE_MASK; 121 122 *bshp = (bus_space_handle_t) 123 mapiodev(base + (addr << stride), size << stride); 124 return 0; 125} 126 127/* |
128 * int bus_space_unmap __P((bus_space_tag_t t, | 128 * int bus_space_unmap(bus_space_tag_t t, |
129 * bus_space_handle_t bsh, bus_size_t size)); 130 * 131 * Unmap a region of bus space. 132 */ 133 134#define bus_space_unmap(t, bsh, size) 135 136/* | 129 * bus_space_handle_t bsh, bus_size_t size)); 130 * 131 * Unmap a region of bus space. 132 */ 133 134#define bus_space_unmap(t, bsh, size) 135 136/* |
137 * int bus_space_subregion __P((bus_space_tag_t t, | 137 * int bus_space_subregion(bus_space_tag_t t, |
138 * bus_space_handle_t bsh, bus_size_t offset, bus_size_t size, 139 * bus_space_handle_t *nbshp)); 140 * 141 * Get a new handle for a subregion of an already-mapped area of bus space. 142 */ 143 144#define bus_space_subregion(t, bsh, offset, size, bshp) \ 145 ((*(bshp) = (bus_space_handle_t)__BA(t, bsh, offset)), 0) 146 147/* | 138 * bus_space_handle_t bsh, bus_size_t offset, bus_size_t size, 139 * bus_space_handle_t *nbshp)); 140 * 141 * Get a new handle for a subregion of an already-mapped area of bus space. 142 */ 143 144#define bus_space_subregion(t, bsh, offset, size, bshp) \ 145 ((*(bshp) = (bus_space_handle_t)__BA(t, bsh, offset)), 0) 146 147/* |
148 * int bus_space_alloc __P((bus_space_tag_t t, bus_addr_t rstart, | 148 * int bus_space_alloc(bus_space_tag_t t, bus_addr_t rstart, |
149 * bus_addr_t rend, bus_size_t size, bus_size_t align, 150 * bus_size_t boundary, int flags, bus_addr_t *addrp, 151 * bus_space_handle_t *bshp)); 152 * 153 * Allocate a region of bus space. 154 */ 155 156#if 0 157#define bus_space_alloc(t, rs, re, s, a, b, f, ap, hp) !!! unimplemented !!! 158#endif 159 160/* | 149 * bus_addr_t rend, bus_size_t size, bus_size_t align, 150 * bus_size_t boundary, int flags, bus_addr_t *addrp, 151 * bus_space_handle_t *bshp)); 152 * 153 * Allocate a region of bus space. 154 */ 155 156#if 0 157#define bus_space_alloc(t, rs, re, s, a, b, f, ap, hp) !!! unimplemented !!! 158#endif 159 160/* |
161 * int bus_space_free __P((bus_space_tag_t t, | 161 * int bus_space_free(bus_space_tag_t t, |
162 * bus_space_handle_t bsh, bus_size_t size)); 163 * 164 * Free a region of bus space. 165 */ 166#if 0 167#define bus_space_free(t, h, s) !!! unimplemented !!! 168#endif 169 170/* | 162 * bus_space_handle_t bsh, bus_size_t size)); 163 * 164 * Free a region of bus space. 165 */ 166#if 0 167#define bus_space_free(t, h, s) !!! unimplemented !!! 168#endif 169 170/* |
171 * u_intN_t bus_space_read_N __P((bus_space_tag_t tag, | 171 * u_intN_t bus_space_read_N(bus_space_tag_t tag, |
172 * bus_space_handle_t bsh, bus_size_t offset)); 173 * 174 * Read a 1, 2, 4, or 8 byte quantity from bus space 175 * described by tag/handle/offset. 176 */ 177 178#define bus_space_read_1(t, h, o) (in8(__BA(t, h, o))) 179#define bus_space_read_2(t, h, o) (in16rb(__BA(t, h, o))) --- 5 unchanged lines hidden (view full) --- 185#define bus_space_read_stream_1(t, h, o) (in8(__BA(t, h, o))) 186#define bus_space_read_stream_2(t, h, o) (in16(__BA(t, h, o))) 187#define bus_space_read_stream_4(t, h, o) (in32(__BA(t, h, o))) 188#if 0 /* Cause a link error for bus_space_read_stream_8 */ 189#define bus_space_read_8(t, h, o) !!! unimplemented !!! 190#endif 191 192/* | 172 * bus_space_handle_t bsh, bus_size_t offset)); 173 * 174 * Read a 1, 2, 4, or 8 byte quantity from bus space 175 * described by tag/handle/offset. 176 */ 177 178#define bus_space_read_1(t, h, o) (in8(__BA(t, h, o))) 179#define bus_space_read_2(t, h, o) (in16rb(__BA(t, h, o))) --- 5 unchanged lines hidden (view full) --- 185#define bus_space_read_stream_1(t, h, o) (in8(__BA(t, h, o))) 186#define bus_space_read_stream_2(t, h, o) (in16(__BA(t, h, o))) 187#define bus_space_read_stream_4(t, h, o) (in32(__BA(t, h, o))) 188#if 0 /* Cause a link error for bus_space_read_stream_8 */ 189#define bus_space_read_8(t, h, o) !!! unimplemented !!! 190#endif 191 192/* |
193 * void bus_space_read_multi_N __P((bus_space_tag_t tag, | 193 * void bus_space_read_multi_N(bus_space_tag_t tag, |
194 * bus_space_handle_t bsh, bus_size_t offset, 195 * u_intN_t *addr, size_t count)); 196 * 197 * Read `count' 1, 2, 4, or 8 byte quantities from bus space 198 * described by tag/handle/offset and copy into buffer provided. 199 */ 200 201#define bus_space_read_multi_1(t, h, o, a, c) do { \ --- 24 unchanged lines hidden (view full) --- 226 ins32(__BA(t, h, o), (a), (c)); \ 227 } while (0) 228 229#if 0 /* Cause a link error for bus_space_read_multi_stream_8 */ 230#define bus_space_read_multi_stream_8 !!! unimplemented !!! 231#endif 232 233/* | 194 * bus_space_handle_t bsh, bus_size_t offset, 195 * u_intN_t *addr, size_t count)); 196 * 197 * Read `count' 1, 2, 4, or 8 byte quantities from bus space 198 * described by tag/handle/offset and copy into buffer provided. 199 */ 200 201#define bus_space_read_multi_1(t, h, o, a, c) do { \ --- 24 unchanged lines hidden (view full) --- 226 ins32(__BA(t, h, o), (a), (c)); \ 227 } while (0) 228 229#if 0 /* Cause a link error for bus_space_read_multi_stream_8 */ 230#define bus_space_read_multi_stream_8 !!! unimplemented !!! 231#endif 232 233/* |
234 * void bus_space_read_region_N __P((bus_space_tag_t tag, | 234 * void bus_space_read_region_N(bus_space_tag_t tag, |
235 * bus_space_handle_t bsh, bus_size_t offset, 236 * u_intN_t *addr, size_t count)); 237 * 238 * Read `count' 1, 2, 4, or 8 byte quantities from bus space 239 * described by tag/handle and starting at `offset' and copy into 240 * buffer provided. 241 */ 242 --- 58 unchanged lines hidden (view full) --- 301 __asm __volatile("eieio; sync"); 302} 303 304#if 0 /* Cause a link error */ 305#define bus_space_read_region_stream_8 !!! unimplemented !!! 306#endif 307 308/* | 235 * bus_space_handle_t bsh, bus_size_t offset, 236 * u_intN_t *addr, size_t count)); 237 * 238 * Read `count' 1, 2, 4, or 8 byte quantities from bus space 239 * described by tag/handle and starting at `offset' and copy into 240 * buffer provided. 241 */ 242 --- 58 unchanged lines hidden (view full) --- 301 __asm __volatile("eieio; sync"); 302} 303 304#if 0 /* Cause a link error */ 305#define bus_space_read_region_stream_8 !!! unimplemented !!! 306#endif 307 308/* |
309 * void bus_space_write_N __P((bus_space_tag_t tag, | 309 * void bus_space_write_N(bus_space_tag_t tag, |
310 * bus_space_handle_t bsh, bus_size_t offset, 311 * u_intN_t value)); 312 * 313 * Write the 1, 2, 4, or 8 byte value `value' to bus space 314 * described by tag/handle/offset. 315 */ 316 317#define bus_space_write_1(t, h, o, v) out8(__BA(t, h, o), (v)) --- 4 unchanged lines hidden (view full) --- 322#define bus_space_write_stream_2(t, h, o, v) out16(__BA(t, h, o), (v)) 323#define bus_space_write_stream_4(t, h, o, v) out32(__BA(t, h, o), (v)) 324 325#if 0 /* Cause a link error for bus_space_write_8 */ 326#define bus_space_write_8 !!! unimplemented !!! 327#endif 328 329/* | 310 * bus_space_handle_t bsh, bus_size_t offset, 311 * u_intN_t value)); 312 * 313 * Write the 1, 2, 4, or 8 byte value `value' to bus space 314 * described by tag/handle/offset. 315 */ 316 317#define bus_space_write_1(t, h, o, v) out8(__BA(t, h, o), (v)) --- 4 unchanged lines hidden (view full) --- 322#define bus_space_write_stream_2(t, h, o, v) out16(__BA(t, h, o), (v)) 323#define bus_space_write_stream_4(t, h, o, v) out32(__BA(t, h, o), (v)) 324 325#if 0 /* Cause a link error for bus_space_write_8 */ 326#define bus_space_write_8 !!! unimplemented !!! 327#endif 328 329/* |
330 * void bus_space_write_multi_N __P((bus_space_tag_t tag, | 330 * void bus_space_write_multi_N(bus_space_tag_t tag, |
331 * bus_space_handle_t bsh, bus_size_t offset, 332 * const u_intN_t *addr, size_t count)); 333 * 334 * Write `count' 1, 2, 4, or 8 byte quantities from the buffer 335 * provided to bus space described by tag/handle/offset. 336 */ 337 338#define bus_space_write_multi_1(t, h, o, a, c) do { \ --- 20 unchanged lines hidden (view full) --- 359 outsl(__BA(t, h, o), (a), (c)); \ 360 } while (0) 361 362#if 0 363#define bus_space_write_multi_stream_8 !!! unimplemented !!! 364#endif 365 366/* | 331 * bus_space_handle_t bsh, bus_size_t offset, 332 * const u_intN_t *addr, size_t count)); 333 * 334 * Write `count' 1, 2, 4, or 8 byte quantities from the buffer 335 * provided to bus space described by tag/handle/offset. 336 */ 337 338#define bus_space_write_multi_1(t, h, o, a, c) do { \ --- 20 unchanged lines hidden (view full) --- 359 outsl(__BA(t, h, o), (a), (c)); \ 360 } while (0) 361 362#if 0 363#define bus_space_write_multi_stream_8 !!! unimplemented !!! 364#endif 365 366/* |
367 * void bus_space_write_region_N __P((bus_space_tag_t tag, | 367 * void bus_space_write_region_N(bus_space_tag_t tag, |
368 * bus_space_handle_t bsh, bus_size_t offset, 369 * const u_intN_t *addr, size_t count)); 370 * 371 * Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided 372 * to bus space described by tag/handle starting at `offset'. 373 */ 374 375static __inline void --- 57 unchanged lines hidden (view full) --- 433 __asm __volatile("eieio; sync"); 434} 435 436#if 0 437#define bus_space_write_region_stream_8 !!! unimplemented !!! 438#endif 439 440/* | 368 * bus_space_handle_t bsh, bus_size_t offset, 369 * const u_intN_t *addr, size_t count)); 370 * 371 * Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided 372 * to bus space described by tag/handle starting at `offset'. 373 */ 374 375static __inline void --- 57 unchanged lines hidden (view full) --- 433 __asm __volatile("eieio; sync"); 434} 435 436#if 0 437#define bus_space_write_region_stream_8 !!! unimplemented !!! 438#endif 439 440/* |
441 * void bus_space_set_multi_N __P((bus_space_tag_t tag, | 441 * void bus_space_set_multi_N(bus_space_tag_t tag, |
442 * bus_space_handle_t bsh, bus_size_t offset, u_intN_t val, 443 * size_t count)); 444 * 445 * Write the 1, 2, 4, or 8 byte value `val' to bus space described 446 * by tag/handle/offset `count' times. 447 */ 448 449static __inline void --- 57 unchanged lines hidden (view full) --- 507 __asm __volatile("eieio; sync"); 508} 509 510#if 0 511#define bus_space_set_multi_stream_8 !!! unimplemented !!! 512#endif 513 514/* | 442 * bus_space_handle_t bsh, bus_size_t offset, u_intN_t val, 443 * size_t count)); 444 * 445 * Write the 1, 2, 4, or 8 byte value `val' to bus space described 446 * by tag/handle/offset `count' times. 447 */ 448 449static __inline void --- 57 unchanged lines hidden (view full) --- 507 __asm __volatile("eieio; sync"); 508} 509 510#if 0 511#define bus_space_set_multi_stream_8 !!! unimplemented !!! 512#endif 513 514/* |
515 * void bus_space_set_region_N __P((bus_space_tag_t tag, | 515 * void bus_space_set_region_N(bus_space_tag_t tag, |
516 * bus_space_handle_t bsh, bus_size_t offset, u_intN_t val, 517 * size_t count)); 518 * 519 * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described 520 * by tag/handle starting at `offset'. 521 */ 522 523static __inline void --- 57 unchanged lines hidden (view full) --- 581 __asm __volatile("eieio; sync"); 582} 583 584#if 0 585#define bus_space_set_region_stream_8 !!! unimplemented !!! 586#endif 587 588/* | 516 * bus_space_handle_t bsh, bus_size_t offset, u_intN_t val, 517 * size_t count)); 518 * 519 * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described 520 * by tag/handle starting at `offset'. 521 */ 522 523static __inline void --- 57 unchanged lines hidden (view full) --- 581 __asm __volatile("eieio; sync"); 582} 583 584#if 0 585#define bus_space_set_region_stream_8 !!! unimplemented !!! 586#endif 587 588/* |
589 * void bus_space_copy_region_N __P((bus_space_tag_t tag, | 589 * void bus_space_copy_region_N(bus_space_tag_t tag, |
590 * bus_space_handle_t bsh1, bus_size_t off1, 591 * bus_space_handle_t bsh2, bus_size_t off2, 592 * size_t count)); 593 * 594 * Copy `count' 1, 2, 4, or 8 byte values from bus space starting 595 * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. 596 */ 597 598 /* XXX IMPLEMENT bus_space_copy_N() XXX */ 599 600/* 601 * Bus read/write barrier methods. 602 * | 590 * bus_space_handle_t bsh1, bus_size_t off1, 591 * bus_space_handle_t bsh2, bus_size_t off2, 592 * size_t count)); 593 * 594 * Copy `count' 1, 2, 4, or 8 byte values from bus space starting 595 * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. 596 */ 597 598 /* XXX IMPLEMENT bus_space_copy_N() XXX */ 599 600/* 601 * Bus read/write barrier methods. 602 * |
603 * void bus_space_barrier __P((bus_space_tag_t tag, | 603 * void bus_space_barrier(bus_space_tag_t tag, |
604 * bus_space_handle_t bsh, bus_size_t offset, 605 * bus_size_t len, int flags)); 606 * 607 * Note: the macppc does not currently require barriers, but we must 608 * provide the flags to MI code. 609 */ 610 611#define bus_space_barrier(t, h, o, l, f) \ --- 62 unchanged lines hidden (view full) --- 674 * bounce the transfer. If this value is 0, it will be 675 * ignored. 676 */ 677 bus_addr_t _bounce_thresh; 678 679 /* 680 * DMA mapping methods. 681 */ | 604 * bus_space_handle_t bsh, bus_size_t offset, 605 * bus_size_t len, int flags)); 606 * 607 * Note: the macppc does not currently require barriers, but we must 608 * provide the flags to MI code. 609 */ 610 611#define bus_space_barrier(t, h, o, l, f) \ --- 62 unchanged lines hidden (view full) --- 674 * bounce the transfer. If this value is 0, it will be 675 * ignored. 676 */ 677 bus_addr_t _bounce_thresh; 678 679 /* 680 * DMA mapping methods. 681 */ |
682 int (*_dmamap_create) __P((bus_dma_tag_t, bus_size_t, int, 683 bus_size_t, bus_size_t, int, bus_dmamap_t *)); 684 void (*_dmamap_destroy) __P((bus_dma_tag_t, bus_dmamap_t)); 685 int (*_dmamap_load) __P((bus_dma_tag_t, bus_dmamap_t, void *, 686 bus_size_t, struct proc *, int)); 687 int (*_dmamap_load_mbuf) __P((bus_dma_tag_t, bus_dmamap_t, 688 struct mbuf *, int)); 689 int (*_dmamap_load_uio) __P((bus_dma_tag_t, bus_dmamap_t, 690 struct uio *, int)); 691 int (*_dmamap_load_raw) __P((bus_dma_tag_t, bus_dmamap_t, 692 bus_dma_segment_t *, int, bus_size_t, int)); 693 void (*_dmamap_unload) __P((bus_dma_tag_t, bus_dmamap_t)); 694 void (*_dmamap_sync) __P((bus_dma_tag_t, bus_dmamap_t, 695 bus_addr_t, bus_size_t, int)); | 682 int (*_dmamap_create)(bus_dma_tag_t, bus_size_t, int, 683 bus_size_t, bus_size_t, int, bus_dmamap_t *); 684 void (*_dmamap_destroy)(bus_dma_tag_t, bus_dmamap_t); 685 int (*_dmamap_load)(bus_dma_tag_t, bus_dmamap_t, void *, 686 bus_size_t, struct proc *, int); 687 int (*_dmamap_load_mbuf)(bus_dma_tag_t, bus_dmamap_t, 688 struct mbuf *, int); 689 int (*_dmamap_load_uio)(bus_dma_tag_t, bus_dmamap_t, 690 struct uio *, int); 691 int (*_dmamap_load_raw)(bus_dma_tag_t, bus_dmamap_t, 692 bus_dma_segment_t *, int, bus_size_t, int); 693 void (*_dmamap_unload)(bus_dma_tag_t, bus_dmamap_t); 694 void (*_dmamap_sync)(bus_dma_tag_t, bus_dmamap_t, 695 bus_addr_t, bus_size_t, int); |
696 697 /* 698 * DMA memory utility functions. 699 */ | 696 697 /* 698 * DMA memory utility functions. 699 */ |
700 int (*_dmamem_alloc) __P((bus_dma_tag_t, bus_size_t, bus_size_t, 701 bus_size_t, bus_dma_segment_t *, int, int *, int)); 702 void (*_dmamem_free) __P((bus_dma_tag_t, 703 bus_dma_segment_t *, int)); 704 int (*_dmamem_map) __P((bus_dma_tag_t, bus_dma_segment_t *, 705 int, size_t, caddr_t *, int)); 706 void (*_dmamem_unmap) __P((bus_dma_tag_t, caddr_t, size_t)); 707 vm_offset_t (*_dmamem_mmap) __P((bus_dma_tag_t, bus_dma_segment_t *, 708 int, off_t, int, int)); | 700 int (*_dmamem_alloc)(bus_dma_tag_t, bus_size_t, bus_size_t, 701 bus_size_t, bus_dma_segment_t *, int, int *, int); 702 void (*_dmamem_free)(bus_dma_tag_t, bus_dma_segment_t *, int); 703 int (*_dmamem_map)(bus_dma_tag_t, bus_dma_segment_t *, 704 int, size_t, caddr_t *, int); 705 void (*_dmamem_unmap)(bus_dma_tag_t, caddr_t, size_t); 706 vm_offset_t (*_dmamem_mmap)(bus_dma_tag_t, bus_dma_segment_t *, 707 int, off_t, int, int); |
709}; 710 711#define bus_dmamap_create(t, s, n, m, b, f, p) \ 712 (*(t)->_dmamap_create)((t), (s), (n), (m), (b), (f), (p)) 713#define bus_dmamap_destroy(t, p) \ 714 (*(t)->_dmamap_destroy)((t), (p)) 715#define bus_dmamap_load(t, m, b, s, p, f) \ 716 (*(t)->_dmamap_load)((t), (m), (b), (s), (p), (f)) --- 42 unchanged lines hidden (view full) --- 759 * PUBLIC MEMBERS: these are used by machine-independent code. 760 */ 761 bus_size_t dm_mapsize; /* size of the mapping */ 762 int dm_nsegs; /* # valid segments in mapping */ 763 bus_dma_segment_t dm_segs[1]; /* segments; variable length */ 764}; 765 766#ifdef _MACPPC_BUS_DMA_PRIVATE | 708}; 709 710#define bus_dmamap_create(t, s, n, m, b, f, p) \ 711 (*(t)->_dmamap_create)((t), (s), (n), (m), (b), (f), (p)) 712#define bus_dmamap_destroy(t, p) \ 713 (*(t)->_dmamap_destroy)((t), (p)) 714#define bus_dmamap_load(t, m, b, s, p, f) \ 715 (*(t)->_dmamap_load)((t), (m), (b), (s), (p), (f)) --- 42 unchanged lines hidden (view full) --- 758 * PUBLIC MEMBERS: these are used by machine-independent code. 759 */ 760 bus_size_t dm_mapsize; /* size of the mapping */ 761 int dm_nsegs; /* # valid segments in mapping */ 762 bus_dma_segment_t dm_segs[1]; /* segments; variable length */ 763}; 764 765#ifdef _MACPPC_BUS_DMA_PRIVATE |
767int _bus_dmamap_create __P((bus_dma_tag_t, bus_size_t, int, bus_size_t, 768 bus_size_t, int, bus_dmamap_t *)); 769void _bus_dmamap_destroy __P((bus_dma_tag_t, bus_dmamap_t)); 770int _bus_dmamap_load __P((bus_dma_tag_t, bus_dmamap_t, void *, 771 bus_size_t, struct proc *, int)); 772int _bus_dmamap_load_mbuf __P((bus_dma_tag_t, bus_dmamap_t, 773 struct mbuf *, int)); 774int _bus_dmamap_load_uio __P((bus_dma_tag_t, bus_dmamap_t, 775 struct uio *, int)); 776int _bus_dmamap_load_raw __P((bus_dma_tag_t, bus_dmamap_t, 777 bus_dma_segment_t *, int, bus_size_t, int)); 778void _bus_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t)); 779void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, bus_addr_t, 780 bus_size_t, int)); | 766int _bus_dmamap_create(bus_dma_tag_t, bus_size_t, int, bus_size_t, 767 bus_size_t, int, bus_dmamap_t *); 768void _bus_dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); 769int _bus_dmamap_load(bus_dma_tag_t, bus_dmamap_t, void *, 770 bus_size_t, struct proc *, int); 771int _bus_dmamap_load_mbuf(bus_dma_tag_t, bus_dmamap_t, struct mbuf *, int); 772int _bus_dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t, struct uio *, int); 773int _bus_dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, 774 bus_dma_segment_t *, int, bus_size_t, int); 775void _bus_dmamap_unload(bus_dma_tag_t, bus_dmamap_t); 776void _bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t, 777 bus_size_t, int); |
781 | 778 |
782int _bus_dmamem_alloc __P((bus_dma_tag_t tag, bus_size_t size, | 779int _bus_dmamem_alloc(bus_dma_tag_t tag, bus_size_t size, |
783 bus_size_t alignment, bus_size_t boundary, | 780 bus_size_t alignment, bus_size_t boundary, |
784 bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags)); 785void _bus_dmamem_free __P((bus_dma_tag_t tag, bus_dma_segment_t *segs, 786 int nsegs)); 787int _bus_dmamem_map __P((bus_dma_tag_t tag, bus_dma_segment_t *segs, 788 int nsegs, size_t size, caddr_t *kvap, int flags)); 789void _bus_dmamem_unmap __P((bus_dma_tag_t tag, caddr_t kva, 790 size_t size)); 791vm_offset_t _bus_dmamem_mmap __P((bus_dma_tag_t tag, | 781 bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags); 782void _bus_dmamem_free(bus_dma_tag_t tag, bus_dma_segment_t *segs, int nsegs); 783int _bus_dmamem_map(bus_dma_tag_t tag, bus_dma_segment_t *segs, 784 int nsegs, size_t size, caddr_t *kvap, int flags); 785void _bus_dmamem_unmap(bus_dma_tag_t tag, caddr_t kva, 786 size_t size); 787vm_offset_t _bus_dmamem_mmap(bus_dma_tag_t tag, |
792 bus_dma_segment_t *segs, | 788 bus_dma_segment_t *segs, |
793 int nsegs, off_t off, int prot, int flags)); | 789 int nsegs, off_t off, int prot, int flags); |
794 | 790 |
795int _bus_dmamem_alloc_range __P((bus_dma_tag_t tag, bus_size_t size, | 791int _bus_dmamem_alloc_range(bus_dma_tag_t tag, bus_size_t size, |
796 bus_size_t alignment, bus_size_t boundary, 797 bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags, | 792 bus_size_t alignment, bus_size_t boundary, 793 bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags, |
798 vm_offset_t low, vm_offset_t high)); | 794 vm_offset_t low, vm_offset_t high); |
799 800#endif /* _MACPPC_BUS_DMA_PRIVATE */ 801 802#endif /* _MACPPC_BUS_H_ */ | 795 796#endif /* _MACPPC_BUS_DMA_PRIVATE */ 797 798#endif /* _MACPPC_BUS_H_ */ |