aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2006-11-20 12:45:09 -0500
committerPaul Mackerras <paulus@samba.org>2006-12-04 04:40:04 -0500
commit3960c260204bc33404a6e54e9dcd44f1f83bc701 (patch)
treedaa31590ad345198dc0e8ef4db49907b821b13a0 /arch/powerpc
parentee2d7340cbf3b123e1c3b7454f3e2b7e65d33bb2 (diff)
[POWERPC] spufs: Add runcntrl read accessors
This change adds a read accessor for the SPE problem-state run control register. This is required for for applying (userspace) changes made to the run control register while the SPE is stopped - simply asserting the master run control bit is not sufficient. My next patch for isolated-mode setup requires this. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/cell/spufs/backing_ops.c6
-rw-r--r--arch/powerpc/platforms/cell/spufs/hw_ops.c6
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/backing_ops.c b/arch/powerpc/platforms/cell/spufs/backing_ops.c
index 4a8e998c6be6..1898f0d3a8b8 100644
--- a/arch/powerpc/platforms/cell/spufs/backing_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/backing_ops.c
@@ -268,6 +268,11 @@ static char *spu_backing_get_ls(struct spu_context *ctx)
268 return ctx->csa.lscsa->ls; 268 return ctx->csa.lscsa->ls;
269} 269}
270 270
271static u32 spu_backing_runcntl_read(struct spu_context *ctx)
272{
273 return ctx->csa.prob.spu_runcntl_RW;
274}
275
271static void spu_backing_runcntl_write(struct spu_context *ctx, u32 val) 276static void spu_backing_runcntl_write(struct spu_context *ctx, u32 val)
272{ 277{
273 spin_lock(&ctx->csa.register_lock); 278 spin_lock(&ctx->csa.register_lock);
@@ -363,6 +368,7 @@ struct spu_context_ops spu_backing_ops = {
363 .npc_write = spu_backing_npc_write, 368 .npc_write = spu_backing_npc_write,
364 .status_read = spu_backing_status_read, 369 .status_read = spu_backing_status_read,
365 .get_ls = spu_backing_get_ls, 370 .get_ls = spu_backing_get_ls,
371 .runcntl_read = spu_backing_runcntl_read,
366 .runcntl_write = spu_backing_runcntl_write, 372 .runcntl_write = spu_backing_runcntl_write,
367 .master_start = spu_backing_master_start, 373 .master_start = spu_backing_master_start,
368 .master_stop = spu_backing_master_stop, 374 .master_stop = spu_backing_master_stop,
diff --git a/arch/powerpc/platforms/cell/spufs/hw_ops.c b/arch/powerpc/platforms/cell/spufs/hw_ops.c
index 69fc342e063d..ae42e03b8c86 100644
--- a/arch/powerpc/platforms/cell/spufs/hw_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/hw_ops.c
@@ -207,6 +207,11 @@ static char *spu_hw_get_ls(struct spu_context *ctx)
207 return ctx->spu->local_store; 207 return ctx->spu->local_store;
208} 208}
209 209
210static u32 spu_hw_runcntl_read(struct spu_context *ctx)
211{
212 return in_be32(&ctx->spu->problem->spu_runcntl_RW);
213}
214
210static void spu_hw_runcntl_write(struct spu_context *ctx, u32 val) 215static void spu_hw_runcntl_write(struct spu_context *ctx, u32 val)
211{ 216{
212 spin_lock_irq(&ctx->spu->register_lock); 217 spin_lock_irq(&ctx->spu->register_lock);
@@ -307,6 +312,7 @@ struct spu_context_ops spu_hw_ops = {
307 .npc_write = spu_hw_npc_write, 312 .npc_write = spu_hw_npc_write,
308 .status_read = spu_hw_status_read, 313 .status_read = spu_hw_status_read,
309 .get_ls = spu_hw_get_ls, 314 .get_ls = spu_hw_get_ls,
315 .runcntl_read = spu_hw_runcntl_read,
310 .runcntl_write = spu_hw_runcntl_write, 316 .runcntl_write = spu_hw_runcntl_write,
311 .master_start = spu_hw_master_start, 317 .master_start = spu_hw_master_start,
312 .master_stop = spu_hw_master_stop, 318 .master_stop = spu_hw_master_stop,
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 135fbb53d8e1..ca56b9b11c1d 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -115,6 +115,7 @@ struct spu_context_ops {
115 void (*npc_write) (struct spu_context * ctx, u32 data); 115 void (*npc_write) (struct spu_context * ctx, u32 data);
116 u32(*status_read) (struct spu_context * ctx); 116 u32(*status_read) (struct spu_context * ctx);
117 char*(*get_ls) (struct spu_context * ctx); 117 char*(*get_ls) (struct spu_context * ctx);
118 u32 (*runcntl_read) (struct spu_context * ctx);
118 void (*runcntl_write) (struct spu_context * ctx, u32 data); 119 void (*runcntl_write) (struct spu_context * ctx, u32 data);
119 void (*master_start) (struct spu_context * ctx); 120 void (*master_start) (struct spu_context * ctx);
120 void (*master_stop) (struct spu_context * ctx); 121 void (*master_stop) (struct spu_context * ctx);