Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67354
b: refs/heads/master
c: e550149
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Sep 19, 2007
1 parent 469c765 commit e5276f9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 48cad41f7ee7b8a9a8317a4abbdaf09bc68b4773
refs/heads/master: e55014923e65e4ee8e477a1212381cca0125f3aa
12 changes: 9 additions & 3 deletions trunk/arch/powerpc/platforms/cell/spu_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/rcupdate.h>
Expand Down Expand Up @@ -112,7 +113,7 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
return ret;
}

int arch_notes_size(void)
int elf_coredump_extra_notes_size(void)
{
struct spufs_calls *calls;
int ret;
Expand All @@ -128,17 +129,22 @@ int arch_notes_size(void)
return ret;
}

void arch_write_notes(struct file *file)
int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset)
{
struct spufs_calls *calls;

calls = spufs_calls_get();
if (!calls)
return;
return 0;

calls->coredump_extra_notes_write(file);

spufs_calls_put(calls);

/* Fudge foffset for now */
*foffset = file->f_pos;

return 0;
}

int register_spu_syscalls(struct spufs_calls *calls)
Expand Down
14 changes: 3 additions & 11 deletions trunk/fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1514,9 +1514,6 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
int thread_status_size = 0;
elf_addr_t *auxv;
unsigned long mm_flags;
#ifdef ELF_CORE_WRITE_EXTRA_NOTES
int extra_notes_size;
#endif

/*
* We no longer stop all VM operations.
Expand Down Expand Up @@ -1645,10 +1642,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)

sz += thread_status_size;

#ifdef ELF_CORE_WRITE_EXTRA_NOTES
extra_notes_size = ELF_CORE_EXTRA_NOTES_SIZE;
sz += extra_notes_size;
#endif
sz += elf_coredump_extra_notes_size();

fill_elf_note_phdr(&phdr, sz, offset);
offset += sz;
Expand Down Expand Up @@ -1698,10 +1692,8 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
if (!writenote(notes + i, file, &foffset))
goto end_coredump;

#ifdef ELF_CORE_WRITE_EXTRA_NOTES
ELF_CORE_WRITE_EXTRA_NOTES;
foffset += extra_notes_size;
#endif
if (elf_coredump_extra_notes_write(file, &foffset))
goto end_coredump;

/* write out the thread status notes section */
list_for_each(t, &thread_list) {
Expand Down
9 changes: 2 additions & 7 deletions trunk/include/asm-powerpc/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,8 @@ do { \
/* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */
#define NT_SPU 1

extern int arch_notes_size(void);
extern void arch_write_notes(struct file *file);

#define ELF_CORE_EXTRA_NOTES_SIZE arch_notes_size()
#define ELF_CORE_WRITE_EXTRA_NOTES arch_write_notes(file)

#define ARCH_HAVE_EXTRA_ELF_NOTES
#endif /* CONFIG_PPC_CELL */

#endif /* CONFIG_SPU_BASE */

#endif /* _ASM_POWERPC_ELF_H */
14 changes: 8 additions & 6 deletions trunk/include/linux/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,14 @@ extern Elf64_Dyn _DYNAMIC [];

#endif

/* Optional callbacks to write extra ELF notes. */
#ifndef ARCH_HAVE_EXTRA_ELF_NOTES
static inline int arch_notes_size(void) { return 0; }
static inline void arch_write_notes(struct file *file) { }

#define ELF_CORE_EXTRA_NOTES_SIZE arch_notes_size()
#define ELF_CORE_WRITE_EXTRA_NOTES arch_write_notes(file)
#endif /* ARCH_HAVE_EXTRA_ELF_NOTES */
static inline int elf_coredump_extra_notes_size(void) { return 0; }
static inline int elf_coredump_extra_notes_write(struct file *file,
loff_t *foffset) { return 0; }
#else
extern int elf_coredump_extra_notes_size(void);
extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
#endif

#endif /* _LINUX_ELF_H */

0 comments on commit e5276f9

Please sign in to comment.