summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/visemul.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-04 21:40:17 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-04 21:40:17 -0800
commit0efcafb0fb7a163999a8821e8a5e7792fca90a2d (patch)
tree649d16382e562f595ec55b2aa9ec0d8c5824629b /arch/sparc64/kernel/visemul.c
parente948990f958c6c41036a99c8a6581e35e7e23d80 (diff)
parent410d2c8187ed969238ba98008c1d57307a56cfd8 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: sparc64: Sync FPU state in VIS emulation handler. sparc64: Fix VIS emulation bugs sparc: asm/bitops.h should define __fls sparc64: Fix bug in PTRACE_SETFPREGS64 handling.
Diffstat (limited to 'arch/sparc64/kernel/visemul.c')
-rw-r--r--arch/sparc64/kernel/visemul.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/sparc64/kernel/visemul.c b/arch/sparc64/kernel/visemul.c
index 9e05cb5cb85..b956fd71c13 100644
--- a/arch/sparc64/kernel/visemul.c
+++ b/arch/sparc64/kernel/visemul.c
@@ -131,7 +131,7 @@
#define VIS_OPF_SHIFT 5
#define VIS_OPF_MASK (0x1ff << VIS_OPF_SHIFT)
-#define RS1(INSN) (((INSN) >> 24) & 0x1f)
+#define RS1(INSN) (((INSN) >> 14) & 0x1f)
#define RS2(INSN) (((INSN) >> 0) & 0x1f)
#define RD(INSN) (((INSN) >> 25) & 0x1f)
@@ -445,7 +445,7 @@ static void pdist(struct pt_regs *regs, unsigned int insn)
unsigned long i;
rs1 = fpd_regval(f, RS1(insn));
- rs2 = fpd_regval(f, RS1(insn));
+ rs2 = fpd_regval(f, RS2(insn));
rd = fpd_regaddr(f, RD(insn));
rd_val = *rd;
@@ -807,6 +807,8 @@ int vis_emul(struct pt_regs *regs, unsigned int insn)
if (get_user(insn, (u32 __user *) pc))
return -EFAULT;
+ save_and_clear_fpu();
+
opf = (insn & VIS_OPF_MASK) >> VIS_OPF_SHIFT;
switch (opf) {
default: