aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-02-13 21:54:22 +0100
committerArnd Bergmann <arnd@klappe.arndb.de>2007-02-13 21:55:40 +0100
commit8389998ae9ea2888c86c446f7911ddced50052a1 (patch)
treedb92e84e16513497344b9bd42b151934cfd881c3 /arch/powerpc/platforms/cell/spufs
parent6a0641e51011def4e308fd07387047f5ee50647f (diff)
[POWERPC] spufs: move prio to spu_context
It doesn't make any sense to have a priority field in the physical spu structure. Move it into the spu context instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs')
-rw-r--r--arch/powerpc/platforms/cell/spufs/context.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c6
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h3
3 files changed, 6 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c
index f2630dc0db89..88a887186303 100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
@@ -53,6 +53,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang)
ctx->owner = get_task_mm(current);
if (gang)
spu_gang_add_ctx(gang, ctx);
+ ctx->prio = current->prio;
goto out;
out_free:
kfree(ctx);
@@ -176,8 +177,7 @@ int spu_acquire_runnable(struct spu_context *ctx)
ret = spu_activate(ctx, 0);
if (ret)
goto out_unlock;
- } else
- ctx->spu->prio = current->prio;
+ }
return 0;
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index c61a34b14083..03b357ce3987 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -145,7 +145,6 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx)
ctx->spu = spu;
ctx->ops = &spu_hw_ops;
spu->pid = current->pid;
- spu->prio = current->prio;
spu->mm = ctx->owner;
mm_needs_global_tlbie(spu->mm);
spu->ibox_callback = spufs_ibox_callback;
@@ -189,7 +188,6 @@ static int spu_unbind_context(struct spu *spu, struct spu_context *ctx)
spu->dma_callback = NULL;
spu->mm = NULL;
spu->pid = 0;
- spu->prio = MAX_PRIO;
ctx->ops = &spu_backing_ops;
ctx->spu = NULL;
spu->flags = 0;
@@ -223,7 +221,7 @@ static inline void spu_del_wq(wait_queue_head_t * wq, wait_queue_t * wait,
static void spu_prio_wait(struct spu_context *ctx, u64 flags)
{
- int prio = current->prio;
+ int prio = ctx->prio;
wait_queue_head_t *wq = &spu_prio->waitq[prio];
DEFINE_WAIT(wait);
@@ -342,8 +340,6 @@ void spu_yield(struct spu_context *ctx)
__FUNCTION__, spu->number, spu->node);
spu_deactivate(ctx);
need_yield = 1;
- } else {
- spu->prio = MAX_PRIO;
}
}
mutex_unlock(&ctx->state_mutex);
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index fa07ec2e2c1a..b500e94188b5 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -74,6 +74,9 @@ struct spu_context {
struct list_head gang_list;
struct spu_gang *gang;
+
+ /* scheduler fields */
+ int prio;
};
struct spu_gang {

Privacy Policy