diff options
author | Dwayne Grant McConnell <decimal@us.ibm.com> | 2006-11-22 18:46:37 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 04:40:19 -0500 |
commit | bf1ab978be2318c5a564de9aa0f1a217b44170d4 (patch) | |
tree | 518a971f12a65c8a3ee54d75b6a8c33b68f54664 /fs | |
parent | 9309180f11f0107c9858a61a1ac2b04518a91080 (diff) |
[POWERPC] coredump: Add SPU elf notes to coredump.
This patch adds SPU elf notes to the coredump. It creates a separate note
for each of /regs, /fpcr, /lslr, /decr, /decr_status, /mem, /signal1,
/signal1_type, /signal2, /signal2_type, /event_mask, /event_status,
/mbox_info, /ibox_info, /wbox_info, /dma_info, /proxydma_info, /object-id.
A new macro, ARCH_HAVE_EXTRA_NOTES, was created for architectures to
specify they have extra elf core notes.
A new macro, ELF_CORE_EXTRA_NOTES_SIZE, was created so the size of the
additional notes could be calculated and added to the notes phdr entry.
A new macro, ELF_CORE_WRITE_EXTRA_NOTES, was created so the new notes
would be written after the existing notes.
The SPU coredump code resides in spufs. Stub functions are provided in the
kernel which are hooked into the spufs code which does the actual work via
register_arch_coredump_calls().
A new set of __spufs_<file>_read/get() functions was provided to allow the
coredump code to read from the spufs files without having to lock the
SPU context for each file read from.
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Dwayne Grant McConnell <decimal@us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_elf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 79b05a1a4365..cc72bb43061d 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1582,6 +1582,10 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file) | |||
1582 | 1582 | ||
1583 | sz += thread_status_size; | 1583 | sz += thread_status_size; |
1584 | 1584 | ||
1585 | #ifdef ELF_CORE_WRITE_EXTRA_NOTES | ||
1586 | sz += ELF_CORE_EXTRA_NOTES_SIZE; | ||
1587 | #endif | ||
1588 | |||
1585 | fill_elf_note_phdr(&phdr, sz, offset); | 1589 | fill_elf_note_phdr(&phdr, sz, offset); |
1586 | offset += sz; | 1590 | offset += sz; |
1587 | DUMP_WRITE(&phdr, sizeof(phdr)); | 1591 | DUMP_WRITE(&phdr, sizeof(phdr)); |
@@ -1622,6 +1626,10 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file) | |||
1622 | if (!writenote(notes + i, file, &foffset)) | 1626 | if (!writenote(notes + i, file, &foffset)) |
1623 | goto end_coredump; | 1627 | goto end_coredump; |
1624 | 1628 | ||
1629 | #ifdef ELF_CORE_WRITE_EXTRA_NOTES | ||
1630 | ELF_CORE_WRITE_EXTRA_NOTES; | ||
1631 | #endif | ||
1632 | |||
1625 | /* write out the thread status notes section */ | 1633 | /* write out the thread status notes section */ |
1626 | list_for_each(t, &thread_list) { | 1634 | list_for_each(t, &thread_list) { |
1627 | struct elf_thread_status *tmp = | 1635 | struct elf_thread_status *tmp = |