aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 04:27:17 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:07 -0400
commit058ac308f3dd34ce4e2dbf938258975ced14b809 (patch)
tree86576cc43740bb45680fc990b445dacd08cfae76
parente8012b584fac3a1bb70cd896612c12086d28e9ff (diff)
uml: coredumping floating point fixes
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>
-rw-r--r--arch/um/sys-i386/ptrace.c22
-rw-r--r--include/asm-um/elf-i386.h12
-rw-r--r--include/asm-um/elf-x86_64.h2
3 files changed, 12 insertions, 24 deletions
diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c
index 659011df1e9a..9657c89fdf31 100644
--- a/arch/um/sys-i386/ptrace.c
+++ b/arch/um/sys-i386/ptrace.c
@@ -205,28 +205,6 @@ int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
205 return restore_fpx_registers(userspace_pid[cpu], fpregs); 205 return restore_fpx_registers(userspace_pid[cpu], fpregs);
206} 206}
207 207
208#ifdef notdef
209int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
210{
211 fpu->cwd = (((SC_FP_CW(PT_REGS_SC(regs)) & 0xffff) << 16) |
212 (SC_FP_SW(PT_REGS_SC(regs)) & 0xffff));
213 fpu->swd = SC_FP_CSSEL(PT_REGS_SC(regs)) & 0xffff;
214 fpu->twd = SC_FP_IPOFF(PT_REGS_SC(regs));
215 fpu->fip = SC_FP_CSSEL(PT_REGS_SC(regs)) & 0xffff;
216 fpu->fcs = SC_FP_DATAOFF(PT_REGS_SC(regs));
217 fpu->foo = SC_FP_DATASEL(PT_REGS_SC(regs));
218 fpu->fos = 0;
219 memcpy(fpu->st_space, (void *) SC_FP_ST(PT_REGS_SC(regs)),
220 sizeof(fpu->st_space));
221 return 1;
222}
223#endif
224
225int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu )
226{
227 return 1;
228}
229
230long subarch_ptrace(struct task_struct *child, long request, long addr, 208long subarch_ptrace(struct task_struct *child, long request, long addr,
231 long data) 209 long data)
232{ 210{
diff --git a/include/asm-um/elf-i386.h b/include/asm-um/elf-i386.h
index 9bab712dc5c0..ca94a136dfe8 100644
--- a/include/asm-um/elf-i386.h
+++ b/include/asm-um/elf-i386.h
@@ -5,7 +5,8 @@
5#ifndef __UM_ELF_I386_H 5#ifndef __UM_ELF_I386_H
6#define __UM_ELF_I386_H 6#define __UM_ELF_I386_H
7 7
8#include <asm/user.h> 8#include <linux/sched.h>
9#include "skas.h"
9 10
10#define R_386_NONE 0 11#define R_386_NONE 0
11#define R_386_32 1 12#define R_386_32 1
@@ -75,6 +76,15 @@ typedef struct user_i387_struct elf_fpregset_t;
75 pr_reg[16] = PT_REGS_SS(regs); \ 76 pr_reg[16] = PT_REGS_SS(regs); \
76} while(0); 77} while(0);
77 78
79static inline int elf_core_copy_fpregs(struct task_struct *t,
80 elf_fpregset_t *fpu)
81{
82 int cpu = ((struct thread_info *) t->stack)->cpu;
83 return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu);
84}
85
86#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)
87
78extern long elf_aux_hwcap; 88extern long elf_aux_hwcap;
79#define ELF_HWCAP (elf_aux_hwcap) 89#define ELF_HWCAP (elf_aux_hwcap)
80 90
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h
index bfe27aa2c9c4..97e1ced71ba7 100644
--- a/include/asm-um/elf-x86_64.h
+++ b/include/asm-um/elf-x86_64.h
@@ -36,7 +36,7 @@ typedef unsigned long elf_greg_t;
36#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) 36#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
37typedef elf_greg_t elf_gregset_t[ELF_NGREG]; 37typedef elf_greg_t elf_gregset_t[ELF_NGREG];
38 38
39typedef struct { } elf_fpregset_t; 39typedef struct user_i387_struct elf_fpregset_t;
40 40
41/* 41/*
42 * This is used to ensure we don't load something for the wrong architecture. 42 * This is used to ensure we don't load something for the wrong architecture.