Skip to content

Commit

Permalink
[PATCH] dump_thread() cleanup
Browse files Browse the repository at this point in the history
)

From: Adrian Bunk <[email protected]>

- create one common dump_thread() prototype in kernel.h

- dump_thread() is only used in fs/binfmt_aout.c and can therefore be
  removed on all architectures where CONFIG_BINFMT_AOUT is not
  available

Signed-off-by: Adrian Bunk <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
[email protected] authored and Linus Torvalds committed Jan 10, 2006
1 parent be4f1bb commit df2e71f
Show file tree
Hide file tree
Showing 28 changed files with 5 additions and 250 deletions.
1 change: 0 additions & 1 deletion arch/alpha/kernel/alpha_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <asm/unistd.h>

extern struct hwrpb_struct *hwrpb;
extern void dump_thread(struct pt_regs *, struct user *);
extern spinlock_t rtc_lock;

/* these are C runtime functions with special calling conventions: */
Expand Down
1 change: 1 addition & 0 deletions arch/alpha/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/* 2.3.x zone allocator, 1999 Andrea Arcangeli <[email protected]> */

#include <linux/config.h>
#include <linux/pagemap.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
Expand Down
1 change: 0 additions & 1 deletion arch/arm26/kernel/armksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <asm/checksum.h>
#include <asm/mach-types.h>

extern void dump_thread(struct pt_regs *, struct user *);
extern int dump_fpu(struct pt_regs *, struct user_fp_struct *);
extern void inswb(unsigned int port, void *to, int len);
extern void outswb(unsigned int port, const void *to, int len);
Expand Down
2 changes: 0 additions & 2 deletions arch/cris/kernel/crisksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <asm/pgtable.h>
#include <asm/fasttimer.h>

extern void dump_thread(struct pt_regs *, struct user *);
extern unsigned long get_cmos_time(void);
extern void __Udiv(void);
extern void __Umod(void);
Expand All @@ -33,7 +32,6 @@ extern void __lshrdi3(void);
extern void iounmap(volatile void * __iomem);

/* Platform dependent support */
EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(kernel_thread);
EXPORT_SYMBOL(get_cmos_time);
EXPORT_SYMBOL(loops_per_usec);
Expand Down
28 changes: 0 additions & 28 deletions arch/cris/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,34 +257,6 @@ void flush_thread(void)
{
}

/*
* fill in the user structure for a core dump..
*/
void dump_thread(struct pt_regs * regs, struct user * dump)
{
#if 0
int i;

/* changed the size calculations - should hopefully work better. lbt */
dump->magic = CMAGIC;
dump->start_code = 0;
dump->start_stack = regs->esp & ~(PAGE_SIZE - 1);
dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT;
dump->u_dsize -= dump->u_tsize;
dump->u_ssize = 0;
for (i = 0; i < 8; i++)
dump->u_debugreg[i] = current->debugreg[i];

if (dump->start_stack < TASK_SIZE)
dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;

dump->regs = *regs;

dump->u_fpvalid = dump_fpu (regs, &dump->i387);
#endif
}

/* Fill in the fpu structure for a core dump. */
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
{
Expand Down
2 changes: 0 additions & 2 deletions arch/frv/kernel/frv_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <asm/hardirq.h>
#include <asm/cacheflush.h>

extern void dump_thread(struct pt_regs *, struct user *);
extern long __memcpy_user(void *dst, const void *src, size_t count);
extern long __memset_user(void *dst, const void *src, size_t count);

Expand All @@ -27,7 +26,6 @@ extern long __memset_user(void *dst, const void *src, size_t count);
EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(iounmap);

EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strstr);
Expand Down
22 changes: 0 additions & 22 deletions arch/frv/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,28 +243,6 @@ int copy_thread(int nr, unsigned long clone_flags,
return 0;
} /* end copy_thread() */

/*
* fill in the user structure for a core dump..
*/
void dump_thread(struct pt_regs *regs, struct user *dump)
{
#if 0
/* changed the size calculations - should hopefully work better. lbt */
dump->magic = CMAGIC;
dump->start_code = 0;
dump->start_stack = user_stack(regs) & ~(PAGE_SIZE - 1);
dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT;
dump->u_dsize -= dump->u_tsize;
dump->u_ssize = 0;

if (dump->start_stack < TASK_SIZE)
dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;

dump->regs = *(struct user_context *) regs;
#endif
}

/*
* sys_execve() executes a new program.
*/
Expand Down
3 changes: 0 additions & 3 deletions arch/h8300/kernel/h8300_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@
//asmlinkage long long __lshrdi3 (long long, int);
extern char h8300_debug_device[];

extern void dump_thread(struct pt_regs *, struct user *);

/* platform dependent support */

EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strstr);
Expand Down
28 changes: 0 additions & 28 deletions arch/h8300/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,34 +207,6 @@ int copy_thread(int nr, unsigned long clone_flags,
return 0;
}

