Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42266
b: refs/heads/master
c: 2ebb247
h: refs/heads/master
v: v3
  • Loading branch information
Masato Noguchi authored and Paul Mackerras committed Dec 4, 2006
1 parent db8cf59 commit 1260ccf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 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: 453d9f72a91d798c3e3c4b4bed26210926dfb57b
refs/heads/master: 2ebb2477f9a61b436dd22b75189857df1a77e585
28 changes: 18 additions & 10 deletions trunk/arch/powerpc/platforms/cell/spufs/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,7 @@ static inline int spu_run_fini(struct spu_context *ctx, u32 * npc,

if (signal_pending(current))
ret = -ERESTARTSYS;
if (unlikely(current->ptrace & PT_PTRACED)) {
if ((*status & SPU_STATUS_STOPPED_BY_STOP)
&& (*status >> SPU_STOP_STATUS_SHIFT) == 0x3fff) {
force_sig(SIGTRAP, current);
ret = -ERESTARTSYS;
}
}

return ret;
}

Expand Down Expand Up @@ -232,7 +226,7 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx,
if (unlikely(ctx->state != SPU_STATE_RUNNABLE)) {
ret = spu_reacquire_runnable(ctx, npc, &status);
if (ret)
goto out;
goto out2;
continue;
}
ret = spu_process_events(ctx);
Expand All @@ -242,10 +236,24 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx,

ctx->ops->runcntl_stop(ctx);
ret = spu_run_fini(ctx, npc, &status);
if (!ret)
ret = status;
spu_yield(ctx);

out2:
if ((ret == 0) ||
((ret == -ERESTARTSYS) &&
((status & SPU_STATUS_STOPPED_BY_HALT) ||
((status & SPU_STATUS_STOPPED_BY_STOP) &&
(status >> SPU_STOP_STATUS_SHIFT != 0x2104)))))
ret = status;

if (unlikely(current->ptrace & PT_PTRACED)) {
if ((status & SPU_STATUS_STOPPED_BY_STOP)
&& (status >> SPU_STOP_STATUS_SHIFT) == 0x3fff) {
force_sig(SIGTRAP, current);
ret = -ERESTARTSYS;
}
}

out:
*event = ctx->event_return;
up(&ctx->run_sema);
Expand Down

0 comments on commit 1260ccf

Please sign in to comment.