Skip to content

Commit bb1a773

Browse files
author
Al Viro
committed
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: Al Viro <[email protected]>
1 parent 5d2c56e commit bb1a773

File tree

14 files changed

+1
-257
lines changed

14 files changed

+1
-257
lines changed

arch/arc/kernel/process.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,6 @@ void flush_thread(void)
295295
{
296296
}
297297

298-
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
299-
{
300-
return 0;
301-
}
302-
303298
int elf_check_arch(const struct elf32_hdr *x)
304299
{
305300
unsigned int eflags;

arch/arm/kernel/process.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -282,21 +282,6 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs)
282282
return 1;
283283
}
284284

285-
/*
286-
* fill in the fpe structure for a core dump...
287-
*/
288-
int dump_fpu (struct pt_regs *regs, struct user_fp *fp)
289-
{
290-
struct thread_info *thread = current_thread_info();
291-
int used_math = thread->used_cp[1] | thread->used_cp[2];
292-
293-
if (used_math)
294-
memcpy(fp, &thread->fpstate.soft, sizeof (*fp));
295-
296-
return used_math != 0;
297-
}
298-
EXPORT_SYMBOL(dump_fpu);
299-
300285
unsigned long get_wchan(struct task_struct *p)
301286
{
302287
struct stackframe frame;

arch/hexagon/kernel/process.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,6 @@ unsigned long get_wchan(struct task_struct *p)
153153
return 0;
154154
}
155155

156-
/*
157-
* Required placeholder.
158-
*/
159-
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
160-
{
161-
return 0;
162-
}
163-
164-
165156
/*
166157
* Called on the exit path of event entry; see vm_entry.S
167158
*

arch/ia64/kernel/process.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -514,52 +514,18 @@ do_copy_task_regs (struct task_struct *task, struct unw_frame_info *info, void *
514514
unw_get_ar(info, UNW_AR_SSD, &dst[56]);
515515
}
516516

517-
void
518-
do_dump_task_fpu (struct task_struct *task, struct unw_frame_info *info, void *arg)
519-
{
520-
elf_fpreg_t *dst = arg;
521-
int i;
522-
523-
memset(dst, 0, sizeof(elf_fpregset_t)); /* don't leak any "random" bits */
524-
525-
if (unw_unwind_to_user(info) < 0)
526-
return;
527-
528-
/* f0 is 0.0, f1 is 1.0 */
529-
530-
for (i = 2; i < 32; ++i)
531-
unw_get_fr(info, i, dst + i);
532-
533-
ia64_flush_fph(task);
534-
if ((task->thread.flags & IA64_THREAD_FPH_VALID) != 0)
535-
memcpy(dst + 32, task->thread.fph, 96*16);
536-
}
537-
538517
void
539518
do_copy_regs (struct unw_frame_info *info, void *arg)
540519
{
541520
do_copy_task_regs(current, info, arg);
542521
}
543522

544-
void
545-
do_dump_fpu (struct unw_frame_info *info, void *arg)
546-
{
547-
do_dump_task_fpu(current, info, arg);
548-
}
549-
550523
void
551524
ia64_elf_core_copy_regs (struct pt_regs *pt, elf_gregset_t dst)
552525
{
553526
unw_init_running(do_copy_regs, dst);
554527
}
555528

556-
int
557-
dump_fpu (struct pt_regs *pt, elf_fpregset_t dst)
558-
{
559-
unw_init_running(do_dump_fpu, dst);
560-
return 1; /* f0-f31 are always valid so we always return 1 */
561-
}
562-
563529
/*
564530
* Flush thread state. This is called when a thread does an execve().
565531
*/

arch/nios2/kernel/process.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,3 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
251251
regs->ea = pc;
252252
regs->sp = sp;
253253
}
254-
255-
#include <linux/elfcore.h>
256-
257-
/* Fill in the FPU structure for a core dump. */
258-
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r)
259-
{
260-
return 0; /* Nios2 has no FPU and thus no FPU registers */
261-
}

arch/openrisc/kernel/process.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,6 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
214214
regs->sp = sp;
215215
}
216216

217-
/* Fill in the fpu structure for a core dump. */
218-
int dump_fpu(struct pt_regs *regs, elf_fpregset_t * fpu)
219-
{
220-
/* TODO */
221-
return 0;
222-
}
223-
224217
extern struct thread_info *_switch(struct thread_info *old_ti,
225218
struct thread_info *new_ti);
226219
extern int lwa_flag;

arch/parisc/include/asm/elf.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,6 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
305305

306306
struct task_struct;
307307

308-
extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
309-
#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
310-
311308
struct pt_regs; /* forward declaration... */
312309

313310

arch/parisc/kernel/process.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -152,25 +152,6 @@ void release_thread(struct task_struct *dead_task)
152152
{
153153
}
154154

155-
/*
156-
* Fill in the FPU structure for a core dump.
157-
*/
158-
159-
int dump_fpu (struct pt_regs * regs, elf_fpregset_t *r)
160-
{
161-
if (regs == NULL)
162-
return 0;
163-
164-
memcpy(r, regs->fr, sizeof *r);
165-
return 1;
166-
}
167-
168-
int dump_task_fpu (struct task_struct *tsk, elf_fpregset_t *r)
169-
{
170-
memcpy(r, tsk->thread.regs.fr, sizeof(*r));
171-
return 1;
172-
}
173-
174155
/*
175156
* Idle thread support
176157
*

arch/s390/kernel/process.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,6 @@ asmlinkage void execve_tail(void)
160160
asm volatile("sfpc %0" : : "d" (0));
161161
}
162162

163-
/*
164-
* fill in the FPU structure for a core dump.
165-
*/
166-
int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs)
167-
{
168-
save_fpu_regs();
169-
fpregs->fpc = current->thread.fpu.fpc;
170-
fpregs->pad = 0;
171-
if (MACHINE_HAS_VX)
172-
convert_vx_to_fp((freg_t *)&fpregs->fprs,
173-
current->thread.fpu.vxrs);
174-
else
175-
memcpy(&fpregs->fprs, current->thread.fpu.fprs,
176-
sizeof(fpregs->fprs));
177-
return 1;
178-
}
179-
EXPORT_SYMBOL(dump_fpu);
180-
181163
unsigned long get_wchan(struct task_struct *p)
182164
{
183165
struct unwind_state state;

arch/sh/include/asm/fpu.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ struct user_regset;
3737
extern int do_fpu_inst(unsigned short, struct pt_regs *);
3838
extern int init_fpu(struct task_struct *);
3939

40-
extern int fpregs_get(struct task_struct *target,
41-
const struct user_regset *regset,
42-
unsigned int pos, unsigned int count,
43-
void *kbuf, void __user *ubuf);
44-
4540
static inline void __unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
4641
{
4742
if (task_thread_info(tsk)->status & TS_USEDFPU) {

0 commit comments

Comments
 (0)