[POWERPC] spufs: Fix SPE single-step mode
authorJeremy Kerr <jk@ozlabs.org>
Fri, 11 Jan 2008 04:03:26 +0000 (15:03 +1100)
committerPaul Mackerras <paulus@samba.org>
Wed, 6 Feb 2008 05:26:59 +0000 (16:26 +1100)
Currently we only catch debug events through the 0x3fff status;
spufs_run_spu doesn't handle single-step SPE events.

This change adds a handler for conditions where the SPE is stopped due
to single-step-mode.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/cell/spufs/run.c

index c01a09da1e562b277ce8000396b7ae382c2758fc..b4814c740d8a7b065453e410a3057fd77a4d9b4f 100644 (file)
@@ -410,8 +410,11 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
         * 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) {
+       if (unlikely(status & SPU_STATUS_SINGLE_STEP))
+               ret = -ERESTARTSYS;
+
+       else if (unlikely((status & SPU_STATUS_STOPPED_BY_STOP)
+           && (status >> SPU_STOP_STATUS_SHIFT) == 0x3fff)) {
                force_sig(SIGTRAP, current);
                ret = -ERESTARTSYS;
        }