提交 39a3cb27 编写于 作者: M Marcin Nowakowski 提交者: Ralf Baechle

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: NMarcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14586/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 08c941bf
......@@ -224,6 +224,9 @@ void mips_dump_regs64(u64 *uregs, const struct pt_regs *regs);
*/
#define ELF_CLASS ELFCLASS32
#define ELF_CORE_COPY_REGS(dest, regs) \
mips_dump_regs32((u32 *)&(dest), (regs));
#endif /* CONFIG_32BIT */
#ifdef CONFIG_64BIT
......@@ -237,6 +240,9 @@ void mips_dump_regs64(u64 *uregs, const struct pt_regs *regs);
*/
#define ELF_CLASS ELFCLASS64
#define ELF_CORE_COPY_REGS(dest, regs) \
mips_dump_regs64((u64 *)&(dest), (regs));
#endif /* CONFIG_64BIT */
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册