aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDwayne Grant McConnell <decimal@us.ibm.com>2006-11-22 18:46:37 -0500
committerPaul Mackerras <paulus@samba.org>2006-12-04 04:40:19 -0500
commitbf1ab978be2318c5a564de9aa0f1a217b44170d4 (patch)
tree518a971f12a65c8a3ee54d75b6a8c33b68f54664 /include
parent9309180f11f0107c9858a61a1ac2b04518a91080 (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 'include')
-rw-r--r--include/asm-powerpc/elf.h13
-rw-r--r--include/asm-powerpc/spu.h10
-rw-r--r--include/linux/elf.h7
3 files changed, 30 insertions, 0 deletions
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h
index 9a83a987d396..4545aa682509 100644
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -411,4 +411,17 @@ do { \
411/* Keep this the last entry. */ 411/* Keep this the last entry. */
412#define R_PPC64_NUM 107 412#define R_PPC64_NUM 107
413 413
414#ifdef CONFIG_PPC_CELL
415/* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */
416#define NT_SPU 1
417
418extern int arch_notes_size(void);
419extern void arch_write_notes(struct file *file);
420
421#define ELF_CORE_EXTRA_NOTES_SIZE arch_notes_size()
422#define ELF_CORE_WRITE_EXTRA_NOTES arch_write_notes(file)
423
424#define ARCH_HAVE_EXTRA_ELF_NOTES
425#endif /* CONFIG_PPC_CELL */
426
414#endif /* _ASM_POWERPC_ELF_H */ 427#endif /* _ASM_POWERPC_ELF_H */
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index ffa4df083609..f968f8697538 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -172,6 +172,13 @@ extern struct spufs_calls {
172 struct module *owner; 172 struct module *owner;
173} spufs_calls; 173} spufs_calls;
174 174
175/* coredump calls implemented in spufs */
176struct spu_coredump_calls {
177 asmlinkage int (*arch_notes_size)(void);
178 asmlinkage void (*arch_write_notes)(struct file *file);
179 struct module *owner;
180};
181
175/* return status from spu_run, same as in libspe */ 182/* return status from spu_run, same as in libspe */
176#define SPE_EVENT_DMA_ALIGNMENT 0x0008 /*A DMA alignment error */ 183#define SPE_EVENT_DMA_ALIGNMENT 0x0008 /*A DMA alignment error */
177#define SPE_EVENT_SPE_ERROR 0x0010 /*An illegal instruction error*/ 184#define SPE_EVENT_SPE_ERROR 0x0010 /*An illegal instruction error*/
@@ -203,6 +210,9 @@ static inline void unregister_spu_syscalls(struct spufs_calls *calls)
203} 210}
204#endif /* MODULE */ 211#endif /* MODULE */
205 212
213int register_arch_coredump_calls(struct spu_coredump_calls *calls);
214void unregister_arch_coredump_calls(struct spu_coredump_calls *calls);
215
206int spu_add_sysdev_attr(struct sysdev_attribute *attr); 216int spu_add_sysdev_attr(struct sysdev_attribute *attr);
207void spu_remove_sysdev_attr(struct sysdev_attribute *attr); 217void spu_remove_sysdev_attr(struct sysdev_attribute *attr);
208 218
diff --git a/include/linux/elf.h b/include/linux/elf.h
index b70d1d2c8d28..743d5c8e6d36 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -368,5 +368,12 @@ extern Elf64_Dyn _DYNAMIC [];
368 368
369#endif 369#endif
370 370
371#ifndef ARCH_HAVE_EXTRA_ELF_NOTES
372static inline int arch_notes_size(void) { return 0; }
373static inline void arch_write_notes(struct file *file) { }
374
375#define ELF_CORE_EXTRA_NOTES_SIZE arch_notes_size()
376#define ELF_CORE_WRITE_EXTRA_NOTES arch_write_notes(file)
377#endif /* ARCH_HAVE_EXTRA_ELF_NOTES */
371 378
372#endif /* _LINUX_ELF_H */ 379#endif /* _LINUX_ELF_H */