diff options
author | Akinobu Mita <mita@fixstars.com> | 2007-04-23 15:08:22 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-04-23 15:18:57 -0400 |
commit | 9e2fe2ce4e957a79d3dc5d813e0cfb10d79b79b3 (patch) | |
tree | 1e7905b1bbf362e18d18636557e0cecf964d1a99 /arch | |
parent | 8a7d86bdb22678b17928eef0c8fa356d8b21cc76 (diff) |
[POWERPC] spufs: use memcpy_fromio() to copy from local store
GCC may generates inline copy loop to handle memcpy() function
instead of kernel defined memcpy(). But this inlined version of memcpy()
causes an alignment interrupt when copying from local store.
This patch uses memcpy_fromio() and memcpy_toio to copy local store
to prevent memcpy() being inlined.
Signed-off-by: Akinobu Mita <mita@fixstars.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/run.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c index 7cf5b298fa13..b5e7bdee1bc2 100644 --- a/arch/powerpc/platforms/cell/spufs/run.c +++ b/arch/powerpc/platforms/cell/spufs/run.c | |||
@@ -234,17 +234,17 @@ int spu_process_callback(struct spu_context *ctx) | |||
234 | { | 234 | { |
235 | struct spu_syscall_block s; | 235 | struct spu_syscall_block s; |
236 | u32 ls_pointer, npc; | 236 | u32 ls_pointer, npc; |
237 | char *ls; | 237 | void __iomem *ls; |
238 | long spu_ret; | 238 | long spu_ret; |
239 | int ret; | 239 | int ret; |
240 | 240 | ||
241 | /* get syscall block from local store */ | 241 | /* get syscall block from local store */ |
242 | npc = ctx->ops->npc_read(ctx); | 242 | npc = ctx->ops->npc_read(ctx) & ~3; |
243 | ls = ctx->ops->get_ls(ctx); | 243 | ls = (void __iomem *)ctx->ops->get_ls(ctx); |
244 | ls_pointer = *(u32*)(ls + npc); | 244 | ls_pointer = in_be32(ls + npc); |
245 | if (ls_pointer > (LS_SIZE - sizeof(s))) | 245 | if (ls_pointer > (LS_SIZE - sizeof(s))) |
246 | return -EFAULT; | 246 | return -EFAULT; |
247 | memcpy(&s, ls + ls_pointer, sizeof (s)); | 247 | memcpy_fromio(&s, ls + ls_pointer, sizeof(s)); |
248 | 248 | ||
249 | /* do actual syscall without pinning the spu */ | 249 | /* do actual syscall without pinning the spu */ |
250 | ret = 0; | 250 | ret = 0; |
@@ -264,7 +264,7 @@ int spu_process_callback(struct spu_context *ctx) | |||
264 | } | 264 | } |
265 | 265 | ||
266 | /* write result, jump over indirect pointer */ | 266 | /* write result, jump over indirect pointer */ |
267 | memcpy(ls + ls_pointer, &spu_ret, sizeof (spu_ret)); | 267 | memcpy_toio(ls + ls_pointer, &spu_ret, sizeof(spu_ret)); |
268 | ctx->ops->npc_write(ctx, npc); | 268 | ctx->ops->npc_write(ctx, npc); |
269 | ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE); | 269 | ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE); |
270 | return ret; | 270 | return ret; |