Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / uiomove.9f
blobca3d6a3599cf5ac4b7b6c08672afea6e75c400ca
1 '\" te
2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH UIOMOVE 9F "Jan 16, 2006"
8 .SH NAME
9 uiomove \- copy kernel data using uio structure
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/types.h>
14 #include <sys/uio.h>
18 \fBint\fR \fBuiomove\fR(\fBcaddr_t\fR \fIaddress\fR, \fBsize_t\fR \fInbytes\fR, \fBenum uio_rw\fR \fIrwflag\fR,
19      \fBuio_t *\fR\fIuio_p\fR);
20 .fi
22 .SH INTERFACE LEVEL
23 .sp
24 .LP
25 Architecture independent level 1 (DDI/DKI).
26 .SH PARAMETERS
27 .sp
28 .ne 2
29 .na
30 \fB\fIaddress\fR\fR
31 .ad
32 .RS 11n
33 Source/destination kernel address of the copy.
34 .RE
36 .sp
37 .ne 2
38 .na
39 \fB\fInbytes\fR\fR
40 .ad
41 .RS 11n
42 Number of bytes to copy.
43 .RE
45 .sp
46 .ne 2
47 .na
48 \fB\fIrwflag\fR\fR
49 .ad
50 .RS 11n
51 Flag indicating read or write operation. Possible values are \fBUIO_READ\fR and
52 \fBUIO_WRITE\fR.
53 .RE
55 .sp
56 .ne 2
57 .na
58 \fB\fIuio_p\fR\fR
59 .ad
60 .RS 11n
61 Pointer to the \fBuio\fR structure for the copy.
62 .RE
64 .SH DESCRIPTION
65 .sp
66 .LP
67 The \fBuiomove()\fR function copies \fInbytes\fR of data to or from the space
68 defined by the \fBuio\fR structure (described in \fBuio\fR(9S)) and the driver.
69 .sp
70 .LP
71 The \fBuio_segflg\fR member of the \fBuio\fR(9S) structure determines the type
72 of space to or from which the transfer is being made. If it is set to
73 \fBUIO_SYSSPACE\fR, the data transfer is between addresses in the kernel. If it
74 is set to \fBUIO_USERSPACE\fR, the transfer is between a user program and
75 kernel space.
76 .sp
77 .LP
78 \fIrwflag\fR indicates the direction of the transfer. If \fBUIO_READ\fR is set,
79 the data will be transferred from \fIaddress\fR to the buffer(s) described by
80 \fIuio_p\fR. If \fBUIO_WRITE\fR is set, the data will be transferred from the
81 buffer(s) described by \fIuio_p\fR to \fIaddress\fR.
82 .sp
83 .LP
84 In addition to moving the data, \fBuiomove()\fR adds the number of bytes moved
85 to the \fBiov_base\fR member of the \fBiovec\fR(9S) structure, decreases the
86 \fBiov_len\fR member, increases the \fBuio_offset\fR member of the
87 \fBuio\fR(9S) structure, and decreases the \fBuio_resid\fR member.
88 .sp
89 .LP
90 This function automatically handles page faults. \fInbytes\fR does not have to
91 be word-aligned.
92 .SH RETURN VALUES
93 .sp
94 .LP
95 The \fBuiomove()\fR function returns \fB0\fR upon success or \fBEFAULT\fR on
96 failure.
97 .SH CONTEXT
98 .sp
99 .LP
100 User context only, if \fBuio_segflg\fR is set to \fBUIO_USERSPACE\fR. User,
101 interrupt, or kernel context, if \fBuio_segflg\fR is set to \fBUIO_SYSSPACE\fR.
102 .SH SEE ALSO
105 \fBureadc\fR(9F), \fBuwritec\fR(9F), \fBiovec\fR(9S), \fBuio\fR(9S)
108 \fIWriting Device Drivers\fR
109 .SH WARNINGS
112 If \fBuio_segflg\fR is set to \fBUIO_SYSSPACE\fR and \fIaddress\fR is selected
113 from user space, the system may panic.