Root/
1 | #ifndef __LINUX_UIO_H |
2 | #define __LINUX_UIO_H |
3 | |
4 | #include <linux/compiler.h> |
5 | #include <linux/types.h> |
6 | |
7 | /* |
8 | * Berkeley style UIO structures - Alan Cox 1994. |
9 | * |
10 | * This program is free software; you can redistribute it and/or |
11 | * modify it under the terms of the GNU General Public License |
12 | * as published by the Free Software Foundation; either version |
13 | * 2 of the License, or (at your option) any later version. |
14 | */ |
15 | |
16 | struct iovec |
17 | { |
18 | void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ |
19 | __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ |
20 | }; |
21 | |
22 | /* |
23 | * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) |
24 | */ |
25 | |
26 | #define UIO_FASTIOV 8 |
27 | #define UIO_MAXIOV 1024 |
28 | |
29 | #ifdef __KERNEL__ |
30 | |
31 | struct kvec { |
32 | void *iov_base; /* and that should *never* hold a userland pointer */ |
33 | size_t iov_len; |
34 | }; |
35 | |
36 | /* |
37 | * Total number of bytes covered by an iovec. |
38 | * |
39 | * NOTE that it is not safe to use this function until all the iovec's |
40 | * segment lengths have been validated. Because the individual lengths can |
41 | * overflow a size_t when added together. |
42 | */ |
43 | static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs) |
44 | { |
45 | unsigned long seg; |
46 | size_t ret = 0; |
47 | |
48 | for (seg = 0; seg < nr_segs; seg++) |
49 | ret += iov[seg].iov_len; |
50 | return ret; |
51 | } |
52 | |
53 | unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); |
54 | #endif |
55 | |
56 | #endif |
57 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9