From 4ce3fe42c5b43325aa5ff2df3812e97f4f0458ac Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 4 Jun 2007 15:15:37 +1000 Subject: [PATCH] --- yaml --- r: 60511 b: refs/heads/master c: 05169237b55058a3993fb4804d00b65dfa3e4a0c h: refs/heads/master i: 60509: 22584d1c0731f6e733ef394aa46344d5ad75f865 60507: b004c56d31038701089f64ee8ed4d9ea29d660a3 60503: 7762fc7fdb9f40536be588c4f0f8d6a9973dbf0e 60495: b6b42a2cc7ecb5ddc5e9f2ef2f205b3b39e7b5a3 60479: e8e1cc2e441547c2579517736db6ee60abe89488 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/platforms/cell/spufs/run.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index b1a2eca5350e..490ba23e1e63 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3d5134ee8341bffc4f539049abb9e90d469b448d +refs/heads/master: 05169237b55058a3993fb4804d00b65dfa3e4a0c diff --git a/trunk/arch/powerpc/platforms/cell/spufs/run.c b/trunk/arch/powerpc/platforms/cell/spufs/run.c index 57626600b1a4..6625ed2a7fdd 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/run.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/run.c @@ -142,8 +142,12 @@ static int spu_run_init(struct spu_context *ctx, u32 * npc) runcntl = SPU_RUNCNTL_RUNNABLE; ctx->ops->runcntl_write(ctx, runcntl); } else { + unsigned long mode = SPU_PRIVCNTL_MODE_NORMAL; spu_start_tick(ctx); ctx->ops->npc_write(ctx, *npc); + if (test_thread_flag(TIF_SINGLESTEP)) + mode = SPU_PRIVCNTL_MODE_SINGLE_STEP; + out_be64(&ctx->spu->priv2->spu_privcntl_RW, mode); ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE); } @@ -334,7 +338,8 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx, ret = spu_process_events(ctx); } while (!ret && !(status & (SPU_STATUS_STOPPED_BY_STOP | - SPU_STATUS_STOPPED_BY_HALT))); + SPU_STATUS_STOPPED_BY_HALT | + SPU_STATUS_SINGLE_STEP))); ctx->ops->master_stop(ctx); ret = spu_run_fini(ctx, npc, &status); @@ -344,10 +349,15 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx, if ((ret == 0) || ((ret == -ERESTARTSYS) && ((status & SPU_STATUS_STOPPED_BY_HALT) || + (status & SPU_STATUS_SINGLE_STEP) || ((status & SPU_STATUS_STOPPED_BY_STOP) && (status >> SPU_STOP_STATUS_SHIFT != 0x2104))))) ret = status; + /* Note: we don't need to force_sig SIGTRAP on single-step + * since we have TIF_SINGLESTEP set, thus the kernel will do + * it upon return from the syscall anyawy + */ if ((status & SPU_STATUS_STOPPED_BY_STOP) && (status >> SPU_STOP_STATUS_SHIFT) == 0x3fff) { force_sig(SIGTRAP, current);