summaryrefslogtreecommitdiff
path: root/lib/libc/arch/mips/gen/setjmp.S
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1996-05-16 11:16:14 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1996-05-16 11:16:14 +0000
commit37ff64ed880153028858c2fdbac9861faa23dcbe (patch)
treeb92cb6c34a77d48ba4bbdd39e539548dc71bb3f8 /lib/libc/arch/mips/gen/setjmp.S
parent7c9f95bad108caeb770047316b52959ab8821ed8 (diff)
Changes to support elf shared librarys
Diffstat (limited to 'lib/libc/arch/mips/gen/setjmp.S')
-rw-r--r--lib/libc/arch/mips/gen/setjmp.S27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/libc/arch/mips/gen/setjmp.S b/lib/libc/arch/mips/gen/setjmp.S
index 40fed43fd02..9213bab8dc7 100644
--- a/lib/libc/arch/mips/gen/setjmp.S
+++ b/lib/libc/arch/mips/gen/setjmp.S
@@ -36,13 +36,21 @@
#include <sys/syscall.h>
#include <machine/regnum.h>
+#if MACHINE==pica
+#include <machine/asm.h>
+#else
#include <machine/machAsmDefs.h>
+#endif
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: setjmp.S,v 1.2 1995/12/26 18:17:18 deraadt Exp $")
+ ASMSTR("$Id: setjmp.S,v 1.3 1996/05/16 11:16:01 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
/*
* C library -- setjmp, longjmp
*
@@ -57,8 +65,16 @@
#define SETJMP_FRAME_SIZE (STAND_FRAME_SIZE + 12)
NON_LEAF(setjmp, SETJMP_FRAME_SIZE, ra)
- subu sp, sp, SETJMP_FRAME_SIZE # allocate stack frame
.mask 0x80000000, (STAND_RA_OFFSET - STAND_FRAME_SIZE)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
+ subu sp, sp, SETJMP_FRAME_SIZE # allocate stack frame
+#ifdef ABICALLS
+ .cprestore 16
+#endif
sw ra, STAND_RA_OFFSET(sp) # save state
sw a0, SETJMP_FRAME_SIZE(sp)
move a0, zero # get current signal mask
@@ -110,6 +126,13 @@ NON_LEAF(setjmp, SETJMP_FRAME_SIZE, ra)
END(setjmp)
LEAF(longjmp)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+ subu sp, sp, 32
+ .cprestore 16
+#endif
sw a1, ((V0 + 3) * 4)(a0) # save return value in sc_regs[V0]
li v0, SYS_sigreturn
syscall