1uiomove(9F) Kernel Functions for Drivers uiomove(9F)
2
3
4
6 uiomove - copy kernel data using uio structure
7
9 #include <sys/types.h>
10 #include <sys/uio.h>
11
12
13
14 int uiomove(caddr_t address, size_t nbytes, enum uio_rw rwflag,
15 uio_t *uio_p);
16
17
19 Architecture independent level 1 (DDI/DKI).
20
22 address Source/destination kernel address of the copy.
23
24
25 nbytes Number of bytes to copy.
26
27
28 rwflag Flag indicating read or write operation. Possible values are
29 UIO_READ and UIO_WRITE.
30
31
32 uio_p Pointer to the uio structure for the copy.
33
34
36 The uiomove() function copies nbytes of data to or from the space
37 defined by the uio structure (described in uio(9S)) and the driver.
38
39
40 The uio_segflg member of the uio(9S) structure determines the type of
41 space to or from which the transfer is being made. If it is set to
42 UIO_SYSSPACE, the data transfer is between addresses in the kernel. If
43 it is set to UIO_USERSPACE, the transfer is between a user program and
44 kernel space.
45
46
47 rwflag indicates the direction of the transfer. If UIO_READ is set, the
48 data will be transferred from address to the buffer(s) described by
49 uio_p. If UIO_WRITE is set, the data will be transferred from the buf‐
50 fer(s) described by uio_p to address.
51
52
53 In addition to moving the data, uiomove() adds the number of bytes
54 moved to the iov_base member of the iovec(9S) structure, decreases the
55 iov_len member, increases the uio_offset member of the uio(9S) struc‐
56 ture, and decreases the uio_resid member.
57
58
59 This function automatically handles page faults. nbytes does not have
60 to be word-aligned.
61
63 The uiomove() function returns 0 upon success or EFAULT on failure.
64
66 User context only, if uio_segflg is set to UIO_USERSPACE. User, inter‐
67 rupt, or kernel context, if uio_segflg is set to UIO_SYSSPACE.
68
70 ureadc(9F), uwritec(9F), iovec(9S), uio(9S)
71
72
73 Writing Device Drivers
74
76 If uio_segflg is set to UIO_SYSSPACE and address is selected from user
77 space, the system may panic.
78
79
80
81SunOS 5.11 16 Jan 2006 uiomove(9F)