summaryrefslogtreecommitdiff
path: root/lib/libc/arch/mips/gen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/arch/mips/gen')
-rw-r--r--lib/libc/arch/mips/gen/_setjmp.S24
-rw-r--r--lib/libc/arch/mips/gen/fabs.S10
-rw-r--r--lib/libc/arch/mips/gen/isinf.S10
-rw-r--r--lib/libc/arch/mips/gen/ldexp.S10
-rw-r--r--lib/libc/arch/mips/gen/modf.S10
-rw-r--r--lib/libc/arch/mips/gen/setjmp.S27
-rw-r--r--lib/libc/arch/mips/gen/sigsetjmp.S33
7 files changed, 112 insertions, 12 deletions
diff --git a/lib/libc/arch/mips/gen/_setjmp.S b/lib/libc/arch/mips/gen/_setjmp.S
index 879a0d67468..2595793639d 100644
--- a/lib/libc/arch/mips/gen/_setjmp.S
+++ b/lib/libc/arch/mips/gen/_setjmp.S
@@ -35,11 +35,19 @@
*/
#include <machine/regnum.h>
+#if MACHINE==pica
+#include <machine/asm.h>
+#else
#include <machine/machAsmDefs.h>
+#endif
+
+#ifdef ABICALLS
+ .abicalls
+#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:15:59 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
/*
@@ -56,6 +64,9 @@
.set noreorder
LEAF(_setjmp)
+#ifdef ABICALLS
+ .cpload t9
+#endif
li v0, 0xACEDBADE # sigcontext magic number
sw ra, (2 * 4)(a0) # sc_pc = return address
sw v0, (3 * 4)(a0) # saved in sc_regs[0]
@@ -88,9 +99,19 @@ LEAF(_setjmp)
END(_setjmp)
LEAF(_longjmp)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+ subu sp, sp, 32
+ .cprestore 16
+ .set noreorder
+#endif
lw v0, (3 * 4)(a0) # get magic number
lw ra, (2 * 4)(a0)
bne v0, 0xACEDBADE, botch # jump if error
+
+ addu sp, sp, 32 # don't matter, sanity
lw s0, ((S0 + 3) * 4)(a0)
lw s1, ((S1 + 3) * 4)(a0)
lw s2, ((S2 + 3) * 4)(a0)
@@ -115,6 +136,7 @@ LEAF(_longjmp)
lwc1 $f29, ((29 + 38) * 4)(a0)
lwc1 $f30, ((30 + 38) * 4)(a0)
lwc1 $f31, ((31 + 38) * 4)(a0)
+
j ra
move v0, a1
botch:
diff --git a/lib/libc/arch/mips/gen/fabs.S b/lib/libc/arch/mips/gen/fabs.S
index b2877afc5db..c6d2f010759 100644
--- a/lib/libc/arch/mips/gen/fabs.S
+++ b/lib/libc/arch/mips/gen/fabs.S
@@ -34,13 +34,21 @@
* SUCH DAMAGE.
*/
+#if MACHINE==pica
+#include <machine/asm.h>
+#else
#include <machine/machAsmDefs.h>
+#endif
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)fabs.s 8.1 (Berkeley) 2/16/94")
- ASMSTR("$Id: fabs.S,v 1.1 1995/10/18 08:41:33 deraadt Exp $")
+ ASMSTR("$Id: fabs.S,v 1.2 1996/05/16 11:16:00 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
.set noreorder
/*
diff --git a/lib/libc/arch/mips/gen/isinf.S b/lib/libc/arch/mips/gen/isinf.S
index db6deca125c..c742ed53368 100644
--- a/lib/libc/arch/mips/gen/isinf.S
+++ b/lib/libc/arch/mips/gen/isinf.S
@@ -34,13 +34,21 @@
* SUCH DAMAGE.
*/
+#if MACHINE==pica
+#include <machine/asm.h>
+#else
#include <machine/machAsmDefs.h>
+#endif
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)isinf.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: isinf.S,v 1.1 1995/10/18 08:41:34 deraadt Exp $")
+ ASMSTR("$Id: isinf.S,v 1.2 1996/05/16 11:16:00 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
#define DEXP_INF 0x7ff
diff --git a/lib/libc/arch/mips/gen/ldexp.S b/lib/libc/arch/mips/gen/ldexp.S
index 8830960e113..2cd22514fe0 100644
--- a/lib/libc/arch/mips/gen/ldexp.S
+++ b/lib/libc/arch/mips/gen/ldexp.S
@@ -34,13 +34,21 @@
* SUCH DAMAGE.
*/
+#if MACHINE==pica
+#include <machine/asm.h>
+#else
#include <machine/machAsmDefs.h>
+#endif
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)ldexp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: ldexp.S,v 1.1 1995/10/18 08:41:34 deraadt Exp $")
+ ASMSTR("$Id: ldexp.S,v 1.2 1996/05/16 11:16:01 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
#define DEXP_INF 0x7ff
#define DEXP_BIAS 1023
#define DEXP_MIN -1022
diff --git a/lib/libc/arch/mips/gen/modf.S b/lib/libc/arch/mips/gen/modf.S
index 96e689aff5c..9fab489e89a 100644
--- a/lib/libc/arch/mips/gen/modf.S
+++ b/lib/libc/arch/mips/gen/modf.S
@@ -34,13 +34,21 @@
* SUCH DAMAGE.
*/
+#if MACHINE==pica
+#include <machine/asm.h>
+#else
#include <machine/machAsmDefs.h>
+#endif
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)modf.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: modf.S,v 1.1 1995/10/18 08:41:34 deraadt Exp $")
+ ASMSTR("$Id: modf.S,v 1.2 1996/05/16 11:16:01 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+
+#ifdef ABICALLS
+ .abicalls
+#endif
/*
* double modf(val, iptr)
* double val, *iptr;
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
diff --git a/lib/libc/arch/mips/gen/sigsetjmp.S b/lib/libc/arch/mips/gen/sigsetjmp.S
index 44507d06701..9f778ab316b 100644
--- a/lib/libc/arch/mips/gen/sigsetjmp.S
+++ b/lib/libc/arch/mips/gen/sigsetjmp.S
@@ -36,14 +36,22 @@
#include <sys/syscall.h>
#include <machine/regnum.h>
+#if MACHINE==pica
+#include <machine/asm.h>
+#else
#include <machine/machAsmDefs.h>
+#endif
#include <machine/setjmp.h>
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: sigsetjmp.S,v 1.2 1995/12/26 18:17:19 deraadt Exp $")
+ ASMSTR("$Id: sigsetjmp.S,v 1.3 1996/05/16 11:16:02 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
/*
* C library -- sigsetjmp, siglongjmp
*
@@ -57,15 +65,30 @@
*/
LEAF(sigsetjmp)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
sw a1, (_JBLEN*4)(a0) # save "savemask"
bne a1, 0x0, 1f # do saving of signal mask?
- j _setjmp
-1: j setjmp
+ la t9, _setjmp
+ jr t9
+
+1: la t9, setjmp
+ jr t9
END(sigsetjmp)
LEAF(siglongjmp)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
lw t0, (_JBLEN * 4)(a0) # get "savemask"
bne t0, 0x0, 1f # restore signal mask?
- j _longjmp
-1: j longjmp
+ la t9, _longjmp
+ jr t9
+1: la t9, longjmp
+ jr t9
END(siglongjmp)