uml: throw out CONFIG_MODE_TT
[pandora-kernel.git] / arch / um / sys-i386 / ptrace.c
index 28bf011..572fd50 100644 (file)
 #include "sysdep/sigcontext.h"
 #include "sysdep/sc.h"
 
-void arch_switch_to_tt(struct task_struct *from, struct task_struct *to)
-{
-       update_debugregs(to->thread.arch.debugregs_seq);
-       arch_switch_tls_tt(from, to);
-}
-
 void arch_switch_to_skas(struct task_struct *from, struct task_struct *to)
 {
        int err = arch_switch_tls_skas(from, to);
@@ -233,79 +227,12 @@ static inline unsigned long twd_fxsr_to_i387( struct i387_fxsave_struct *fxsave
        return ret;
 }
 
-/*
- * FXSR floating point environment conversions.
- */
-
-#ifdef CONFIG_MODE_TT
-static inline int convert_fxsr_to_user_tt(struct _fpstate __user *buf,
-                                         struct pt_regs *regs)
-{
-       struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs));
-       unsigned long env[7];
-       struct _fpreg __user *to;
-       struct _fpxreg *from;
-       int i;
-
-       env[0] = (unsigned long)fxsave->cwd | 0xffff0000;
-       env[1] = (unsigned long)fxsave->swd | 0xffff0000;
-       env[2] = twd_fxsr_to_i387(fxsave);
-       env[3] = fxsave->fip;
-       env[4] = fxsave->fcs | ((unsigned long)fxsave->fop << 16);
-       env[5] = fxsave->foo;
-       env[6] = fxsave->fos;
-
-       if ( __copy_to_user( buf, env, 7 * sizeof(unsigned long) ) )
-               return 1;
-
-       to = &buf->_st[0];
-       from = (struct _fpxreg *) &fxsave->st_space[0];
-       for ( i = 0 ; i < 8 ; i++, to++, from++ ) {
-               if ( __copy_to_user( to, from, sizeof(*to) ) )
-                       return 1;
-       }
-       return 0;
-}
-#endif
-
 static inline int convert_fxsr_to_user(struct _fpstate __user *buf,
                                       struct pt_regs *regs)
 {
        return(CHOOSE_MODE(convert_fxsr_to_user_tt(buf, regs), 0));
 }
 
-#ifdef CONFIG_MODE_TT
-static inline int convert_fxsr_from_user_tt(struct pt_regs *regs,
-                                           struct _fpstate __user *buf)
-{
-       struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs));
-       unsigned long env[7];
-       struct _fpxreg *to;
-       struct _fpreg __user *from;
-       int i;
-
-       if ( __copy_from_user( env, buf, 7 * sizeof(long) ) )
-               return 1;
-
-       fxsave->cwd = (unsigned short)(env[0] & 0xffff);
-       fxsave->swd = (unsigned short)(env[1] & 0xffff);
-       fxsave->twd = twd_i387_to_fxsr((unsigned short)(env[2] & 0xffff));
-       fxsave->fip = env[3];
-       fxsave->fop = (unsigned short)((env[4] & 0xffff0000) >> 16);
-       fxsave->fcs = (env[4] & 0xffff);
-       fxsave->foo = env[5];
-       fxsave->fos = env[6];
-
-       to = (struct _fpxreg *) &fxsave->st_space[0];
-       from = &buf->_st[0];
-       for ( i = 0 ; i < 8 ; i++, to++, from++ ) {
-               if ( __copy_from_user( to, from, sizeof(*from) ) )
-                       return 1;
-       }
-       return 0;
-}
-#endif
-
 static inline int convert_fxsr_from_user(struct pt_regs *regs, 
                                         struct _fpstate __user *buf)
 {
@@ -332,39 +259,11 @@ int set_fpregs(unsigned long buf, struct task_struct *child)
        else return(0);
 }
 
-#ifdef CONFIG_MODE_TT
-int get_fpxregs_tt(unsigned long buf, struct task_struct *tsk)
-{
-       struct pt_regs *regs = &tsk->thread.regs;
-       struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs));
-       int err;
-
-       err = __copy_to_user((void __user *) buf, fxsave,
-                            sizeof(struct user_fxsr_struct));
-       if(err) return -EFAULT;
-       else return 0;
-}
-#endif
-
 int get_fpxregs(unsigned long buf, struct task_struct *tsk)
 {
        return(CHOOSE_MODE(get_fpxregs_tt(buf, tsk), 0));
 }
 
-#ifdef CONFIG_MODE_TT
-int set_fpxregs_tt(unsigned long buf, struct task_struct *tsk)
-{
-       struct pt_regs *regs = &tsk->thread.regs;
-       struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs));
-       int err;
-
-       err = __copy_from_user(fxsave, (void __user *) buf,
-                              sizeof(struct user_fxsr_struct) );
-       if(err) return -EFAULT;
-       else return 0;
-}
-#endif
-
 int set_fpxregs(unsigned long buf, struct task_struct *tsk)
 {
        return(CHOOSE_MODE(set_fpxregs_tt(buf, tsk), 0));
@@ -387,25 +286,6 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
 }
 #endif
 
-#ifdef CONFIG_MODE_TT
-static inline void copy_fpu_fxsave_tt(struct pt_regs *regs,
-                                     struct user_i387_struct *buf)
-{
-       struct i387_fxsave_struct *fpu = SC_FXSR_ENV(PT_REGS_SC(regs));
-       unsigned short *to;
-       unsigned short *from;
-       int i;
-
-       memcpy( buf, fpu, 7 * sizeof(long) );
-
-       to = (unsigned short *) &buf->st_space[0];
-       from = (unsigned short *) &fpu->st_space[0];
-       for ( i = 0 ; i < 8 ; i++, to += 5, from += 8 ) {
-               memcpy( to, from, 5 * sizeof(unsigned short) );
-       }
-}
-#endif
-
 static inline void copy_fpu_fxsave(struct pt_regs *regs,
                                   struct user_i387_struct *buf)
 {