]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man9/bus_space.9
accept_filter(9): Fix a mandoc related error
[FreeBSD/FreeBSD.git] / share / man / man9 / bus_space.9
1 .\" $NetBSD: bus_space.9,v 1.9 1999/03/06 22:09:29 mycroft Exp $
2 .\"
3 .\" Copyright (c) 2005 M. Warner Losh <imp@FreeBSD.org>
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
14 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
15 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
17 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 .\" POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .\"
26 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
27 .\" All rights reserved.
28 .\"
29 .\" This code is derived from software contributed to The NetBSD Foundation
30 .\" by Christopher G. Demetriou.
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 .\"
55 .Dd July 7, 2020
56 .Dt BUS_SPACE 9
57 .Os
58 .Sh NAME
59 .Nm bus_space ,
60 .Nm bus_space_barrier ,
61 .Nm bus_space_copy_region_1 ,
62 .Nm bus_space_copy_region_2 ,
63 .Nm bus_space_copy_region_4 ,
64 .Nm bus_space_copy_region_8 ,
65 .Nm bus_space_copy_region_stream_1 ,
66 .Nm bus_space_copy_region_stream_2 ,
67 .Nm bus_space_copy_region_stream_4 ,
68 .Nm bus_space_copy_region_stream_8 ,
69 .Nm bus_space_free ,
70 .Nm bus_space_map ,
71 .Nm bus_space_peek_1 ,
72 .Nm bus_space_peek_2 ,
73 .Nm bus_space_peek_4 ,
74 .Nm bus_space_peek_8 ,
75 .Nm bus_space_poke_1 ,
76 .Nm bus_space_poke_2 ,
77 .Nm bus_space_poke_4 ,
78 .Nm bus_space_poke_8 ,
79 .Nm bus_space_read_1 ,
80 .Nm bus_space_read_2 ,
81 .Nm bus_space_read_4 ,
82 .Nm bus_space_read_8 ,
83 .Nm bus_space_read_multi_1 ,
84 .Nm bus_space_read_multi_2 ,
85 .Nm bus_space_read_multi_4 ,
86 .Nm bus_space_read_multi_8 ,
87 .Nm bus_space_read_multi_stream_1 ,
88 .Nm bus_space_read_multi_stream_2 ,
89 .Nm bus_space_read_multi_stream_4 ,
90 .Nm bus_space_read_multi_stream_8 ,
91 .Nm bus_space_read_region_1 ,
92 .Nm bus_space_read_region_2 ,
93 .Nm bus_space_read_region_4 ,
94 .Nm bus_space_read_region_8 ,
95 .Nm bus_space_read_region_stream_1 ,
96 .Nm bus_space_read_region_stream_2 ,
97 .Nm bus_space_read_region_stream_4 ,
98 .Nm bus_space_read_region_stream_8 ,
99 .Nm bus_space_read_stream_1 ,
100 .Nm bus_space_read_stream_2 ,
101 .Nm bus_space_read_stream_4 ,
102 .Nm bus_space_read_stream_8 ,
103 .Nm bus_space_set_multi_1 ,
104 .Nm bus_space_set_multi_2 ,
105 .Nm bus_space_set_multi_4 ,
106 .Nm bus_space_set_multi_8 ,
107 .Nm bus_space_set_multi_stream_1 ,
108 .Nm bus_space_set_multi_stream_2 ,
109 .Nm bus_space_set_multi_stream_4 ,
110 .Nm bus_space_set_multi_stream_8 ,
111 .Nm bus_space_set_region_1 ,
112 .Nm bus_space_set_region_2 ,
113 .Nm bus_space_set_region_4 ,
114 .Nm bus_space_set_region_8 ,
115 .Nm bus_space_set_region_stream_1 ,
116 .Nm bus_space_set_region_stream_2 ,
117 .Nm bus_space_set_region_stream_4 ,
118 .Nm bus_space_set_region_stream_8 ,
119 .Nm bus_space_subregion ,
120 .Nm bus_space_unmap ,
121 .Nm bus_space_write_1 ,
122 .Nm bus_space_write_2 ,
123 .Nm bus_space_write_4 ,
124 .Nm bus_space_write_8 ,
125 .Nm bus_space_write_multi_1 ,
126 .Nm bus_space_write_multi_2 ,
127 .Nm bus_space_write_multi_4 ,
128 .Nm bus_space_write_multi_8 ,
129 .Nm bus_space_write_multi_stream_1 ,
130 .Nm bus_space_write_multi_stream_2 ,
131 .Nm bus_space_write_multi_stream_4 ,
132 .Nm bus_space_write_multi_stream_8 ,
133 .Nm bus_space_write_region_1 ,
134 .Nm bus_space_write_region_2 ,
135 .Nm bus_space_write_region_4 ,
136 .Nm bus_space_write_region_8 ,
137 .Nm bus_space_write_region_stream_1 ,
138 .Nm bus_space_write_region_stream_2 ,
139 .Nm bus_space_write_region_stream_4 ,
140 .Nm bus_space_write_region_stream_8 ,
141 .Nm bus_space_write_stream_1 ,
142 .Nm bus_space_write_stream_2 ,
143 .Nm bus_space_write_stream_4 ,
144 .Nm bus_space_write_stream_8
145 .Nd "bus space manipulation functions"
146 .Sh SYNOPSIS
147 .In machine/bus.h
148 .Ft int
149 .Fo bus_space_map
150 .Fa "bus_space_tag_t space" "bus_addr_t address"
151 .Fa "bus_size_t size" "int flags" "bus_space_handle_t *handlep"
152 .Fc
153 .Ft void
154 .Fo bus_space_unmap
155 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t size"
156 .Fc
157 .Ft int
158 .Fo bus_space_subregion
159 .Fa "bus_space_tag_t space" "bus_space_handle_t handle"
160 .Fa "bus_size_t offset" "bus_size_t size" "bus_space_handle_t *nhandlep"
161 .Fc
162 .Ft int
163 .Fo bus_space_alloc
164 .Fa "bus_space_tag_t space" "bus_addr_t reg_start" "bus_addr_t reg_end"
165 .Fa "bus_size_t size" "bus_size_t alignment" "bus_size_t boundary"
166 .Fa "int flags" "bus_addr_t *addrp" "bus_space_handle_t *handlep"
167 .Fc
168 .Ft void
169 .Fo bus_space_free
170 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t size"
171 .Fc
172 .Ft int
173 .Fo bus_space_peek_1
174 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
175 .Fa "uint8_t *datap"
176 .Fc
177 .Ft int
178 .Fo bus_space_peek_2
179 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
180 .Fa "uint8_t *datap"
181 .Fc
182 .Ft int
183 .Fo bus_space_peek_4
184 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
185 .Fa "uint8_t *datap"
186 .Fc
187 .Ft int
188 .Fo bus_space_peek_8
189 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
190 .Fa "uint8_t *datap"
191 .Fc
192 .Ft int
193 .Fo bus_space_poke_1
194 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
195 .Fa "uint8_t *datap"
196 .Fc
197 .Ft int
198 .Fo bus_space_poke_2
199 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
200 .Fa "uint8_t *datap"
201 .Fc
202 .Ft int
203 .Fo bus_space_poke_4
204 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
205 .Fa "uint8_t *datap"
206 .Fc
207 .Ft int
208 .Fo bus_space_poke_8
209 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
210 .Fa "uint8_t *datap"
211 .Fc
212 .Ft uint8_t
213 .Fo bus_space_read_1
214 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
215 .Fc
216 .Ft uint16_t
217 .Fo bus_space_read_2
218 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
219 .Fc
220 .Ft uint32_t
221 .Fo bus_space_read_4
222 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
223 .Fc
224 .Ft uint64_t
225 .Fo bus_space_read_8
226 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
227 .Fc
228 .Ft uint8_t
229 .Fo bus_space_read_stream_1
230 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
231 .Fc
232 .Ft uint16_t
233 .Fo bus_space_read_stream_2
234 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
235 .Fc
236 .Ft uint32_t
237 .Fo bus_space_read_stream_4
238 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
239 .Fc
240 .Ft uint64_t
241 .Fo bus_space_read_stream_8
242 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
243 .Fc
244 .Ft void
245 .Fo bus_space_write_1
246 .Fa "bus_space_tag_t space" "bus_space_handle_t handle"
247 .Fa "bus_size_t offset" "uint8_t value"
248 .Fc
249 .Ft void
250 .Fo bus_space_write_2
251 .Fa "bus_space_tag_t space" "bus_space_handle_t handle"
252 .Fa "bus_size_t offset" "uint16_t value"
253 .Fc
254 .Ft void
255 .Fo bus_space_write_4
256 .Fa "bus_space_tag_t space" "bus_space_handle_t handle"
257 .Fa "bus_size_t offset" "uint32_t value"
258 .Fc
259 .Ft void
260 .Fo bus_space_write_8
261 .Fa "bus_space_tag_t space" "bus_space_handle_t handle"
262 .Fa "bus_size_t offset" "uint64_t value"
263 .Fc
264 .Ft void
265 .Fo bus_space_write_stream_1
266 .Fa "bus_space_tag_t space" "bus_space_handle_t handle"
267 .Fa "bus_size_t offset" "uint8_t value"
268 .Fc
269 .Ft void
270 .Fo bus_space_write_stream_2
271 .Fa "bus_space_tag_t space" "bus_space_handle_t handle"
272 .Fa "bus_size_t offset" "uint16_t value"
273 .Fc
274 .Ft void
275 .Fo bus_space_write_stream_4
276 .Fa "bus_space_tag_t space" "bus_space_handle_t handle"
277 .Fa "bus_size_t offset" "uint32_t value"
278 .Fc
279 .Ft void
280 .Fo bus_space_write_stream_8
281 .Fa "bus_space_tag_t space" "bus_space_handle_t handle"
282 .Fa "bus_size_t offset" "uint64_t value"
283 .Fc
284 .Ft void
285 .Fo bus_space_barrier
286 .Fa "bus_space_tag_t space" "bus_space_handle_t handle"
287 .Fa "bus_size_t offset" "bus_size_t length" "int flags"
288 .Fc
289 .Ft void
290 .Fo bus_space_read_region_1
291 .Fa "bus_space_tag_t space"
292 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
293 .Fa "bus_size_t count"
294 .Fc
295 .Ft void
296 .Fo bus_space_read_region_2
297 .Fa "bus_space_tag_t space"
298 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
299 .Fa "bus_size_t count"
300 .Fc
301 .Ft void
302 .Fo bus_space_read_region_4
303 .Fa "bus_space_tag_t space"
304 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
305 .Fa "bus_size_t count"
306 .Fc
307 .Ft void
308 .Fo bus_space_read_region_8
309 .Fa "bus_space_tag_t space"
310 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
311 .Fa "bus_size_t count"
312 .Fc
313 .Ft void
314 .Fo bus_space_read_region_stream_1
315 .Fa "bus_space_tag_t space"
316 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
317 .Fa "bus_size_t count"
318 .Fc
319 .Ft void
320 .Fo bus_space_read_region_stream_2
321 .Fa "bus_space_tag_t space"
322 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
323 .Fa "bus_size_t count"
324 .Fc
325 .Ft void
326 .Fo bus_space_read_region_stream_4
327 .Fa "bus_space_tag_t space"
328 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
329 .Fa "bus_size_t count"
330 .Fc
331 .Ft void
332 .Fo bus_space_read_region_stream_8
333 .Fa "bus_space_tag_t space"
334 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
335 .Fa "bus_size_t count"
336 .Fc
337 .Ft void
338 .Fo bus_space_write_region_1
339 .Fa "bus_space_tag_t space"
340 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
341 .Fa "bus_size_t count"
342 .Fc
343 .Ft void
344 .Fo bus_space_write_region_2
345 .Fa "bus_space_tag_t space"
346 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
347 .Fa "bus_size_t count"
348 .Fc
349 .Ft void
350 .Fo bus_space_write_region_4
351 .Fa "bus_space_tag_t space"
352 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
353 .Fa "bus_size_t count"
354 .Fc
355 .Ft void
356 .Fo bus_space_write_region_8
357 .Fa "bus_space_tag_t space"
358 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
359 .Fa "bus_size_t count"
360 .Fc
361 .Ft void
362 .Fo bus_space_write_region_stream_1
363 .Fa "bus_space_tag_t space"
364 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
365 .Fa "bus_size_t count"
366 .Fc
367 .Ft void
368 .Fo bus_space_write_region_stream_2
369 .Fa "bus_space_tag_t space"
370 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
371 .Fa "bus_size_t count"
372 .Fc
373 .Ft void
374 .Fo bus_space_write_region_stream_4
375 .Fa "bus_space_tag_t space"
376 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
377 .Fa "bus_size_t count"
378 .Fc
379 .Ft void
380 .Fo bus_space_write_region_stream_8
381 .Fa "bus_space_tag_t space"
382 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
383 .Fa "bus_size_t count"
384 .Fc
385 .Ft void
386 .Fo bus_space_copy_region_1
387 .Fa "bus_space_tag_t space"
388 .Fa "bus_space_handle_t srchandle" "bus_size_t srcoffset"
389 .Fa "bus_space_handle_t dsthandle" "bus_size_t dstoffset" "bus_size_t count"
390 .Fc
391 .Ft void
392 .Fo bus_space_copy_region_2
393 .Fa "bus_space_tag_t space"
394 .Fa "bus_space_handle_t srchandle" "bus_size_t srcoffset"
395 .Fa "bus_space_handle_t dsthandle" "bus_size_t dstoffset" "bus_size_t count"
396 .Fc
397 .Ft void
398 .Fo bus_space_copy_region_4
399 .Fa "bus_space_tag_t space"
400 .Fa "bus_space_handle_t srchandle" "bus_size_t srcoffset"
401 .Fa "bus_space_handle_t dsthandle" "bus_size_t dstoffset" "bus_size_t count"
402 .Fc
403 .Ft void
404 .Fo bus_space_copy_region_8
405 .Fa "bus_space_tag_t space"
406 .Fa "bus_space_handle_t srchandle" "bus_size_t srcoffset"
407 .Fa "bus_space_handle_t dsthandle" "bus_size_t dstoffset" "bus_size_t count"
408 .Fc
409 .Ft void
410 .Fo bus_space_copy_region_stream_1
411 .Fa "bus_space_tag_t space"
412 .Fa "bus_space_handle_t srchandle" "bus_size_t srcoffset"
413 .Fa "bus_space_handle_t dsthandle" "bus_size_t dstoffset" "bus_size_t count"
414 .Fc
415 .Ft void
416 .Fo bus_space_copy_region_stream_2
417 .Fa "bus_space_tag_t space"
418 .Fa "bus_space_handle_t srchandle" "bus_size_t srcoffset"
419 .Fa "bus_space_handle_t dsthandle" "bus_size_t dstoffset" "bus_size_t count"
420 .Fc
421 .Ft void
422 .Fo bus_space_copy_region_stream_4
423 .Fa "bus_space_tag_t space"
424 .Fa "bus_space_handle_t srchandle" "bus_size_t srcoffset"
425 .Fa "bus_space_handle_t dsthandle" "bus_size_t dstoffset" "bus_size_t count"
426 .Fc
427 .Ft void
428 .Fo bus_space_copy_region_stream_8
429 .Fa "bus_space_tag_t space"
430 .Fa "bus_space_handle_t srchandle" "bus_size_t srcoffset"
431 .Fa "bus_space_handle_t dsthandle" "bus_size_t dstoffset" "bus_size_t count"
432 .Fc
433 .Ft void
434 .Fo bus_space_set_region_1
435 .Fa "bus_space_tag_t space"
436 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t value"
437 .Fa "bus_size_t count"
438 .Fc
439 .Ft void
440 .Fo bus_space_set_region_2
441 .Fa "bus_space_tag_t space"
442 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t value"
443 .Fa "bus_size_t count"
444 .Fc
445 .Ft void
446 .Fo bus_space_set_region_4
447 .Fa "bus_space_tag_t space"
448 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t value"
449 .Fa "bus_size_t count"
450 .Fc
451 .Ft void
452 .Fo bus_space_set_region_8
453 .Fa "bus_space_tag_t space"
454 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t value"
455 .Fa "bus_size_t count"
456 .Fc
457 .Ft void
458 .Fo bus_space_set_region_stream_1
459 .Fa "bus_space_tag_t space"
460 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t value"
461 .Fa "bus_size_t count"
462 .Fc
463 .Ft void
464 .Fo bus_space_set_region_stream_2
465 .Fa "bus_space_tag_t space"
466 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t value"
467 .Fa "bus_size_t count"
468 .Fc
469 .Ft void
470 .Fo bus_space_set_region_stream_4
471 .Fa "bus_space_tag_t space"
472 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t value"
473 .Fa "bus_size_t count"
474 .Fc
475 .Ft void
476 .Fo bus_space_set_region_stream_8
477 .Fa "bus_space_tag_t space"
478 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t value"
479 .Fa "bus_size_t count"
480 .Fc
481 .Ft void
482 .Fo bus_space_read_multi_1
483 .Fa "bus_space_tag_t space"
484 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
485 .Fa "bus_size_t count"
486 .Fc
487 .Ft void
488 .Fo bus_space_read_multi_2
489 .Fa "bus_space_tag_t space"
490 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
491 .Fa "bus_size_t count"
492 .Fc
493 .Ft void
494 .Fo bus_space_read_multi_4
495 .Fa "bus_space_tag_t space"
496 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
497 .Fa "bus_size_t count"
498 .Fc
499 .Ft void
500 .Fo bus_space_read_multi_8
501 .Fa "bus_space_tag_t space"
502 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
503 .Fa "bus_size_t count"
504 .Fc
505 .Ft void
506 .Fo bus_space_read_multi_stream_1
507 .Fa "bus_space_tag_t space"
508 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
509 .Fa "bus_size_t count"
510 .Fc
511 .Ft void
512 .Fo bus_space_read_multi_stream_2
513 .Fa "bus_space_tag_t space"
514 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
515 .Fa "bus_size_t count"
516 .Fc
517 .Ft void
518 .Fo bus_space_read_multi_stream_4
519 .Fa "bus_space_tag_t space"
520 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
521 .Fa "bus_size_t count"
522 .Fc
523 .Ft void
524 .Fo bus_space_read_multi_stream_8
525 .Fa "bus_space_tag_t space"
526 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
527 .Fa "bus_size_t count"
528 .Fc
529 .Ft void
530 .Fo bus_space_write_multi_1
531 .Fa "bus_space_tag_t space"
532 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
533 .Fa "bus_size_t count"
534 .Fc
535 .Ft void
536 .Fo bus_space_write_multi_2
537 .Fa "bus_space_tag_t space"
538 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
539 .Fa "bus_size_t count"
540 .Fc
541 .Ft void
542 .Fo bus_space_write_multi_4
543 .Fa "bus_space_tag_t space"
544 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
545 .Fa "bus_size_t count"
546 .Fc
547 .Ft void
548 .Fo bus_space_write_multi_8
549 .Fa "bus_space_tag_t space"
550 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
551 .Fa "bus_size_t count"
552 .Fc
553 .Ft void
554 .Fo bus_space_write_multi_stream_1
555 .Fa "bus_space_tag_t space"
556 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t *datap"
557 .Fa "bus_size_t count"
558 .Fc
559 .Ft void
560 .Fo bus_space_write_multi_stream_2
561 .Fa "bus_space_tag_t space"
562 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t *datap"
563 .Fa "bus_size_t count"
564 .Fc
565 .Ft void
566 .Fo bus_space_write_multi_stream_4
567 .Fa "bus_space_tag_t space"
568 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t *datap"
569 .Fa "bus_size_t count"
570 .Fc
571 .Ft void
572 .Fo bus_space_write_multi_stream_8
573 .Fa "bus_space_tag_t space"
574 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t *datap"
575 .Fa "bus_size_t count"
576 .Fc
577 .Ft void
578 .Fo bus_space_set_multi_1
579 .Fa "bus_space_tag_t space"
580 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t value"
581 .Fa "bus_size_t count"
582 .Fc
583 .Ft void
584 .Fo bus_space_set_multi_2
585 .Fa "bus_space_tag_t space"
586 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t value"
587 .Fa "bus_size_t count"
588 .Fc
589 .Ft void
590 .Fo bus_space_set_multi_4
591 .Fa "bus_space_tag_t space"
592 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t value"
593 .Fa "bus_size_t count"
594 .Fc
595 .Ft void
596 .Fo bus_space_set_multi_8
597 .Fa "bus_space_tag_t space"
598 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t value"
599 .Fa "bus_size_t count"
600 .Fc
601 .Ft void
602 .Fo bus_space_set_multi_stream_1
603 .Fa "bus_space_tag_t space"
604 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint8_t value"
605 .Fa "bus_size_t count"
606 .Fc
607 .Ft void
608 .Fo bus_space_set_multi_stream_2
609 .Fa "bus_space_tag_t space"
610 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint16_t value"
611 .Fa "bus_size_t count"
612 .Fc
613 .Ft void
614 .Fo bus_space_set_multi_stream_4
615 .Fa "bus_space_tag_t space"
616 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint32_t value"
617 .Fa "bus_size_t count"
618 .Fc
619 .Ft void
620 .Fo bus_space_set_multi_stream_8
621 .Fa "bus_space_tag_t space"
622 .Fa "bus_space_handle_t handle" "bus_size_t offset" "uint64_t value"
623 .Fa "bus_size_t count"
624 .Fc
625 .Sh DESCRIPTION
626 The
627 .Nm
628 functions exist to allow device drivers
629 machine-independent access to bus memory and register areas.
630 All of the
631 functions and types described in this document can be used by including
632 the
633 .In machine/bus.h
634 header file.
635 .Pp
636 Many common devices are used on multiple architectures, but are accessed
637 differently on each because of architectural constraints.
638 For instance, a device which is mapped in one system's I/O space may be
639 mapped in memory space on a second system.
640 On a third system, architectural
641 limitations might change the way registers need to be accessed (e.g.\&
642 creating a non-linear register space).
643 In some cases, a single
644 driver may need to access the same type of device in multiple ways in a
645 single system or architecture.
646 The goal of the
647 .Nm
648 functions is to allow a single driver source file to manipulate a set
649 of devices on different system architectures, and to allow a single driver
650 object file to manipulate a set of devices on multiple bus types on a
651 single architecture.
652 .Pp
653 Not all buses have to implement all functions described in this
654 document, though that is encouraged if the operations are logically
655 supported by the bus.
656 Unimplemented functions should cause
657 compile-time errors if possible.
658 .Pp
659 All of the interface definitions described in this document are shown as
660 function prototypes and discussed as if they were required to be
661 functions.
662 Implementations are encouraged to implement prototyped
663 (type-checked) versions of these interfaces, but may implement them as
664 macros if appropriate.
665 Machine-dependent types, variables, and functions
666 should be marked clearly in
667 .In machine/bus.h
668 to avoid confusion with the
669 machine-independent types and functions, and, if possible, should be
670 given names which make the machine-dependence clear.
671 .Sh CONCEPTS AND GUIDELINES
672 Bus spaces are described by bus space tags, which can be created only by
673 machine-dependent code.
674 A given machine may have several different types
675 of bus space (e.g.\& memory space and I/O space), and thus may provide
676 multiple different bus space tags.
677 Individual buses or devices on a machine may use more than one bus space
678 tag.
679 For instance, ISA devices are
680 given an ISA memory space tag and an ISA I/O space tag.
681 Architectures
682 may have several different tags which represent the same type of
683 space, for instance because of multiple different host bus interface
684 chipsets.
685 .Pp
686 A range in bus space is described by a bus address and a bus size.
687 The
688 bus address describes the start of the range in bus space.
689 The bus
690 size describes the size of the range in bytes.
691 Buses which are not byte
692 addressable may require use of bus space ranges with appropriately
693 aligned addresses and properly rounded sizes.
694 .Pp
695 Access to regions of bus space is facilitated by use of bus space handles,
696 which are usually created by mapping a specific range of a bus space.
697 Handles may also be created by allocating
698 and mapping a range of bus space, the actual location of which is picked
699 by the implementation within bounds specified by the caller of the
700 allocation function.
701 .Pp
702 All of the bus space access functions require one bus space tag
703 argument, at least one handle argument, and at least one offset argument
704 (a bus size).
705 The bus space tag specifies the space, each handle specifies a region in
706 the space, and each offset specifies the offset into the region of the
707 actual location(s) to be accessed.
708 Offsets are given in bytes, though buses
709 may impose alignment constraints.
710 The offset used to access data
711 relative to a given handle must be such that all of the data being
712 accessed is in the mapped region that the handle describes.
713 Trying to
714 access data outside that region is an error.
715 .Pp
716 Because some architectures' memory systems use buffering to improve
717 memory and device access performance, there is a mechanism which can be
718 used to create
719 .Dq barriers
720 in the bus space read and write stream.
721 There
722 are three types of barriers: read, write, and read/write.
723 All reads
724 started to the region before a read barrier must complete before any reads
725 after the read barrier are started.
726 (The analogous requirement is true for
727 write barriers.)
728 Read/write barriers force all reads and writes started
729 before the barrier to complete before any reads or writes after the
730 barrier are started.
731 Correctly-written drivers will include all
732 appropriate barriers, and assume only the read/write ordering imposed by
733 the barrier operations.
734 .Pp
735 People trying to write portable drivers with the
736 .Nm
737 functions should
738 try to make minimal assumptions about what the system allows.
739 In particular,
740 they should expect that the system requires bus space addresses being
741 accessed to be naturally aligned (i.e., base address of handle added to
742 offset is a multiple of the access size), and that the system does
743 alignment checking on pointers (i.e., pointer to objects being read and
744 written must point to properly-aligned data).
745 .Pp
746 The descriptions of the
747 .Nm
748 functions given below all assume that
749 they are called with proper arguments.
750 If called with invalid arguments
751 or arguments that are out of range (e.g.\& trying to access data outside of
752 the region mapped when a given handle was created), undefined behaviour
753 results.
754 In that case, they may cause the
755 system to halt, either intentionally (via panic) or unintentionally (by
756 causing a fatal trap of by some other means) or may cause improper
757 operation which is not immediately fatal.
758 Functions which return
759 .Ft void
760 or which return data read from bus space (i.e., functions which
761 do not obviously return an error code) do not fail.
762 They could only fail
763 if given invalid arguments, and in that case their behaviour is undefined.
764 Functions which take a count of bytes have undefined results if the specified
765 .Fa count
766 is zero.
767 .Sh TYPES
768 Several types are defined in
769 .In machine/bus.h
770 to facilitate use of the
771 .Nm
772 functions by drivers.
773 .Ss Vt bus_addr_t
774 The
775 .Vt bus_addr_t
776 type is used to describe bus addresses.
777 It must be an
778 unsigned integral type
779 capable of holding the largest bus address usable by the architecture.
780 This
781 type is primarily used when mapping and unmapping bus space.
782 .Ss Vt bus_size_t
783 The
784 .Vt bus_size_t
785 type is used to describe sizes of ranges in bus space.
786 It must be an
787 unsigned integral type capable of holding the size of the largest bus
788 address range usable on the architecture.
789 This type is used by virtually all
790 of the
791 .Nm
792 functions, describing sizes when mapping regions and
793 offsets into regions when performing space access operations.
794 .Ss Vt bus_space_tag_t
795 The
796 .Vt bus_space_tag_t
797 type is used to describe a particular bus space on a machine.
798 Its
799 contents are machine-dependent and should be considered opaque by
800 machine-independent code.
801 This type is used by all
802 .Nm
803 functions to name the space on which they are operating.
804 .Ss Vt bus_space_handle_t
805 The
806 .Vt bus_space_handle_t
807 type is used to describe a mapping of a range of bus space.
808 Its
809 contents are machine-dependent and should be considered opaque by
810 machine-independent code.
811 This type is used when performing bus space
812 access operations.
813 .Sh MAPPING AND UNMAPPING BUS SPACE
814 This section is specific to the
815 .Nx
816 version of these functions and may or may not apply to the
817 .Fx
818 version.
819 .Pp
820 Bus space must be mapped before it can be used, and should be
821 unmapped when it is no longer needed.
822 The
823 .Fn bus_space_map
824 and
825 .Fn bus_space_unmap
826 functions provide these capabilities.
827 .Pp
828 Some drivers need to be able to pass a subregion of already-mapped bus
829 space to another driver or module within a driver.
830 The
831 .Fn bus_space_subregion
832 function allows such subregions to be created.
833 .Ss Fn bus_space_map space address size flags handlep
834 The
835 .Fn bus_space_map
836 function maps the region of bus space named by the
837 .Fa space , address ,
838 and
839 .Fa size
840 arguments.
841 If successful, it returns zero
842 and fills in the bus space handle pointed to by
843 .Fa handlep
844 with the handle
845 that can be used to access the mapped region.
846 If unsuccessful,
847 it will return non-zero and leave the bus space handle pointed
848 to by
849 .Fa handlep
850 in an undefined state.
851 .Pp
852 The
853 .Fa flags
854 argument controls how the space is to be mapped.
855 Supported flags include:
856 .Bl -tag -width ".Dv BUS_SPACE_MAP_CACHEABLE"
857 .It Dv BUS_SPACE_MAP_CACHEABLE
858 Try to map the space so that accesses can be cached and/or
859 prefetched by the system.
860 If this flag is not specified, the
861 implementation should map the space so that it will not be cached or
862 prefetched.
863 .Pp
864 This flag must have a value of 1 on all implementations for backward
865 compatibility.
866 .It Dv BUS_SPACE_MAP_LINEAR
867 Try to map the space so that its contents can be accessed linearly via
868 normal memory access methods (e.g.\& pointer dereferencing and structure
869 accesses).
870 This is useful when software wants to do direct access to a memory
871 device, e.g.\& a frame buffer.
872 If this flag is specified and linear
873 mapping is not possible, the
874 .Fn bus_space_map
875 call should fail.
876 If this
877 flag is not specified, the system may map the space in whatever way is
878 most convenient.
879 .El
880 .Pp
881 Not all combinations of flags make sense or are supported with all
882 spaces.
883 For instance,
884 .Dv BUS_SPACE_MAP_CACHEABLE
885 may be meaningless when
886 used on many systems' I/O port spaces, and on some systems
887 .Dv BUS_SPACE_MAP_LINEAR
888 without
889 .Dv BUS_SPACE_MAP_CACHEABLE
890 may never work.
891 When the system hardware or firmware provides hints as to how spaces should be
892 mapped (e.g.\& the PCI memory mapping registers'
893 .Dq prefetchable
894 bit), those
895 hints should be followed for maximum compatibility.
896 On some systems,
897 requesting a mapping that cannot be satisfied (e.g.\& requesting a
898 non-cacheable mapping when the system can only provide a cacheable one)
899 will cause the request to fail.
900 .Pp
901 Some implementations may keep track of use of bus space for some or all
902 bus spaces and refuse to allow duplicate allocations.
903 This is encouraged
904 for bus spaces which have no notion of slot-specific space addressing,
905 such as ISA, and for spaces which coexist with those spaces
906 (e.g.\& PCI memory and I/O spaces co-existing with ISA memory and
907 I/O spaces).
908 .Pp
909 Mapped regions may contain areas for which there is no device on the
910 bus.
911 If space in those areas is accessed, the results are
912 bus-dependent.
913 .Ss Fn bus_space_unmap space handle size
914 The
915 .Fn bus_space_unmap
916 function unmaps a region of bus space mapped with
917 .Fn bus_space_map .
918 When unmapping a region, the
919 .Fa size
920 specified should be
921 the same as the size given to
922 .Fn bus_space_map
923 when mapping that region.
924 .Pp
925 After
926 .Fn bus_space_unmap
927 is called on a handle, that handle is no longer
928 valid.
929 (If copies were made of the handle they are no longer valid,
930 either.)
931 .Pp
932 This function will never fail.
933 If it would fail (e.g.\& because of an
934 argument error), that indicates a software bug which should cause a
935 panic.
936 In that case,
937 .Fn bus_space_unmap
938 will never return.
939 .Ss Fn bus_space_subregion space handle offset size nhandlep
940 The
941 .Fn bus_space_subregion
942 function is a convenience function which makes a
943 new handle to some subregion of an already-mapped region of bus space.
944 The subregion described by the new handle starts at byte offset
945 .Fa offset
946 into the region described by
947 .Fa handle ,
948 with the size give by
949 .Fa size ,
950 and must be wholly contained within the original region.
951 .Pp
952 If successful,
953 .Fn bus_space_subregion
954 returns zero and fills in the bus
955 space handle pointed to by
956 .Fa nhandlep .
957 If unsuccessful, it returns non-zero and leaves the bus space handle
958 pointed to by
959 .Fa nhandlep
960 in an
961 undefined state.
962 In either case, the handle described by
963 .Fa handle
964 remains valid and is unmodified.
965 .Pp
966 When done with a handle created by
967 .Fn bus_space_subregion ,
968 the handle should
969 be thrown away.
970 Under no circumstances should
971 .Fn bus_space_unmap
972 be used on the handle.
973 Doing so may confuse any resource management
974 being done on the space, and will result in undefined behaviour.
975 When
976 .Fn bus_space_unmap
977 or
978 .Fn bus_space_free
979 is called on a handle, all subregions of that handle become invalid.
980 .Sh ALLOCATING AND FREEING BUS SPACE
981 This section is specific to the
982 .Nx
983 version of these functions and may or may not apply to the
984 .Fx
985 version.
986 .Pp
987 Some devices require or allow bus space to be allocated by the operating
988 system for device use.
989 When the devices no longer need the space, the
990 operating system should free it for use by other devices.
991 The
992 .Fn bus_space_alloc
993 and
994 .Fn bus_space_free
995 functions provide these capabilities.
996 .Ss Fn bus_space_alloc space reg_start reg_end size alignment boundary \
997 flags addrp handlep
998 The
999 .Fn bus_space_alloc
1000 function allocates and maps a region of bus space with the size given by
1001 .Fa size ,
1002 corresponding to the given constraints.
1003 If successful, it returns
1004 zero, fills in the bus address pointed to by
1005 .Fa addrp
1006 with the bus space address of the allocated region, and fills in
1007 the bus space handle pointed to by
1008 .Fa handlep
1009 with the handle that can be used to access that region.
1010 If unsuccessful, it returns non-zero and leaves the bus address pointed to by
1011 .Fa addrp
1012 and the bus space handle pointed to by
1013 .Fa handlep
1014 in an undefined state.
1015 .Pp
1016 Constraints on the allocation are given by the
1017 .Fa reg_start , reg_end , alignment ,
1018 and
1019 .Fa boundary
1020 parameters.
1021 The allocated region will start at or after
1022 .Fa reg_start
1023 and end before or at
1024 .Fa reg_end .
1025 The
1026 .Fa alignment
1027 constraint must be a power of two, and the allocated region will start at
1028 an address that is an even multiple of that power of two.
1029 The
1030 .Fa boundary
1031 constraint, if non-zero, ensures that the region is allocated so that
1032 .Fa "first address in region"
1033 /
1034 .Fa boundary
1035 has the same value as
1036 .Fa "last address in region"
1037 /
1038 .Fa boundary .
1039 If the constraints cannot be met,
1040 .Fn bus_space_alloc
1041 will fail.
1042 It is an error to specify a set of
1043 constraints that can never be met
1044 (for example,
1045 .Fa size
1046 greater than
1047 .Fa boundary ) .
1048 .Pp
1049 The
1050 .Fa flags
1051 parameter is the same as the like-named parameter to
1052 .Fn bus_space_map ,
1053 the same flag values should be used, and they have the
1054 same meanings.
1055 .Pp
1056 Handles created by
1057 .Fn bus_space_alloc
1058 should only be freed with
1059 .Fn bus_space_free .
1060 Trying to use
1061 .Fn bus_space_unmap
1062 on them causes undefined behaviour.
1063 The
1064 .Fn bus_space_subregion
1065 function can be used on
1066 handles created by
1067 .Fn bus_space_alloc .
1068 .Ss Fn bus_space_free space handle size
1069 The
1070 .Fn bus_space_free
1071 function unmaps and frees a region of bus space mapped
1072 and allocated with
1073 .Fn bus_space_alloc .
1074 When unmapping a region, the
1075 .Fa size
1076 specified should be the same as the size given to
1077 .Fn bus_space_alloc
1078 when allocating the region.
1079 .Pp
1080 After
1081 .Fn bus_space_free
1082 is called on a handle, that handle is no longer valid.
1083 (If copies were
1084 made of the handle, they are no longer valid, either.)
1085 .Pp
1086 This function will never fail.
1087 If it would fail (e.g.\& because of an
1088 argument error), that indicates a software bug which should cause a
1089 panic.
1090 In that case,
1091 .Fn bus_space_free
1092 will never return.
1093 .Sh READING AND WRITING SINGLE DATA ITEMS
1094 The simplest way to access bus space is to read or write a single data
1095 item.
1096 The
1097 .Fn bus_space_read_N
1098 and
1099 .Fn bus_space_write_N
1100 families of functions provide
1101 the ability to read and write 1, 2, 4, and 8 byte data items on buses
1102 which support those access sizes.
1103 .Ss Fn bus_space_read_1 space handle offset
1104 .Ss Fn bus_space_read_2 space handle offset
1105 .Ss Fn bus_space_read_4 space handle offset
1106 .Ss Fn bus_space_read_8 space handle offset
1107 The
1108 .Fn bus_space_read_N
1109 family of functions reads a 1, 2, 4, or 8 byte data item from
1110 the offset specified by
1111 .Fa offset
1112 into the region specified by
1113 .Fa handle
1114 of the bus space specified by
1115 .Fa space .
1116 The location being read must lie within the bus space region specified by
1117 .Fa handle .
1118 .Pp
1119 For portability, the starting address of the region specified by
1120 .Fa handle
1121 plus the offset should be a multiple of the size of data item being read.
1122 On some systems, not obeying this requirement may cause incorrect data to
1123 be read, on others it may cause a system crash.
1124 .Pp
1125 Read operations done by the
1126 .Fn bus_space_read_N
1127 functions may be executed out
1128 of order with respect to other pending read and write operations unless
1129 order is enforced by use of the
1130 .Fn bus_space_barrier
1131 function.
1132 .Pp
1133 These functions will never fail.
1134 If they would fail (e.g.\& because of an
1135 argument error), that indicates a software bug which should cause a
1136 panic.
1137 In that case, they will never return.
1138 .Ss Fn bus_space_write_1 space handle offset value
1139 .Ss Fn bus_space_write_2 space handle offset value
1140 .Ss Fn bus_space_write_4 space handle offset value
1141 .Ss Fn bus_space_write_8 space handle offset value
1142 The
1143 .Fn bus_space_write_N
1144 family of functions writes a 1, 2, 4, or 8 byte data item to the offset
1145 specified by
1146 .Fa offset
1147 into the region specified by
1148 .Fa handle
1149 of the bus space specified by
1150 .Fa space .
1151 The location being written must lie within
1152 the bus space region specified by
1153 .Fa handle .
1154 .Pp
1155 For portability, the starting address of the region specified by
1156 .Fa handle
1157 plus the offset should be a multiple of the size of data item being
1158 written.
1159 On some systems, not obeying this requirement may cause
1160 incorrect data to be written, on others it may cause a system crash.
1161 .Pp
1162 Write operations done by the
1163 .Fn bus_space_write_N
1164 functions may be executed
1165 out of order with respect to other pending read and write operations
1166 unless order is enforced by use of the
1167 .Fn bus_space_barrier
1168 function.
1169 .Pp
1170 These functions will never fail.
1171 If they would fail (e.g.\& because of an
1172 argument error), that indicates a software bug which should cause a
1173 panic.
1174 In that case, they will never return.
1175 .Sh PROBING BUS SPACE FOR HARDWARE WHICH MAY NOT RESPOND
1176 One problem with the
1177 .Fn bus_space_read_N
1178 and
1179 .Fn bus_space_write_N
1180 family of functions is that they provide no protection against
1181 exceptions which can occur when no physical hardware or
1182 device responds to the read or write cycles.
1183 In such a situation, the system typically would panic due to a kernel-mode
1184 bus error.
1185 The
1186 .Fn bus_space_peek_N
1187 and
1188 .Fn bus_space_poke_N
1189 family of functions provide a mechanism to handle these exceptions
1190 gracefully without the risk of crashing the system.
1191 .Pp
1192 As with
1193 .Fn bus_space_read_N
1194 and
1195 .Fn bus_space_write_N ,
1196 the peek and poke functions provide the ability to read and
1197 write 1, 2, 4, and 8 byte data items on busses which support those
1198 access sizes.
1199 All of the constraints specified in the descriptions of the
1200 .Fn bus_space_read_N
1201 and
1202 .Fn bus_space_write_N
1203 functions also apply to
1204 .Fn bus_space_peek_N
1205 and
1206 .Fn bus_space_poke_N .
1207 .Pp
1208 In addition, explicit calls to the
1209 .Fn bus_space_barrier
1210 function are not required as the implementation will ensure all
1211 pending operations complete before the peek or poke operation starts.
1212 The implementation will also ensure that the peek or poke operations
1213 complete before returning.
1214 .Pp
1215 The return value indicates the outcome of the peek or poke operation.
1216 A return value of zero implies that a hardware device is
1217 responding to the operation at the specified offset in the bus space.
1218 A non-zero return value indicates that the kernel intercepted a
1219 hardware exception (e.g., bus error) when the peek or poke operation
1220 was attempted.
1221 Note that some busses are incapable of generating exceptions when
1222 non-existent hardware is accessed.
1223 In such cases, these functions will always return zero and the value of
1224 the data read by
1225 .Fn bus_space_peek_N
1226 will be unspecified.
1227 .Pp
1228 Finally, it should be noted that at this time the
1229 .Fn bus_space_peek_N
1230 and
1231 .Fn bus_space_poke_N
1232 functions are not re-entrant and should not, therefore, be used
1233 from within an interrupt service routine.
1234 This constraint may be removed at some point in the future.
1235 .Pp
1236 .Bl -ohang -compact
1237 .It Fn bus_space_peek_1 "space" "handle" "offset" "datap"
1238 .It Fn bus_space_peek_2 "space" "handle" "offset" "datap"
1239 .It Fn bus_space_peek_4 "space" "handle" "offset" "datap"
1240 .It Fn bus_space_peek_8 "space" "handle" "offset" "datap"
1241 .Pp
1242 The
1243 .Fn bus_space_peek_N
1244 family of functions cautiously read a 1, 2, 4, or 8 byte data item from
1245 the offset specified by
1246 .Fa offset
1247 in the region specified by
1248 .Fa handle
1249 of the bus space specified by
1250 .Fa space .
1251 The data item read is stored in the location pointed to by
1252 .Fa datap .
1253 It is permissible for
1254 .Fa datap
1255 to be NULL, in which case the data item will be discarded after being read.
1256 .Pp
1257 .It Fn bus_space_poke_1 "space" "handle" "offset" "value"
1258 .It Fn bus_space_poke_2 "space" "handle" "offset" "value"
1259 .It Fn bus_space_poke_4 "space" "handle" "offset" "value"
1260 .It Fn bus_space_poke_8 "space" "handle" "offset" "value"
1261 .Pp
1262 The
1263 .Fn bus_space_poke_N
1264 family of functions cautiously write a 1, 2, 4, or 8 byte data item
1265 specified by
1266 .Fa value
1267 to the offset specified by
1268 .Fa offset
1269 in the region specified by
1270 .Fa handle
1271 of the bus space specified by
1272 .Fa space .
1273 .El
1274 .Sh BARRIERS
1275 In order to allow high-performance buffering implementations to avoid bus
1276 activity on every operation, read and write ordering should be specified
1277 explicitly by drivers when necessary.
1278 The
1279 .Fn bus_space_barrier
1280 function provides that ability.
1281 .Ss Fn bus_space_barrier space handle offset length flags
1282 The
1283 .Fn bus_space_barrier
1284 function enforces ordering of bus space read and write operations
1285 for the specified subregion (described by the
1286 .Fa offset
1287 and
1288 .Fa length
1289 parameters) of the region named by
1290 .Fa handle
1291 in the space named by
1292 .Fa space .
1293 .Pp
1294 The
1295 .Fa flags
1296 argument controls what types of operations are to be ordered.
1297 Supported flags are:
1298 .Bl -tag -width ".Dv BUS_SPACE_BARRIER_WRITE"
1299 .It Dv BUS_SPACE_BARRIER_READ
1300 Synchronize read operations.
1301 .It Dv BUS_SPACE_BARRIER_WRITE
1302 Synchronize write operations.
1303 .El
1304 .Pp
1305 Those flags can be combined (or-ed together) to enforce ordering on both
1306 read and write operations.
1307 .Pp
1308 All of the specified type(s) of operation which are done to the region
1309 before the barrier operation are guaranteed to complete before any of the
1310 specified type(s) of operation done after the barrier.
1311 .Pp
1312 Example: Consider a hypothetical device with two single-byte ports, one
1313 write-only input port (at offset 0) and a read-only output port (at
1314 offset 1).
1315 Operation of the device is as follows: data bytes are written
1316 to the input port, and are placed by the device on a stack, the top of
1317 which is read by reading from the output port.
1318 The sequence to correctly
1319 write two data bytes to the device then read those two data bytes back
1320 would be:
1321 .Bd -literal
1322 /*
1323  * t and h are the tag and handle for the mapped device's
1324  * space.
1325  */
1326 bus_space_write_1(t, h, 0, data0);
1327 bus_space_barrier(t, h, 0, 1, BUS_SPACE_BARRIER_WRITE);  /* 1 */
1328 bus_space_write_1(t, h, 0, data1);
1329 bus_space_barrier(t, h, 0, 2,
1330     BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE);     /* 2 */
1331 ndata1 = bus_space_read_1(t, h, 1);
1332 bus_space_barrier(t, h, 1, 1, BUS_SPACE_BARRIER_READ);   /* 3 */
1333 ndata0 = bus_space_read_1(t, h, 1);
1334 /* data0 == ndata0, data1 == ndata1 */
1335 .Ed
1336 .Pp
1337 The first barrier makes sure that the first write finishes before the
1338 second write is issued, so that two writes to the input port are done
1339 in order and are not collapsed into a single write.
1340 This ensures that
1341 the data bytes are written to the device correctly and in order.
1342 .Pp
1343 The second barrier makes sure that the writes to the output port finish
1344 before any of the reads to the input port are issued, thereby making sure
1345 that all of the writes are finished before data is read.
1346 This ensures
1347 that the first byte read from the device really is the last one that was
1348 written.
1349 .Pp
1350 The third barrier makes sure that the first read finishes before the
1351 second read is issued, ensuring that data is read correctly and in order.
1352 .Pp
1353 The barriers in the example above are specified to cover the absolute
1354 minimum number of bus space locations.
1355 It is correct (and often
1356 easier) to make barrier operations cover the device's whole range of bus
1357 space, that is, to specify an offset of zero and the size of the
1358 whole region.
1359 .Sh REGION OPERATIONS
1360 Some devices use buffers which are mapped as regions in bus space.
1361 Often, drivers want to copy the contents of those buffers to or from
1362 memory, e.g.\& into mbufs which can be passed to higher levels of the
1363 system or from mbufs to be output to a network.
1364 In order to allow
1365 drivers to do this as efficiently as possible, the
1366 .Fn bus_space_read_region_N
1367 and
1368 .Fn bus_space_write_region_N
1369 families of functions are provided.
1370 .Pp
1371 Drivers occasionally need to copy one region of a bus space to another,
1372 or to set all locations in a region of bus space to contain a single
1373 value.
1374 The
1375 .Fn bus_space_copy_region_N
1376 family of functions and the
1377 .Fn bus_space_set_region_N
1378 family of functions allow drivers to perform these operations.
1379 .Ss Fn bus_space_read_region_1 space handle offset datap count
1380 .Ss Fn bus_space_read_region_2 space handle offset datap count
1381 .Ss Fn bus_space_read_region_4 space handle offset datap count
1382 .Ss Fn bus_space_read_region_8 space handle offset datap count
1383 The
1384 .Fn bus_space_read_region_N
1385 family of functions reads
1386 .Fa count
1387 1, 2, 4, or 8 byte data items from bus space
1388 starting at byte offset
1389 .Fa offset
1390 in the region specified by
1391 .Fa handle
1392 of the bus space specified by
1393 .Fa space
1394 and writes them into the array specified by
1395 .Fa datap .
1396 Each successive data item is read from an offset
1397 1, 2, 4, or 8 bytes after the previous data item (depending on which
1398 function is used).
1399 All locations being read must lie within the bus
1400 space region specified by
1401 .Fa handle .
1402 .Pp
1403 For portability, the starting address of the region specified by
1404 .Fa handle
1405 plus the offset should be a multiple of the size of data items being
1406 read and the data array pointer should be properly aligned.
1407 On some
1408 systems, not obeying these requirements may cause incorrect data to be
1409 read, on others it may cause a system crash.
1410 .Pp
1411 Read operations done by the
1412 .Fn bus_space_read_region_N
1413 functions may be executed in any order.
1414 They may also be executed out
1415 of order with respect to other pending read and write operations unless
1416 order is enforced by use of the
1417 .Fn bus_space_barrier
1418 function.
1419 There is no way to insert barriers between reads of
1420 individual bus space locations executed by the
1421 .Fn bus_space_read_region_N
1422 functions.
1423 .Pp
1424 These functions will never fail.
1425 If they would fail (e.g.\& because of an
1426 argument error), that indicates a software bug which should cause a
1427 panic.
1428 In that case, they will never return.
1429 .Ss Fn bus_space_write_region_1 space handle offset datap count
1430 .Ss Fn bus_space_write_region_2 space handle offset datap count
1431 .Ss Fn bus_space_write_region_4 space handle offset datap count
1432 .Ss Fn bus_space_write_region_8 space handle offset datap count
1433 The
1434 .Fn bus_space_write_region_N
1435 family of functions reads
1436 .Fa count
1437 1, 2, 4, or 8 byte data items from the array
1438 specified by
1439 .Fa datap
1440 and writes them to bus space starting at byte offset
1441 .Fa offset
1442 in the region specified by
1443 .Fa handle
1444 of the bus space specified
1445 by
1446 .Fa space .
1447 Each successive data item is written to an offset 1, 2, 4,
1448 or 8 bytes after the previous data item (depending on which function is
1449 used).
1450 All locations being written must lie within the bus space region
1451 specified by
1452 .Fa handle .
1453 .Pp
1454 For portability, the starting address of the region specified by
1455 .Fa handle
1456 plus the offset should be a multiple of the size of data items being
1457 written and the data array pointer should be properly aligned.
1458 On some
1459 systems, not obeying these requirements may cause incorrect data to be
1460 written, on others it may cause a system crash.
1461 .Pp
1462 Write operations done by the
1463 .Fn bus_space_write_region_N
1464 functions may be
1465 executed in any order.
1466 They may also be executed out of order with
1467 respect to other pending read and write operations unless order is
1468 enforced by use of the
1469 .Fn bus_space_barrier
1470 function.
1471 There is no way to insert barriers between writes of
1472 individual bus space locations executed by the
1473 .Fn bus_space_write_region_N
1474 functions.
1475 .Pp
1476 These functions will never fail.
1477 If they would fail (e.g.\& because of an
1478 argument error), that indicates a software bug which should cause a
1479 panic.
1480 In that case, they will never return.
1481 .Ss Fn bus_space_copy_region_1 space srchandle srcoffset dsthandle \
1482 dstoffset count
1483 .Ss Fn bus_space_copy_region_2 space srchandle srcoffset dsthandle \
1484 dstoffset count
1485 .Ss Fn bus_space_copy_region_4 space srchandle srcoffset dsthandle \
1486 dstoffset count
1487 .Ss Fn bus_space_copy_region_8 space srchandle srcoffset dsthandle \
1488 dstoffset count
1489 The
1490 .Fn bus_space_copy_region_N
1491 family of functions copies
1492 .Fa count
1493 1, 2, 4, or 8 byte data items in bus space
1494 from the area starting at byte offset
1495 .Fa srcoffset
1496 in the region specified by
1497 .Fa srchandle
1498 of the bus space specified by
1499 .Fa space
1500 to the area starting at byte offset
1501 .Fa dstoffset
1502 in the region specified by
1503 .Fa dsthandle
1504 in the same bus space.
1505 Each successive data item read or written has
1506 an offset 1, 2, 4, or 8 bytes after the previous data item (depending
1507 on which function is used).
1508 All locations being read and written must
1509 lie within the bus space region specified by their respective handles.
1510 .Pp
1511 For portability, the starting addresses of the regions specified by the
1512 each handle plus its respective offset should be a multiple of the size
1513 of data items being copied.
1514 On some systems, not obeying this
1515 requirement may cause incorrect data to be copied, on others it may cause
1516 a system crash.
1517 .Pp
1518 Read and write operations done by the
1519 .Fn bus_space_copy_region_N
1520 functions may be executed in any order.
1521 They may also be executed out
1522 of order with respect to other pending read and write operations unless
1523 order is enforced by use of the
1524 .Fn bus_space_barrier
1525 function.
1526 There is no way to insert barriers between reads or writes of
1527 individual bus space locations executed by the
1528 .Fn bus_space_copy_region_N
1529 functions.
1530 .Pp
1531 Overlapping copies between different subregions of a single region
1532 of bus space are handled correctly by the
1533 .Fn bus_space_copy_region_N
1534 functions.
1535 .Pp
1536 These functions will never fail.
1537 If they would fail (e.g.\& because of an
1538 argument error), that indicates a software bug which should cause a
1539 panic.
1540 In that case, they will never return.
1541 .Ss Fn bus_space_set_region_1 space handle offset value count
1542 .Ss Fn bus_space_set_region_2 space handle offset value count
1543 .Ss Fn bus_space_set_region_4 space handle offset value count
1544 .Ss Fn bus_space_set_region_8 space handle offset value count
1545 The
1546 .Fn bus_space_set_region_N
1547 family of functions writes the given
1548 .Fa value
1549 to
1550 .Fa count
1551 1, 2, 4, or 8 byte
1552 data items in bus space starting at byte offset
1553 .Fa offset
1554 in the region specified by
1555 .Fa handle
1556 of the bus space specified by
1557 .Fa space .
1558 Each successive data item has an offset 1, 2, 4, or 8 bytes after the
1559 previous data item (depending on which function is used).
1560 All
1561 locations being written must lie within the bus space region specified
1562 by
1563 .Fa handle .
1564 .Pp
1565 For portability, the starting address of the region specified by
1566 .Fa handle
1567 plus the offset should be a multiple of the size of data items being
1568 written.
1569 On some systems, not obeying this requirement may cause
1570 incorrect data to be written, on others it may cause a system crash.
1571 .Pp
1572 Write operations done by the
1573 .Fn bus_space_set_region_N
1574 functions may be
1575 executed in any order.
1576 They may also be executed out of order with
1577 respect to other pending read and write operations unless order is
1578 enforced by use of the
1579 .Fn bus_space_barrier
1580 function.
1581 There is no way to insert barriers between writes of
1582 individual bus space locations executed by the
1583 .Fn bus_space_set_region_N
1584 functions.
1585 .Pp
1586 These functions will never fail.
1587 If they would fail (e.g.\& because of an
1588 argument error), that indicates a software bug which should cause a
1589 panic.
1590 In that case, they will never return.
1591 .Sh READING AND WRITING A SINGLE LOCATION MULTIPLE TIMES
1592 Some devices implement single locations in bus space which are to be read
1593 or written multiple times to communicate data, e.g.\& some ethernet
1594 devices' packet buffer FIFOs.
1595 In order to allow drivers to manipulate
1596 these types of devices as efficiently as possible, the
1597 .Fn bus_space_read_multi_N ,
1598 .Fn bus_space_set_multi_N ,
1599 and
1600 .Fn bus_space_write_multi_N
1601 families of functions are provided.
1602 .Ss Fn bus_space_read_multi_1 space handle offset datap count
1603 .Ss Fn bus_space_read_multi_2 space handle offset datap count
1604 .Ss Fn bus_space_read_multi_4 space handle offset datap count
1605 .Ss Fn bus_space_read_multi_8 space handle offset datap count
1606 The
1607 .Fn bus_space_read_multi_N
1608 family of functions reads
1609 .Fa count
1610 1, 2, 4, or 8 byte data items from bus space
1611 at byte offset
1612 .Fa offset
1613 in the region specified by
1614 .Fa handle
1615 of the bus space specified by
1616 .Fa space
1617 and writes them into the array specified by
1618 .Fa datap .
1619 Each successive data item is read from the same location in bus
1620 space.
1621 The location being read must lie within the bus space region
1622 specified by
1623 .Fa handle .
1624 .Pp
1625 For portability, the starting address of the region specified by
1626 .Fa handle
1627 plus the offset should be a multiple of the size of data items being
1628 read and the data array pointer should be properly aligned.
1629 On some
1630 systems, not obeying these requirements may cause incorrect data to be
1631 read, on others it may cause a system crash.
1632 .Pp
1633 Read operations done by the
1634 .Fn bus_space_read_multi_N
1635 functions may be
1636 executed out of order with respect to other pending read and write
1637 operations unless order is enforced by use of the
1638 .Fn bus_space_barrier
1639 function.
1640 Because the
1641 .Fn bus_space_read_multi_N
1642 functions read the same bus space location multiple times, they
1643 place an implicit read barrier between each successive read of that bus
1644 space location.
1645 .Pp
1646 These functions will never fail.
1647 If they would fail (e.g.\& because of an
1648 argument error), that indicates a software bug which should cause a
1649 panic.
1650 In that case, they will never return.
1651 .Ss Fn bus_space_write_multi_1 space handle offset datap count
1652 .Ss Fn bus_space_write_multi_2 space handle offset datap count
1653 .Ss Fn bus_space_write_multi_4 space handle offset datap count
1654 .Ss Fn bus_space_write_multi_8 space handle offset datap count
1655 The
1656 .Fn bus_space_write_multi_N
1657 family of functions reads
1658 .Fa count
1659 1, 2, 4, or 8 byte data items from the array
1660 specified by
1661 .Fa datap
1662 and writes them into bus space at byte offset
1663 .Fa offset
1664 in the region specified by
1665 .Fa handle
1666 of the bus space specified by
1667 .Fa space .
1668 Each successive data item is written to the same location in
1669 bus space.
1670 The location being written must lie within the bus space
1671 region specified by
1672 .Fa handle .
1673 .Pp
1674 For portability, the starting address of the region specified by
1675 .Fa handle
1676 plus the offset should be a multiple of the size of data items being
1677 written and the data array pointer should be properly aligned.
1678 On some
1679 systems, not obeying these requirements may cause incorrect data to be
1680 written, on others it may cause a system crash.
1681 .Pp
1682 Write operations done by the
1683 .Fn bus_space_write_multi_N
1684 functions may be executed out of order with respect to other pending
1685 read and write operations unless order is enforced by use of the
1686 .Fn bus_space_barrier
1687 function.
1688 Because the
1689 .Fn bus_space_write_multi_N
1690 functions write the same bus space location multiple times, they
1691 place an implicit write barrier between each successive write of that
1692 bus space location.
1693 .Pp
1694 These functions will never fail.
1695 If they would fail (e.g.\& because of an
1696 argument error), that indicates a software bug which should cause a
1697 panic.
1698 In that case, they will never return.
1699 .Ss Fn bus_space_set_multi_1 space handle offset value count
1700 .Ss Fn bus_space_set_multi_2 space handle offset value count
1701 .Ss Fn bus_space_set_multi_4 space handle offset value count
1702 .Ss Fn bus_space_set_multi_8 space handle offset value count
1703 The
1704 .Fn bus_space_set_multi_N
1705 writes
1706 .Fa value
1707 into bus space at byte offset
1708 .Fa offset
1709 in the region specified by
1710 .Fa handle
1711 of the bus space specified by
1712 .Fa space ,
1713 .Fa count
1714 times.
1715 The location being written must lie within the bus space
1716 region specified by
1717 .Fa handle .
1718 .Pp
1719 For portability, the starting address of the region specified by
1720 .Fa handle
1721 plus the offset should be a multiple of the size of data items being
1722 written and the data array pointer should be properly aligned.
1723 On some
1724 systems, not obeying these requirements may cause incorrect data to be
1725 written, on others it may cause a system crash.
1726 .Pp
1727 Write operations done by the
1728 .Fn bus_space_set_multi_N
1729 functions may be executed out of order with respect to other pending
1730 read and write operations unless order is enforced by use of the
1731 .Fn bus_space_barrier
1732 function.
1733 Because the
1734 .Fn bus_space_set_multi_N
1735 functions write the same bus space location multiple times, they
1736 place an implicit write barrier between each successive write of that
1737 bus space location.
1738 .Pp
1739 These functions will never fail.
1740 If they would fail (e.g.\& because of an
1741 argument error), that indicates a software bug which should cause a
1742 panic.
1743 In that case, they will never return.
1744 .Sh STREAM FUNCTIONS
1745 Most of the
1746 .Nm
1747 functions imply a host byte-order and a bus byte-order and take care of
1748 any translation for the caller.
1749 In some cases, however, hardware may map a FIFO or some other memory region
1750 for which the caller may want to use multi-word, yet untranslated access.
1751 Access to these types of memory regions should be with the
1752 .Fn bus_space_*_stream_N
1753 functions.
1754 .Pp
1755 .Bl -tag -compact -width Fn
1756 .It Fn bus_space_read_stream_1
1757 .It Fn bus_space_read_stream_2
1758 .It Fn bus_space_read_stream_4
1759 .It Fn bus_space_read_stream_8
1760 .It Fn bus_space_read_multi_stream_1
1761 .It Fn bus_space_read_multi_stream_2
1762 .It Fn bus_space_read_multi_stream_4
1763 .It Fn bus_space_read_multi_stream_8
1764 .It Fn bus_space_read_region_stream_1
1765 .It Fn bus_space_read_region_stream_2
1766 .It Fn bus_space_read_region_stream_4
1767 .It Fn bus_space_read_region_stream_8
1768 .It Fn bus_space_write_stream_1
1769 .It Fn bus_space_write_stream_2
1770 .It Fn bus_space_write_stream_4
1771 .It Fn bus_space_write_stream_8
1772 .It Fn bus_space_write_multi_stream_1
1773 .It Fn bus_space_write_multi_stream_2
1774 .It Fn bus_space_write_multi_stream_4
1775 .It Fn bus_space_write_multi_stream_8
1776 .It Fn bus_space_write_region_stream_1
1777 .It Fn bus_space_write_region_stream_2
1778 .It Fn bus_space_write_region_stream_4
1779 .It Fn bus_space_write_region_stream_8
1780 .It Fn bus_space_copy_region_stream_1
1781 .It Fn bus_space_copy_region_stream_2
1782 .It Fn bus_space_copy_region_stream_4
1783 .It Fn bus_space_copy_region_stream_8
1784 .It Fn bus_space_set_multi_stream_1
1785 .It Fn bus_space_set_multi_stream_2
1786 .It Fn bus_space_set_multi_stream_4
1787 .It Fn bus_space_set_multi_stream_8
1788 .It Fn bus_space_set_region_stream_1
1789 .It Fn bus_space_set_region_stream_2
1790 .It Fn bus_space_set_region_stream_4
1791 .It Fn bus_space_set_region_stream_8
1792 .El
1793 .Pp
1794 These functions are defined just as their non-stream counterparts,
1795 except that they provide no byte-order translation.
1796 .Sh COMPATIBILITY
1797 The current
1798 .Nx
1799 version of the
1800 .Nm
1801 interface specification differs slightly from the original
1802 specification that came into wide use and
1803 .Fx
1804 adopted.
1805 A few of the function names and arguments have changed
1806 for consistency and increased functionality.
1807 .Sh SEE ALSO
1808 .Xr bus_dma 9
1809 .Sh HISTORY
1810 The
1811 .Nm
1812 functions were introduced in a different form (memory and I/O spaces
1813 were accessed via different sets of functions) in
1814 .Nx 1.2 .
1815 The functions were merged to work on generic
1816 .Dq spaces
1817 early in the
1818 .Nx 1.3
1819 development cycle, and many drivers were converted to use them.
1820 This document was written later during the
1821 .Nx 1.3
1822 development cycle, and the specification was updated to fix some
1823 consistency problems and to add some missing functionality.
1824 .Pp
1825 The manual page was then adapted to the version of the interface that
1826 .Fx
1827 imported for the CAM SCSI drivers, plus subsequent evolution.
1828 The
1829 .Fx
1830 .Nm
1831 version was imported in
1832 .Fx 3.0 .
1833 .Sh AUTHORS
1834 .An -nosplit
1835 The
1836 .Nm
1837 interfaces were designed and implemented by the
1838 .Nx
1839 developer
1840 community.
1841 Primary contributors and implementors were
1842 .An Chris Demetriou ,
1843 .An Jason Thorpe ,
1844 and
1845 .An Charles Hannum ,
1846 but the rest of the
1847 .Nx
1848 developers and the user community played a significant role in development.
1849 .Pp
1850 .An Justin Gibbs
1851 ported these interfaces to
1852 .Fx .
1853 .Pp
1854 .An Chris Demetriou
1855 wrote this manual page.
1856 .Pp
1857 .An Warner Losh
1858 modified it for the
1859 .Fx
1860 implementation.
1861 .Sh BUGS
1862 This manual may not completely and accurately document the interface,
1863 and many parts of the interface are unspecified.