aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-09-19 00:38:12 -0400
committerPaul Mackerras <paulus@samba.org>2007-09-19 01:12:19 -0400
commite55014923e65e4ee8e477a1212381cca0125f3aa (patch)
treee84c0cab99f6963e644083be123042a0da6cd515 /include
parent48cad41f7ee7b8a9a8317a4abbdaf09bc68b4773 (diff)
[POWERPC] spufs: Cleanup ELF coredump extra notes logic
To start with, arch_notes_size() etc. is a little too ambiguous a name for my liking, so change the function names to be more explicit. Calling through macros is ugly, especially with hidden parameters, so don't do that, call the routines directly. Use ARCH_HAVE_EXTRA_ELF_NOTES as the only flag, and based on it decide whether we want the extern declarations or the empty versions. Since we have empty routines, actually use them in the coredump code to save a few #ifdefs. We want to change the handling of foffset so that the write routine updates foffset as it goes, instead of using file->f_pos (so that writing to a pipe works). So pass foffset to the write routine, and for now just set it to file->f_pos at the end of writing. It should also be possible for the write routine to fail, so change it to return int and treat a non-zero return as failure. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-powerpc/elf.h9
-rw-r--r--include/linux/elf.h14
2 files changed, 10 insertions, 13 deletions
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h
index de507995c7b1..e42820d6d25b 100644
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -413,13 +413,8 @@ do { \
413/* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */ 413/* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */
414#define NT_SPU 1 414#define NT_SPU 1
415 415
416extern int arch_notes_size(void);
417extern void arch_write_notes(struct file *file);
418
419#define ELF_CORE_EXTRA_NOTES_SIZE arch_notes_size()
420#define ELF_CORE_WRITE_EXTRA_NOTES arch_write_notes(file)
421
422#define ARCH_HAVE_EXTRA_ELF_NOTES 416#define ARCH_HAVE_EXTRA_ELF_NOTES
423#endif /* CONFIG_PPC_CELL */ 417
418#endif /* CONFIG_SPU_BASE */
424 419
425#endif /* _ASM_POWERPC_ELF_H */ 420#endif /* _ASM_POWERPC_ELF_H */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 8b17ffe222c4..d2da84acf45d 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -389,12 +389,14 @@ extern Elf64_Dyn _DYNAMIC [];
389 389
390#endif 390#endif
391 391
392/* Optional callbacks to write extra ELF notes. */
392#ifndef ARCH_HAVE_EXTRA_ELF_NOTES 393#ifndef ARCH_HAVE_EXTRA_ELF_NOTES
393static inline int arch_notes_size(void) { return 0; } 394static inline int elf_coredump_extra_notes_size(void) { return 0; }
394static inline void arch_write_notes(struct file *file) { } 395static inline int elf_coredump_extra_notes_write(struct file *file,
395 396 loff_t *foffset) { return 0; }
396#define ELF_CORE_EXTRA_NOTES_SIZE arch_notes_size() 397#else
397#define ELF_CORE_WRITE_EXTRA_NOTES arch_write_notes(file) 398extern int elf_coredump_extra_notes_size(void);
398#endif /* ARCH_HAVE_EXTRA_ELF_NOTES */ 399extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
400#endif
399 401
400#endif /* _LINUX_ELF_H */ 402#endif /* _LINUX_ELF_H */