aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-08-12 21:29:31 -0400
committerJeremy Kerr <jk@ozlabs.org>2008-08-12 21:42:47 -0400
commitd9dd421fd6ed17af55d27c8d93a9f561be0ff50f (patch)
tree00a4f49a7a9f478e97aebee786682c2723e3b533 /arch/powerpc/platforms
parent2e1e9212ed8c532c6b324de77d3cafef5d2bc846 (diff)
powerpc/spufs: fix npc setting for NOSCHED contexts
Currently, spu_run ignores the npc argument for contexts created with SPU_CREATE_NOSCHED. While this is correct for isolated contexts, there's no need to enforce the npc restriction on non-isolated NOSCHED contexts. This means that NOSCHED contexts can only ever run with an entry point of 0x0. This change to spu_run_init allows setting of the npc (and, while we're at it, the privcntl) for non-isolated NOSCHED contexts. This allows us to run NOSCHED contexts from any entry point. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index f7edba6cb795..c9bb7cfd3dca 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -206,11 +206,6 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
206 (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE); 206 (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE);
207 if (runcntl == 0) 207 if (runcntl == 0)
208 runcntl = SPU_RUNCNTL_RUNNABLE; 208 runcntl = SPU_RUNCNTL_RUNNABLE;
209 }
210
211 if (ctx->flags & SPU_CREATE_NOSCHED) {
212 spuctx_switch_state(ctx, SPU_UTIL_USER);
213 ctx->ops->runcntl_write(ctx, runcntl);
214 } else { 209 } else {
215 unsigned long privcntl; 210 unsigned long privcntl;
216 211
@@ -219,9 +214,15 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
219 else 214 else
220 privcntl = SPU_PRIVCNTL_MODE_NORMAL; 215 privcntl = SPU_PRIVCNTL_MODE_NORMAL;
221 216
222 ctx->ops->npc_write(ctx, *npc);
223 ctx->ops->privcntl_write(ctx, privcntl); 217 ctx->ops->privcntl_write(ctx, privcntl);
224 ctx->ops->runcntl_write(ctx, runcntl); 218 ctx->ops->npc_write(ctx, *npc);
219 }
220
221 ctx->ops->runcntl_write(ctx, runcntl);
222
223 if (ctx->flags & SPU_CREATE_NOSCHED) {
224 spuctx_switch_state(ctx, SPU_UTIL_USER);
225 } else {
225 226
226 if (ctx->state == SPU_STATE_SAVED) { 227 if (ctx->state == SPU_STATE_SAVED) {
227 ret = spu_activate(ctx, 0); 228 ret = spu_activate(ctx, 0);