diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 04:26:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:05 -0400 |
commit | 6aa802ce6acc9b1f0b34114b3f7c21c84872cc3a (patch) | |
tree | 74523303349693ef482dec4a1d803566b69c6abd /arch/um/include/um_uaccess.h | |
parent | 4c9e13851315a25a705e7a686116e491041ca228 (diff) |
uml: throw out CHOOSE_MODE
The next stage after removing code which depends on CONFIG_MODE_TT is removing
the CHOOSE_MODE abstraction, which provided both compile-time and run-time
branching to either tt-mode or skas-mode code.
This patch removes choose-mode.h and all inclusions of it, and replaces all
CHOOSE_MODE invocations with the skas branch. This leaves a number of trivial
functions which will be dealt with in a later patch.
There are some changes in the uaccess and tls support which go somewhat beyond
this and eliminate some of the now-redundant functions.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/include/um_uaccess.h')
-rw-r--r-- | arch/um/include/um_uaccess.h | 39 |
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 | ||
33 | static inline int copy_from_user(void *to, const void __user *from, int n) | 30 | extern int copy_from_user(void *to, const void __user *from, int n); |
34 | { | 31 | extern 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 | |||
39 | static 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 | ||
64 | static inline int strncpy_from_user(char *dst, const char __user *src, int count) | 52 | extern 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 | */ |
81 | static inline int __clear_user(void *mem, int len) | 65 | extern 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 | */ |
96 | static inline int clear_user(void __user *mem, int len) | 77 | extern 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 | */ |
112 | static inline int strnlen_user(const void __user *str, long len) | 90 | extern 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 | ||