]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man9/bus_dma.9
Import the kyua test framework.
[FreeBSD/FreeBSD.git] / share / man / man9 / bus_dma.9
1 .\" Copyright (c) 2002, 2003 Hiten M. Pandya.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions, and the following disclaimer,
9 .\"    without modification, immediately at the beginning of the file.
10 .\" 2. The name of the author may not be used to endorse or promote products
11 .\"    derived from this software without specific prior written permission.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR, CONTRIBUTORS OR THE
17 .\" VOICES IN HITEN PANDYA'S HEAD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
19 .\" TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 .\" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22 .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 .\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .\" Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
26 .\" All rights reserved.
27 .\"
28 .\" This code is derived from software contributed to The NetBSD Foundation
29 .\" by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
30 .\" NASA Ames Research Center.
31 .\"
32 .\" Redistribution and use in source and binary forms, with or without
33 .\" modification, are permitted provided that the following conditions
34 .\" are met:
35 .\" 1. Redistributions of source code must retain the above copyright
36 .\"    notice, this list of conditions and the following disclaimer.
37 .\" 2. Redistributions in binary form must reproduce the above copyright
38 .\"    notice, this list of conditions and the following disclaimer in the
39 .\"    documentation and/or other materials provided with the distribution.
40 .\"
41 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
42 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
43 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
44 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
45 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
46 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
47 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
48 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
49 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
51 .\" POSSIBILITY OF SUCH DAMAGE.
52 .\"
53 .\" $FreeBSD$
54 .\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $
55 .\"
56 .Dd August 11, 2018
57 .Dt BUS_DMA 9
58 .Os
59 .Sh NAME
60 .Nm bus_dma ,
61 .Nm bus_dma_tag_create ,
62 .Nm bus_dma_tag_destroy ,
63 .Nm bus_dma_template_init ,
64 .Nm bus_dma_template_tag ,
65 .Nm bus_dma_template_clone ,
66 .Nm bus_dmamap_create ,
67 .Nm bus_dmamap_destroy ,
68 .Nm bus_dmamap_load ,
69 .Nm bus_dmamap_load_bio ,
70 .Nm bus_dmamap_load_ccb ,
71 .Nm bus_dmamap_load_mbuf ,
72 .Nm bus_dmamap_load_mbuf_sg ,
73 .Nm bus_dmamap_load_uio ,
74 .Nm bus_dmamap_unload ,
75 .Nm bus_dmamap_sync ,
76 .Nm bus_dmamem_alloc ,
77 .Nm bus_dmamem_free
78 .Nd Bus and Machine Independent DMA Mapping Interface
79 .Sh SYNOPSIS
80 .In machine/bus.h
81 .Ft int
82 .Fn bus_dma_tag_create "bus_dma_tag_t parent" "bus_size_t alignment" \
83 "bus_addr_t boundary" "bus_addr_t lowaddr" "bus_addr_t highaddr" \
84 "bus_dma_filter_t *filtfunc" "void *filtfuncarg" "bus_size_t maxsize" \
85 "int nsegments" "bus_size_t maxsegsz" "int flags" "bus_dma_lock_t *lockfunc" \
86 "void *lockfuncarg" "bus_dma_tag_t *dmat"
87 .Ft int
88 .Fn bus_dma_tag_destroy "bus_dma_tag_t dmat"
89 .Ft void
90 .Fo bus_dma_template_init
91 .Fa "bus_dma_template_t template"
92 .Fa "bus_dma_tag_t parent"
93 .Fc
94 .Ft int
95 .Fo bus_dma_template_tag
96 .Fa "bus_dma_template_t template"
97 .Fa "bus_dma_tag_t *dmat"
98 .Fc
99 .Ft void
100 .Fo bus_dma_template_clone
101 .Fa "bus_dma_template_t template"
102 .Fa "bus_dma_tag_t dmat"
103 .Fc
104 .Ft int
105 .Fn bus_dmamap_create "bus_dma_tag_t dmat" "int flags" "bus_dmamap_t *mapp"
106 .Ft int
107 .Fn bus_dmamap_destroy "bus_dma_tag_t dmat" "bus_dmamap_t map"
108 .Ft int
109 .Fn bus_dmamap_load "bus_dma_tag_t dmat" "bus_dmamap_t map" "void *buf" \
110 "bus_size_t buflen" "bus_dmamap_callback_t *callback" "void *callback_arg" \
111 "int flags"
112 .Ft int
113 .Fn bus_dmamap_load_bio "bus_dma_tag_t dmat" "bus_dmamap_t map" \
114 "struct bio *bio" "bus_dmamap_callback_t *callback" "void *callback_arg" \
115 "int flags"
116 .Ft int
117 .Fn bus_dmamap_load_ccb "bus_dma_tag_t dmat" "bus_dmamap_t map" \
118 "union ccb *ccb" "bus_dmamap_callback_t *callback" "void *callback_arg" \
119 "int flags"
120 .Ft int
121 .Fn bus_dmamap_load_mbuf "bus_dma_tag_t dmat" "bus_dmamap_t map" \
122 "struct mbuf *mbuf" "bus_dmamap_callback2_t *callback" "void *callback_arg" \
123 "int flags"
124 .Ft int
125 .Fn bus_dmamap_load_mbuf_sg "bus_dma_tag_t dmat" "bus_dmamap_t map" \
126 "struct mbuf *mbuf" "bus_dma_segment_t *segs" "int *nsegs" "int flags"
127 .Ft int
128 .Fn bus_dmamap_load_uio "bus_dma_tag_t dmat" "bus_dmamap_t map" \
129 "struct uio *uio" "bus_dmamap_callback2_t *callback" "void *callback_arg" \
130 "int flags"
131 .Ft void
132 .Fn bus_dmamap_unload "bus_dma_tag_t dmat" "bus_dmamap_t map"
133 .Ft void
134 .Fn bus_dmamap_sync "bus_dma_tag_t dmat" "bus_dmamap_t map" \
135 "op"
136 .Ft int
137 .Fn bus_dmamem_alloc "bus_dma_tag_t dmat" "void **vaddr" \
138 "int flags" "bus_dmamap_t *mapp"
139 .Ft void
140 .Fn bus_dmamem_free "bus_dma_tag_t dmat" "void *vaddr" \
141 "bus_dmamap_t map"
142 .Sh DESCRIPTION
143 Direct Memory Access (DMA) is a method of transferring data
144 without involving the CPU, thus providing higher performance.
145 A DMA transaction can be achieved between device to memory,
146 device to device, or memory to memory.
147 .Pp
148 The
149 .Nm
150 API is a bus, device, and machine-independent (MI) interface to
151 DMA mechanisms.
152 It provides the client with flexibility and simplicity by
153 abstracting machine dependent issues like setting up
154 DMA mappings, handling cache issues, bus specific features
155 and limitations.
156 .Sh OVERVIEW
157 A tag structure
158 .Vt ( bus_dma_tag_t )
159 is used to describe the properties of a group of related DMA
160 transactions.
161 One way to view this is that a tag describes the limitations of a DMA engine.
162 For example, if a DMA engine in a device is limited to 32-bit addresses,
163 that limitation is specified by a parameter when creating the tag
164 for that device.
165 Similarly, a tag can be marked as requiring buffers whose addresses are
166 aligned to a specific boundary.
167 .Pp
168 Some devices may require multiple tags to describe DMA
169 transactions with differing properties.
170 For example, a device might require 16-byte alignment of its descriptor ring
171 while permitting arbitrary alignment of I/O buffers.
172 In this case,
173 the driver must create one tag for the descriptor ring and a separate tag for
174 I/O buffers.
175 If a device has restrictions that are common to all DMA transactions
176 in addition to restrictions that differ between unrelated groups of
177 transactions,
178 the driver can first create a
179 .Dq parent
180 tag that decribes the common restrictions.
181 The per-group tags can then inherit these restrictions from this
182 .Dq parent
183 tag rather than having to list them explicitly when creating the per-group tags.
184 .Pp
185 A mapping structure
186 .Vt ( bus_dmamap_t )
187 represents a mapping of a memory region for DMA.
188 On systems with I/O MMUs,
189 the mapping structure tracks any I/O MMU entries used by a request.
190 For DMA requests that require bounce pages,
191 the mapping tracks the bounce pages used.
192 .Pp
193 To prepare for one or more DMA transactions,
194 a mapping must be bound to a memory region by calling one of the
195 .Fn bus_dmamap_load
196 functions.
197 These functions configure the mapping which can include programming entries
198 in an I/O MMU and/or allocating bounce pages.
199 An output of these functions
200 (either directly or indirectly by invoking a callback routine)
201 is the list of scatter/gather address ranges a consumer can pass to a DMA
202 engine to access the memory region.
203 When a mapping is no longer needed,
204 the mapping must be unloaded via
205 .Fn bus_dmamap_unload .
206 .Pp
207 Before and after each DMA transaction,
208 .Fn bus_dmamap_sync
209 must be used to ensure that the correct data is used by the DMA engine and
210 the CPU.
211 If a mapping uses bounce pages,
212 the sync operations copy data between the bounce pages and the memory region
213 bound to the mapping.
214 Sync operations also handle architecture-specific details such as CPU cache
215 flushing and CPU memory operation ordering.
216 .Sh STATIC VS DYNAMIC
217 .Nm
218 handles two types of DMA transactions: static and dynamic.
219 Static transactions are used with a long-lived memory region that is reused
220 for many transactions such as a descriptor ring.
221 Dynamic transactions are used for transfers to or from transient buffers
222 such as I/O buffers holding a network packet or disk block.
223 Each transaction type uses a different subset of the
224 .Nm
225 API.
226 .Ss Static Transactions
227 Static transactions use memory regions allocated by
228 .Nm .
229 Each static memory region is allocated by calling
230 .Fn bus_dmamem_alloc .
231 This function requires a valid tag describing the properties of the
232 DMA transactions to this region such as alignment or address restrictions.
233 Multiple regions can share a single tag if they share the same restrictions.
234 .Pp
235 .Fn bus_dmamem_alloc
236 allocates a memory region along with a mapping object.
237 The associated tag, memory region, and mapping object must then be passed to
238 .Fn bus_dmamap_load
239 to bind the mapping to the allocated region and obtain the
240 scatter/gather list.
241 .Pp
242 It is expected that
243 .Fn bus_dmamem_alloc
244 will attempt to allocate memory requiring less expensive sync operations
245 (for example, implementations should not allocate regions requiring bounce
246 pages),
247 but sync operations should still be used.
248 For example, a driver should use
249 .Fn bus_dmamap_sync
250 in an interrupt handler before reading descriptor ring entries written by the
251 device prior to the interrupt.
252 .Pp
253 When a consumer is finished with a memory region,
254 it should unload the mapping via
255 .Fn bus_dmamap_unload
256 and then release the memory region and mapping object via
257 .Fn bus_dmamem_free .
258 .Ss Dynamic Transactions
259 Dynamic transactions map memory regions provided by other parts of the system.
260 A tag must be created via
261 .Fn bus_dma_tag_create
262 to describe the DMA transactions to and from these memory regions,
263 and a pool of mapping objects must be allocated via
264 .Fn bus_dmamap_create
265 to track the mappings of any in-flight transactions.
266 .Pp
267 When a consumer wishes to schedule a transaction for a memory region,
268 the consumer must first obtain an unused mapping object from its pool
269 of mapping objects.
270 The memory region must be bound to the mapping object via one of the
271 .Fn bus_dmamap_load
272 functions.
273 Before scheduling the transaction,
274 the consumer should sync the memory region via
275 .Fn bus_dmamap_sync
276 with one or more of the
277 .Dq PRE
278 flags.
279 After the transaction has completed,
280 the consumer should sync the memory region via
281 .Fn bus_dmamap_sync
282 with one or more of the
283 .Dq POST
284 flags.
285 The mapping can then be unloaded via
286 .Fn bus_dmamap_unload ,
287 and the mapping object can be returned to the pool of unused mapping objects.
288 .Pp
289 When a consumer is no longer scheduling DMA transactions,
290 the mapping objects should be freed via
291 .Fn bus_dmamap_destroy ,
292 and the tag should be freed via
293 .Fn bus_dma_tag_destroy .
294 .Sh STRUCTURES AND TYPES
295 .Bl -tag -width indent
296 .It Vt bus_dma_tag_t
297 A machine-dependent (MD) opaque type that describes the
298 characteristics of a group of DMA transactions.
299 DMA tags are organized into a hierarchy, with each child
300 tag inheriting the restrictions of its parent.
301 This allows all devices along the path of DMA transactions
302 to contribute to the constraints of those transactions.
303 .It Vt bus_dma_template_t
304 A template structure for creating a
305 .Fa bus_dma_tag_t
306 from a set of defaults.
307 Once initialized with
308 .Fn bus_dma_template_init ,
309 a driver can over-ride individual fields to suit its needs.
310 The following fields have the indicated values:
311 .Bd -literal
312         alignment       1
313         boundary        0
314         lowaddr         BUS_SPACE_MAXADDR
315         highaddr        BUS_SPACE_MAXADDR
316         maxsize         BUS_SPACE_MAXSIZE
317         nsegments       BUS_SPACE_UNRESTRICTED
318         maxsegsize      BUS_SPACE_MAXSIZE
319         flags           0
320         lockfunc        NULL
321         lockfuncarg     NULL
322 .Ed
323 .Pp
324 Descriptions of each field are documented with
325 .Fn bus_dma_tag_create .
326 Note that the
327 .Fa filtfunc
328 and
329 .Fa filtfuncarg
330 attributes of the DMA tag are not supported with templates.
331 .It Vt bus_dma_filter_t
332 Client specified address filter having the format:
333 .Bl -tag -width indent
334 .It Ft int
335 .Fn "client_filter" "void *filtarg" "bus_addr_t testaddr"
336 .El
337 .Pp
338 Address filters can be specified during tag creation to allow
339 for devices whose DMA address restrictions cannot be specified
340 by a single window.
341 The
342 .Fa filtarg
343 argument is specified by the client during tag creation to be passed to all
344 invocations of the callback.
345 The
346 .Fa testaddr
347 argument contains a potential starting address of a DMA mapping.
348 The filter function operates on the set of addresses from
349 .Fa testaddr
350 to
351 .Ql trunc_page(testaddr) + PAGE_SIZE - 1 ,
352 inclusive.
353 The filter function should return zero if any mapping in this range
354 can be accommodated by the device and non-zero otherwise.
355 .It Vt bus_dma_segment_t
356 A machine-dependent type that describes individual
357 DMA segments.
358 It contains the following fields:
359 .Bd -literal
360         bus_addr_t      ds_addr;
361         bus_size_t      ds_len;
362 .Ed
363 .Pp
364 The
365 .Fa ds_addr
366 field contains the device visible address of the DMA segment, and
367 .Fa ds_len
368 contains the length of the DMA segment.
369 Although the DMA segments returned by a mapping call will adhere to
370 all restrictions necessary for a successful DMA operation, some conversion
371 (e.g.\& a conversion from host byte order to the device's byte order) is
372 almost always required when presenting segment information to the device.
373 .It Vt bus_dmamap_t
374 A machine-dependent opaque type describing an individual mapping.
375 One map is used for each memory allocation that will be loaded.
376 Maps can be reused once they have been unloaded.
377 Multiple maps can be associated with one DMA tag.
378 While the value of the map may evaluate to
379 .Dv NULL
380 on some platforms under certain conditions,
381 it should never be assumed that it will be
382 .Dv NULL
383 in all cases.
384 .It Vt bus_dmamap_callback_t
385 Client specified callback for receiving mapping information resulting from
386 the load of a
387 .Vt bus_dmamap_t
388 via
389 .Fn bus_dmamap_load ,
390 .Fn bus_dmamap_load_bio
391 or
392 .Fn bus_dmamap_load_ccb .
393 Callbacks are of the format:
394 .Bl -tag -width indent
395 .It Ft void
396 .Fn "client_callback" "void *callback_arg" "bus_dma_segment_t *segs" \
397 "int nseg" "int error"
398 .El
399 .Pp
400 The
401 .Fa callback_arg
402 is the callback argument passed to dmamap load functions.
403 The
404 .Fa segs
405 and
406 .Fa nseg
407 arguments describe an array of
408 .Vt bus_dma_segment_t
409 structures that represent the mapping.
410 This array is only valid within the scope of the callback function.
411 The success or failure of the mapping is indicated by the
412 .Fa error
413 argument.
414 More information on the use of callbacks can be found in the
415 description of the individual dmamap load functions.
416 .It Vt bus_dmamap_callback2_t
417 Client specified callback for receiving mapping information resulting from
418 the load of a
419 .Vt bus_dmamap_t
420 via
421 .Fn bus_dmamap_load_uio
422 or
423 .Fn bus_dmamap_load_mbuf .
424 .Pp
425 Callback2s are of the format:
426 .Bl -tag -width indent
427 .It Ft void
428 .Fn "client_callback2" "void *callback_arg" "bus_dma_segment_t *segs" \
429 "int nseg" "bus_size_t mapsize" "int error"
430 .El
431 .Pp
432 Callback2's behavior is the same as
433 .Vt bus_dmamap_callback_t
434 with the addition that the length of the data mapped is provided via
435 .Fa mapsize .
436 .It Vt bus_dmasync_op_t
437 Memory synchronization operation specifier.
438 Bus DMA requires explicit synchronization of memory with its device
439 visible mapping in order to guarantee memory coherency.
440 The
441 .Vt bus_dmasync_op_t
442 allows the type of DMA operation that will be or has been performed
443 to be communicated to the system so that the correct coherency measures
444 are taken.
445 The operations are represented as bitfield flags that can be combined together,
446 though it only makes sense to combine PRE flags or POST flags, not both.
447 See the
448 .Fn bus_dmamap_sync
449 description below for more details on how to use these operations.
450 .Pp
451 All operations specified below are performed from the host memory point of view,
452 where a read implies data coming from the device to the host memory, and a write
453 implies data going from the host memory to the device.
454 Alternatively, the operations can be thought of in terms of driver operations,
455 where reading a network packet or storage sector corresponds to a read operation
456 in
457 .Nm .
458 .Bl -tag -width ".Dv BUS_DMASYNC_POSTWRITE"
459 .It Dv BUS_DMASYNC_PREREAD
460 Perform any synchronization required prior to an update of host memory by the
461 device.
462 .It Dv BUS_DMASYNC_PREWRITE
463 Perform any synchronization required after an update of host memory by the CPU
464 and prior to device access to host memory.
465 .It Dv BUS_DMASYNC_POSTREAD
466 Perform any synchronization required after an update of host memory by the
467 device and prior to CPU access to host memory.
468 .It Dv BUS_DMASYNC_POSTWRITE
469 Perform any synchronization required after device access to host memory.
470 .El
471 .It Vt bus_dma_lock_t
472 Client specified lock/mutex manipulation method.
473 This will be called from
474 within busdma whenever a client lock needs to be manipulated.
475 In its current form, the function will be called immediately before
476 the callback for a DMA load operation that has been deferred with
477 .Dv BUS_DMA_LOCK
478 and immediately after with
479 .Dv BUS_DMA_UNLOCK .
480 If the load operation does not need to be deferred, then it
481 will not be called since the function loading the map should
482 be holding the appropriate locks.
483 This method is of the format:
484 .Bl -tag -width indent
485 .It Ft void
486 .Fn "lockfunc" "void *lockfunc_arg" "bus_dma_lock_op_t op"
487 .El
488 .Pp
489 The
490 .Fa lockfuncarg
491 argument is specified by the client during tag creation to be passed to all
492 invocations of the callback.
493 The
494 .Fa op
495 argument specifies the lock operation to perform.
496 .Pp
497 Two
498 .Vt lockfunc
499 implementations are provided for convenience.
500 .Fn busdma_lock_mutex
501 performs standard mutex operations on the sleep mutex provided via
502 .Fa lockfuncarg .
503 .Fn dflt_lock
504 will generate a system panic if it is called.
505 It is substituted into the tag when
506 .Fa lockfunc
507 is passed as
508 .Dv NULL
509 to
510 .Fn bus_dma_tag_create
511 and is useful for tags that should not be used with deferred load operations.
512 .It Vt bus_dma_lock_op_t
513 Operations to be performed by the client-specified
514 .Fn lockfunc .
515 .Bl -tag -width ".Dv BUS_DMA_UNLOCK"
516 .It Dv BUS_DMA_LOCK
517 Acquires and/or locks the client locking primitive.
518 .It Dv BUS_DMA_UNLOCK
519 Releases and/or unlocks the client locking primitive.
520 .El
521 .El
522 .Sh FUNCTIONS
523 .Bl -tag -width indent
524 .It Fn bus_dma_tag_create "parent" "alignment" "boundary" "lowaddr" \
525 "highaddr" "*filtfunc" "*filtfuncarg" "maxsize" "nsegments" "maxsegsz" \
526 "flags" "lockfunc" "lockfuncarg" "*dmat"
527 Allocates a DMA tag, and initializes it according to
528 the arguments provided:
529 .Bl -tag -width ".Fa filtfuncarg"
530 .It Fa parent
531 A parent tag from which to inherit restrictions.
532 The restrictions passed in other arguments can only further tighten the
533 restrictions inherited from the parent tag.
534 .Pp
535 All tags created by a device driver must inherit from the tag returned by
536 .Fn bus_get_dma_tag
537 to honor restrictions between the parent bridge, CPU memory, and the
538 device.
539 .It Fa alignment
540 Alignment constraint, in bytes, of any mappings created using this tag.
541 The alignment must be a power of 2.
542 Hardware that can DMA starting at any address would specify
543 .Em 1
544 for byte alignment.
545 Hardware requiring DMA transfers to start on a multiple of 4K
546 would specify
547 .Em 4096 .
548 .It Fa boundary
549 Boundary constraint, in bytes, of the target DMA memory region.
550 The boundary indicates the set of addresses, all multiples of the
551 boundary argument, that cannot be crossed by a single
552 .Vt bus_dma_segment_t .
553 The boundary must be a power of 2 and must be no smaller than the
554 maximum segment size.
555 .Ql 0
556 indicates that there are no boundary restrictions.
557 .It Fa lowaddr , highaddr
558 Bounds of the window of bus address space that
559 .Em cannot
560 be directly accessed by the device.
561 The window contains all addresses greater than
562 .Fa lowaddr
563 and less than or equal to
564 .Fa highaddr .
565 For example, a device incapable of DMA above 4GB, would specify a
566 .Fa highaddr
567 of
568 .Dv BUS_SPACE_MAXADDR
569 and a
570 .Fa lowaddr
571 of
572 .Dv BUS_SPACE_MAXADDR_32BIT .
573 Similarly a device that can only perform DMA to addresses below
574 16MB would specify a
575 .Fa highaddr
576 of
577 .Dv BUS_SPACE_MAXADDR
578 and a
579 .Fa lowaddr
580 of
581 .Dv BUS_SPACE_MAXADDR_24BIT .
582 Some implementations require that some region of device visible
583 address space, overlapping available host memory, be outside the
584 window.
585 This area of
586 .Ql safe memory
587 is used to bounce requests that would otherwise conflict with
588 the exclusion window.
589 .It Fa filtfunc
590 Optional filter function (may be
591 .Dv NULL )
592 to be called for any attempt to
593 map memory into the window described by
594 .Fa lowaddr
595 and
596 .Fa highaddr .
597 A filter function is only required when the single window described
598 by
599 .Fa lowaddr
600 and
601 .Fa highaddr
602 cannot adequately describe the constraints of the device.
603 The filter function will be called for every machine page
604 that overlaps the exclusion window.
605 .It Fa filtfuncarg
606 Argument passed to all calls to the filter function for this tag.
607 May be
608 .Dv NULL .
609 .It Fa maxsize
610 Maximum size, in bytes, of the sum of all segment lengths in a given
611 DMA mapping associated with this tag.
612 .It Fa nsegments
613 Number of discontinuities (scatter/gather segments) allowed
614 in a DMA mapped region.
615 If there is no restriction,
616 .Dv BUS_SPACE_UNRESTRICTED
617 may be specified.
618 .It Fa maxsegsz
619 Maximum size, in bytes, of a segment in any DMA mapped region associated
620 with
621 .Fa dmat .
622 .It Fa flags
623 Are as follows:
624 .Bl -tag -width ".Dv BUS_DMA_ALLOCNOW"
625 .It Dv BUS_DMA_ALLOCNOW
626 Pre-allocate enough resources to handle at least one map load operation on
627 this tag.
628 If sufficient resources are not available,
629 .Er ENOMEM
630 is returned.
631 This should not be used for tags that only describe buffers that will be
632 allocated with
633 .Fn bus_dmamem_alloc .
634 Also, due to resource sharing with other tags, this flag does not guarantee
635 that resources will be allocated or reserved exclusively for this tag.
636 It should be treated only as a minor optimization.
637 .It Dv BUS_DMA_COHERENT
638 Indicate that the DMA engine and CPU are cache-coherent.
639 Cached memory may be used to back allocations created by
640 .Fn bus_dmamem_alloc .
641 For
642 .Fn bus_dma_tag_create ,
643 the
644 .Dv BUS_DMA_COHERENT
645 flag is currently implemented on arm64.
646 .El
647 .It Fa lockfunc
648 Optional lock manipulation function (may be
649 .Dv NULL )
650 to be called when busdma
651 needs to manipulate a lock on behalf of the client.
652 If
653 .Dv NULL
654 is specified,
655 .Fn dflt_lock
656 is used.
657 .It Fa lockfuncarg
658 Optional argument to be passed to the function specified by
659 .Fa lockfunc .
660 .It Fa dmat
661 Pointer to a bus_dma_tag_t where the resulting DMA tag will
662 be stored.
663 .El
664 .Pp
665 Returns
666 .Er ENOMEM
667 if sufficient memory is not available for tag creation
668 or allocating mapping resources.
669 .It Fn bus_dma_tag_destroy "dmat"
670 Deallocate the DMA tag
671 .Fa dmat
672 that was created by
673 .Fn bus_dma_tag_create .
674 .Pp
675 Returns
676 .Er EBUSY
677 if any DMA maps remain associated with
678 .Fa dmat
679 or
680 .Ql 0
681 on success.
682 .It Fn bus_dma_template_init "*template" "parent"
683 Initializes a
684 .Fa bus_dma_template_t
685 structure and associates it with an optional 
686 .Fa parent .
687 The
688 .Fa parent
689 argument may be NULL.
690 .It Fn bus_dma_template_tag "*template" "*dmat"
691 Unpacks a template into a tag, and returns the tag via the
692 .Fa dmat .
693 All return values are identical to
694 .Fn bus_dma_tag_create .
695 .It Fn bus_dma_template_clone "*template" "dmat"
696 Clones the fields from a tag to a template.
697 This is useful for cloning tags when paired with
698 .Fn bus_dma_template_tag .
699 A template that is filled in as a clone does not need to be initialized
700 first.
701 .It Fn bus_dmamap_create "dmat" "flags" "*mapp"
702 Allocates and initializes a DMA map.
703 Arguments are as follows:
704 .Bl -tag -width ".Fa nsegments"
705 .It Fa dmat
706 DMA tag.
707 .It Fa flags
708 Are as follows:
709 .Bl -tag -width ".Dv BUS_DMA_COHERENT"
710 .It Dv BUS_DMA_COHERENT
711 Attempt to map the memory loaded with this map such that cache sync
712 operations are as cheap as possible.
713 This flag is typically set on maps when the memory loaded with these will
714 be accessed by both a CPU and a DMA engine, frequently such as control data
715 and as opposed to streamable data such as receive and transmit buffers.
716 Use of this flag does not remove the requirement of using
717 .Fn bus_dmamap_sync ,
718 but it may reduce the cost of performing these operations.
719 .El
720 .It Fa mapp
721 Pointer to a
722 .Vt bus_dmamap_t
723 where the resulting DMA map will be stored.
724 .El
725 .Pp
726 Returns
727 .Er ENOMEM
728 if sufficient memory is not available for creating the
729 map or allocating mapping resources.
730 .It Fn bus_dmamap_destroy "dmat" "map"
731 Frees all resources associated with a given DMA map.
732 Arguments are as follows:
733 .Bl -tag -width ".Fa dmat"
734 .It Fa dmat
735 DMA tag used to allocate
736 .Fa map .
737 .It Fa map
738 The DMA map to destroy.
739 .El
740 .Pp
741 Returns
742 .Er EBUSY
743 if a mapping is still active for
744 .Fa map .
745 .It Fn bus_dmamap_load "dmat" "map" "buf" "buflen" "*callback" \
746 "callback_arg" "flags"
747 Creates a mapping in device visible address space of
748 .Fa buflen
749 bytes of
750 .Fa buf ,
751 associated with the DMA map
752 .Fa map .
753 This call will always return immediately and will not block for any reason.
754 Arguments are as follows:
755 .Bl -tag -width ".Fa buflen"
756 .It Fa dmat
757 DMA tag used to allocate
758 .Fa map .
759 .It Fa map
760 A DMA map without a currently active mapping.
761 .It Fa buf
762 A kernel virtual address pointer to a contiguous (in KVA) buffer, to be
763 mapped into device visible address space.
764 .It Fa buflen
765 The size of the buffer.
766 .It Fa callback Fa callback_arg
767 The callback function, and its argument.
768 This function is called once sufficient mapping resources are available for
769 the DMA operation.
770 If resources are temporarily unavailable, this function will be deferred until
771 later, but the load operation will still return immediately to the caller.
772 Thus, callers should not assume that the callback will be called before the
773 load returns, and code should be structured appropriately to handle this.
774 See below for specific flags and error codes that control this behavior.
775 .It Fa flags
776 Are as follows:
777 .Bl -tag -width ".Dv BUS_DMA_NOWAIT"
778 .It Dv BUS_DMA_NOWAIT
779 The load should not be deferred in case of insufficient mapping resources,
780 and instead should return immediately with an appropriate error.
781 .It Dv BUS_DMA_NOCACHE
782 The generated transactions to and from the virtual page are non-cacheable.
783 .El
784 .El
785 .Pp
786 Return values to the caller are as follows:
787 .Bl -tag -width ".Er EINPROGRESS"
788 .It 0
789 The callback has been called and completed.
790 The status of the mapping has been delivered to the callback.
791 .It Er EINPROGRESS
792 The mapping has been deferred for lack of resources.
793 The callback will be called as soon as resources are available.
794 Callbacks are serviced in FIFO order.
795 .Pp
796 Note that subsequent load operations for the same tag that do not require
797 extra resources will still succeed.
798 This may result in out-of-order processing of requests.
799 If the caller requires the order of requests to be preserved,
800 then the caller is required to stall subsequent requests until a pending
801 request's callback is invoked.
802 .It Er ENOMEM
803 The load request has failed due to insufficient resources, and the caller
804 specifically used the
805 .Dv BUS_DMA_NOWAIT
806 flag.
807 .It Er EINVAL
808 The load request was invalid.
809 The callback has been called and has been provided the same error.
810 This error value may indicate that
811 .Fa dmat ,
812 .Fa map ,
813 .Fa buf ,
814 or
815 .Fa callback
816 were invalid, or
817 .Fa buflen
818 was larger than the
819 .Fa maxsize
820 argument used to create the dma tag
821 .Fa dmat .
822 .El
823 .Pp
824 When the callback is called, it is presented with an error value
825 indicating the disposition of the mapping.
826 Error may be one of the following:
827 .Bl -tag -width ".Er EINPROGRESS"
828 .It 0
829 The mapping was successful and the
830 .Fa dm_segs
831 callback argument contains an array of
832 .Vt bus_dma_segment_t
833 elements describing the mapping.
834 This array is only valid during the scope of the callback function.
835 .It Er EFBIG
836 A mapping could not be achieved within the segment constraints provided
837 in the tag even though the requested allocation size was less than maxsize.
838 .El
839 .It Fn bus_dmamap_load_bio "dmat" "map" "bio" "callback" "callback_arg" "flags"
840 This is a variation of
841 .Fn bus_dmamap_load
842 which maps buffers pointed to by
843 .Fa bio
844 for DMA transfers.
845 .Fa bio
846 may point to either a mapped or unmapped buffer.
847 .It Fn bus_dmamap_load_ccb "dmat" "map" "ccb" "callback" "callback_arg" "flags"
848 This is a variation of
849 .Fn bus_dmamap_load
850 which maps data pointed to by
851 .Fa ccb
852 for DMA transfers.
853 The data for
854 .Fa ccb
855 may be any of the following types:
856 .Bl -tag -width ".Er CAM_DATA_SG_PADDR"
857 .It CAM_DATA_VADDR
858 The data is a single KVA buffer.
859 .It CAM_DATA_PADDR
860 The data is a single bus address range.
861 .It CAM_DATA_SG
862 The data is a scatter/gather list of KVA buffers.
863 .It CAM_DATA_SG_PADDR
864 The data is a scatter/gather list of bus address ranges.
865 .It CAM_DATA_BIO
866 The data is contained in a
867 .Vt struct bio
868 attached to the CCB.
869 .El
870 .Pp
871 .Fn bus_dmamap_load_ccb
872 supports the following CCB XPT function codes:
873 .Pp
874 .Bl -item -offset indent -compact
875 .It
876 XPT_ATA_IO
877 .It
878 XPT_CONT_TARGET_IO
879 .It
880 XPT_SCSI_IO
881 .El
882 .It Fn bus_dmamap_load_mbuf "dmat" "map" "mbuf" "callback2" "callback_arg" \
883 "flags"
884 This is a variation of
885 .Fn bus_dmamap_load
886 which maps mbuf chains
887 for DMA transfers.
888 A
889 .Vt bus_size_t
890 argument is also passed to the callback routine, which
891 contains the mbuf chain's packet header length.
892 The
893 .Dv BUS_DMA_NOWAIT
894 flag is implied, thus no callback deferral will happen.
895 .Pp
896 Mbuf chains are assumed to be in kernel virtual address space.
897 .Pp
898 Beside the error values listed for
899 .Fn bus_dmamap_load ,
900 .Er EINVAL
901 will be returned if the size of the mbuf chain exceeds the maximum limit of the
902 DMA tag.
903 .It Fn bus_dmamap_load_mbuf_sg "dmat" "map" "mbuf" "segs" "nsegs" "flags"
904 This is just like
905 .Fn bus_dmamap_load_mbuf
906 except that it returns immediately without calling a callback function.
907 It is provided for efficiency.
908 The scatter/gather segment array
909 .Va segs
910 is provided by the caller and filled in directly by the function.
911 The
912 .Va nsegs
913 argument is returned with the number of segments filled in.
914 Returns the same errors as
915 .Fn bus_dmamap_load_mbuf .
916 .It Fn bus_dmamap_load_uio "dmat" "map" "uio" "callback2" "callback_arg" "flags"
917 This is a variation of
918 .Fn bus_dmamap_load
919 which maps buffers pointed to by
920 .Fa uio
921 for DMA transfers.
922 A
923 .Vt bus_size_t
924 argument is also passed to the callback routine, which contains the size of
925 .Fa uio ,
926 i.e.
927 .Fa uio->uio_resid .
928 The
929 .Dv BUS_DMA_NOWAIT
930 flag is implied, thus no callback deferral will happen.
931 Returns the same errors as
932 .Fn bus_dmamap_load .
933 .Pp
934 If
935 .Fa uio->uio_segflg
936 is
937 .Dv UIO_USERSPACE ,
938 then it is assumed that the buffer,
939 .Fa uio
940 is in
941 .Fa "uio->uio_td->td_proc" Ns 's
942 address space.
943 User space memory must be in-core and wired prior to attempting a map
944 load operation.
945 Pages may be locked using
946 .Xr vslock 9 .
947 .It Fn bus_dmamap_unload "dmat" "map"
948 Unloads a DMA map.
949 Arguments are as follows:
950 .Bl -tag -width ".Fa dmam"
951 .It Fa dmat
952 DMA tag used to allocate
953 .Fa map .
954 .It Fa map
955 The DMA map that is to be unloaded.
956 .El
957 .Pp
958 .Fn bus_dmamap_unload
959 will not perform any implicit synchronization of DMA buffers.
960 This must be done explicitly by a call to
961 .Fn bus_dmamap_sync
962 prior to unloading the map.
963 .It Fn bus_dmamap_sync "dmat" "map" "op"
964 Performs synchronization of a device visible mapping with the CPU visible
965 memory referenced by that mapping.
966 Arguments are as follows:
967 .Bl -tag -width ".Fa dmat"
968 .It Fa dmat
969 DMA tag used to allocate
970 .Fa map .
971 .It Fa map
972 The DMA mapping to be synchronized.
973 .It Fa op
974 Type of synchronization operation to perform.
975 See the definition of
976 .Vt bus_dmasync_op_t
977 for a description of the acceptable values for
978 .Fa op .
979 .El
980 .Pp
981 The
982 .Fn bus_dmamap_sync
983 function
984 is the method used to ensure that CPU's and device's direct
985 memory access (DMA) to shared
986 memory is coherent.
987 For example, the CPU might be used to set up the contents of a buffer
988 that is to be made available to a device.
989 To ensure that the data are visible via the device's mapping of that
990 memory, the buffer must be loaded and a DMA sync operation of
991 .Dv BUS_DMASYNC_PREWRITE
992 must be performed after the CPU has updated the buffer and before the device
993 access is initiated.
994 If the CPU modifies this buffer again later, another
995 .Dv BUS_DMASYNC_PREWRITE
996 sync operation must be performed before an additional device
997 access.
998 Conversely, suppose a device updates memory that is to be read by a CPU.
999 In this case, the buffer must be loaded, and a DMA sync operation of
1000 .Dv BUS_DMASYNC_PREREAD
1001 must be performed before the device access is initiated.
1002 The CPU will only be able to see the results of this memory update
1003 once the DMA operation has completed and a
1004 .Dv BUS_DMASYNC_POSTREAD
1005 sync operation has been performed.
1006 .Pp
1007 If read and write operations are not preceded and followed by the
1008 appropriate synchronization operations, behavior is undefined.
1009 .It Fn bus_dmamem_alloc "dmat" "**vaddr" "flags" "*mapp"
1010 Allocates memory that is mapped into KVA at the address returned
1011 in
1012 .Fa vaddr
1013 and that is permanently loaded into the newly created
1014 .Vt bus_dmamap_t
1015 returned via
1016 .Fa mapp .
1017 Arguments are as follows:
1018 .Bl -tag -width ".Fa alignment"
1019 .It Fa dmat
1020 DMA tag describing the constraints of the DMA mapping.
1021 .It Fa vaddr
1022 Pointer to a pointer that will hold the returned KVA mapping of
1023 the allocated region.
1024 .It Fa flags
1025 Flags are defined as follows:
1026 .Bl -tag -width ".Dv BUS_DMA_NOWAIT"
1027 .It Dv BUS_DMA_WAITOK
1028 The routine can safely wait (sleep) for resources.
1029 .It Dv BUS_DMA_NOWAIT
1030 The routine is not allowed to wait for resources.
1031 If resources are not available,
1032 .Dv ENOMEM
1033 is returned.
1034 .It Dv BUS_DMA_COHERENT
1035 Attempt to map this memory in a coherent fashion.
1036 See
1037 .Fn bus_dmamap_create
1038 above for a description of this flag.
1039 For
1040 .Fn bus_dmamem_alloc ,
1041 the
1042 .Dv BUS_DMA_COHERENT
1043 flag is currently implemented on arm and arm64.
1044 .It Dv BUS_DMA_ZERO
1045 Causes the allocated memory to be set to all zeros.
1046 .It Dv BUS_DMA_NOCACHE
1047 The allocated memory will not be cached in the processor caches.
1048 All memory accesses appear on the bus and are executed
1049 without reordering.
1050 For
1051 .Fn bus_dmamem_alloc ,
1052 the
1053 .Dv BUS_DMA_NOCACHE
1054 flag is currently implemented on amd64 and i386 where it results in the
1055 Strong Uncacheable PAT to be set for the allocated virtual address range.
1056 .El
1057 .It Fa mapp
1058 Pointer to a
1059 .Vt bus_dmamap_t
1060 where the resulting DMA map will be stored.
1061 .El
1062 .Pp
1063 The size of memory to be allocated is
1064 .Fa maxsize
1065 as specified in the call to
1066 .Fn bus_dma_tag_create
1067 for
1068 .Fa dmat .
1069 .Pp
1070 The current implementation of
1071 .Fn bus_dmamem_alloc
1072 will allocate all requests as a single segment.
1073 .Pp
1074 An initial load operation is required to obtain the bus address of the allocated
1075 memory, and an unload operation is required before freeing the memory, as
1076 described below in
1077 .Fn bus_dmamem_free .
1078 Maps are automatically handled by this function and should not be explicitly
1079 allocated or destroyed.
1080 .Pp
1081 Although an explicit load is not required for each access to the memory
1082 referenced by the returned map, the synchronization requirements
1083 as described in the
1084 .Fn bus_dmamap_sync
1085 section still apply and should be used to achieve portability on architectures
1086 without coherent buses.
1087 .Pp
1088 Returns
1089 .Er ENOMEM
1090 if sufficient memory is not available for completing
1091 the operation.
1092 .It Fn bus_dmamem_free "dmat" "*vaddr" "map"
1093 Frees memory previously allocated by
1094 .Fn bus_dmamem_alloc .
1095 Any mappings
1096 will be invalidated.
1097 Arguments are as follows:
1098 .Bl -tag -width ".Fa vaddr"
1099 .It Fa dmat
1100 DMA tag.
1101 .It Fa vaddr
1102 Kernel virtual address of the memory.
1103 .It Fa map
1104 DMA map to be invalidated.
1105 .El
1106 .El
1107 .Sh RETURN VALUES
1108 Behavior is undefined if invalid arguments are passed to
1109 any of the above functions.
1110 If sufficient resources cannot be allocated for a given
1111 transaction,
1112 .Er ENOMEM
1113 is returned.
1114 All
1115 routines that are not of type
1116 .Vt void
1117 will return 0 on success or an error
1118 code on failure as discussed above.
1119 .Pp
1120 All
1121 .Vt void
1122 routines will succeed if provided with valid arguments.
1123 .Sh LOCKING
1124 Two locking protocols are used by
1125 .Nm .
1126 The first is a private global lock that is used to synchronize access to the
1127 bounce buffer pool on the architectures that make use of them.
1128 This lock is strictly a leaf lock that is only used internally to
1129 .Nm
1130 and is not exposed to clients of the API.
1131 .Pp
1132 The second protocol involves protecting various resources stored in the tag.
1133 Since almost all
1134 .Nm
1135 operations are done through requests from the driver that created the tag,
1136 the most efficient way to protect the tag resources is through the lock that
1137 the driver uses.
1138 In cases where
1139 .Nm
1140 acts on its own without being called by the driver, the lock primitive
1141 specified in the tag is acquired and released automatically.
1142 An example of this is when the
1143 .Fn bus_dmamap_load
1144 callback function is called from a deferred context instead of the driver
1145 context.
1146 This means that certain
1147 .Nm
1148 functions must always be called with the same lock held that is specified in the
1149 tag.
1150 These functions include:
1151 .Pp
1152 .Bl -item -offset indent -compact
1153 .It
1154 .Fn bus_dmamap_load
1155 .It
1156 .Fn bus_dmamap_load_bio
1157 .It
1158 .Fn bus_dmamap_load_ccb
1159 .It
1160 .Fn bus_dmamap_load_mbuf
1161 .It
1162 .Fn bus_dmamap_load_mbuf_sg
1163 .It
1164 .Fn bus_dmamap_load_uio
1165 .It
1166 .Fn bus_dmamap_unload
1167 .It
1168 .Fn bus_dmamap_sync
1169 .El
1170 .Pp
1171 There is one exception to this rule.
1172 It is common practice to call some of these functions during driver start-up
1173 without any locks held.
1174 So long as there is a guarantee of no possible concurrent use of the tag by
1175 different threads during this operation, it is safe to not hold a lock for
1176 these functions.
1177 .Pp
1178 Certain
1179 .Nm
1180 operations should not be called with the driver lock held, either because
1181 they are already protected by an internal lock, or because they might sleep
1182 due to memory or resource allocation.
1183 The following functions must not be
1184 called with any non-sleepable locks held:
1185 .Pp
1186 .Bl -item -offset indent -compact
1187 .It
1188 .Fn bus_dma_tag_create
1189 .It
1190 .Fn bus_dmamap_create
1191 .It
1192 .Fn bus_dmamem_alloc
1193 .El
1194 .Pp
1195 All other functions do not have a locking protocol and can thus be
1196 called with or without any system or driver locks held.
1197 .Sh SEE ALSO
1198 .Xr devclass 9 ,
1199 .Xr device 9 ,
1200 .Xr driver 9 ,
1201 .Xr rman 9 ,
1202 .Xr vslock 9
1203 .Pp
1204 .Rs
1205 .%A "Jason R. Thorpe"
1206 .%T "A Machine-Independent DMA Framework for NetBSD"
1207 .%J "Proceedings of the Summer 1998 USENIX Technical Conference"
1208 .%Q "USENIX Association"
1209 .%D "June 1998"
1210 .Re
1211 .Sh HISTORY
1212 The
1213 .Nm
1214 interface first appeared in
1215 .Nx 1.3 .
1216 .Pp
1217 The
1218 .Nm
1219 API was adopted from
1220 .Nx
1221 for use in the CAM SCSI subsystem.
1222 The alterations to the original API were aimed to remove the need for
1223 a
1224 .Vt bus_dma_segment_t
1225 array stored in each
1226 .Vt bus_dmamap_t
1227 while allowing callers to queue up on scarce resources.
1228 .Sh AUTHORS
1229 The
1230 .Nm
1231 interface was designed and implemented by
1232 .An Jason R. Thorpe
1233 of the Numerical Aerospace Simulation Facility, NASA Ames Research Center.
1234 Additional input on the
1235 .Nm
1236 design was provided by
1237 .An -nosplit
1238 .An Chris Demetriou ,
1239 .An Charles Hannum ,
1240 .An Ross Harvey ,
1241 .An Matthew Jacob ,
1242 .An Jonathan Stone ,
1243 and
1244 .An Matt Thomas .
1245 .Pp
1246 The
1247 .Nm
1248 interface in
1249 .Fx
1250 benefits from the contributions of
1251 .An Justin T. Gibbs ,
1252 .An Peter Wemm ,
1253 .An Doug Rabson ,
1254 .An Matthew N. Dodd ,
1255 .An Sam Leffler ,
1256 .An Maxime Henrion ,
1257 .An Jake Burkholder ,
1258 .An Takahashi Yoshihiro ,
1259 .An Scott Long
1260 and many others.
1261 .Pp
1262 This manual page was written by
1263 .An Hiten M. Pandya
1264 and
1265 .An Justin T. Gibbs .