Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ba02946a903015840ef672ccc9dc8620a7e83de6
Commit:     ba02946a903015840ef672ccc9dc8620a7e83de6
Parent:     65a6ec0d72a07f16719e9b7a96e1c4bae044b591
Author:     Kumar Gala <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 11 17:07:34 2007 -0500
Committer:  Kumar Gala <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:05:24 2007 -0500

    [POWERPC] Fix handling of stfiwx math emulation
    
    Its legal for the stfiwx instruction to have RA = 0 as part of its
    effective address calculation.  This is illegal for all other XE
    form instructions.
    
    Add code to compute the proper effective address for stfiwx if
    RA = 0 rather than treating it as illegal.
    
    Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 arch/powerpc/math-emu/math.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/math-emu/math.c b/arch/powerpc/math-emu/math.c
index 69058b2..381306b 100644
--- a/arch/powerpc/math-emu/math.c
+++ b/arch/powerpc/math-emu/math.c
@@ -407,11 +407,16 @@ do_mathemu(struct pt_regs *regs)
 
        case XE:
                idx = (insn >> 16) & 0x1f;
-               if (!idx)
-                       goto illegal;
-
                op0 = (void *)&current->thread.fpr[(insn >> 21) & 0x1f];
-               op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]);
+               if (!idx) {
+                       if (((insn >> 1) & 0x3ff) == STFIWX)
+                               op1 = (void *)(regs->gpr[(insn >> 11) & 0x1f]);
+                       else
+                               goto illegal;
+               } else {
+                       op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) 
& 0x1f]);
+               }
+
                break;
 
        case XEU:
-
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