diff options
author | Luke Browning <lukebr@linux.vnet.ibm.com> | 2007-12-20 07:39:59 (GMT) |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-21 08:46:19 (GMT) |
commit | cc210b3ec5e4d9c690549e07aa5853e8de8dbff9 (patch) | |
tree | 6476ad83b29215452bb452f96dbc75d9376d8baf /arch/powerpc/platforms/cell/spufs/run.c | |
parent | 33bfd7a73861c3727482c6c1c1c2ef40054060b7 (diff) | |
download | linux-fsl-qoriq-cc210b3ec5e4d9c690549e07aa5853e8de8dbff9.tar.xz |
[POWERPC] spufs: add backing ops for privcntl register
This change encapsulates the spu_privcntl_RW register so that it can
be written through backing ops. This is necessary so that spu contexts
can be initialized and queued to the scheduler in spufs_run_spu.
Signed-off-by: Luke Browning <lukebr@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/run.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/run.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c index aad163f..b3cc1dd 100644 --- a/arch/powerpc/platforms/cell/spufs/run.c +++ b/arch/powerpc/platforms/cell/spufs/run.c @@ -128,10 +128,11 @@ out: static int spu_run_init(struct spu_context *ctx, u32 *npc) { + unsigned long runcntl; + spuctx_switch_state(ctx, SPU_UTIL_SYSTEM); if (ctx->flags & SPU_CREATE_ISOLATE) { - unsigned long runcntl; if (!(ctx->ops->status_read(ctx) & SPU_STATUS_ISOLATED_STATE)) { int ret = spu_setup_isolated(ctx); @@ -145,16 +146,21 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc) (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE); if (runcntl == 0) runcntl = SPU_RUNCNTL_RUNNABLE; - ctx->ops->runcntl_write(ctx, runcntl); } else { - unsigned long mode = SPU_PRIVCNTL_MODE_NORMAL; - ctx->ops->npc_write(ctx, *npc); + unsigned long privcntl; + 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); + privcntl = SPU_PRIVCNTL_MODE_SINGLE_STEP; + else + privcntl = SPU_PRIVCNTL_MODE_NORMAL; + runcntl = SPU_RUNCNTL_RUNNABLE; + + ctx->ops->npc_write(ctx, *npc); + ctx->ops->privcntl_write(ctx, privcntl); } + ctx->ops->runcntl_write(ctx, runcntl); + spuctx_switch_state(ctx, SPU_UTIL_USER); return 0; |