diff options
author | Paul Mackerras <paulus@samba.org> | 2007-07-11 13:28:26 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-07-11 13:28:26 +1000 |
commit | bf22f6fe2d72b4d7e9035be8ceb340414cf490e3 (patch) | |
tree | 14085d90de0428316479fe6de8a0c6d32e6e65e2 /arch/powerpc/platforms/cell/spufs/context.c | |
parent | 4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4 (diff) | |
parent | 93ab471889c6662b42ce7da257f31f24c08d7d9e (diff) | |
download | kernel_samsung_espresso10-bf22f6fe2d72b4d7e9035be8ceb340414cf490e3.zip kernel_samsung_espresso10-bf22f6fe2d72b4d7e9035be8ceb340414cf490e3.tar.gz kernel_samsung_espresso10-bf22f6fe2d72b4d7e9035be8ceb340414cf490e3.tar.bz2 |
Merge branch 'for-2.6.23' into merge
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/context.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/context.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index 7c51cb5..6d7bd60 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c @@ -23,10 +23,14 @@ #include <linux/fs.h> #include <linux/mm.h> #include <linux/slab.h> +#include <asm/atomic.h> #include <asm/spu.h> #include <asm/spu_csa.h> #include "spufs.h" + +atomic_t nr_spu_contexts = ATOMIC_INIT(0); + struct spu_context *alloc_spu_context(struct spu_gang *gang) { struct spu_context *ctx; @@ -53,10 +57,12 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang) INIT_LIST_HEAD(&ctx->rq); if (gang) spu_gang_add_ctx(gang, ctx); - ctx->rt_priority = current->rt_priority; - ctx->policy = current->policy; - ctx->prio = current->prio; - INIT_DELAYED_WORK(&ctx->sched_work, spu_sched_tick); + ctx->cpus_allowed = current->cpus_allowed; + spu_set_timeslice(ctx); + ctx->stats.execution_state = SPUCTX_UTIL_USER; + ctx->stats.tstamp = jiffies; + + atomic_inc(&nr_spu_contexts); goto out; out_free: kfree(ctx); @@ -76,6 +82,7 @@ void destroy_spu_context(struct kref *kref) if (ctx->gang) spu_gang_remove_ctx(ctx->gang, ctx); BUG_ON(!list_empty(&ctx->rq)); + atomic_dec(&nr_spu_contexts); kfree(ctx); } |