aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/include/asm/elf.h17
-rw-r--r--arch/mips/kernel/binfmt_elfo32.c32
-rw-r--r--arch/mips/kernel/process.c55
3 files changed, 0 insertions, 104 deletions
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
index d4144056e928..1d38fe0edd2d 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
@@ -339,23 +339,6 @@ do { \
339 339
340#endif /* CONFIG_64BIT */ 340#endif /* CONFIG_64BIT */
341 341
342struct pt_regs;
343struct task_struct;
344
345extern void elf_dump_regs(elf_greg_t *, struct pt_regs *regs);
346extern int dump_task_regs(struct task_struct *, elf_gregset_t *);
347extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
348
349#ifndef ELF_CORE_COPY_REGS
350#define ELF_CORE_COPY_REGS(elf_regs, regs) \
351 elf_dump_regs((elf_greg_t *)&(elf_regs), regs);
352#endif
353#ifndef ELF_CORE_COPY_TASK_REGS
354#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
355#endif
356#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \
357 dump_task_fpu(tsk, elf_fpregs)
358
359#define CORE_DUMP_USE_REGSET 342#define CORE_DUMP_USE_REGSET
360#define ELF_EXEC_PAGESIZE PAGE_SIZE 343#define ELF_EXEC_PAGESIZE PAGE_SIZE
361 344
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
index 71df942fb77c..928767858b86 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -72,16 +72,6 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
72 72
73#include <asm/processor.h> 73#include <asm/processor.h>
74 74
75/* These MUST be defined before elf.h gets included */
76extern void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs);
77#define ELF_CORE_COPY_REGS(_dest, _regs) elf32_core_copy_regs(_dest, _regs);
78#define ELF_CORE_COPY_TASK_REGS(_tsk, _dest) \
79({ \
80 int __res = 1; \
81 elf32_core_copy_regs(*(_dest), task_pt_regs(_tsk)); \
82 __res; \
83})
84
85#include <linux/module.h> 75#include <linux/module.h>
86#include <linux/elfcore.h> 76#include <linux/elfcore.h>
87#include <linux/compat.h> 77#include <linux/compat.h>
@@ -139,28 +129,6 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
139 value->tv_usec = rem / NSEC_PER_USEC; 129 value->tv_usec = rem / NSEC_PER_USEC;
140} 130}
141 131
142void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs)
143{
144 int i;
145
146 for (i = 0; i < MIPS32_EF_R0; i++)
147 grp[i] = 0;
148 grp[MIPS32_EF_R0] = 0;
149 for (i = 1; i <= 31; i++)
150 grp[MIPS32_EF_R0 + i] = (elf_greg_t) regs->regs[i];
151 grp[MIPS32_EF_R26] = 0;
152 grp[MIPS32_EF_R27] = 0;
153 grp[MIPS32_EF_LO] = (elf_greg_t) regs->lo;
154 grp[MIPS32_EF_HI] = (elf_greg_t) regs->hi;
155 grp[MIPS32_EF_CP0_EPC] = (elf_greg_t) regs->cp0_epc;
156 grp[MIPS32_EF_CP0_BADVADDR] = (elf_greg_t) regs->cp0_badvaddr;
157 grp[MIPS32_EF_CP0_STATUS] = (elf_greg_t) regs->cp0_status;
158 grp[MIPS32_EF_CP0_CAUSE] = (elf_greg_t) regs->cp0_cause;
159#ifdef MIPS32_EF_UNUSED0
160 grp[MIPS32_EF_UNUSED0] = 0;
161#endif
162}
163
164MODULE_DESCRIPTION("Binary format loader for compatibility with o32 Linux/MIPS binaries"); 132MODULE_DESCRIPTION("Binary format loader for compatibility with o32 Linux/MIPS binaries");
165MODULE_AUTHOR("Ralf Baechle (ralf@linux-mips.org)"); 133MODULE_AUTHOR("Ralf Baechle (ralf@linux-mips.org)");
166 134
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 0a1ec0f3beff..7564c371c660 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -152,61 +152,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
152 return 0; 152 return 0;
153} 153}
154 154
155/* Fill in the fpu structure for a core dump.. */
156int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r)
157{
158 int i;
159
160 for (i = 0; i < NUM_FPU_REGS; i++)
161 memcpy(&r[i], &current->thread.fpu.fpr[i], sizeof(*r));
162
163 memcpy(&r[NUM_FPU_REGS], &current->thread.fpu.fcr31,
164 sizeof(current->thread.fpu.fcr31));
165
166 return 1;
167}
168
169void elf_dump_regs(elf_greg_t *gp, struct pt_regs *regs)
170{
171 int i;
172
173 for (i = 0; i < EF_R0; i++)
174 gp[i] = 0;
175 gp[EF_R0] = 0;
176 for (i = 1; i <= 31; i++)
177 gp[EF_R0 + i] = regs->regs[i];
178 gp[EF_R26] = 0;
179 gp[EF_R27] = 0;
180 gp[EF_LO] = regs->lo;
181 gp[EF_HI] = regs->hi;
182 gp[EF_CP0_EPC] = regs->cp0_epc;
183 gp[EF_CP0_BADVADDR] = regs->cp0_badvaddr;
184 gp[EF_CP0_STATUS] = regs->cp0_status;
185 gp[EF_CP0_CAUSE] = regs->cp0_cause;
186#ifdef EF_UNUSED0
187 gp[EF_UNUSED0] = 0;
188#endif
189}
190
191int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
192{
193 elf_dump_regs(*regs, task_pt_regs(tsk));
194 return 1;
195}
196
197int dump_task_fpu(struct task_struct *t, elf_fpregset_t *fpr)
198{
199 int i;
200
201 for (i = 0; i < NUM_FPU_REGS; i++)
202 memcpy(&fpr[i], &t->thread.fpu.fpr[i], sizeof(*fpr));
203
204 memcpy(&fpr[NUM_FPU_REGS], &t->thread.fpu.fcr31,
205 sizeof(t->thread.fpu.fcr31));
206
207 return 1;
208}
209
210#ifdef CONFIG_CC_STACKPROTECTOR 155#ifdef CONFIG_CC_STACKPROTECTOR
211#include <linux/stackprotector.h> 156#include <linux/stackprotector.h>
212unsigned long __stack_chk_guard __read_mostly; 157unsigned long __stack_chk_guard __read_mostly;