1 .\" $NetBSD: bus_dma.9,v 1.47 2009/02/20 00:13:57 dyoung Exp $
3 .\" Copyright (c) 1996, 1997, 1998, 2001, 2005, 2006 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
8 .\" NASA Ames Research Center.
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
19 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 .\" POSSIBILITY OF SUCH DAMAGE.
36 .Nm bus_dmamap_create ,
37 .Nm bus_dmamap_destroy ,
39 .Nm bus_dmamap_load_mbuf ,
40 .Nm bus_dmamap_load_uio ,
41 .Nm bus_dmamap_load_raw ,
42 .Nm bus_dmamap_unload ,
44 .Nm bus_dmamem_alloc ,
47 .Nm bus_dmamem_unmap ,
49 .Nm bus_dmatag_subregion ,
50 .Nm bus_dmatag_destroy
51 .Nd Bus and Machine Independent DMA Mapping Interface
55 .Fn bus_dmamap_create "bus_dma_tag_t tag" "bus_size_t size" "int nsegments" \
56 "bus_size_t maxsegsz" "bus_size_t boundary" "int flags" "bus_dmamap_t *dmamp"
58 .Fn bus_dmamap_destroy "bus_dma_tag_t tag" "bus_dmamap_t dmam"
60 .Fn bus_dmamap_load "bus_dma_tag_t tag" "bus_dmamap_t dmam" "void *buf" \
61 "bus_size_t buflen" "struct lwp *l" "int flags"
63 .Fn bus_dmamap_load_mbuf "bus_dma_tag_t tag" "bus_dmamap_t dmam" \
64 "struct mbuf *chain" "int flags"
66 .Fn bus_dmamap_load_uio "bus_dma_tag_t tag" "bus_dmamap_t dmam" \
67 "struct uio *uio" "int flags"
69 .Fn bus_dmamap_load_raw "bus_dma_tag_t tag" "bus_dmamap_t dmam" \
70 "bus_dma_segment_t *segs" "int nsegs" "bus_size_t size" "int flags"
72 .Fn bus_dmamap_unload "bus_dma_tag_t tag" "bus_dmamap_t dmam"
74 .Fn bus_dmamap_sync "bus_dma_tag_t tag" "bus_dmamap_t dmam" \
75 "bus_addr_t offset" "bus_size_t len" "int ops"
77 .Fn bus_dmamem_alloc "bus_dma_tag_t tag" "bus_size_t size" \
78 "bus_size_t alignment" "bus_size_t boundary" "bus_dma_segment_t *segs" \
79 "int nsegs" "int *rsegs" "int flags"
81 .Fn bus_dmamem_free "bus_dma_tag_t tag" "bus_dma_segment_t *segs" "int nsegs"
83 .Fn bus_dmamem_map "bus_dma_tag_t tag" "bus_dma_segment_t *segs" "int nsegs" \
84 "size_t size" "void **kvap" "int flags"
86 .Fn bus_dmamem_unmap "bus_dma_tag_t tag" "void *kva" "size_t size"
88 .Fn bus_dmamem_mmap "bus_dma_tag_t tag" "bus_dma_segment_t *segs" \
89 "int nsegs" "off_t off" "int prot" "int flags"
91 .Fn bus_dmatag_subregion "bus_dma_tag_t tag" "bus_addr_t min_addr" \
92 "bus_addr_t max_addr" "bus_dma_tag_t *newtag" "int flags"
94 .Fn bus_dmatag_destroy "bus_dma_tag_t tag"
96 Provide a bus- and machine-independent "DMA mapping interface."
98 All data structures, function prototypes, and macros will be defined
99 by the port-specific header
100 .Aq Pa machine/bus.h .
101 Note that this document
102 assumes the existence of types already defined by the current "bus.h"
105 Unless otherwise noted, all function calls in this interface may be
110 Individual implementations may name these structures whatever they
111 wish, providing that the external representations are:
112 .Bl -tag -width compact
114 A machine-dependent opaque type describing the implementation of
116 .It Fa bus_dma_segment_t
117 A structure with at least the following members:
123 The structure may have machine-dependent members and arbitrary layout.
128 are suitable for programming into
129 DMA controller address and length registers.
131 A pointer to a structure with at least the following members:
133 bus_size_t dm_maxsegsz;
134 bus_size_t dm_mapsize;
136 bus_dma_segment_t *dm_segs;
139 The structure may have machine-dependent members and arbitrary layout.
142 member indicates the maximum number of bytes that may be transferred by
143 any given DMA segment.
146 member indicates the size of the mapping.
147 A value of 0 indicates the mapping is invalid.
150 member may be an array of segments or a pointer to an
154 member indicates the number of segments in
158 .Bl -tag -width compact
159 .It Fn bus_dmamap_create "tag" "size" "nsegments" "maxsegsz" "boundary" "flags" "dmamp"
160 Allocates a DMA handle and initializes it according to the parameters
162 Arguments are as follows:
163 .Bl -tag -width nsegments -compact
165 This is the bus_dma_tag_t passed down from the parent driver via
166 .Fa \*[Lt]bus\*[Gt]_attach_args .
168 This is the maximum DMA transfer that can be mapped by the handle.
170 Number of segments the device can support in a single DMA transaction.
171 This may be the number of scatter-gather descriptors supported by the
174 The maximum number of bytes that may be transferred by any given DMA
175 segment and will be assigned to the
179 Some DMA controllers are not able to transfer data that crosses a
181 This argument allows this boundary to be specified.
182 The boundary lines begin at 0, and occur every
185 Mappings may begin on a boundary line but may not end on or
186 cross a boundary line.
187 If no boundary condition needs to be observed, a
189 argument of 0 should be used.
191 Flags are defined as follows:
192 .Bl -tag -width BUS_DMA_ALLOCNOW -compact
193 .It Dv BUS_DMA_WAITOK
194 It is safe to wait (sleep) for resources during this call.
195 .It Dv BUS_DMA_NOWAIT
196 It is not safe to wait (sleep) for resources during this call.
197 .It Dv BUS_DMA_ALLOCNOW
198 Perform any resource allocation this handle may need now.
199 If this is not specified, the allocation may be deferred to
200 .Fn bus_dmamap_load .
201 If this flag is specified,
203 will not block on resource
205 .It Dv BUS_DMA_BUS[1-4]
206 These flags are placeholders, and may be used by busses to provide
207 bus-dependent functionality.
210 This is a pointer to a bus_dmamap_t.
211 A DMA map will be allocated and pointed to by
213 upon successful completion of this routine.
215 is undefined if this routine fails.
218 Behavior is not defined if invalid arguments are passed to
219 .Fn bus_dmamap_create .
221 Returns 0 on success, or an error code to indicate mode of failure.
222 .It Fn bus_dmamap_destroy "tag" "dmam"
223 Frees all resources associated with a given DMA handle.
224 Arguments are as follows:
225 .Bl -tag -width dmam -compact
227 This is the bus_dma_tag_t passed down from the parent driver via
228 .Fa \*[Lt]bus\*[Gt]_attach_args .
230 The DMA handle to destroy.
233 In the event that the DMA handle contains a valid mapping,
234 the mapping will be unloaded via the same mechanism used by
235 .Fn bus_dmamap_unload .
237 Behavior is not defined if invalid arguments are passed to
238 .Fn bus_dmamap_destroy .
240 If given valid arguments,
241 .Fn bus_dmamap_destroy
243 .It Fn bus_dmamap_load "tag" "dmam" "buf" "buflen" "l" "flags"
244 Loads a DMA handle with mappings for a DMA transfer.
245 It assumes that all pages involved in a DMA transfer are wired.
246 Arguments are as follows:
247 .Bl -tag -width buflen -compact
249 This is the bus_dma_tag_t passed down from the parent driver via
250 .Fa \*[Lt]bus\*[Gt]_attach_args .
252 The DMA handle with which to map the transfer.
254 The buffer to be used for the DMA transfer.
256 The size of the buffer.
258 Used to indicate the address space in which the buffer is located.
261 the buffer is assumed to be in kernel space.
262 Otherwise, the buffer is assumed to be in lwp
266 are defined as follows:
267 .Bl -tag -width "BUS_DMA_STREAMING" -compact
268 .It Dv BUS_DMA_WAITOK
269 It is safe to wait (sleep) for resources during this call.
270 .It Dv BUS_DMA_NOWAIT
271 It is not safe to wait (sleep) for resources during this call.
272 .It Dv BUS_DMA_STREAMING
275 API assumes that there is coherency between memory and the device
276 performing the DMA transaction.
277 Some platforms, however, have special hardware, such as an
279 which may improve performance
280 of some types of DMA transactions, but which break the assumption
281 that there is coherency between memory and the device performing
283 This flag allows the use of this special hardware, provided that
284 the device is doing sequential, unidirectional transfers which
285 conform to certain alignment and size constraints defined by the
287 If the platform does not support the feature, or if the buffer being
288 loaded into the DMA map does not conform to the constraints required
289 for use of the feature, then this flag will be silently ignored.
290 Also refer to the use of this flag with the
294 This is a hint to the machine-dependent back-end that indicates the
295 mapping will be used only for a
296 .Em "device -\*[Gt] memory"
298 The back-end may perform optimizations based on this information.
300 This is a hint to the machine-dependent back-end that indicates the
301 mapping will be used only for a
302 .Em "memory -\*[Gt] device"
304 The back-end may perform optimizations based on this information.
305 .It Dv BUS_DMA_BUS[1-4]
306 These flags are placeholders, and may be used by busses to
307 provide bus-dependent functionality.
311 As noted above, if a DMA handle is created with
312 .Dv BUS_DMA_ALLOCNOW ,
318 fails, the mapping in
319 the DMA handle will be invalid.
320 It is the responsibility of the caller to clean up any inconsistent
321 device state resulting from incomplete iteration through the uio.
323 Behavior is not defined if invalid arguments are passed to
324 .Fn bus_dmamap_load .
326 Returns 0 on success, or an error code to indicate mode of failure.
327 .It Fn bus_dmamap_load_mbuf "tag" "dmam" "chain" "flags"
328 This is a variation of
330 which maps mbuf chains
332 Mbuf chains are assumed to be in kernel virtual address space.
333 .It Fn bus_dmamap_load_uio "tag" "dmam" "uio" "flags"
334 This is a variation of
336 which maps buffers pointed to by
339 Determination if the buffers are in user or kernel virtual address space
340 is done internally, according to
341 .Fa "uio-\*[Gt]uio_vmspace" .
347 .It Fn bus_dmamap_load_raw "tag" "dmam" "segs" "nsegs" "size" "flags"
348 This is a variation of
356 argument is an array of bus_dma_segment_t's filled in
358 .Fn bus_dmamem_alloc .
361 argument is the number of segments in the array.
364 argument is the size of the DMA transfer.
365 .It Fn bus_dmamap_unload "tag" "dmam"
366 Deletes the mappings for a given DMA handle.
367 Arguments are as follows:
368 .Bl -tag -width dmam -compact
370 This is the bus_dma_tag_t passed down from the parent driver via
371 .Fa \*[Lt]bus\*[Gt]_attach_args .
373 The DMA handle containing the mappings which are to be deleted.
376 If the DMA handle was created with
377 .Dv BUS_DMA_ALLOCNOW ,
378 .Fn bus_dmamap_unload
379 will not free the corresponding
380 resources which were allocated by
381 .Fn bus_dmamap_create .
382 This is to ensure that
385 on resources if the handle was created with
386 .Dv BUS_DMA_ALLOCNOW .
388 .Fn bus_dmamap_unload
389 will not perform any implicit synchronization of DMA buffers.
390 This must be done explicitly by
391 .Fn bus_dmamap_sync .
393 .Fn bus_dmamap_unload
396 member to its initial value assigned by
397 .Fn bus_dmamap_create .
399 Behavior is not defined if invalid arguments are passed to
400 .Fn bus_dmamap_unload .
402 If given valid arguments,
403 .Fn bus_dmamap_unload
405 .It Fn bus_dmamap_sync "tag" "dmam" "offset" "len" "ops"
406 Performs pre- and post-DMA operation cache and/or buffer synchronization.
407 Arguments are as follows:
408 .Bl -tag -width offset -compact
410 This is the bus_dma_tag_t passed down from the parent driver via
411 .Fa \*[Lt]bus\*[Gt]_attach_args .
413 The DMA mapping to be synchronized.
415 The offset into the DMA mapping to synchronize.
417 The length of the mapping from
421 One or more synchronization operation to perform.
422 The following DMA synchronization operations are defined:
423 .Bl -tag -width BUS_DMASYNC_POSTWRITE -compact
424 .It Dv BUS_DMASYNC_PREREAD
425 Perform any pre-read DMA cache and/or bounce operations.
426 .It Dv BUS_DMASYNC_POSTREAD
427 Perform any post-read DMA cache and/or bounce operations.
428 .It Dv BUS_DMASYNC_PREWRITE
429 Perform any pre-write DMA cache and/or bounce operations.
430 .It Dv BUS_DMASYNC_POSTWRITE
431 Perform any post-write DMA cache and/or bounce operations.
434 More than one operation may performed in a given synchronization call.
439 operations is not allowed, and behavior is undefined if this is attempted.
442 Synchronization operations are expressed from the perspective of
443 the host RAM, e.g., a
444 .Em "device -\*[Gt] memory"
448 .Em "memory -\*[Gt] device"
453 may consult state kept within the DMA map to determine if the memory
454 is mapped in a DMA coherent fashion.
457 may elect to skip certain expensive operations, such as flushing
461 for more information on this subject.
463 On platforms which implement a weak memory access ordering model,
465 will always cause the appropriate memory barriers to be issued.
467 This function exists to ensure that the host and the device have
468 a consistent view of a range of DMA memory, before and after
472 .Fn bus_dmamap_sync ,
473 involving multiple read-write use of a single mapping
474 might look like this:
476 bus_dmamap_load(...);
479 /* invalidate soon-to-be-stale cache blocks */
480 bus_dmamap_sync(..., BUS_DMASYNC_PREREAD);
484 /* copy from bounce */
485 bus_dmamap_sync(..., BUS_DMASYNC_POSTREAD);
487 /* read data now in driver-provided buffer */
491 /* data to be written now in driver-provided buffer */
493 /* flush write buffers and writeback, copy to bounce */
494 bus_dmamap_sync(..., BUS_DMASYNC_PREWRITE);
498 /* probably a no-op, but provided for consistency */
499 bus_dmamap_sync(..., BUS_DMASYNC_POSTWRITE);
502 bus_dmamap_unload(...);
507 be called to synchronize DMA buffers before and after a DMA operation.
512 be relied on to do this synchronization implicitly.
513 If DMA read and write operations are not preceded and followed by the
514 appropriate synchronization operations, behavior is undefined.
516 Behavior is not defined if invalid arguments are passed to
517 .Fn bus_dmamap_sync .
519 If given valid arguments,
522 .\" XXX: This does not work with all the arguments.
523 .It Fn bus_dmamem_alloc "tag" "size" "alignment" "boundary" "segs" "..."
524 Allocates memory that is "DMA safe" for the bus corresponding to the
527 The mapping of this memory is machine-dependent (or
528 "opaque"); machine-independent code is not to assume that the
529 addresses returned are valid in kernel virtual address space, or that
530 the addresses returned are system physical addresses.
531 The address value returned as part of
533 can thus not be used to program DMA controller address registers.
534 Only the values in the
536 array of a successfully loaded DMA map (using
537 .Fn bus_dmamap_load )
538 can be used for this purpose.
540 Allocations will always be rounded to the hardware page size.
541 Callers may wish to take advantage of this, and cluster allocation of small
543 Arguments are as follows:
544 .Bl -tag -width alignment -compact
546 This is the bus_dma_tag_t passed down from the parent driver via
547 .Fa \*[Lt]bus\*[Gt]_attach_args .
549 The amount of memory to allocate.
551 Each segment in the allocated memory will be aligned to this value.
552 If the alignment is less than a hardware page size, it will be rounded up
553 to the hardware page size.
554 This value must be a power of two.
556 Each segment in the allocated memory must not cross this boundary
558 This value must be a power of two.
559 A boundary value less than the size of the allocation is invalid.
561 An array of bus_dma_segment_t's, filled in as memory is allocated,
562 representing the opaque addresses of the memory chunks.
564 Specifies the number of segments in
566 and this is the maximum number
567 of segments that the allocated memory may contain.
569 Used to return the actual number of segments the memory contains.
571 Flags are defined as follows:
572 .Bl -tag -width BUS_DMA_STREAMING -compact
573 .It Dv BUS_DMA_WAITOK
574 It is safe to wait (sleep) for resources during this call.
575 .It Dv BUS_DMA_NOWAIT
576 It is not safe to wait (sleep) for resources during this call.
577 .It Dv BUS_DMA_STREAMING
578 Adjusts, if necessary, the size, alignment, and boundary constrains
579 to conform to the platform-dependent requirements for the use of the
580 .Dv BUS_DMA_STREAMING
584 If the platform does not support the
585 .Dv BUS_DMA_STREAMING
586 feature, or if the size, alignment, and boundary constraints
587 would already satisfy the platform's requirements, this flag
590 .Dv BUS_DMA_STREAMING
591 flag will never relax the constraints specified in the call.
592 .It Dv BUS_DMA_BUS[1-4]
593 These flags are placeholders, and may be used by busses to provide
594 bus-dependent functionality.
598 All pages allocated by
601 until they are freed by
602 .Fn bus_dmamem_free .
604 Behavior is undefined if invalid arguments are passed to
605 .Fn bus_dmamem_alloc .
607 Returns 0 on success, or an error code indicating mode of failure.
608 .It Fn bus_dmamem_free "tag" "segs" "nsegs"
609 Frees memory previously allocated by
610 .Fn bus_dmamem_alloc .
613 Arguments are as follows:
614 .Bl -tag -width nsegs -compact
616 This is the bus_dma_tag_t passed down from the parent driver via
617 .Fa \*[Lt]bus\*[Gt]_attach_args .
619 The array of bus_dma_segment_t's filled in by
620 .Fn bus_dmamem_alloc .
622 The number of segments in
626 Behavior is undefined if invalid arguments are passed to
627 .Fn bus_dmamem_free .
629 If given valid arguments,
632 .It Fn bus_dmamem_map "tag" "segs" "nsegs" "size" "kvap" "flags"
633 Maps memory allocated with
635 into kernel virtual address space.
636 Arguments are as follows:
637 .Bl -tag -width flags -compact
639 This is the bus_dma_tag_t passed down from the parent driver via
640 .Fa \*[Lt]bus\*[Gt]_attach_args .
642 The array of bus_dma_segment_t's filled in by
643 .Fn bus_dmamem_alloc ,
644 representing the memory regions to map.
646 The number of segments in
649 The size of the mapping.
651 Filled in to specify the kernel virtual address where the memory is mapped.
653 Flags are defined as follows:
654 .Bl -tag -width BUS_DMA_COHERENT -compact
655 .It Dv BUS_DMA_WAITOK
656 It is safe to wait (sleep) for resources during this call.
657 .It Dv BUS_DMA_NOWAIT
658 It is not safe to wait (sleep) for resources during this call.
659 .It Dv BUS_DMA_BUS[1-4]
660 These flags are placeholders, and may be used by busses to provide
661 bus-dependent functionality.
662 .It Dv BUS_DMA_COHERENT
665 to machine-dependent code.
666 If possible, map the memory in such a way as it will be DMA coherent.
667 This may include mapping the pages into uncached address space or
668 setting the cache-inhibit bits in page table entries.
669 If DMA coherent mappings are impossible, this flag is silently ignored.
671 Later, when this memory is loaded into a DMA map, machine-dependent code
672 will take whatever steps are necessary to determine if the memory was
673 mapped in a DMA coherent fashion.
674 This may include checking if the kernel virtual address lies within
675 uncached address space or if the cache-inhibit bits are set in page
677 If it is determined that the mapping is DMA coherent, state may be
678 placed into the DMA map for use by later calls to
679 .Fn bus_dmamap_sync .
681 Note that a device driver must not rely on
683 for correct operation.
687 This flag is provided only as an optimization hint to machine-dependent code.
689 Also note that this flag only applies to coherency between the CPU
691 Coherency between memory and the device is controlled with a different flag.
692 See the description of the
695 .It Dv BUS_DMA_NOCACHE
698 to machine-dependent code.
699 If possible, map the uncached memory.
700 This flag may be useful in the case that the memory cache causes unexpected
701 behavior of the device.
705 Behavior is undefined if invalid arguments are passed to
708 Returns 0 on success, or an error code indicating mode of failure.
709 .It Fn bus_dmamem_unmap "tag" "kva" "size"
710 Unmaps memory previously mapped with
713 kernel virtual address space used by the mapping.
714 The arguments are as follows:
715 .Bl -tag -width size -compact
717 This is the bus_dma_tag_t passed down from the parent driver via
718 .Fa \*[Lt]bus\*[Gt]_attach_args .
720 The kernel virtual address of the mapped memory.
722 The size of the mapping.
725 Behavior is undefined if invalid arguments are passed to
726 .Fn bus_dmamem_unmap .
728 If given valid arguments,
731 .It Fn bus_dmamem_mmap "tag" "segs" "nsegs" "off" "prot" "flags"
732 Provides support for user
735 This function is to be called by a device driver's (*d_mmap)() entry
736 point, which is called by the device pager for each page to be mapped.
737 The arguments are as follows:
738 .Bl -tag -width nsegs -compact
740 This is the bus_dma_tag_t passed down from the parent driver via
741 .Fa \*[Lt]bus\*[Gt]_attach_args .
743 The array of bus_dma_segment_t's filled in by
744 .Fn bus_dmamem_alloc ,
745 representing the memory to be
748 The number of elements in the
752 The offset of the page in DMA memory which is to be mapped.
754 The protection codes for the mapping.
756 Flags are defined as follows:
757 .Bl -tag -width BUS_DMA_COHERENT -compact
758 .It Dv BUS_DMA_WAITOK
759 It is safe to wait (sleep) for resources during this call.
760 .It Dv BUS_DMA_NOWAIT
761 It is not safe to wait (sleep) for resources during this call.
762 .It Dv BUS_DMA_BUS[1-4]
763 These flags are placeholders, and may be used by busses to provide
764 bus-dependent functionality.
765 .It Dv BUS_DMA_COHERENT
768 above for a description of this flag.
769 .It Dv BUS_DMA_NOCACHE
772 above for a description of this flag.
776 Behavior is undefined if invalid arguments are passed
778 .Fn bus_dmamem_mmap .
780 Returns -1 to indicate failure.
781 Otherwise, returns an opaque value to be interpreted by the device pager.
782 .It Fn bus_dmatag_subregion "tag" "min_addr" "max_addr" "newtag" "flags"
783 Given a bus_dma_tag_t
784 create a new bus_dma_tag_t with a limited bus address space.
785 This function should not normally be used, but is useful for devices
786 that do not support the full address space of the parent bus.
787 The arguments are as follows:
788 .Bl -tag -width max_addr -compact
790 This is the bus_dma_tag_t to subregion.
792 The smallest address this new tag can address.
794 The largest address this new tag can address.
796 Pointer filled in with the address of the new bus_dma_tag_t.
798 Flags are defined as follows:
799 .Bl -tag -width BUS_DMA_WAITOK -compact
800 .It Dv BUS_DMA_WAITOK
801 It is safe to wait (sleep) for resources during this call.
802 .It Dv BUS_DMA_NOWAIT
803 It is not safe to wait (sleep) for resources during this call.
806 .It Fn bus_dmatag_destroy "tag"
807 Free a tag created by
808 .Fn bus_dmatag_subregion .
815 .%T "A Machine-Independent DMA Framework for NetBSD"
816 .%J "Proceedings of the FREENIX track: 1998 USENIX Annual Technical Conference"
823 interface appeared in
828 interface was designed and implemented by Jason R. Thorpe of the
829 Numerical Aerospace Simulation Facility, NASA Ames Research Center.
830 Additional input on the
832 design was provided by Chris Demetriou, Charles Hannum, Ross Harvey,
833 Matthew Jacob, Jonathan Stone, and Matt Thomas.