aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-i386
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/sys-i386
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/sys-i386')
-rw-r--r--arch/um/sys-i386/ldt.c4
-rw-r--r--arch/um/sys-i386/ptrace.c17
-rw-r--r--arch/um/sys-i386/signal.c12
-rw-r--r--arch/um/sys-i386/tls.c7
4 files changed, 11 insertions, 29 deletions
diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c
index 762a12aec757..2683d302395d 100644
--- a/arch/um/sys-i386/ldt.c
+++ b/arch/um/sys-i386/ldt.c
@@ -12,7 +12,6 @@
12#include "asm/smp.h" 12#include "asm/smp.h"
13#include "asm/ldt.h" 13#include "asm/ldt.h"
14#include "asm/unistd.h" 14#include "asm/unistd.h"
15#include "choose-mode.h"
16#include "kern.h" 15#include "kern.h"
17#include "mode_kern.h" 16#include "mode_kern.h"
18#include "os.h" 17#include "os.h"
@@ -506,6 +505,5 @@ void free_ldt(struct mmu_context_skas * mm)
506 505
507int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount) 506int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
508{ 507{
509 return CHOOSE_MODE_PROC(do_modify_ldt_tt, do_modify_ldt_skas, func, 508 return do_modify_ldt_skas(func, ptr, bytecount);
510 ptr, bytecount);
511} 509}
diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c
index 572fd504b94b..7792365827a2 100644
--- a/arch/um/sys-i386/ptrace.c
+++ b/arch/um/sys-i386/ptrace.c
@@ -230,13 +230,13 @@ static inline unsigned long twd_fxsr_to_i387( struct i387_fxsave_struct *fxsave
230static inline int convert_fxsr_to_user(struct _fpstate __user *buf, 230static inline int convert_fxsr_to_user(struct _fpstate __user *buf,
231 struct pt_regs *regs) 231 struct pt_regs *regs)
232{ 232{
233 return(CHOOSE_MODE(convert_fxsr_to_user_tt(buf, regs), 0)); 233 return 0;
234} 234}
235 235
236static inline int convert_fxsr_from_user(struct pt_regs *regs, 236static inline int convert_fxsr_from_user(struct pt_regs *regs,
237 struct _fpstate __user *buf) 237 struct _fpstate __user *buf)
238{ 238{
239 return(CHOOSE_MODE(convert_fxsr_from_user_tt(regs, buf), 0)); 239 return 0;
240} 240}
241 241
242int get_fpregs(unsigned long buf, struct task_struct *child) 242int get_fpregs(unsigned long buf, struct task_struct *child)
@@ -261,12 +261,12 @@ int set_fpregs(unsigned long buf, struct task_struct *child)
261 261
262int get_fpxregs(unsigned long buf, struct task_struct *tsk) 262int get_fpxregs(unsigned long buf, struct task_struct *tsk)
263{ 263{
264 return(CHOOSE_MODE(get_fpxregs_tt(buf, tsk), 0)); 264 return 0;
265} 265}
266 266
267int set_fpxregs(unsigned long buf, struct task_struct *tsk) 267int set_fpxregs(unsigned long buf, struct task_struct *tsk)
268{ 268{
269 return(CHOOSE_MODE(set_fpxregs_tt(buf, tsk), 0)); 269 return 0;
270} 270}
271 271
272#ifdef notdef 272#ifdef notdef
@@ -286,16 +286,9 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
286} 286}
287#endif 287#endif
288 288
289static inline void copy_fpu_fxsave(struct pt_regs *regs,
290 struct user_i387_struct *buf)
291{
292 (void) CHOOSE_MODE(copy_fpu_fxsave_tt(regs, buf), 0);
293}
294
295int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu ) 289int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu )
296{ 290{
297 copy_fpu_fxsave(regs, (struct user_i387_struct *) fpu); 291 return 1;
298 return(1);
299} 292}
300 293
301/* 294/*
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c
index 187ea27536bd..a9fe8d6f72c3 100644
--- a/arch/um/sys-i386/signal.c
+++ b/arch/um/sys-i386/signal.c
@@ -12,7 +12,6 @@
12#include "frame_kern.h" 12#include "frame_kern.h"
13#include "sigcontext.h" 13#include "sigcontext.h"
14#include "registers.h" 14#include "registers.h"
15#include "mode.h"
16#include "skas.h" 15#include "skas.h"
17 16
18void copy_sc(union uml_pt_regs *regs, void *from) 17void copy_sc(union uml_pt_regs *regs, void *from)
@@ -108,20 +107,13 @@ int copy_sc_to_user_skas(struct sigcontext __user *to, struct _fpstate __user *t
108 107
109static int copy_sc_from_user(struct pt_regs *to, void __user *from) 108static int copy_sc_from_user(struct pt_regs *to, void __user *from)
110{ 109{
111 int ret; 110 return copy_sc_from_user_skas(to, from);
112
113 ret = CHOOSE_MODE(copy_sc_from_user_tt(UPT_SC(&to->regs), from,
114 sizeof(struct _fpstate)),
115 copy_sc_from_user_skas(to, from));
116 return ret;
117} 111}
118 112
119static int copy_sc_to_user(struct sigcontext __user *to, struct _fpstate __user *fp, 113static int copy_sc_to_user(struct sigcontext __user *to, struct _fpstate __user *fp,
120 struct pt_regs *from, unsigned long sp) 114 struct pt_regs *from, unsigned long sp)
121{ 115{
122 return CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs), 116 return copy_sc_to_user_skas(to, fp, from, sp);
123 sizeof(*fp), sp),
124 copy_sc_to_user_skas(to, fp, from, sp));
125} 117}
126 118
127static int copy_ucontext_to_user(struct ucontext __user *uc, struct _fpstate __user *fp, 119static int copy_ucontext_to_user(struct ucontext __user *uc, struct _fpstate __user *fp,
diff --git a/arch/um/sys-i386/tls.c b/arch/um/sys-i386/tls.c
index 0340b96d101b..bb4d0e23aa81 100644
--- a/arch/um/sys-i386/tls.c
+++ b/arch/um/sys-i386/tls.c
@@ -12,7 +12,6 @@
12#include "asm/segment.h" 12#include "asm/segment.h"
13#include "asm/smp.h" 13#include "asm/smp.h"
14#include "asm/desc.h" 14#include "asm/desc.h"
15#include "choose-mode.h"
16#include "kern.h" 15#include "kern.h"
17#include "kern_util.h" 16#include "kern_util.h"
18#include "mode_kern.h" 17#include "mode_kern.h"
@@ -28,7 +27,7 @@
28static int host_supports_tls = -1; 27static int host_supports_tls = -1;
29int host_gdt_entry_tls_min; 28int host_gdt_entry_tls_min;
30 29
31int do_set_thread_area_skas(struct user_desc *info) 30int do_set_thread_area(struct user_desc *info)
32{ 31{
33 int ret; 32 int ret;
34 u32 cpu; 33 u32 cpu;
@@ -39,7 +38,7 @@ int do_set_thread_area_skas(struct user_desc *info)
39 return ret; 38 return ret;
40} 39}
41 40
42int do_get_thread_area_skas(struct user_desc *info) 41int do_get_thread_area(struct user_desc *info)
43{ 42{
44 int ret; 43 int ret;
45 u32 cpu; 44 u32 cpu;
@@ -277,7 +276,7 @@ asmlinkage int sys_set_thread_area(struct user_desc __user *user_desc)
277 return -EFAULT; 276 return -EFAULT;
278 } 277 }
279 278
280 ret = CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, &info); 279 ret = do_set_thread_area(&info);
281 if (ret) 280 if (ret)
282 return ret; 281 return ret;
283 return set_tls_entry(current, &info, idx, 1); 282 return set_tls_entry(current, &info, idx, 1);