Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d40a01d4f4f205d0645beb371edc153d9ec8fb9f
Commit:     d40a01d4f4f205d0645beb371edc153d9ec8fb9f
Parent:     1cfc0f86eb0348dd04ace8c2171642ebe9cd87bb
Author:     Masato Noguchi <[EMAIL PROTECTED]>
AuthorDate: Fri Jul 20 21:39:38 2007 +0200
Committer:  Arnd Bergmann <[EMAIL PROTECTED]>
CommitDate: Fri Jul 20 21:41:56 2007 +0200

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]>
    Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/cell/spufs/file.c |   12 ++++++++----
 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 88da996..7de4e91 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,
 static void spufs_decr_status_set(void *data, u64 val)
 {
        struct spu_context *ctx = data;
-       struct spu_lscsa *lscsa = ctx->csa.lscsa;
        spu_acquire_saved(ctx);
-       lscsa->decr_status.slot[0] = (u32) val;
+       if (val)
+               ctx->csa.priv2.mfc_control_RW |= MFC_CNTL_DECREMENTER_RUNNING;
+       else
+               ctx->csa.priv2.mfc_control_RW &= ~MFC_CNTL_DECREMENTER_RUNNING;
        spu_release_saved(ctx);
 }
 
 static u64 __spufs_decr_status_get(void *data)
 {
        struct spu_context *ctx = data;
-       struct spu_lscsa *lscsa = ctx->csa.lscsa;
-       return lscsa->decr_status.slot[0];
+       if (ctx->csa.priv2.mfc_control_RW & MFC_CNTL_DECREMENTER_RUNNING)
+               return SPU_DECR_STATUS_RUNNING;
+       else
+               return 0;
 }
 
 static u64 spufs_decr_status_get(void *data)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to