Commit bb1a773d authored by Al Viro's avatar Al Viro

kill unused dump_fpu() instances

dump_fpu() is used only on the architectures that support elf
and have neither CORE_DUMP_USE_REGSET nor ELF_CORE_COPY_FPREGS
defined.

Currently that's csky, m68k, microblaze, nds32 and unicore32.  The rest
of the instances are dead code.

NB: THIS MUST GO AFTER ELF_FDPIC CONVERSION
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 5d2c56ec
...@@ -295,11 +295,6 @@ void flush_thread(void) ...@@ -295,11 +295,6 @@ void flush_thread(void)
{ {
} }
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
{
return 0;
}
int elf_check_arch(const struct elf32_hdr *x) int elf_check_arch(const struct elf32_hdr *x)
{ {
unsigned int eflags; unsigned int eflags;
......
...@@ -282,21 +282,6 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs) ...@@ -282,21 +282,6 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs)
return 1; return 1;
} }
/*
* fill in the fpe structure for a core dump...
*/
int dump_fpu (struct pt_regs *regs, struct user_fp *fp)
{
struct thread_info *thread = current_thread_info();
int used_math = thread->used_cp[1] | thread->used_cp[2];
if (used_math)
memcpy(fp, &thread->fpstate.soft, sizeof (*fp));
return used_math != 0;
}
EXPORT_SYMBOL(dump_fpu);
unsigned long get_wchan(struct task_struct *p) unsigned long get_wchan(struct task_struct *p)
{ {
struct stackframe frame; struct stackframe frame;
......
...@@ -153,15 +153,6 @@ unsigned long get_wchan(struct task_struct *p) ...@@ -153,15 +153,6 @@ unsigned long get_wchan(struct task_struct *p)
return 0; return 0;
} }
/*
* Required placeholder.
*/
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
{
return 0;
}
/* /*
* Called on the exit path of event entry; see vm_entry.S * Called on the exit path of event entry; see vm_entry.S
* *
......
...@@ -514,52 +514,18 @@ do_copy_task_regs (struct task_struct *task, struct unw_frame_info *info, void * ...@@ -514,52 +514,18 @@ do_copy_task_regs (struct task_struct *task, struct unw_frame_info *info, void *
unw_get_ar(info, UNW_AR_SSD, &dst[56]); unw_get_ar(info, UNW_AR_SSD, &dst[56]);
} }
void
do_dump_task_fpu (struct task_struct *task, struct unw_frame_info *info, void *arg)
{
elf_fpreg_t *dst = arg;
int i;
memset(dst, 0, sizeof(elf_fpregset_t)); /* don't leak any "random" bits */
if (unw_unwind_to_user(info) < 0)
return;
/* f0 is 0.0, f1 is 1.0 */
for (i = 2; i < 32; ++i)
unw_get_fr(info, i, dst + i);
ia64_flush_fph(task);
if ((task->thread.flags & IA64_THREAD_FPH_VALID) != 0)
memcpy(dst + 32, task->thread.fph, 96*16);
}
void void
do_copy_regs (struct unw_frame_info *info, void *arg) do_copy_regs (struct unw_frame_info *info, void *arg)
{ {
do_copy_task_regs(current, info, arg); do_copy_task_regs(current, info, arg);
} }
void
do_dump_fpu (struct unw_frame_info *info, void *arg)
{
do_dump_task_fpu(current, info, arg);
}
void void
ia64_elf_core_copy_regs (struct pt_regs *pt, elf_gregset_t dst) ia64_elf_core_copy_regs (struct pt_regs *pt, elf_gregset_t dst)
{ {
unw_init_running(do_copy_regs, dst); unw_init_running(do_copy_regs, dst);
} }
int
dump_fpu (struct pt_regs *pt, elf_fpregset_t dst)
{
unw_init_running(do_dump_fpu, dst);
return 1; /* f0-f31 are always valid so we always return 1 */
}
/* /*
* Flush thread state. This is called when a thread does an execve(). * Flush thread state. This is called when a thread does an execve().
*/ */
......
...@@ -251,11 +251,3 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp) ...@@ -251,11 +251,3 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
regs->ea = pc; regs->ea = pc;
regs->sp = sp; regs->sp = sp;
} }
#include <linux/elfcore.h>
/* Fill in the FPU structure for a core dump. */
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r)
{
return 0; /* Nios2 has no FPU and thus no FPU registers */
}
...@@ -214,13 +214,6 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp) ...@@ -214,13 +214,6 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
regs->sp = sp; regs->sp = sp;
} }
/* Fill in the fpu structure for a core dump. */
int dump_fpu(struct pt_regs *regs, elf_fpregset_t * fpu)
{
/* TODO */
return 0;
}
extern struct thread_info *_switch(struct thread_info *old_ti, extern struct thread_info *_switch(struct thread_info *old_ti,
struct thread_info *new_ti); struct thread_info *new_ti);
extern int lwa_flag; extern int lwa_flag;
......
...@@ -305,9 +305,6 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; ...@@ -305,9 +305,6 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
struct task_struct; struct task_struct;
extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
struct pt_regs; /* forward declaration... */ struct pt_regs; /* forward declaration... */
......
...@@ -152,25 +152,6 @@ void release_thread(struct task_struct *dead_task) ...@@ -152,25 +152,6 @@ void release_thread(struct task_struct *dead_task)
{ {
} }
/*
* Fill in the FPU structure for a core dump.
*/
int dump_fpu (struct pt_regs * regs, elf_fpregset_t *r)
{
if (regs == NULL)
return 0;
memcpy(r, regs->fr, sizeof *r);
return 1;
}
int dump_task_fpu (struct task_struct *tsk, elf_fpregset_t *r)
{
memcpy(r, tsk->thread.regs.fr, sizeof(*r));
return 1;
}
/* /*
* Idle thread support * Idle thread support
* *
......
...@@ -160,24 +160,6 @@ asmlinkage void execve_tail(void) ...@@ -160,24 +160,6 @@ asmlinkage void execve_tail(void)
asm volatile("sfpc %0" : : "d" (0)); asm volatile("sfpc %0" : : "d" (0));
} }
/*
* fill in the FPU structure for a core dump.
*/
int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs)
{
save_fpu_regs();
fpregs->fpc = current->thread.fpu.fpc;
fpregs->pad = 0;
if (MACHINE_HAS_VX)
convert_vx_to_fp((freg_t *)&fpregs->fprs,
current->thread.fpu.vxrs);
else
memcpy(&fpregs->fprs, current->thread.fpu.fprs,
sizeof(fpregs->fprs));
return 1;
}
EXPORT_SYMBOL(dump_fpu);
unsigned long get_wchan(struct task_struct *p) unsigned long get_wchan(struct task_struct *p)
{ {
struct unwind_state state; struct unwind_state state;
......
...@@ -37,11 +37,6 @@ struct user_regset; ...@@ -37,11 +37,6 @@ struct user_regset;
extern int do_fpu_inst(unsigned short, struct pt_regs *); extern int do_fpu_inst(unsigned short, struct pt_regs *);
extern int init_fpu(struct task_struct *); extern int init_fpu(struct task_struct *);
extern int fpregs_get(struct task_struct *target,
const struct user_regset *regset,
unsigned int pos, unsigned int count,
void *kbuf, void __user *ubuf);
static inline void __unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs) static inline void __unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
{ {
if (task_thread_info(tsk)->status & TS_USEDFPU) { if (task_thread_info(tsk)->status & TS_USEDFPU) {
......
...@@ -93,24 +93,6 @@ void release_thread(struct task_struct *dead_task) ...@@ -93,24 +93,6 @@ void release_thread(struct task_struct *dead_task)
/* do nothing */ /* do nothing */
} }
/* Fill in the fpu structure for a core dump.. */
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
{
int fpvalid = 0;
#if defined(CONFIG_SH_FPU)
struct task_struct *tsk = current;
fpvalid = !!tsk_used_math(tsk);
if (fpvalid)
fpvalid = !fpregs_get(tsk, NULL,
(struct membuf){fpu, sizeof(*fpu)});
#endif
return fpvalid;
}
EXPORT_SYMBOL(dump_fpu);
asmlinkage void ret_from_fork(void); asmlinkage void ret_from_fork(void);
asmlinkage void ret_from_kernel_thread(void); asmlinkage void ret_from_kernel_thread(void);
......
...@@ -165,7 +165,7 @@ static int genregs_set(struct task_struct *target, ...@@ -165,7 +165,7 @@ static int genregs_set(struct task_struct *target,
} }
#ifdef CONFIG_SH_FPU #ifdef CONFIG_SH_FPU
int fpregs_get(struct task_struct *target, static int fpregs_get(struct task_struct *target,
const struct user_regset *regset, const struct user_regset *regset,
struct membuf to) struct membuf to)
{ {
......
...@@ -408,55 +408,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, ...@@ -408,55 +408,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
return 0; return 0;
} }
/*
* fill in the fpu structure for a core dump.
*/
int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs)
{
if (used_math()) {
memset(fpregs, 0, sizeof(*fpregs));
fpregs->pr_q_entrysize = 8;
return 1;
}
#ifdef CONFIG_SMP
if (test_thread_flag(TIF_USEDFPU)) {
put_psr(get_psr() | PSR_EF);
fpsave(&current->thread.float_regs[0], &current->thread.fsr,
&current->thread.fpqueue[0], &current->thread.fpqdepth);
if (regs != NULL) {
regs->psr &= ~(PSR_EF);
clear_thread_flag(TIF_USEDFPU);
}
}
#else
if (current == last_task_used_math) {
put_psr(get_psr() | PSR_EF);
fpsave(&current->thread.float_regs[0], &current->thread.fsr,
&current->thread.fpqueue[0], &current->thread.fpqdepth);
if (regs != NULL) {
regs->psr &= ~(PSR_EF);
last_task_used_math = NULL;
}
}
#endif
memcpy(&fpregs->pr_fr.pr_regs[0],
&current->thread.float_regs[0],
(sizeof(unsigned long) * 32));
fpregs->pr_fsr = current->thread.fsr;
fpregs->pr_qcnt = current->thread.fpqdepth;
fpregs->pr_q_entrysize = 8;
fpregs->pr_en = 1;
if(fpregs->pr_qcnt != 0) {
memcpy(&fpregs->pr_q[0],
&current->thread.fpqueue[0],
sizeof(struct fpq) * fpregs->pr_qcnt);
}
/* Zero out the rest. */
memset(&fpregs->pr_q[fpregs->pr_qcnt], 0,
sizeof(struct fpq) * (32 - fpregs->pr_qcnt));
return 1;
}
unsigned long get_wchan(struct task_struct *task) unsigned long get_wchan(struct task_struct *task)
{ {
unsigned long pc, fp, bias = 0; unsigned long pc, fp, bias = 0;
......
...@@ -700,72 +700,6 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) ...@@ -700,72 +700,6 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
return 0; return 0;
} }
typedef struct {
union {
unsigned int pr_regs[32];
unsigned long pr_dregs[16];
} pr_fr;
unsigned int __unused;
unsigned int pr_fsr;
unsigned char pr_qcnt;
unsigned char pr_q_entrysize;
unsigned char pr_en;
unsigned int pr_q[64];
} elf_fpregset_t32;
/*
* fill in the fpu structure for a core dump.
*/
int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs)
{
unsigned long *kfpregs = current_thread_info()->fpregs;
unsigned long fprs = current_thread_info()->fpsaved[0];
if (test_thread_flag(TIF_32BIT)) {
elf_fpregset_t32 *fpregs32 = (elf_fpregset_t32 *)fpregs;
if (fprs & FPRS_DL)
memcpy(&fpregs32->pr_fr.pr_regs[0], kfpregs,
sizeof(unsigned int) * 32);
else
memset(&fpregs32->pr_fr.pr_regs[0], 0,
sizeof(unsigned int) * 32);
fpregs32->pr_qcnt = 0;
fpregs32->pr_q_entrysize = 8;
memset(&fpregs32->pr_q[0], 0,
(sizeof(unsigned int) * 64));
if (fprs & FPRS_FEF) {
fpregs32->pr_fsr = (unsigned int) current_thread_info()->xfsr[0];
fpregs32->pr_en = 1;
} else {
fpregs32->pr_fsr = 0;
fpregs32->pr_en = 0;
}
} else {
if(fprs & FPRS_DL)
memcpy(&fpregs->pr_regs[0], kfpregs,
sizeof(unsigned int) * 32);
else
memset(&fpregs->pr_regs[0], 0,
sizeof(unsigned int) * 32);
if(fprs & FPRS_DU)
memcpy(&fpregs->pr_regs[16], kfpregs+16,
sizeof(unsigned int) * 32);
else
memset(&fpregs->pr_regs[16], 0,
sizeof(unsigned int) * 32);
if(fprs & FPRS_FEF) {
fpregs->pr_fsr = current_thread_info()->xfsr[0];
fpregs->pr_gsr = current_thread_info()->gsr[0];
} else {
fpregs->pr_fsr = fpregs->pr_gsr = 0;
}
fpregs->pr_fprs = fprs;
}
return 1;
}
EXPORT_SYMBOL(dump_fpu);
unsigned long get_wchan(struct task_struct *task) unsigned long get_wchan(struct task_struct *task)
{ {
unsigned long pc, fp, bias = 0; unsigned long pc, fp, bias = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment