Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17227
b: refs/heads/master
c: 5ef8224
h: refs/heads/master
i:
  17225: 5fd84f4
  17223: 04360eb
v: v3
  • Loading branch information
Arnd Bergmann authored and Paul Mackerras committed Jan 9, 2006
1 parent 16673c1 commit a45b0c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e80358ad8606382154d97165121602dfae213e4a
refs/heads/master: 5ef8224aaa9220bfecb362f0802cf78aad47c02a
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/cell/spufs/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct spu_context *alloc_spu_context(struct address_space *local_store)
spin_lock_init(&ctx->mmio_lock);
kref_init(&ctx->kref);
init_rwsem(&ctx->state_sema);
init_MUTEX(&ctx->run_sema);
init_waitqueue_head(&ctx->ibox_wq);
init_waitqueue_head(&ctx->wbox_wq);
init_waitqueue_head(&ctx->stop_wq);
Expand Down
15 changes: 10 additions & 5 deletions trunk/arch/powerpc/platforms/cell/spufs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,18 +620,21 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx,
{
int ret;

if ((ret = spu_run_init(ctx, npc, status)) != 0)
return ret;
if (down_interruptible(&ctx->run_sema))
return -ERESTARTSYS;

ret = spu_run_init(ctx, npc, status);
if (ret)
goto out;

do {
ret = spufs_wait(ctx->stop_wq, spu_stopped(ctx, status));
if (unlikely(ret))
break;
if (unlikely(ctx->state != SPU_STATE_RUNNABLE)) {
ret = spu_reacquire_runnable(ctx, npc, status);
if (ret) {
return ret;
}
if (ret)
goto out;
continue;
}
ret = spu_process_events(ctx);
Expand All @@ -645,6 +648,8 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx,
ret = *status;
spu_yield(ctx);

out:
up(&ctx->run_sema);
return ret;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/cell/spufs/spufs.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct spu_context {

enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state;
struct rw_semaphore state_sema;
struct semaphore run_sema;

struct mm_struct *owner;

Expand Down

0 comments on commit a45b0c9

Please sign in to comment.