aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 04:26:56 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:05 -0400
commit6aa802ce6acc9b1f0b34114b3f7c21c84872cc3a (patch)
tree74523303349693ef482dec4a1d803566b69c6abd /arch/um/include
parent4c9e13851315a25a705e7a686116e491041ca228 (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')
-rw-r--r--arch/um/include/choose-mode.h20
-rw-r--r--arch/um/include/skas/uaccess-skas.h21
-rw-r--r--arch/um/include/sysdep-i386/ptrace.h67
-rw-r--r--arch/um/include/sysdep-x86_64/ptrace.h83
-rw-r--r--arch/um/include/um_mmu.h1
-rw-r--r--arch/um/include/um_uaccess.h39
6 files changed, 65 insertions, 166 deletions
diff --git a/arch/um/include/choose-mode.h b/arch/um/include/choose-mode.h
deleted file mode 100644
index 51a387626da2..000000000000
--- a/arch/um/include/choose-mode.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __CHOOSE_MODE_H__
7#define __CHOOSE_MODE_H__
8
9#include "uml-config.h"
10
11#define CHOOSE_MODE(tt, skas) (skas)
12
13#define CHOOSE_MODE_PROC(tt, skas, args...) \
14 CHOOSE_MODE(tt(args), skas(args))
15
16#ifndef __CHOOSE_MODE
17#define __CHOOSE_MODE(tt, skas) CHOOSE_MODE(tt, skas)
18#endif
19
20#endif
diff --git a/arch/um/include/skas/uaccess-skas.h b/arch/um/include/skas/uaccess-skas.h
deleted file mode 100644
index 224a75f4c025..000000000000
--- a/arch/um/include/skas/uaccess-skas.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __SKAS_UACCESS_H
7#define __SKAS_UACCESS_H
8
9#include "asm/errno.h"
10
11/* No SKAS-specific checking. */
12#define access_ok_skas(type, addr, size) 0
13
14extern int copy_from_user_skas(void *to, const void __user *from, int n);
15extern int copy_to_user_skas(void __user *to, const void *from, int n);
16extern int strncpy_from_user_skas(char *dst, const char __user *src, int count);
17extern int __clear_user_skas(void __user *mem, int len);
18extern int clear_user_skas(void __user *mem, int len);
19extern int strnlen_user_skas(const void __user *str, int len);
20
21#endif
diff --git a/arch/um/include/sysdep-i386/ptrace.h b/arch/um/include/sysdep-i386/ptrace.h
index c0ea4dbd042b..45573088864c 100644
--- a/arch/um/include/sysdep-i386/ptrace.h
+++ b/arch/um/include/sysdep-i386/ptrace.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -9,7 +9,6 @@
9#include "uml-config.h" 9#include "uml-config.h"
10#include "user_constants.h" 10#include "user_constants.h"
11#include "sysdep/faultinfo.h" 11#include "sysdep/faultinfo.h"
12#include "choose-mode.h"
13 12
14#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long)) 13#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long))
15#define MAX_REG_OFFSET (UM_FRAME_SIZE) 14#define MAX_REG_OFFSET (UM_FRAME_SIZE)
@@ -67,40 +66,23 @@ union uml_pt_regs {
67#define EMPTY_UML_PT_REGS { } 66#define EMPTY_UML_PT_REGS { }
68 67
69#define UPT_SC(r) ((r)->tt.sc) 68#define UPT_SC(r) ((r)->tt.sc)
70#define UPT_IP(r) \ 69#define UPT_IP(r) REGS_IP((r)->skas.regs)
71 __CHOOSE_MODE(SC_IP(UPT_SC(r)), REGS_IP((r)->skas.regs)) 70#define UPT_SP(r) REGS_SP((r)->skas.regs)
72#define UPT_SP(r) \ 71#define UPT_EFLAGS(r) REGS_EFLAGS((r)->skas.regs)
73 __CHOOSE_MODE(SC_SP(UPT_SC(r)), REGS_SP((r)->skas.regs)) 72#define UPT_EAX(r) REGS_EAX((r)->skas.regs)
74#define UPT_EFLAGS(r) \ 73#define UPT_EBX(r) REGS_EBX((r)->skas.regs)
75 __CHOOSE_MODE(SC_EFLAGS(UPT_SC(r)), REGS_EFLAGS((r)->skas.regs)) 74#define UPT_ECX(r) REGS_ECX((r)->skas.regs)
76#define UPT_EAX(r) \ 75#define UPT_EDX(r) REGS_EDX((r)->skas.regs)
77 __CHOOSE_MODE(SC_EAX(UPT_SC(r)), REGS_EAX((r)->skas.regs)) 76#define UPT_ESI(r) REGS_ESI((r)->skas.regs)
78#define UPT_EBX(r) \ 77#define UPT_EDI(r) REGS_EDI((r)->skas.regs)
79 __CHOOSE_MODE(SC_EBX(UPT_SC(r)), REGS_EBX((r)->skas.regs)) 78#define UPT_EBP(r) REGS_EBP((r)->skas.regs)
80#define UPT_ECX(r) \ 79#define UPT_ORIG_EAX(r) ((r)->skas.syscall)
81 __CHOOSE_MODE(SC_ECX(UPT_SC(r)), REGS_ECX((r)->skas.regs)) 80#define UPT_CS(r) REGS_CS((r)->skas.regs)
82#define UPT_EDX(r) \ 81#define UPT_SS(r) REGS_SS((r)->skas.regs)
83 __CHOOSE_MODE(SC_EDX(UPT_SC(r)), REGS_EDX((r)->skas.regs)) 82#define UPT_DS(r) REGS_DS((r)->skas.regs)
84#define UPT_ESI(r) \ 83#define UPT_ES(r) REGS_ES((r)->skas.regs)
85 __CHOOSE_MODE(SC_ESI(UPT_SC(r)), REGS_ESI((r)->skas.regs)) 84#define UPT_FS(r) REGS_FS((r)->skas.regs)
86#define UPT_EDI(r) \ 85#define UPT_GS(r) REGS_GS((r)->skas.regs)
87 __CHOOSE_MODE(SC_EDI(UPT_SC(r)), REGS_EDI((r)->skas.regs))
88#define UPT_EBP(r) \
89 __CHOOSE_MODE(SC_EBP(UPT_SC(r)), REGS_EBP((r)->skas.regs))
90#define UPT_ORIG_EAX(r) \
91 __CHOOSE_MODE((r)->tt.syscall, (r)->skas.syscall)
92#define UPT_CS(r) \
93 __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs))
94#define UPT_SS(r) \
95 __CHOOSE_MODE(SC_SS(UPT_SC(r)), REGS_SS((r)->skas.regs))
96#define UPT_DS(r) \
97 __CHOOSE_MODE(SC_DS(UPT_SC(r)), REGS_DS((r)->skas.regs))
98#define UPT_ES(r) \
99 __CHOOSE_MODE(SC_ES(UPT_SC(r)), REGS_ES((r)->skas.regs))
100#define UPT_FS(r) \
101 __CHOOSE_MODE(SC_FS(UPT_SC(r)), REGS_FS((r)->skas.regs))
102#define UPT_GS(r) \
103 __CHOOSE_MODE(SC_GS(UPT_SC(r)), REGS_GS((r)->skas.regs))
104 86
105#define UPT_SYSCALL_ARG1(r) UPT_EBX(r) 87#define UPT_SYSCALL_ARG1(r) UPT_EBX(r)
106#define UPT_SYSCALL_ARG2(r) UPT_ECX(r) 88#define UPT_SYSCALL_ARG2(r) UPT_ECX(r)
@@ -111,8 +93,7 @@ union uml_pt_regs {
111 93
112extern int user_context(unsigned long sp); 94extern int user_context(unsigned long sp);
113 95
114#define UPT_IS_USER(r) \ 96#define UPT_IS_USER(r) ((r)->skas.is_user)
115 CHOOSE_MODE(user_context(UPT_SP(r)), (r)->skas.is_user)
116 97
117struct syscall_args { 98struct syscall_args {
118 unsigned long args[6]; 99 unsigned long args[6];
@@ -181,18 +162,14 @@ struct syscall_args {
181 } while (0) 162 } while (0)
182 163
183#define UPT_SET_SYSCALL_RETURN(r, res) \ 164#define UPT_SET_SYSCALL_RETURN(r, res) \
184 CHOOSE_MODE(SC_SET_SYSCALL_RETURN(UPT_SC(r), (res)), \ 165 REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res))
185 REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res)))
186 166
187#define UPT_RESTART_SYSCALL(r) \ 167#define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->skas.regs)
188 CHOOSE_MODE(SC_RESTART_SYSCALL(UPT_SC(r)), \
189 REGS_RESTART_SYSCALL((r)->skas.regs))
190 168
191#define UPT_ORIG_SYSCALL(r) UPT_EAX(r) 169#define UPT_ORIG_SYSCALL(r) UPT_EAX(r)
192#define UPT_SYSCALL_NR(r) UPT_ORIG_EAX(r) 170#define UPT_SYSCALL_NR(r) UPT_ORIG_EAX(r)
193#define UPT_SYSCALL_RET(r) UPT_EAX(r) 171#define UPT_SYSCALL_RET(r) UPT_EAX(r)
194 172
195#define UPT_FAULTINFO(r) \ 173#define UPT_FAULTINFO(r) (&(r)->skas.faultinfo)
196 CHOOSE_MODE((&(r)->tt.faultinfo), (&(r)->skas.faultinfo))
197 174
198#endif 175#endif
diff --git a/arch/um/include/sysdep-x86_64/ptrace.h b/arch/um/include/sysdep-x86_64/ptrace.h
index ff525bda4c11..b3412b64cbea 100644
--- a/arch/um/include/sysdep-x86_64/ptrace.h
+++ b/arch/um/include/sysdep-x86_64/ptrace.h
@@ -84,8 +84,6 @@
84 84
85#define REGS_ERR(r) ((r)->fault_type) 85#define REGS_ERR(r) ((r)->fault_type)
86 86
87#include "choose-mode.h"
88
89/* XXX */ 87/* XXX */
90union uml_pt_regs { 88union uml_pt_regs {
91 struct skas_regs { 89 struct skas_regs {
@@ -99,48 +97,45 @@ union uml_pt_regs {
99 97
100#define EMPTY_UML_PT_REGS { } 98#define EMPTY_UML_PT_REGS { }
101 99
102#define UPT_RBX(r) __CHOOSE_MODE(SC_RBX(UPT_SC(r)), REGS_RBX((r)->skas.regs)) 100#define UPT_RBX(r) REGS_RBX((r)->skas.regs)
103#define UPT_RCX(r) __CHOOSE_MODE(SC_RCX(UPT_SC(r)), REGS_RCX((r)->skas.regs)) 101#define UPT_RCX(r) REGS_RCX((r)->skas.regs)
104#define UPT_RDX(r) __CHOOSE_MODE(SC_RDX(UPT_SC(r)), REGS_RDX((r)->skas.regs)) 102#define UPT_RDX(r) REGS_RDX((r)->skas.regs)
105#define UPT_RSI(r) __CHOOSE_MODE(SC_RSI(UPT_SC(r)), REGS_RSI((r)->skas.regs)) 103#define UPT_RSI(r) REGS_RSI((r)->skas.regs)
106#define UPT_RDI(r) __CHOOSE_MODE(SC_RDI(UPT_SC(r)), REGS_RDI((r)->skas.regs)) 104#define UPT_RDI(r) REGS_RDI((r)->skas.regs)
107#define UPT_RBP(r) __CHOOSE_MODE(SC_RBP(UPT_SC(r)), REGS_RBP((r)->skas.regs)) 105#define UPT_RBP(r) REGS_RBP((r)->skas.regs)
108#define UPT_RAX(r) __CHOOSE_MODE(SC_RAX(UPT_SC(r)), REGS_RAX((r)->skas.regs)) 106#define UPT_RAX(r) REGS_RAX((r)->skas.regs)
109#define UPT_R8(r) __CHOOSE_MODE(SC_R8(UPT_SC(r)), REGS_R8((r)->skas.regs)) 107#define UPT_R8(r) REGS_R8((r)->skas.regs)
110#define UPT_R9(r) __CHOOSE_MODE(SC_R9(UPT_SC(r)), REGS_R9((r)->skas.regs)) 108#define UPT_R9(r) REGS_R9((r)->skas.regs)
111#define UPT_R10(r) __CHOOSE_MODE(SC_R10(UPT_SC(r)), REGS_R10((r)->skas.regs)) 109#define UPT_R10(r) REGS_R10((r)->skas.regs)
112#define UPT_R11(r) __CHOOSE_MODE(SC_R11(UPT_SC(r)), REGS_R11((r)->skas.regs)) 110#define UPT_R11(r) REGS_R11((r)->skas.regs)
113#define UPT_R12(r) __CHOOSE_MODE(SC_R12(UPT_SC(r)), REGS_R12((r)->skas.regs)) 111#define UPT_R12(r) REGS_R12((r)->skas.regs)
114#define UPT_R13(r) __CHOOSE_MODE(SC_R13(UPT_SC(r)), REGS_R13((r)->skas.regs)) 112#define UPT_R13(r) REGS_R13((r)->skas.regs)
115#define UPT_R14(r) __CHOOSE_MODE(SC_R14(UPT_SC(r)), REGS_R14((r)->skas.regs)) 113#define UPT_R14(r) REGS_R14((r)->skas.regs)
116#define UPT_R15(r) __CHOOSE_MODE(SC_R15(UPT_SC(r)), REGS_R15((r)->skas.regs)) 114#define UPT_R15(r) REGS_R15((r)->skas.regs)
117#define UPT_CS(r) __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs)) 115#define UPT_CS(r) REGS_CS((r)->skas.regs)
118#define UPT_FS_BASE(r) \ 116#define UPT_FS_BASE(r) \
119 __CHOOSE_MODE(SC_FS_BASE(UPT_SC(r)), REGS_FS_BASE((r)->skas.regs)) 117 REGS_FS_BASE((r)->skas.regs)
120#define UPT_FS(r) __CHOOSE_MODE(SC_FS(UPT_SC(r)), REGS_FS((r)->skas.regs)) 118#define UPT_FS(r) REGS_FS((r)->skas.regs)
121#define UPT_GS_BASE(r) \ 119#define UPT_GS_BASE(r) \
122 __CHOOSE_MODE(SC_GS_BASE(UPT_SC(r)), REGS_GS_BASE((r)->skas.regs)) 120 REGS_GS_BASE((r)->skas.regs)
123#define UPT_GS(r) __CHOOSE_MODE(SC_GS(UPT_SC(r)), REGS_GS((r)->skas.regs)) 121#define UPT_GS(r) REGS_GS((r)->skas.regs)
124#define UPT_DS(r) __CHOOSE_MODE(SC_DS(UPT_SC(r)), REGS_DS((r)->skas.regs)) 122#define UPT_DS(r) REGS_DS((r)->skas.regs)
125#define UPT_ES(r) __CHOOSE_MODE(SC_ES(UPT_SC(r)), REGS_ES((r)->skas.regs)) 123#define UPT_ES(r) REGS_ES((r)->skas.regs)
126#define UPT_CS(r) __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs)) 124#define UPT_CS(r) REGS_CS((r)->skas.regs)
127#define UPT_SS(r) __CHOOSE_MODE(SC_SS(UPT_SC(r)), REGS_SS((r)->skas.regs)) 125#define UPT_SS(r) REGS_SS((r)->skas.regs)
128#define UPT_ORIG_RAX(r) \ 126#define UPT_ORIG_RAX(r) REGS_ORIG_RAX((r)->skas.regs)
129 __CHOOSE_MODE((r)->tt.orig_rax, REGS_ORIG_RAX((r)->skas.regs)) 127
130 128#define UPT_IP(r) REGS_IP((r)->skas.regs)
131#define UPT_IP(r) __CHOOSE_MODE(SC_IP(UPT_SC(r)), REGS_IP((r)->skas.regs)) 129#define UPT_SP(r) REGS_SP((r)->skas.regs)
132#define UPT_SP(r) __CHOOSE_MODE(SC_SP(UPT_SC(r)), REGS_SP((r)->skas.regs)) 130
133 131#define UPT_EFLAGS(r) REGS_EFLAGS((r)->skas.regs)
134#define UPT_EFLAGS(r) \
135 __CHOOSE_MODE(SC_EFLAGS(UPT_SC(r)), REGS_EFLAGS((r)->skas.regs))
136#define UPT_SC(r) ((r)->tt.sc) 132#define UPT_SC(r) ((r)->tt.sc)
137#define UPT_SYSCALL_NR(r) __CHOOSE_MODE((r)->tt.syscall, (r)->skas.syscall) 133#define UPT_SYSCALL_NR(r) ((r)->skas.syscall)
138#define UPT_SYSCALL_RET(r) UPT_RAX(r) 134#define UPT_SYSCALL_RET(r) UPT_RAX(r)
139 135
140extern int user_context(unsigned long sp); 136extern int user_context(unsigned long sp);
141 137
142#define UPT_IS_USER(r) \ 138#define UPT_IS_USER(r) ((r)->skas.is_user)
143 CHOOSE_MODE(user_context(UPT_SP(r)), (r)->skas.is_user)
144 139
145#define UPT_SYSCALL_ARG1(r) UPT_RDI(r) 140#define UPT_SYSCALL_ARG1(r) UPT_RDI(r)
146#define UPT_SYSCALL_ARG2(r) UPT_RSI(r) 141#define UPT_SYSCALL_ARG2(r) UPT_RSI(r)
@@ -237,18 +232,12 @@ struct syscall_args {
237 }) 232 })
238 233
239#define UPT_SET_SYSCALL_RETURN(r, res) \ 234#define UPT_SET_SYSCALL_RETURN(r, res) \
240 CHOOSE_MODE(SC_SET_SYSCALL_RETURN(UPT_SC(r), (res)), \ 235 REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res))
241 REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res)))
242 236
243#define UPT_RESTART_SYSCALL(r) \ 237#define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->skas.regs)
244 CHOOSE_MODE(SC_RESTART_SYSCALL(UPT_SC(r)), \
245 REGS_RESTART_SYSCALL((r)->skas.regs))
246 238
247#define UPT_SEGV_IS_FIXABLE(r) \ 239#define UPT_SEGV_IS_FIXABLE(r) REGS_SEGV_IS_FIXABLE(&r->skas)
248 CHOOSE_MODE(SC_SEGV_IS_FIXABLE(UPT_SC(r)), \
249 REGS_SEGV_IS_FIXABLE(&r->skas))
250 240
251#define UPT_FAULTINFO(r) \ 241#define UPT_FAULTINFO(r) (&(r)->skas.faultinfo)
252 CHOOSE_MODE((&(r)->tt.faultinfo), (&(r)->skas.faultinfo))
253 242
254#endif 243#endif
diff --git a/arch/um/include/um_mmu.h b/arch/um/include/um_mmu.h
index 2461be6b0a60..03bd4b949c04 100644
--- a/arch/um/include/um_mmu.h
+++ b/arch/um/include/um_mmu.h
@@ -7,7 +7,6 @@
7#define __ARCH_UM_MMU_H 7#define __ARCH_UM_MMU_H
8 8
9#include "uml-config.h" 9#include "uml-config.h"
10#include "choose-mode.h"
11#include "mmu-skas.h" 10#include "mmu-skas.h"
12 11
13typedef union mm_context { 12typedef union mm_context {
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