Skip to content

Commit

Permalink
Reorder insns to fix more load delay hazard botches on R3000.
Browse files Browse the repository at this point in the history
Fixes floating point exceptions in _longjmp() during /etc/rc and
now NWS-3470D boots up to multi user with -current userland binaries.

Also fill BDslots in error path properly.
  • Loading branch information
tsutsui committed Mar 9, 2011
1 parent a7f2979 commit 7e1a38b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/libc/arch/mips/gen/_setjmp.S
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: _setjmp.S,v 1.22 2010/09/03 17:22:51 matt Exp $ */
/* $NetBSD: _setjmp.S,v 1.23 2011/03/09 16:10:29 tsutsui Exp $ */

/*-
* Copyright (c) 1991, 1993
Expand Down Expand Up @@ -46,7 +46,7 @@
#if 0
RCSID("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93")
#else
RCSID("$NetBSD: _setjmp.S,v 1.22 2010/09/03 17:22:51 matt Exp $")
RCSID("$NetBSD: _setjmp.S,v 1.23 2011/03/09 16:10:29 tsutsui Exp $")
#endif
#endif /* LIBC_SCCS and not lint */

Expand Down Expand Up @@ -88,7 +88,6 @@ LEAF(_setjmp)
*/
#ifndef SOFTFLOAT_FOR_GCC
cfc1 v0, $31 # too bad cant check if FP used
INT_S v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
#if defined(__mips_n64) || defined(__mips_n32)
FP_S $f30, _OFFSETOF_SC_FPREGS_F30(a0)
FP_S $f28, _OFFSETOF_SC_FPREGS_F28(a0)
Expand All @@ -109,6 +108,7 @@ LEAF(_setjmp)
FP_S $f29, _OFFSETOF_SC_FPREGS_F29(a0)
FP_S $f31, _OFFSETOF_SC_FPREGS_F31(a0)
#endif
INT_S v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
#endif /* SOFTFLOAT_FOR_GCC */
REG_EPILOGUE

Expand Down Expand Up @@ -139,11 +139,13 @@ LEAF(_longjmp)
#if defined(__mips_n32) || defined(__mips_n64)
REG_L gp, _OFFSETOF_SC_REGS_GP(a0)
#endif
#ifndef SOFTFLOAT_FOR_GCC
# get fpu status
INT_L v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
#endif
REG_L sp, _OFFSETOF_SC_REGS_SP(a0)
REG_L s8, _OFFSETOF_SC_REGS_S8(a0)
#ifndef SOFTFLOAT_FOR_GCC
INT_L v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
ctc1 v0, $31
/*
* In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
Expand Down Expand Up @@ -183,6 +185,8 @@ botch:
* our caller's GP.
*/
jal _C_LABEL(longjmperror)
nop

PIC_TAILCALL(abort)
nop
END(_longjmp)

0 comments on commit 7e1a38b

Please sign in to comment.