[POWERPC] spufs: add support for nonschedulable contexts
[linux-2.6-block.git] / arch / powerpc / platforms / cell / spufs / run.c
index 63df8cf4ba1607e13ee8c01cdab8a392da12835b..0c03a04b6a3045df9a5322c252b5ae68d6f37029 100644 (file)
@@ -51,11 +51,17 @@ static inline int spu_stopped(struct spu_context *ctx, u32 * stat)
 static inline int spu_run_init(struct spu_context *ctx, u32 * npc)
 {
        int ret;
+       unsigned long runcntl = SPU_RUNCNTL_RUNNABLE;
 
        if ((ret = spu_acquire_runnable(ctx)) != 0)
                return ret;
-       ctx->ops->npc_write(ctx, *npc);
-       ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
+
+       if (ctx->flags & SPU_CREATE_ISOLATE)
+               runcntl |= SPU_RUNCNTL_ISOLATE;
+       else
+               ctx->ops->npc_write(ctx, *npc);
+
+       ctx->ops->runcntl_write(ctx, runcntl);
        return 0;
 }