summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/cell/spufs/coredump.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-09-19 04:38:12 (GMT)
committerPaul Mackerras <paulus@samba.org>2007-09-19 05:12:18 (GMT)
commitd464fb441071a3d65bde2264c5f97f9ca47ce5c3 (patch)
tree9e015d125634898103f93b364006a5759d0eccd4 /arch/powerpc/platforms/cell/spufs/coredump.c
parent4fca9c425009c01d41db6c6ebf0189843ee90f0b (diff)
downloadlinux-d464fb441071a3d65bde2264c5f97f9ca47ce5c3.tar.xz
[POWERPC] spufs: Write some SPU coredump values as ASCII
Unfortunately GDB expects some of the SPU coredump values to be identical in format to what is found in spufs. This means we need to dump some of the values as ASCII strings, not the actual values. Because we don't know what the values will be, we always print the values with the format "0x%.16lx", that way we know the result will be 19 bytes. do_coredump_read() doesn't take a __user buffer, so remove the annotation, and because we know that it's safe to just snprintf() directly to it. 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/cell/spufs/coredump.c')
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index 21283f6..c65b717 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -31,7 +31,7 @@
#include "spufs.h"
-static ssize_t do_coredump_read(int num, struct spu_context *ctx, void __user *buffer,
+static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
size_t size, loff_t *off)
{
u64 data;
@@ -41,8 +41,10 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void __user *b
return spufs_coredump_read[num].read(ctx, buffer, size, off);
data = spufs_coredump_read[num].get(ctx);
- ret = copy_to_user(buffer, &data, 8);
- return ret ? -EFAULT : 8;
+ ret = snprintf(buffer, size, "0x%.16lx", data);
+ if (ret >= size)
+ return size;
+ return ++ret; /* count trailing NULL */
}
/*