patch-2.4.4 linux/arch/mips/kernel/branch.c
Next file: linux/arch/mips/kernel/process.c
Previous file: linux/arch/mips/jazz/Makefile
Back to the patch index
Back to the overall index
- Lines: 87
- Date:
Fri Apr 13 20:26:07 2001
- Orig file:
v2.4.3/linux/arch/mips/kernel/branch.c
- Orig date:
Wed Dec 10 10:31:09 1997
diff -u --recursive --new-file v2.4.3/linux/arch/mips/kernel/branch.c linux/arch/mips/kernel/branch.c
@@ -5,15 +5,19 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1996, 1997 by Ralf Baechle
+ * Copyright (C) 1996, 97, 2000 by Ralf Baechle
*/
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/signal.h>
#include <asm/branch.h>
+#include <asm/cpu.h>
#include <asm/inst.h>
#include <asm/ptrace.h>
#include <asm/uaccess.h>
+#include <asm/bootinfo.h>
+#include <asm/processor.h>
/*
* Compute the return address and do emulate branch simulation, if required.
@@ -65,7 +69,7 @@
switch (insn.i_format.rt) {
case bltz_op:
case bltzl_op:
- if (regs->regs[insn.i_format.rs] < 0)
+ if ((long)regs->regs[insn.i_format.rs] < 0)
epc = epc + 4 + (insn.i_format.simmediate << 2);
else
epc += 8;
@@ -74,7 +78,7 @@
case bgez_op:
case bgezl_op:
- if (regs->regs[insn.i_format.rs] >= 0)
+ if ((long)regs->regs[insn.i_format.rs] >= 0)
epc = epc + 4 + (insn.i_format.simmediate << 2);
else
epc += 8;
@@ -84,7 +88,7 @@
case bltzal_op:
case bltzall_op:
regs->regs[31] = epc + 8;
- if (regs->regs[insn.i_format.rs] < 0)
+ if ((long)regs->regs[insn.i_format.rs] < 0)
epc = epc + 4 + (insn.i_format.simmediate << 2);
else
epc += 8;
@@ -94,7 +98,7 @@
case bgezal_op:
case bgezall_op:
regs->regs[31] = epc + 8;
- if (regs->regs[insn.i_format.rs] >= 0)
+ if ((long)regs->regs[insn.i_format.rs] >= 0)
epc = epc + 4 + (insn.i_format.simmediate << 2);
else
epc += 8;
@@ -142,7 +146,7 @@
case blez_op: /* not really i_format */
case blezl_op:
/* rt field assumed to be zero */
- if (regs->regs[insn.i_format.rs] <= 0)
+ if ((long)regs->regs[insn.i_format.rs] <= 0)
epc = epc + 4 + (insn.i_format.simmediate << 2);
else
epc += 8;
@@ -152,7 +156,7 @@
case bgtz_op:
case bgtzl_op:
/* rt field assumed to be zero */
- if (regs->regs[insn.i_format.rs] > 0)
+ if ((long)regs->regs[insn.i_format.rs] > 0)
epc = epc + 4 + (insn.i_format.simmediate << 2);
else
epc += 8;
@@ -163,6 +167,11 @@
* And now the FPA/cp1 branch instructions.
*/
case cop1_op:
+#ifdef CONFIG_MIPS_FPU_EMULATOR
+ if(!(mips_cpu.options & MIPS_CPU_FPU))
+ fcr31 = current->thread.fpu.soft.sr;
+ else
+#endif
asm ("cfc1\t%0,$31":"=r" (fcr31));
bit = (insn.i_format.rt >> 2);
bit += (bit != 0);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)