aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
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 /arch/powerpc/platforms
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 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/cell/spu_syscalls.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c
index 05841cdef4e1..b0117a7c6100 100644
--- a/arch/powerpc/platforms/cell/spu_syscalls.c
+++ b/arch/powerpc/platforms/cell/spu_syscalls.c
@@ -21,6 +21,7 @@
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */ 22 */
23#include <linux/file.h> 23#include <linux/file.h>
24#include <linux/fs.h>
24#include <linux/module.h> 25#include <linux/module.h>
25#include <linux/syscalls.h> 26#include <linux/syscalls.h>
26#include <linux/rcupdate.h> 27#include <linux/rcupdate.h>
@@ -112,7 +113,7 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
112 return ret; 113 return ret;
113} 114}
114 115
115int arch_notes_size(void) 116int elf_coredump_extra_notes_size(void)
116{ 117{
117 struct spufs_calls *calls; 118 struct spufs_calls *calls;
118 int ret; 119 int ret;
@@ -128,17 +129,22 @@ int arch_notes_size(void)
128 return ret; 129 return ret;
129} 130}
130 131
131void arch_write_notes(struct file *file) 132int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset)
132{ 133{
133 struct spufs_calls *calls; 134 struct spufs_calls *calls;
134 135
135 calls = spufs_calls_get(); 136 calls = spufs_calls_get();
136 if (!calls) 137 if (!calls)
137 return; 138 return 0;
138 139
139 calls->coredump_extra_notes_write(file); 140 calls->coredump_extra_notes_write(file);
140 141
141 spufs_calls_put(calls); 142 spufs_calls_put(calls);
143
144 /* Fudge foffset for now */
145 *foffset = file->f_pos;
146
147 return 0;
142} 148}
143 149
144int register_spu_syscalls(struct spufs_calls *calls) 150int register_spu_syscalls(struct spufs_calls *calls)