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>

+8 -7
+8 -7
arch/powerpc/platforms/cell/spufs/run.c
··· 206 (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE); 207 if (runcntl == 0) 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 { 215 unsigned long privcntl; 216 ··· 214 else 215 privcntl = SPU_PRIVCNTL_MODE_NORMAL; 216 217 - ctx->ops->npc_write(ctx, *npc); 218 ctx->ops->privcntl_write(ctx, privcntl); 219 - ctx->ops->runcntl_write(ctx, runcntl); 220 221 if (ctx->state == SPU_STATE_SAVED) { 222 ret = spu_activate(ctx, 0);
··· 206 (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE); 207 if (runcntl == 0) 208 runcntl = SPU_RUNCNTL_RUNNABLE; 209 } else { 210 unsigned long privcntl; 211 ··· 219 else 220 privcntl = SPU_PRIVCNTL_MODE_NORMAL; 221 222 ctx->ops->privcntl_write(ctx, privcntl); 223 + ctx->ops->npc_write(ctx, *npc); 224 + } 225 + 226 + ctx->ops->runcntl_write(ctx, runcntl); 227 + 228 + if (ctx->flags & SPU_CREATE_NOSCHED) { 229 + spuctx_switch_state(ctx, SPU_UTIL_USER); 230 + } else { 231 232 if (ctx->state == SPU_STATE_SAVED) { 233 ret = spu_activate(ctx, 0);