]> err.no Git - linux-2.6/blobdiff - arch/um/sys-i386/ptrace.c
[ARM] 4652/1: pxa: fix a typo of pxa27x usb host clk definition
[linux-2.6] / arch / um / sys-i386 / ptrace.c
index cb899dd1c6b51f9c7617e2efd6e97798a65d7923..bd3da8a61f645810bc7af9ec42a6db240379b778 100644 (file)
@@ -6,6 +6,7 @@
 #include "linux/mm.h"
 #include "linux/sched.h"
 #include "asm/uaccess.h"
+#include "skas.h"
 
 extern int arch_switch_tls(struct task_struct *from, struct task_struct *to);
 
@@ -144,68 +145,68 @@ int peek_user(struct task_struct *child, long addr, long data)
        return put_user(tmp, (unsigned long __user *) data);
 }
 
-static inline int convert_fxsr_to_user(struct _fpstate __user *buf,
-                                      struct pt_regs *regs)
+int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
 {
-       return 0;
-}
+       int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
+       long fpregs[HOST_FP_SIZE];
 
-static inline int convert_fxsr_from_user(struct pt_regs *regs,
-                                        struct _fpstate __user *buf)
-{
-       return 0;
+       BUG_ON(sizeof(*buf) != sizeof(fpregs));
+       err = save_fp_registers(userspace_pid[cpu], fpregs);
+       if (err)
+               return err;
+
+       n = copy_to_user(buf, fpregs, sizeof(fpregs));
+       if(n > 0)
+               return -EFAULT;
+
+       return n;
 }
 
-int get_fpregs(unsigned long buf, struct task_struct *child)
+int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
 {
-       int err;
+       int n, cpu = ((struct thread_info *) child->stack)->cpu;
+       long fpregs[HOST_FP_SIZE];
 
-       err = convert_fxsr_to_user((struct _fpstate __user *) buf,
-                                  &child->thread.regs);
-       if (err)
+       BUG_ON(sizeof(*buf) != sizeof(fpregs));
+       n = copy_from_user(fpregs, buf, sizeof(fpregs));
+       if (n > 0)
                return -EFAULT;
-       return 0;
+
+       return restore_fp_registers(userspace_pid[cpu], fpregs);
 }
 
-int set_fpregs(unsigned long buf, struct task_struct *child)
+int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
 {
-       int err;
+       int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
+       long fpregs[HOST_XFP_SIZE];
 
-       err = convert_fxsr_from_user(&child->thread.regs,
-                                    (struct _fpstate __user *) buf);
+       BUG_ON(sizeof(*buf) != sizeof(fpregs));
+       err = save_fpx_registers(userspace_pid[cpu], fpregs);
        if (err)
+               return err;
+
+       n = copy_to_user(buf, fpregs, sizeof(fpregs));
+       if(n > 0)
                return -EFAULT;
-       return 0;
-}
 
-int get_fpxregs(unsigned long buf, struct task_struct *tsk)
-{
-       return 0;
+       return n;
 }
 
-int set_fpxregs(unsigned long buf, struct task_struct *tsk)
+int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
 {
-       return 0;
-}
+       int n, cpu = ((struct thread_info *) child->stack)->cpu;
+       long fpregs[HOST_XFP_SIZE];
 
-#ifdef notdef
-int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
-{
-       fpu->cwd = (((SC_FP_CW(PT_REGS_SC(regs)) & 0xffff) << 16) |
-                   (SC_FP_SW(PT_REGS_SC(regs)) & 0xffff));
-       fpu->swd = SC_FP_CSSEL(PT_REGS_SC(regs)) & 0xffff;
-       fpu->twd = SC_FP_IPOFF(PT_REGS_SC(regs));
-       fpu->fip = SC_FP_CSSEL(PT_REGS_SC(regs)) & 0xffff;
-       fpu->fcs = SC_FP_DATAOFF(PT_REGS_SC(regs));
-       fpu->foo = SC_FP_DATASEL(PT_REGS_SC(regs));
-       fpu->fos = 0;
-       memcpy(fpu->st_space, (void *) SC_FP_ST(PT_REGS_SC(regs)),
-              sizeof(fpu->st_space));
-       return 1;
+       BUG_ON(sizeof(*buf) != sizeof(fpregs));
+       n = copy_from_user(fpregs, buf, sizeof(fpregs));
+       if (n > 0)
+               return -EFAULT;
+
+       return restore_fpx_registers(userspace_pid[cpu], fpregs);
 }
-#endif
 
-int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu )
+long subarch_ptrace(struct task_struct *child, long request, long addr,
+                   long data)
 {
-       return 1;
+       return -EIO;
 }