uml: coredumping floating point fixes
authorJeff Dike <jdike@addtoit.com>
Tue, 16 Oct 2007 08:27:17 +0000 (01:27 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:43:07 +0000 (09:43 -0700)
Fix core dumping of floating point state.  ELF_CORE_COPY_FPREGS gets a
definitions, and as a result, dump_fpu no longer needs to exist.  Also,
elf_fpregset_t needed a real definition.

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>
arch/um/sys-i386/ptrace.c
include/asm-um/elf-i386.h
include/asm-um/elf-x86_64.h

index 659011df1e9ae2ee1752e8945c63f6f632e02cfb..9657c89fdf31cd5d9024b8786053def3814315ce 100644 (file)
@@ -205,28 +205,6 @@ int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
        return restore_fpx_registers(userspace_pid[cpu], fpregs);
 }
 
-#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;
-}
-#endif
-
-int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu )
-{
-       return 1;
-}
-
 long subarch_ptrace(struct task_struct *child, long request, long addr,
                    long data)
 {
index 9bab712dc5c0f50917249a47ecffcf59a356d329..ca94a136dfe8ed0e75231d3a415cbbc9577ae62f 100644 (file)
@@ -5,7 +5,8 @@
 #ifndef __UM_ELF_I386_H
 #define __UM_ELF_I386_H
 
-#include <asm/user.h>
+#include <linux/sched.h>
+#include "skas.h"
 
 #define R_386_NONE     0
 #define R_386_32       1
@@ -75,6 +76,15 @@ typedef struct user_i387_struct elf_fpregset_t;
        pr_reg[16] = PT_REGS_SS(regs);          \
 } while(0);
 
+static inline int elf_core_copy_fpregs(struct task_struct *t,
+                                      elf_fpregset_t *fpu)
+{
+       int cpu = ((struct thread_info *) t->stack)->cpu;
+       return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu);
+}
+
+#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)
+
 extern long elf_aux_hwcap;
 #define ELF_HWCAP (elf_aux_hwcap)
 
index bfe27aa2c9c461862e79df34b12824cb906e778b..97e1ced71ba764a1a5c73c69ceed99fe8cffdbb0 100644 (file)
@@ -36,7 +36,7 @@ typedef unsigned long elf_greg_t;
 #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 
-typedef struct { } elf_fpregset_t;
+typedef struct user_i387_struct elf_fpregset_t;
 
 /*
  * This is used to ensure we don't load something for the wrong architecture.