diff options
author | Mark Nutter <mnutter@us.ibm.com> | 2006-10-24 18:31:16 +0200 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-10-25 14:20:21 +1000 |
commit | 5737edd1ddbde5ab7f63bb3cb36015edbdb7c295 (patch) | |
tree | 10162eb7c27fa0a3d1614c2d46fdcf2c87410d3a /arch/powerpc/platforms/cell/spufs/run.c | |
parent | cc21a66d7f727ab97b27af9cf763bc0b51510ffa (diff) | |
download | kernel_samsung_aries-5737edd1ddbde5ab7f63bb3cb36015edbdb7c295.zip kernel_samsung_aries-5737edd1ddbde5ab7f63bb3cb36015edbdb7c295.tar.gz kernel_samsung_aries-5737edd1ddbde5ab7f63bb3cb36015edbdb7c295.tar.bz2 |
[POWERPC] spufs: add support for nonschedulable contexts
This adds two new flags to spu_create:
SPU_CREATE_NONSCHED: create a context that is never moved
away from an SPE once it has started running. This flag
can only be used by tasks with the CAP_SYS_NICE capability.
SPU_CREATE_ISOLATED: create a nonschedulable context that
enters isolation mode upon first run. This requires the
SPU_CREATE_NONSCHED flag.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/run.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/run.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c index 63df8cf..0c03a04 100644 --- a/arch/powerpc/platforms/cell/spufs/run.c +++ b/arch/powerpc/platforms/cell/spufs/run.c @@ -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; } |