aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMasato Noguchi <Masato.Noguchi@jp.sony.com>2007-07-20 15:39:38 -0400
committerArnd Bergmann <arnd@klappe.arndb.de>2007-07-20 15:41:56 -0400
commitd40a01d4f4f205d0645beb371edc153d9ec8fb9f (patch)
tree7ac0b4d28b0d747535f910b1d727af6762b2c2bb /arch
parent1cfc0f86eb0348dd04ace8c2171642ebe9cd87bb (diff)
[CELL] spufs: fix read and write for decr_status file
The decr_status in the LSCSA is valid only in the sequence of context restore. Thus, it's nonsense to read and/or write it through spufs. This patch changes decr_status node to access MFC_CNTL[Ds] in the CSA. Signed-off-by: Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 88da996f6d2f..7de4e919687b 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -1651,17 +1651,21 @@ DEFINE_SIMPLE_ATTRIBUTE(spufs_decr_ops, spufs_decr_get, spufs_decr_set,
1651static void spufs_decr_status_set(void *data, u64 val) 1651static void spufs_decr_status_set(void *data, u64 val)
1652{ 1652{
1653 struct spu_context *ctx = data; 1653 struct spu_context *ctx = data;
1654 struct spu_lscsa *lscsa = ctx->csa.lscsa;
1655 spu_acquire_saved(ctx); 1654 spu_acquire_saved(ctx);
1656 lscsa->decr_status.slot[0] = (u32) val; 1655 if (val)
1656 ctx->csa.priv2.mfc_control_RW |= MFC_CNTL_DECREMENTER_RUNNING;
1657 else
1658 ctx->csa.priv2.mfc_control_RW &= ~MFC_CNTL_DECREMENTER_RUNNING;
1657 spu_release_saved(ctx); 1659 spu_release_saved(ctx);
1658} 1660}
1659 1661
1660static u64 __spufs_decr_status_get(void *data) 1662static u64 __spufs_decr_status_get(void *data)
1661{ 1663{
1662 struct spu_context *ctx = data; 1664 struct spu_context *ctx = data;
1663 struct spu_lscsa *lscsa = ctx->csa.lscsa; 1665 if (ctx->csa.priv2.mfc_control_RW & MFC_CNTL_DECREMENTER_RUNNING)
1664 return lscsa->decr_status.slot[0]; 1666 return SPU_DECR_STATUS_RUNNING;
1667 else
1668 return 0;
1665} 1669}
1666 1670
1667static u64 spufs_decr_status_get(void *data) 1671static u64 spufs_decr_status_get(void *data)