aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2014-04-15 19:59:03 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-05-21 05:12:51 -0400
commite7e9cae5db78030abc73fd3daa93f7cc005177db (patch)
tree1fc9338e381dcec645fc90842ae402e0d8fed3b2 /arch
parent5a7ebbf89395392f16cb5dd342b7edd154ca2d11 (diff)
MIPS: math-emu: Use helpers to manipulate CAUSEF_BD flag.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/math-emu/cp1emu.c14
-rw-r--r--arch/mips/math-emu/dsemul.c2
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index d670e3973bf1..eabbbd9ff942 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -933,17 +933,17 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
933 int pc_inc; 933 int pc_inc;
934 934
935 /* XXX NEC Vr54xx bug workaround */ 935 /* XXX NEC Vr54xx bug workaround */
936 if (xcp->cp0_cause & CAUSEF_BD) { 936 if (delay_slot(xcp)) {
937 if (dec_insn.micro_mips_mode) { 937 if (dec_insn.micro_mips_mode) {
938 if (!mm_isBranchInstr(xcp, dec_insn, &contpc)) 938 if (!mm_isBranchInstr(xcp, dec_insn, &contpc))
939 xcp->cp0_cause &= ~CAUSEF_BD; 939 clear_delay_slot(xcp);
940 } else { 940 } else {
941 if (!isBranchInstr(xcp, dec_insn, &contpc)) 941 if (!isBranchInstr(xcp, dec_insn, &contpc))
942 xcp->cp0_cause &= ~CAUSEF_BD; 942 clear_delay_slot(xcp);
943 } 943 }
944 } 944 }
945 945
946 if (xcp->cp0_cause & CAUSEF_BD) { 946 if (delay_slot(xcp)) {
947 /* 947 /*
948 * The instruction to be emulated is in a branch delay slot 948 * The instruction to be emulated is in a branch delay slot
949 * which means that we have to emulate the branch instruction 949 * which means that we have to emulate the branch instruction
@@ -1178,7 +1178,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
1178 case bc_op:{ 1178 case bc_op:{
1179 int likely = 0; 1179 int likely = 0;
1180 1180
1181 if (xcp->cp0_cause & CAUSEF_BD) 1181 if (delay_slot(xcp))
1182 return SIGILL; 1182 return SIGILL;
1183 1183
1184#if __mips >= 4 1184#if __mips >= 4
@@ -1201,7 +1201,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
1201 return SIGILL; 1201 return SIGILL;
1202 } 1202 }
1203 1203
1204 xcp->cp0_cause |= CAUSEF_BD; 1204 set_delay_slot(xcp);
1205 if (cond) { 1205 if (cond) {
1206 /* branch taken: emulate dslot 1206 /* branch taken: emulate dslot
1207 * instruction 1207 * instruction
@@ -1321,7 +1321,7 @@ sigill:
1321 1321
1322 /* we did it !! */ 1322 /* we did it !! */
1323 xcp->cp0_epc = contpc; 1323 xcp->cp0_epc = contpc;
1324 xcp->cp0_cause &= ~CAUSEF_BD; 1324 clear_delay_slot(xcp);
1325 1325
1326 return 0; 1326 return 0;
1327} 1327}
diff --git a/arch/mips/math-emu/dsemul.c b/arch/mips/math-emu/dsemul.c
index 7ea622ab8dad..cd047fe6d9ef 100644
--- a/arch/mips/math-emu/dsemul.c
+++ b/arch/mips/math-emu/dsemul.c
@@ -59,7 +59,7 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc)
59 (ir == 0)) { 59 (ir == 0)) {
60 /* NOP is easy */ 60 /* NOP is easy */
61 regs->cp0_epc = cpc; 61 regs->cp0_epc = cpc;
62 regs->cp0_cause &= ~CAUSEF_BD; 62 clear_delay_slot(regs);
63 return 0; 63 return 0;
64 } 64 }
65#ifdef DSEMUL_TRACE 65#ifdef DSEMUL_TRACE