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"
9 uiomove \- copy kernel data using uio structure
13 #include <sys/types.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);
25 Architecture independent level 1 (DDI/DKI).
33 Source/destination kernel address of the copy.
42 Number of bytes to copy.
51 Flag indicating read or write operation. Possible values are \fBUIO_READ\fR and
61 Pointer to the \fBuio\fR structure for the copy.
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.
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
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.
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.
90 This function automatically handles page faults. \fInbytes\fR does not have to
95 The \fBuiomove()\fR function returns \fB0\fR upon success or \fBEFAULT\fR on
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.
105 \fBureadc\fR(9F), \fBuwritec\fR(9F), \fBiovec\fR(9S), \fBuio\fR(9S)
108 \fIWriting Device Drivers\fR
112 If \fBuio_segflg\fR is set to \fBUIO_SYSSPACE\fR and \fIaddress\fR is selected
113 from user space, the system may panic.