/*
* fill in the user structure for a core dump..
*/
void dump_thread(struct pt_regs * regs, struct user * dump)
{
/* changed the size calculations - should hopefully work better. lbt */
dump->magic = CMAGIC;
dump->start_code = 0;
dump->start_stack = rdusp() & ~(PAGE_SIZE - 1);
dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
dump->u_dsize = ((unsigned long) (current->mm->brk +
(PAGE_SIZE-1))) >> PAGE_SHIFT;
dump->u_dsize -= dump->u_tsize;
dump->u_ssize = 0;

dump->u_ar0 = (struct user_regs_struct *)(((int)(&dump->regs)) -((int)(dump)));
dump->regs.er0 = regs->er0;
dump->regs.er1 = regs->er1;
dump->regs.er2 = regs->er2;
dump->regs.er3 = regs->er3;
dump->regs.er4 = regs->er4;
dump->regs.er5 = regs->er5;
dump->regs.er6 = regs->er6;
dump->regs.orig_er0 = regs->orig_er0;
dump->regs.ccr = regs->ccr;
dump->regs.pc = regs->pc;
}

/*
* sys_execve() executes a new program.
*/
Expand Down
3 changes: 0 additions & 3 deletions arch/m32r/kernel/m32r_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@
#include <asm/irq.h>
#include <asm/tlbflush.h>

extern void dump_thread(struct pt_regs *, struct user *);

#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
extern struct drive_info_struct drive_info;
EXPORT_SYMBOL(drive_info);
#endif

/* platform dependent support */
EXPORT_SYMBOL(boot_cpu_data);
EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(dump_fpu);
EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(iounmap);
Expand Down
8 changes: 0 additions & 8 deletions arch/m32r/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long spu,
return 0;
}

/*
* fill in the user structure for a core dump..
*/
void dump_thread(struct pt_regs * regs, struct user * dump)
{
/* M32R_FIXME */
}

/*
* Capture the user space registers if the task is not running (in user space)
*/
Expand Down
2 changes: 0 additions & 2 deletions arch/m68k/kernel/m68k_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ asmlinkage long long __lshrdi3 (long long, int);
asmlinkage long long __muldi3 (long long, long long);
extern char m68k_debug_device[];

extern void dump_thread(struct pt_regs *, struct user *);

/* platform dependent support */

EXPORT_SYMBOL(m68k_machtype);
Expand Down
2 changes: 0 additions & 2 deletions arch/m68knommu/kernel/m68k_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
#include <asm/checksum.h>
#include <asm/current.h>

extern void dump_thread(struct pt_regs *, struct user *);
extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);

/* platform dependent support */

EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(iounmap);
EXPORT_SYMBOL(dump_fpu);
EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strstr);
Expand Down
46 changes: 0 additions & 46 deletions arch/m68knommu/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,52 +275,6 @@ int dump_fpu(struct pt_regs *regs, struct user_m68kfp_struct *fpu)
return 1;
}

/*
* fill in the user structure for a core dump..
*/
void dump_thread(struct pt_regs * regs, struct user * dump)
{
struct switch_stack *sw;

/* changed the size calculations - should hopefully work better. lbt */
dump->magic = CMAGIC;
dump->start_code = 0;
dump->start_stack = rdusp() & ~(PAGE_SIZE - 1);
dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
dump->u_dsize = ((unsigned long) (current->mm->brk +
(PAGE_SIZE-1))) >> PAGE_SHIFT;
dump->u_dsize -= dump->u_tsize;
dump->u_ssize = 0;

if (dump->start_stack < TASK_SIZE)
dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;

dump->u_ar0 = (struct user_regs_struct *)((int)&dump->regs - (int)dump);
sw = ((struct switch_stack *)regs) - 1;
dump->regs.d1 = regs->d1;
dump->regs.d2 = regs->d2;
dump->regs.d3 = regs->d3;
dump->regs.d4 = regs->d4;
dump->regs.d5 = regs->d5;
dump->regs.d6 = sw->d6;
dump->regs.d7 = sw->d7;
dump->regs.a0 = regs->a0;
dump->regs.a1 = regs->a1;
dump->regs.a2 = regs->a2;
dump->regs.a3 = sw->a3;
dump->regs.a4 = sw->a4;
dump->regs.a5 = sw->a5;
dump->regs.a6 = sw->a6;
dump->regs.d0 = regs->d0;
dump->regs.orig_d0 = regs->orig_d0;
dump->regs.stkadj = regs->stkadj;
dump->regs.sr = regs->sr;
dump->regs.pc = regs->pc;
dump->regs.fmtvec = (regs->format << 12) | regs->vector;
/* dump floating point stuff */
dump->u_fpvalid = dump_fpu (regs, &dump->m68kfp);
}

