Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9e2fe2ce4e957a79d3dc5d813e0cfb10d79b79b3
Commit:     9e2fe2ce4e957a79d3dc5d813e0cfb10d79b79b3
Parent:     8a7d86bdb22678b17928eef0c8fa356d8b21cc76
Author:     Akinobu Mita <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 23 21:08:22 2007 +0200
Committer:  Arnd Bergmann <[EMAIL PROTECTED]>
CommitDate: Mon Apr 23 21:18:57 2007 +0200

    [POWERPC] spufs: use memcpy_fromio() to copy from local store
    
    GCC may generates inline copy loop to handle memcpy() function
    instead of kernel defined memcpy(). But this inlined version of memcpy()
    causes an alignment interrupt when copying from local store.
    
    This patch uses memcpy_fromio() and memcpy_toio to copy local store
    to prevent memcpy() being inlined.
    
    Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>
    Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/cell/spufs/run.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/run.c 
b/arch/powerpc/platforms/cell/spufs/run.c
index 7cf5b29..b5e7bde 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -234,17 +234,17 @@ int spu_process_callback(struct spu_context *ctx)
 {
        struct spu_syscall_block s;
        u32 ls_pointer, npc;
-       char *ls;
+       void __iomem *ls;
        long spu_ret;
        int ret;
 
        /* get syscall block from local store */
-       npc = ctx->ops->npc_read(ctx);
-       ls = ctx->ops->get_ls(ctx);
-       ls_pointer = *(u32*)(ls + npc);
+       npc = ctx->ops->npc_read(ctx) & ~3;
+       ls = (void __iomem *)ctx->ops->get_ls(ctx);
+       ls_pointer = in_be32(ls + npc);
        if (ls_pointer > (LS_SIZE - sizeof(s)))
                return -EFAULT;
-       memcpy(&s, ls + ls_pointer, sizeof (s));
+       memcpy_fromio(&s, ls + ls_pointer, sizeof(s));
 
        /* do actual syscall without pinning the spu */
        ret = 0;
@@ -264,7 +264,7 @@ int spu_process_callback(struct spu_context *ctx)
        }
 
        /* write result, jump over indirect pointer */
-       memcpy(ls + ls_pointer, &spu_ret, sizeof (spu_ret));
+       memcpy_toio(ls + ls_pointer, &spu_ret, sizeof(spu_ret));
        ctx->ops->npc_write(ctx, npc);
        ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
        return ret;
-
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