aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs/run.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-03-24 22:32:03 -0400
committerJeremy Kerr <jk@ozlabs.org>2008-03-27 23:36:01 -0400
commit4eb5aef583aab29dc125b6c2feb0b31f2e350c45 (patch)
treef5b7f31574938b89f88cedfcb64f9102a851b9fb /arch/powerpc/platforms/cell/spufs/run.c
parentaf8b44e01b4e5a94cb665f6b958f5a5bc4025b0e (diff)
[POWERPC] spufs: reacquire LS pointer in spu_process_callback
During spu_process callback, we release then acquire the SPU, but keep a pointer to the local store memory. Since the context may have been scheduled out during the callback, the ls pointer may become invalid. This change reacquires the pointer to the context local store after spu_acquire()-ing, so that it isn't invalidated by a context switch. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/run.c')
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index cac69e116776..2619f14546a3 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -323,6 +323,10 @@ static int spu_process_callback(struct spu_context *ctx)
323 return -EINTR; 323 return -EINTR;
324 } 324 }
325 325
326 /* need to re-get the ls, as it may have changed when we released the
327 * spu */
328 ls = (void __iomem *)ctx->ops->get_ls(ctx);
329
326 /* write result, jump over indirect pointer */ 330 /* write result, jump over indirect pointer */
327 memcpy_toio(ls + ls_pointer, &spu_ret, sizeof(spu_ret)); 331 memcpy_toio(ls + ls_pointer, &spu_ret, sizeof(spu_ret));
328 ctx->ops->npc_write(ctx, npc); 332 ctx->ops->npc_write(ctx, npc);