/*
* Generic dumping code. Used for panic and debug.
*/
Expand Down
21 changes: 0 additions & 21 deletions arch/s390/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,27 +352,6 @@ int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs)
return 1;
}

/*
* fill in the user structure for a core dump..
*/
void dump_thread(struct pt_regs * regs, struct user * dump)
{

/* changed the size calculations - should hopefully work better. lbt */
dump->magic = CMAGIC;
dump->start_code = 0;
dump->start_stack = regs->gprs[15] & ~(PAGE_SIZE - 1);
dump->u_tsize = current->mm->end_code >> PAGE_SHIFT;
dump->u_dsize = (current->mm->brk + PAGE_SIZE - 1) >> PAGE_SHIFT;
dump->u_dsize -= dump->u_tsize;
dump->u_ssize = 0;
if (dump->start_stack < TASK_SIZE)
dump->u_ssize = (TASK_SIZE - dump->start_stack) >> PAGE_SHIFT;
memcpy(&dump->regs, regs, sizeof(s390_regs));
dump_fpu (regs, &dump->regs.fp_regs);
dump->regs.per_info = current->thread.per_info;
}

unsigned long get_wchan(struct task_struct *p)
{
struct stack_frame *sf, *low, *high;
Expand Down
20 changes: 0 additions & 20 deletions arch/sh/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,26 +305,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
return 0;
}

/*
* fill in the user structure for a core dump..
*/
void dump_thread(struct pt_regs * regs, struct user * dump)
{
dump->magic = CMAGIC;
dump->start_code = current->mm->start_code;
dump->start_data = current->mm->start_data;
dump->start_stack = regs->regs[15] & ~(PAGE_SIZE - 1);
dump->u_tsize = (current->mm->end_code - dump->start_code) >> PAGE_SHIFT;
dump->u_dsize = (current->mm->brk + (PAGE_SIZE-1) - dump->start_data) >> PAGE_SHIFT;
dump->u_ssize = (current->mm->start_stack - dump->start_stack +
PAGE_SIZE - 1) >> PAGE_SHIFT;
/* Debug registers will come here. */

dump->regs = *regs;

dump->u_fpvalid = dump_fpu(regs, &dump->fpu);
}

/* Tracing by user break controller. */
static void
ubc_set_tracing(int asid, unsigned long pc)
Expand Down
2 changes: 0 additions & 2 deletions arch/sh/kernel/sh_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
#include <asm/cacheflush.h>
#include <asm/checksum.h>

extern void dump_thread(struct pt_regs *, struct user *);
extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
extern struct hw_interrupt_type no_irq_type;

EXPORT_SYMBOL(sh_mv);

/* platform dependent support */
EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(dump_fpu);
EXPORT_SYMBOL(iounmap);
EXPORT_SYMBOL(enable_irq);
Expand Down
20 changes: 0 additions & 20 deletions arch/sh64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,26 +775,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
return 0;
}

/*
* fill in the user structure for a core dump..
*/
void dump_thread(struct pt_regs * regs, struct user * dump)
{
dump->magic = CMAGIC;
dump->start_code = current->mm->start_code;
dump->start_data = current->mm->start_data;
dump->start_stack = regs->regs[15] & ~(PAGE_SIZE - 1);
dump->u_tsize = (current->mm->end_code - dump->start_code) >> PAGE_SHIFT;
dump->u_dsize = (current->mm->brk + (PAGE_SIZE-1) - dump->start_data) >> PAGE_SHIFT;
dump->u_ssize = (current->mm->start_stack - dump->start_stack +
PAGE_SIZE - 1) >> PAGE_SHIFT;
/* Debug registers will come here. */

dump->regs = *regs;

dump->u_fpvalid = dump_fpu(regs, &dump->fpu);
}

asmlinkage int sys_fork(unsigned long r2, unsigned long r3,
unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
Expand Down
2 changes: 0 additions & 2 deletions arch/sh64/kernel/sh_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <asm/delay.h>
#include <asm/irq.h>

extern void dump_thread(struct pt_regs *, struct user *);
extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);

#if 0
Expand All @@ -41,7 +40,6 @@ EXPORT_SYMBOL(drive_info);
#endif

/* platform dependent support */
EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(dump_fpu);
EXPORT_SYMBOL(iounmap);
EXPORT_SYMBOL(enable_irq);
Expand Down
2 changes: 0 additions & 2 deletions arch/sparc/kernel/sparc_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ extern int __lshrdi3(int, int);
extern int __muldi3(int, int);
extern int __divdi3(int, int);

extern void dump_thread(struct pt_regs *, struct user *);

/* Private functions with odd calling conventions. */
extern void ___atomic24_add(void);
extern void ___atomic24_sub(void);
Expand Down
Loading

0 comments on commit df2e71f

Please sign in to comment.