diff options
author | Marcin Nowakowski <marcin.nowakowski@imgtec.com> | 2016-11-21 05:23:39 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2017-01-03 10:34:44 -0500 |
commit | 39a3cb27c123df8e8461291cc9e86f1ac3f0ea06 (patch) | |
tree | 2447680677724f3c0d5180039e3f86fd128cb4c5 /arch/mips/include | |
parent | 08c941bf6ec523d666a78f86e3d696ed45dfb6e5 (diff) |
MIPS: elfcore: add correct copy_regs implementations
MIPS does not currently define ELF_CORE_COPY_REGS macros and as a result
the generic implementation is used. The generic version attempts to do
directly map (struct pt_regs) into (elf_gregset_t), which isn't correct
for MIPS platforms and also triggers a BUG() at runtime in
include/linux/elfcore.h:16 (BUG_ON(sizeof(*elfregs) != sizeof(*regs)))
[ralf@linux-mips.org: Add semicolons to the macro definitions as I do not
apply https://patchwork.linux-mips.org/patch/14588/ for now.]
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14586/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/elf.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h index f61a4a14bb56..7a6c466e5f2a 100644 --- a/arch/mips/include/asm/elf.h +++ b/arch/mips/include/asm/elf.h | |||
@@ -224,6 +224,9 @@ void mips_dump_regs64(u64 *uregs, const struct pt_regs *regs); | |||
224 | */ | 224 | */ |
225 | #define ELF_CLASS ELFCLASS32 | 225 | #define ELF_CLASS ELFCLASS32 |
226 | 226 | ||
227 | #define ELF_CORE_COPY_REGS(dest, regs) \ | ||
228 | mips_dump_regs32((u32 *)&(dest), (regs)); | ||
229 | |||
227 | #endif /* CONFIG_32BIT */ | 230 | #endif /* CONFIG_32BIT */ |
228 | 231 | ||
229 | #ifdef CONFIG_64BIT | 232 | #ifdef CONFIG_64BIT |
@@ -237,6 +240,9 @@ void mips_dump_regs64(u64 *uregs, const struct pt_regs *regs); | |||
237 | */ | 240 | */ |
238 | #define ELF_CLASS ELFCLASS64 | 241 | #define ELF_CLASS ELFCLASS64 |
239 | 242 | ||
243 | #define ELF_CORE_COPY_REGS(dest, regs) \ | ||
244 | mips_dump_regs64((u64 *)&(dest), (regs)); | ||
245 | |||
240 | #endif /* CONFIG_64BIT */ | 246 | #endif /* CONFIG_64BIT */ |
241 | 247 | ||
242 | /* | 248 | /* |