aboutsummaryrefslogtreecommitdiffstats
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:18 -0400
commit59000b53c7ea07531018b6cf1f5fcd21e881867a (patch)
treeaee6299853b27a9587cc617e878b3018f08252f1
parentd464fb441071a3d65bde2264c5f97f9ca47ce5c3 (diff)
[POWERPC] spufs: Correctly calculate the size of the local-store to dump
The routine to dump the local store, __spufs_mem_read(), does not take the spu_lslr_RW value into account - so we shouldn't check it when we're calculating the size either. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index c65b7178e77b..52d62193fd83 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -66,11 +66,6 @@ static int spufs_dump_seek(struct file *file, loff_t off)
66 return 1; 66 return 1;
67} 67}
68 68
69static u64 ctx_ls_size(struct spu_context *ctx)
70{
71 return ctx->csa.priv2.spu_lslr_RW + 1;
72}
73
74static int spufs_ctx_note_size(struct spu_context *ctx, int dfd) 69static int spufs_ctx_note_size(struct spu_context *ctx, int dfd)
75{ 70{
76 int i, sz, total = 0; 71 int i, sz, total = 0;
@@ -85,10 +80,7 @@ static int spufs_ctx_note_size(struct spu_context *ctx, int dfd)
85 80
86 total += sizeof(struct elf_note); 81 total += sizeof(struct elf_note);
87 total += roundup(strlen(fullname) + 1, 4); 82 total += roundup(strlen(fullname) + 1, 4);
88 if (!strcmp(name, "mem")) 83 total += roundup(sz, 4);
89 total += roundup(ctx_ls_size(ctx), 4);
90 else
91 total += roundup(sz, 4);
92 } 84 }
93 85
94 return total; 86 return total;
@@ -164,11 +156,7 @@ static void spufs_arch_write_note(struct spu_context *ctx, int i,
164 return; 156 return;
165 157
166 name = spufs_coredump_read[i].name; 158 name = spufs_coredump_read[i].name;
167 159 sz = spufs_coredump_read[i].size;
168 if (!strcmp(name, "mem"))
169 sz = ctx_ls_size(ctx);
170 else
171 sz = spufs_coredump_read[i].size;
172 160
173 sprintf(fullname, "SPU/%d/%s", dfd, name); 161 sprintf(fullname, "SPU/%d/%s", dfd, name);
174 en.n_namesz = strlen(fullname) + 1; 162 en.n_namesz = strlen(fullname) + 1;