summaryrefslogtreecommitdiff
path: root/lib/libc/arch/mips/gen
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1996-07-30 20:28:03 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1996-07-30 20:28:03 +0000
commit9f1ce502291b1ef4a0674512422a65282086574b (patch)
tree08116c12775190d7d5e7f5b27550e9b8e184d9f2 /lib/libc/arch/mips/gen
parent5a4b8571aa88ae3650f87ddb399045f4b797437a (diff)
Cleanup of abi call and endian stuff. Also fixed some bugs. (AENT).
Diffstat (limited to 'lib/libc/arch/mips/gen')
-rw-r--r--lib/libc/arch/mips/gen/_setjmp.S21
-rw-r--r--lib/libc/arch/mips/gen/fabs.S12
-rw-r--r--lib/libc/arch/mips/gen/isinf.S14
-rw-r--r--lib/libc/arch/mips/gen/ldexp.S11
-rw-r--r--lib/libc/arch/mips/gen/modf.S10
-rw-r--r--lib/libc/arch/mips/gen/setjmp.S22
-rw-r--r--lib/libc/arch/mips/gen/sigsetjmp.S18
7 files changed, 24 insertions, 84 deletions
diff --git a/lib/libc/arch/mips/gen/_setjmp.S b/lib/libc/arch/mips/gen/_setjmp.S
index 2595793639d..046639346d9 100644
--- a/lib/libc/arch/mips/gen/_setjmp.S
+++ b/lib/libc/arch/mips/gen/_setjmp.S
@@ -1,3 +1,4 @@
+/* $OpenBSD: _setjmp.S,v 1.4 1996/07/30 20:27:49 pefo Exp $ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,19 +36,12 @@
*/
#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.3 1996/05/16 11:15:59 pefo Exp $")
+ ASMSTR("$Id: _setjmp.S,v 1.4 1996/07/30 20:27:49 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
/*
@@ -61,12 +55,8 @@
* The previous signal state is NOT restored.
*/
- .set noreorder
-
LEAF(_setjmp)
-#ifdef ABICALLS
- .cpload t9
-#endif
+ .set noreorder
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]
@@ -100,13 +90,10 @@ END(_setjmp)
LEAF(_longjmp)
#ifdef ABICALLS
- .set noreorder
- .cpload t9
- .set reorder
subu sp, sp, 32
.cprestore 16
- .set noreorder
#endif
+ .set noreorder
lw v0, (3 * 4)(a0) # get magic number
lw ra, (2 * 4)(a0)
bne v0, 0xACEDBADE, botch # jump if error
diff --git a/lib/libc/arch/mips/gen/fabs.S b/lib/libc/arch/mips/gen/fabs.S
index c6d2f010759..4cccb47356d 100644
--- a/lib/libc/arch/mips/gen/fabs.S
+++ b/lib/libc/arch/mips/gen/fabs.S
@@ -1,3 +1,4 @@
+/* $OpenBSD: fabs.S,v 1.3 1996/07/30 20:27:50 pefo Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
@@ -34,22 +35,14 @@
* 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.2 1996/05/16 11:16:00 pefo Exp $")
+ ASMSTR("$Id: fabs.S,v 1.3 1996/07/30 20:27:50 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
-#ifdef ABICALLS
- .abicalls
-#endif
- .set noreorder
/*
* fabs(x)
@@ -58,6 +51,7 @@
* Return absolute value of x.
*/
LEAF(fabs)
+ .set noreorder
j ra
abs.d $f0, $f12 # compute absolute value of x
END(fabs)
diff --git a/lib/libc/arch/mips/gen/isinf.S b/lib/libc/arch/mips/gen/isinf.S
index c742ed53368..a2f12276d98 100644
--- a/lib/libc/arch/mips/gen/isinf.S
+++ b/lib/libc/arch/mips/gen/isinf.S
@@ -1,3 +1,4 @@
+/* $OpenBSD: isinf.S,v 1.3 1996/07/30 20:27:50 pefo Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
@@ -34,25 +35,16 @@
* 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.2 1996/05/16 11:16:00 pefo Exp $")
+ ASMSTR("$Id: isinf.S,v 1.3 1996/07/30 20:27:50 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
-#ifdef ABICALLS
- .abicalls
-#endif
-
#define DEXP_INF 0x7ff
- .set noreorder
/*
* isnan(x)
@@ -61,6 +53,7 @@
* Return true if x is a NAN.
*/
LEAF(isnan)
+ .set noreorder
mfc1 v1, $f13 # get MSW of x
mfc1 t3, $f12 # get LSW of x
sll t1, v1, 1 # get x exponent
@@ -86,6 +79,7 @@ END(isnan)
* Return true if x is infinity.
*/
LEAF(isinf)
+ .set noreorder
mfc1 v1, $f13 # get MSW of x
mfc1 t3, $f12 # get LSW of x
sll t1, v1, 1 # get x exponent
diff --git a/lib/libc/arch/mips/gen/ldexp.S b/lib/libc/arch/mips/gen/ldexp.S
index 2cd22514fe0..2445793edc4 100644
--- a/lib/libc/arch/mips/gen/ldexp.S
+++ b/lib/libc/arch/mips/gen/ldexp.S
@@ -1,3 +1,4 @@
+/* $OpenBSD: ldexp.S,v 1.3 1996/07/30 20:27:51 pefo Exp $ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -34,20 +35,13 @@
* 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.2 1996/05/16 11:16:01 pefo Exp $")
+ ASMSTR("$Id: ldexp.S,v 1.3 1996/07/30 20:27:51 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
-#ifdef ABICALLS
- .abicalls
-#endif
#define DEXP_INF 0x7ff
#define DEXP_BIAS 1023
@@ -69,6 +63,7 @@
* Return x * (2**N), for integer values N.
*/
LEAF(ldexp)
+ .set reorder
mfc1 v1, $f13 # get MSW of x
mfc1 t3, $f12 # get LSW of x
sll t1, v1, 1 # get x exponent
diff --git a/lib/libc/arch/mips/gen/modf.S b/lib/libc/arch/mips/gen/modf.S
index db24a8140d3..376f53621dc 100644
--- a/lib/libc/arch/mips/gen/modf.S
+++ b/lib/libc/arch/mips/gen/modf.S
@@ -1,3 +1,4 @@
+/* $OpenBSD: modf.S,v 1.4 1996/07/30 20:27:51 pefo Exp $ */
/*-
* Copyright (c) 1991, 1993, 1995
* The Regents of the University of California. All rights reserved.
@@ -38,22 +39,17 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)modf.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: modf.S,v 1.3 1996/07/25 09:58:33 pefo Exp $")
+ ASMSTR("$Id: modf.S,v 1.4 1996/07/30 20:27:51 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
-#ifdef ABICALLS
- .abicalls
-#endif
/*
* double modf(val, iptr)
* double val, *iptr;
* returns: xxx and n (in *iptr) where val == n.xxx
*/
LEAF(modf)
- .set noreorder
- .cpload t9
- .set reorder
+ .set reorder
cfc1 t0, $31 # get the control register
li.d $f2, 4503599627370496e0 # f2 <- 2^52
diff --git a/lib/libc/arch/mips/gen/setjmp.S b/lib/libc/arch/mips/gen/setjmp.S
index 9213bab8dc7..dd9225eb48e 100644
--- a/lib/libc/arch/mips/gen/setjmp.S
+++ b/lib/libc/arch/mips/gen/setjmp.S
@@ -1,3 +1,4 @@
+/* $OpenBSD: setjmp.S,v 1.4 1996/07/30 20:27:51 pefo Exp $ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,21 +36,14 @@
*/
#include <sys/syscall.h>
-#include <machine/regnum.h>
-#if MACHINE==pica
#include <machine/asm.h>
-#else
-#include <machine/machAsmDefs.h>
-#endif
+#include <machine/regnum.h>
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: setjmp.S,v 1.3 1996/05/16 11:16:01 pefo Exp $")
+ ASMSTR("$Id: setjmp.S,v 1.4 1996/07/30 20:27:51 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
-#ifdef ABICALLS
- .abicalls
-#endif
/*
* C library -- setjmp, longjmp
@@ -66,15 +60,11 @@
NON_LEAF(setjmp, SETJMP_FRAME_SIZE, ra)
.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
+ .set reorder
sw ra, STAND_RA_OFFSET(sp) # save state
sw a0, SETJMP_FRAME_SIZE(sp)
move a0, zero # get current signal mask
@@ -127,12 +117,10 @@ END(setjmp)
LEAF(longjmp)
#ifdef ABICALLS
- .set noreorder
- .cpload t9
- .set reorder
subu sp, sp, 32
.cprestore 16
#endif
+ .set reorder
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 9f778ab316b..fa687497e54 100644
--- a/lib/libc/arch/mips/gen/sigsetjmp.S
+++ b/lib/libc/arch/mips/gen/sigsetjmp.S
@@ -1,3 +1,4 @@
+/* $OpenBSD: sigsetjmp.S,v 1.4 1996/07/30 20:27:52 pefo Exp $ */
/*-
* Copyright (c) 1991, 1993, 1995,
* The Regents of the University of California. All rights reserved.
@@ -36,21 +37,14 @@
#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.3 1996/05/16 11:16:02 pefo Exp $")
+ ASMSTR("$Id: sigsetjmp.S,v 1.4 1996/07/30 20:27:52 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
-#ifdef ABICALLS
- .abicalls
-#endif
/*
* C library -- sigsetjmp, siglongjmp
@@ -65,11 +59,7 @@
*/
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?
la t9, _setjmp
@@ -80,11 +70,7 @@ LEAF(sigsetjmp)
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?
la t9, _longjmp