aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include/um_uaccess.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/include/um_uaccess.h')
-rw-r--r--arch/um/include/um_uaccess.h39
1 files changed, 7 insertions, 32 deletions
diff --git a/arch/um/include/um_uaccess.h b/arch/um/include/um_uaccess.h
index 6757ee768ccb..b1629b1e1423 100644
--- a/arch/um/include/um_uaccess.h
+++ b/arch/um/include/um_uaccess.h
@@ -6,8 +6,6 @@
6#ifndef __ARCH_UM_UACCESS_H 6#ifndef __ARCH_UM_UACCESS_H
7#define __ARCH_UM_UACCESS_H 7#define __ARCH_UM_UACCESS_H
8 8
9#include "choose-mode.h"
10#include "uaccess-skas.h"
11#include "asm/fixmap.h" 9#include "asm/fixmap.h"
12 10
13#define __under_task_size(addr, size) \ 11#define __under_task_size(addr, size) \
@@ -27,20 +25,10 @@
27 (__addr_range_nowrap(addr, size) && \ 25 (__addr_range_nowrap(addr, size) && \
28 (__under_task_size(addr, size) || \ 26 (__under_task_size(addr, size) || \
29 __access_ok_vsyscall(type, addr, size) || \ 27 __access_ok_vsyscall(type, addr, size) || \
30 segment_eq(get_fs(), KERNEL_DS) || \ 28 segment_eq(get_fs(), KERNEL_DS)))
31 CHOOSE_MODE_PROC(access_ok_tt, access_ok_skas, type, addr, size)))
32 29
33static inline int copy_from_user(void *to, const void __user *from, int n) 30extern int copy_from_user(void *to, const void __user *from, int n);
34{ 31extern int copy_to_user(void __user *to, const void *from, int n);
35 return(CHOOSE_MODE_PROC(copy_from_user_tt, copy_from_user_skas, to,
36 from, n));
37}
38
39static inline int copy_to_user(void __user *to, const void *from, int n)
40{
41 return(CHOOSE_MODE_PROC(copy_to_user_tt, copy_to_user_skas, to,
42 from, n));
43}
44 32
45/* 33/*
46 * strncpy_from_user: - Copy a NUL terminated string from userspace. 34 * strncpy_from_user: - Copy a NUL terminated string from userspace.
@@ -61,11 +49,7 @@ static inline int copy_to_user(void __user *to, const void *from, int n)
61 * and returns @count. 49 * and returns @count.
62 */ 50 */
63 51
64static inline int strncpy_from_user(char *dst, const char __user *src, int count) 52extern int strncpy_from_user(char *dst, const char __user *src, int count);
65{
66 return(CHOOSE_MODE_PROC(strncpy_from_user_tt, strncpy_from_user_skas,
67 dst, src, count));
68}
69 53
70/* 54/*
71 * __clear_user: - Zero a block of memory in user space, with less checking. 55 * __clear_user: - Zero a block of memory in user space, with less checking.
@@ -78,10 +62,7 @@ static inline int strncpy_from_user(char *dst, const char __user *src, int count
78 * Returns number of bytes that could not be cleared. 62 * Returns number of bytes that could not be cleared.
79 * On success, this will be zero. 63 * On success, this will be zero.
80 */ 64 */
81static inline int __clear_user(void *mem, int len) 65extern int __clear_user(void __user *mem, int len);
82{
83 return(CHOOSE_MODE_PROC(__clear_user_tt, __clear_user_skas, mem, len));
84}
85 66
86/* 67/*
87 * clear_user: - Zero a block of memory in user space. 68 * clear_user: - Zero a block of memory in user space.
@@ -93,10 +74,7 @@ static inline int __clear_user(void *mem, int len)
93 * Returns number of bytes that could not be cleared. 74 * Returns number of bytes that could not be cleared.
94 * On success, this will be zero. 75 * On success, this will be zero.
95 */ 76 */
96static inline int clear_user(void __user *mem, int len) 77extern int clear_user(void __user *mem, int len);
97{
98 return(CHOOSE_MODE_PROC(clear_user_tt, clear_user_skas, mem, len));
99}
100 78
101/* 79/*
102 * strlen_user: - Get the size of a string in user space. 80 * strlen_user: - Get the size of a string in user space.
@@ -109,10 +87,7 @@ static inline int clear_user(void __user *mem, int len)
109 * On exception, returns 0. 87 * On exception, returns 0.
110 * If the string is too long, returns a value greater than @n. 88 * If the string is too long, returns a value greater than @n.
111 */ 89 */
112static inline int strnlen_user(const void __user *str, long len) 90extern int strnlen_user(const void __user *str, int len);
113{
114 return(CHOOSE_MODE_PROC(strnlen_user_tt, strnlen_user_skas, str, len));
115}
116 91
117#endif 92#endif
118 93