aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index 57626600b1a4..6625ed2a7fdd 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -142,8 +142,12 @@ static int spu_run_init(struct spu_context *ctx, u32 * npc)
142 runcntl = SPU_RUNCNTL_RUNNABLE; 142 runcntl = SPU_RUNCNTL_RUNNABLE;
143 ctx->ops->runcntl_write(ctx, runcntl); 143 ctx->ops->runcntl_write(ctx, runcntl);
144 } else { 144 } else {
145 unsigned long mode = SPU_PRIVCNTL_MODE_NORMAL;
145 spu_start_tick(ctx); 146 spu_start_tick(ctx);
146 ctx->ops->npc_write(ctx, *npc); 147 ctx->ops->npc_write(ctx, *npc);
148 if (test_thread_flag(TIF_SINGLESTEP))
149 mode = SPU_PRIVCNTL_MODE_SINGLE_STEP;
150 out_be64(&ctx->spu->priv2->spu_privcntl_RW, mode);
147 ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE); 151 ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
148 } 152 }
149 153
@@ -334,7 +338,8 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx,
334 ret = spu_process_events(ctx); 338 ret = spu_process_events(ctx);
335 339
336 } while (!ret && !(status & (SPU_STATUS_STOPPED_BY_STOP | 340 } while (!ret && !(status & (SPU_STATUS_STOPPED_BY_STOP |
337 SPU_STATUS_STOPPED_BY_HALT))); 341 SPU_STATUS_STOPPED_BY_HALT |
342 SPU_STATUS_SINGLE_STEP)));
338 343
339 ctx->ops->master_stop(ctx); 344 ctx->ops->master_stop(ctx);
340 ret = spu_run_fini(ctx, npc, &status); 345 ret = spu_run_fini(ctx, npc, &status);
@@ -344,10 +349,15 @@ out2:
344 if ((ret == 0) || 349 if ((ret == 0) ||
345 ((ret == -ERESTARTSYS) && 350 ((ret == -ERESTARTSYS) &&
346 ((status & SPU_STATUS_STOPPED_BY_HALT) || 351 ((status & SPU_STATUS_STOPPED_BY_HALT) ||
352 (status & SPU_STATUS_SINGLE_STEP) ||
347 ((status & SPU_STATUS_STOPPED_BY_STOP) && 353 ((status & SPU_STATUS_STOPPED_BY_STOP) &&
348 (status >> SPU_STOP_STATUS_SHIFT != 0x2104))))) 354 (status >> SPU_STOP_STATUS_SHIFT != 0x2104)))))
349 ret = status; 355 ret = status;
350 356
357 /* Note: we don't need to force_sig SIGTRAP on single-step
358 * since we have TIF_SINGLESTEP set, thus the kernel will do
359 * it upon return from the syscall anyawy
360 */
351 if ((status & SPU_STATUS_STOPPED_BY_STOP) 361 if ((status & SPU_STATUS_STOPPED_BY_STOP)
352 && (status >> SPU_STOP_STATUS_SHIFT) == 0x3fff) { 362 && (status >> SPU_STOP_STATUS_SHIFT) == 0x3fff) {
353 force_sig(SIGTRAP, current); 363 force_sig(SIGTRAP, current);