X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Fpowerpc%2Fmath-emu%2Fmath.c;h=381306bb1590ec62e198ebf16efbb024208c7273;hb=89a93f2f4834f8c126e8d9dd6b368d0b9e21ec3d;hp=5891534727617836c6ebfffdb958f95edf12c107;hpb=064c94f9da8845f12446ab37142aa10f3c6f66ac;p=linux-2.6 diff --git a/arch/powerpc/math-emu/math.c b/arch/powerpc/math-emu/math.c index 5891534727..381306bb15 100644 --- a/arch/powerpc/math-emu/math.c +++ b/arch/powerpc/math-emu/math.c @@ -2,7 +2,6 @@ * Copyright (C) 1999 Eddie C. Dost (ecd@atecom.com) */ -#include #include #include @@ -408,11 +407,16 @@ do_mathemu(struct pt_regs *regs) case XE: idx = (insn >> 16) & 0x1f; - if (!idx) - goto illegal; - op0 = (void *)¤t->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: