|
@@ -527,34 +527,6 @@ fadump_read_registers(struct fadump_reg_entry *reg_entry, struct pt_regs *regs)
|
|
|
return reg_entry;
|
|
|
}
|
|
|
|
|
|
-static u32 *fadump_append_elf_note(u32 *buf, char *name, unsigned type,
|
|
|
- void *data, size_t data_len)
|
|
|
-{
|
|
|
- struct elf_note note;
|
|
|
-
|
|
|
- note.n_namesz = strlen(name) + 1;
|
|
|
- note.n_descsz = data_len;
|
|
|
- note.n_type = type;
|
|
|
- memcpy(buf, ¬e, sizeof(note));
|
|
|
- buf += (sizeof(note) + 3)/4;
|
|
|
- memcpy(buf, name, note.n_namesz);
|
|
|
- buf += (note.n_namesz + 3)/4;
|
|
|
- memcpy(buf, data, note.n_descsz);
|
|
|
- buf += (note.n_descsz + 3)/4;
|
|
|
-
|
|
|
- return buf;
|
|
|
-}
|
|
|
-
|
|
|
-static void fadump_final_note(u32 *buf)
|
|
|
-{
|
|
|
- struct elf_note note;
|
|
|
-
|
|
|
- note.n_namesz = 0;
|
|
|
- note.n_descsz = 0;
|
|
|
- note.n_type = 0;
|
|
|
- memcpy(buf, ¬e, sizeof(note));
|
|
|
-}
|
|
|
-
|
|
|
static u32 *fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)
|
|
|
{
|
|
|
struct elf_prstatus prstatus;
|
|
@@ -565,8 +537,8 @@ static u32 *fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)
|
|
|
* prstatus.pr_pid = ????
|
|
|
*/
|
|
|
elf_core_copy_kernel_regs(&prstatus.pr_reg, regs);
|
|
|
- buf = fadump_append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS,
|
|
|
- &prstatus, sizeof(prstatus));
|
|
|
+ buf = append_elf_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS,
|
|
|
+ &prstatus, sizeof(prstatus));
|
|
|
return buf;
|
|
|
}
|
|
|
|
|
@@ -707,7 +679,7 @@ static int __init fadump_build_cpu_notes(const struct fadump_mem_struct *fdm)
|
|
|
note_buf = fadump_regs_to_elf_notes(note_buf, ®s);
|
|
|
}
|
|
|
}
|
|
|
- fadump_final_note(note_buf);
|
|
|
+ final_note(note_buf);
|
|
|
|
|
|
if (fdh) {
|
|
|
pr_debug("Updating elfcore header (%llx) with cpu notes\n",
|