diff options
author | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-09-10 12:45:36 +0000 |
---|---|---|
committer | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-09-10 12:45:36 +0000 |
commit | 4052a0860985038335779112b680415a62b84eb7 (patch) | |
tree | b98377c5f46b831464e912a03f7a5d5d7e54b766 /lib/libc | |
parent | 3002e87cf78b549b860149fd9eb3d4504011e930 (diff) |
setjmp now passes all regress tests.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/arch/mips64/gen/_setjmp.S | 14 | ||||
-rw-r--r-- | lib/libc/arch/mips64/gen/setjmp.S | 10 | ||||
-rw-r--r-- | lib/libc/arch/mips64/gen/sigsetjmp.S | 4 |
3 files changed, 17 insertions, 11 deletions
diff --git a/lib/libc/arch/mips64/gen/_setjmp.S b/lib/libc/arch/mips64/gen/_setjmp.S index ff40eccc9a4..f375190cedc 100644 --- a/lib/libc/arch/mips64/gen/_setjmp.S +++ b/lib/libc/arch/mips64/gen/_setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: _setjmp.S,v 1.2 2004/09/09 16:14:02 pefo Exp $ */ +/* $OpenBSD: _setjmp.S,v 1.3 2004/09/10 12:45:35 pefo Exp $ */ /* * Copyright (c) 2002 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -35,7 +35,7 @@ #if defined(LIBC_SCCS) .text - .asciz "$OpenBSD: _setjmp.S,v 1.2 2004/09/09 16:14:02 pefo Exp $" + .asciz "$OpenBSD: _setjmp.S,v 1.3 2004/09/10 12:45:35 pefo Exp $" #endif /* LIBC_SCCS */ /* @@ -46,7 +46,7 @@ * */ -FRAMESZ= MKFSIZ(1,1) +FRAMESZ= MKFSIZ(0,4) GPOFF= FRAMESZ-2*REGSZ LEAF(_setjmp, FRAMESZ) @@ -68,7 +68,8 @@ LEAF(_setjmp, FRAMESZ) REG_S s6, SC_REGS+S6*REGSZ(a0) REG_S s7, SC_REGS+S7*REGSZ(a0) REG_S s8, SC_REGS+S8*REGSZ(a0) - REG_S gp, SC_REGS+GP*REGSZ(a0) + REG_L v0, GPOFF(sp) + REG_S v0, SC_REGS+GP*REGSZ(a0) PTR_ADDU v0, sp, FRAMESZ REG_S v0, SC_REGS+SP*REGSZ(a0) REG_S ra, SC_PC(a0) @@ -154,8 +155,9 @@ LEAF(_longjmp, FRAMESZ) lwc1 $f30, SC_FPREGS+((F30-F0)*REGSZ)(a0) lwc1 $f31, SC_FPREGS+((F31-F0)*REGSZ)(a0) #endif - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ + beql a1, zero, 1f + li a1, 1 # only executed if branch taken. +1: j ra move v0, a1 diff --git a/lib/libc/arch/mips64/gen/setjmp.S b/lib/libc/arch/mips64/gen/setjmp.S index 5b4bdc286dd..214112d2dba 100644 --- a/lib/libc/arch/mips64/gen/setjmp.S +++ b/lib/libc/arch/mips64/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.3 2004/09/09 16:14:02 pefo Exp $ */ +/* $OpenBSD: setjmp.S,v 1.4 2004/09/10 12:45:35 pefo Exp $ */ /* * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) .text - .asciz "$OpenBSD: setjmp.S,v 1.3 2004/09/09 16:14:02 pefo Exp $" + .asciz "$OpenBSD: setjmp.S,v 1.4 2004/09/10 12:45:35 pefo Exp $" #endif /* LIBC_SCCS */ /* @@ -90,7 +90,8 @@ NON_LEAF(setjmp, FRAMESZ, ra) REG_S s6, SC_REGS+S6*REGSZ(a0) REG_S s7, SC_REGS+S7*REGSZ(a0) REG_S s8, SC_REGS+S8*REGSZ(a0) - REG_S gp, SC_REGS+GP*REGSZ(a0) + REG_L v0, GPOFF(sp) + REG_S v0, SC_REGS+GP*REGSZ(a0) PTR_ADDU v0, sp, FRAMESZ REG_S v0, SC_REGS+SP*REGSZ(a0) li v0, 1 # be nice if we could tell @@ -144,6 +145,9 @@ LEAF(longjmp, FRAMESZ) PTR_SUBU sp, FRAMESZ SETUP_GP64(GPOFF, longjmp) .set reorder + bne a1, zero, 1f + li a1, 1 # never return 0! +1: REG_S a1, SC_REGS+V0*REGSZ(a0) li v0, SYS_sigreturn syscall diff --git a/lib/libc/arch/mips64/gen/sigsetjmp.S b/lib/libc/arch/mips64/gen/sigsetjmp.S index c08612c57f6..12d8a06b9e1 100644 --- a/lib/libc/arch/mips64/gen/sigsetjmp.S +++ b/lib/libc/arch/mips64/gen/sigsetjmp.S @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) .text - .asciz "$OpenBSD: sigsetjmp.S,v 1.3 2004/09/09 16:14:02 pefo Exp $" + .asciz "$OpenBSD: sigsetjmp.S,v 1.4 2004/09/10 12:45:35 pefo Exp $" #endif /* LIBC_SCCS */ /* @@ -74,8 +74,8 @@ LEAF(siglongjmp, FRAMESZ) PTR_ADDU sp, FRAMESZ jr t9 1: + LA t9, longjmp RESTORE_GP64 PTR_ADDU sp, FRAMESZ - LA t9, longjmp jr t9 END(siglongjmp) |