1 .\" $NetBSD: physio.9,v 1.9 2001/06/21 12:13:36 wiz Exp $
3 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Paul Kranenburg.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd initiate I/O on raw devices
39 .Fa "(*strategy)(struct buf *)"
43 .Fa "(*minphys)(struct buf *)"
49 is a helper function typically called from character device read and write
50 routines to start I/O on a user process buffer.
51 It calls back on the provided
53 routine one or more times to complete the transfer described by
55 The maximum amount of data to transfer with each call to
62 normally describes user space addresses,
64 needs to lock the appropriate data area into memory before each transaction
69 .Xr uvm_vsunlock 9 ) .
71 always awaits the completion of the entire requested transfer before
72 returning, unless an error condition is detected earlier.
73 In all cases, the buffer passed in
77 for the duration of the entire transfer.
79 A break-down of the arguments follows:
80 .Bl -tag -width indent
82 The device strategy routine to call for each chunk of data to initiate
85 The buffer to use with the strategy routine.
86 The buffer flags will have
91 set when passed to the strategy routine.
94 a buffer is allocated from a system pool.
96 The device number identifying the device to interact with.
98 Direction of transfer; the only valid settings are
103 A device specific routine called to determine the maximum transfer size
104 that the device's strategy routine can handle.
106 The description of the entire transfer as requested by the user process.
107 Currently, the results of passing a
111 set to anything other than
120 is returned if the address range described by
122 is not accessible by the requesting process.
124 will return any error resulting from calls to the device strategy routine,
130 Note that the actual transfer size may be less than requested by
132 if the device signals an