diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-08-06 17:28:03 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-08-06 17:28:03 +0000 |
commit | 4dae44d319aebf7c5c16b731d08448984442a31b (patch) | |
tree | bdd691203fe48b3a04eedbeaaf76ac50cdb10657 | |
parent | 2e2507c07717ce791ed56790e7922f143583fc70 (diff) |
In setjmp() and sigsetjmp(), be sure to return with r14 and r15 unchanged, as
they are part of the call preserved register set, and gcc -O relies upon this.
-rw-r--r-- | lib/libc/arch/m88k/gen/setjmp.S | 7 | ||||
-rw-r--r-- | lib/libc/arch/m88k/gen/sigsetjmp.S | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/libc/arch/m88k/gen/setjmp.S b/lib/libc/arch/m88k/gen/setjmp.S index 7227c0f89fb..b49c4428638 100644 --- a/lib/libc/arch/m88k/gen/setjmp.S +++ b/lib/libc/arch/m88k/gen/setjmp.S @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) .data - .string "$OpenBSD: setjmp.S,v 1.6 2003/08/01 07:41:35 miod Exp $" + .string "$OpenBSD: setjmp.S,v 1.7 2003/08/06 17:28:02 miod Exp $" #endif /* LIBC_SCCS */ #include "SYS.h" @@ -90,8 +90,11 @@ ENTRY(setjmp) or r14,r2,0 /* store address of env in r14 */ bsr.n _C_LABEL(sigblock) /* r2 = sigblock(0) */ or r2,r0,0 + or r1,r15,0 st r2,r14,4 /* save signal set in offset 4 of env */ - jmp.n r15 /* return 0 */ + ld r15,r14,12 + ld r14,r14,8 + jmp.n r1 /* return 0 */ or r2,r0,0 /* diff --git a/lib/libc/arch/m88k/gen/sigsetjmp.S b/lib/libc/arch/m88k/gen/sigsetjmp.S index 85285e7422e..5a748f7897f 100644 --- a/lib/libc/arch/m88k/gen/sigsetjmp.S +++ b/lib/libc/arch/m88k/gen/sigsetjmp.S @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) .data - .string "$OpenBSD: sigsetjmp.S,v 1.6 2003/08/01 07:41:35 miod Exp $" + .string "$OpenBSD: sigsetjmp.S,v 1.7 2003/08/06 17:28:02 miod Exp $" #endif /* LIBC_SCCS */ #include "SYS.h" @@ -98,7 +98,11 @@ ENTRY(sigsetjmp) bsr.n _C_LABEL(sigblock) /* r2 = sigblock(savemask) */ or r2,r0,r13 st r2,r14,4 /* save signal set in offset 4 of env */ -1: jmp.n r15 /* return 0 */ + +1: or r1,r15,0 + ld r15,r14,12 + ld r14,r14,8 + jmp.n r1 /* return 0 */ or r2,r0,0 /* |