summaryrefslogtreecommitdiff
path: root/lib
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
parent7c9f95bad108caeb770047316b52959ab8821ed8 (diff)
Changes to support elf shared librarys
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/arch/mips/SYS.h32
-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
-rw-r--r--lib/libc/arch/mips/net/htonl.S10
-rw-r--r--lib/libc/arch/mips/net/htons.S10
-rw-r--r--lib/libc/arch/mips/string/bcmp.S10
-rw-r--r--lib/libc/arch/mips/string/bcopy.S10
-rw-r--r--lib/libc/arch/mips/string/bzero.S10
-rw-r--r--lib/libc/arch/mips/string/ffs.S10
-rw-r--r--lib/libc/arch/mips/string/index.S10
-rw-r--r--lib/libc/arch/mips/string/rindex.S10
-rw-r--r--lib/libc/arch/mips/string/strcmp.S10
-rw-r--r--lib/libc/arch/mips/string/strlen.S10
-rw-r--r--lib/libc/arch/mips/sys/Ovfork.S14
-rw-r--r--lib/libc/arch/mips/sys/brk.S16
-rw-r--r--lib/libc/arch/mips/sys/cerror.S6
-rw-r--r--lib/libc/arch/mips/sys/exect.S14
-rw-r--r--lib/libc/arch/mips/sys/fork.S14
-rw-r--r--lib/libc/arch/mips/sys/pipe.S14
-rw-r--r--lib/libc/arch/mips/sys/ptrace.S14
-rw-r--r--lib/libc/arch/mips/sys/reboot.S16
-rw-r--r--lib/libc/arch/mips/sys/sbrk.S14
-rw-r--r--lib/libc/arch/mips/sys/setlogin.S14
-rw-r--r--lib/libc/arch/mips/sys/sigpending.S14
-rw-r--r--lib/libc/arch/mips/sys/sigprocmask.S14
-rw-r--r--lib/libc/arch/mips/sys/sigreturn.S6
-rw-r--r--lib/libc/arch/mips/sys/sigsuspend.S14
-rw-r--r--lib/libc/arch/mips/sys/syscall.S6
33 files changed, 395 insertions, 51 deletions
diff --git a/lib/libc/arch/mips/SYS.h b/lib/libc/arch/mips/SYS.h
index 0342b8bb76b..626aa183b37 100644
--- a/lib/libc/arch/mips/SYS.h
+++ b/lib/libc/arch/mips/SYS.h
@@ -34,20 +34,50 @@
* SUCH DAMAGE.
*
* from: @(#)SYS.h 8.1 (Berkeley) 6/4/93
- * $Id: SYS.h,v 1.1 1995/10/18 08:41:33 deraadt Exp $
+ * $Id: SYS.h,v 1.2 1996/05/16 11:15:57 pefo Exp $
*/
#include <sys/syscall.h>
+#if MACHINE==pica
+#include <machine/asm.h>
+#else
#include <machine/machAsmDefs.h>
+#endif
#ifdef __STDC__
+#ifdef ABICALLS
+#define RSYSCALL(x) .abicalls; \
+ LEAF(x); .set noreorder; .cpload t9; .set reorder; \
+ li v0,SYS_ ## x; syscall; \
+ bne a3,zero,err; j ra; \
+ err: la t9, _C_LABEL(cerror); jr t9; END(x);
+#define PSEUDO(x,y) .abicalls; \
+ LEAF(x); .set noreorder; .cpload t9; .set reorder; \
+ li v0,SYS_ ## y; syscall; \
+ bne a3,zero,err; j ra; \
+ err: la t9, _C_LABEL(cerror); jr t9; END(x);
+#else
#define RSYSCALL(x) LEAF(x); li v0,SYS_ ## x; syscall; \
bne a3,zero,err; j ra; err: j _C_LABEL(cerror); END(x);
#define PSEUDO(x,y) LEAF(x); li v0,SYS_ ## y; syscall; \
bne a3,zero,err; j ra; err: j _C_LABEL(cerror); END(x);
+#endif
+#else
+#ifdef ABICALLS
+#define RSYSCALL(x) .abicalls; \
+ LEAF(x); .set noreorder; .cpload t9; .set reorder; \
+ li v0,SYS_/**/x; syscall; \
+ bne a3,zero,err; j ra; \
+ err: la t9, _C_LABEL(cerror); jr t9; END(x);
+#define PSEUDO(x,y) .abicalls; \
+ LEAF(x); .set noreorder; .cpload t9; .set reorder; \
+ li v0,SYS_/**/y; syscall; \
+ bne a3,zero,err; j ra; \
+ err: la t9, _C_LABEL(cerror); jr t9; END(x);
#else
#define RSYSCALL(x) LEAF(x); li v0,SYS_/**/x; syscall; \
bne a3,zero,err; j ra; err: j _C_LABEL(cerror); END(x);
#define PSEUDO(x,y) LEAF(x); li v0,SYS_/**/y; syscall; \
bne a3,zero,err; j ra; err: j _C_LABEL(cerror); END(x);
#endif
+#endif
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)
diff --git a/lib/libc/arch/mips/net/htonl.S b/lib/libc/arch/mips/net/htonl.S
index 98c8a0af4a9..732a52e1912 100644
--- a/lib/libc/arch/mips/net/htonl.S
+++ b/lib/libc/arch/mips/net/htonl.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: @(#)htonl.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: htonl.S,v 1.1 1995/10/18 08:41:34 deraadt Exp $")
+ ASMSTR("$Id: htonl.S,v 1.2 1996/05/16 11:16:02 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+
+#ifdef ABICALLS
+ .abicalls
+#endif
/*
* netorder = htonl(hostorder)
* hostorder = ntohl(netorder)
diff --git a/lib/libc/arch/mips/net/htons.S b/lib/libc/arch/mips/net/htons.S
index 306c5fa92a4..98e8cb061a2 100644
--- a/lib/libc/arch/mips/net/htons.S
+++ b/lib/libc/arch/mips/net/htons.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: @(#)htons.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: htons.S,v 1.1 1995/10/18 08:41:34 deraadt Exp $")
+ ASMSTR("$Id: htons.S,v 1.2 1996/05/16 11:16:03 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+
+#ifdef ABICALLS
+ .abicalls
+#endif
/*
* netorder = htons(hostorder)
* hostorder = ntohs(netorder)
diff --git a/lib/libc/arch/mips/string/bcmp.S b/lib/libc/arch/mips/string/bcmp.S
index 139704c1902..de1185f6bbd 100644
--- a/lib/libc/arch/mips/string/bcmp.S
+++ b/lib/libc/arch/mips/string/bcmp.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: @(#)bcmp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: bcmp.S,v 1.1 1995/10/18 08:41:34 deraadt Exp $")
+ ASMSTR("$Id: bcmp.S,v 1.2 1996/05/16 11:16:04 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+
+#ifdef ABICALLS
+ .abicalls
+#endif
/* bcmp(s1, s2, n) */
#ifdef MIPSEL
diff --git a/lib/libc/arch/mips/string/bcopy.S b/lib/libc/arch/mips/string/bcopy.S
index 90ead170596..244f78314cd 100644
--- a/lib/libc/arch/mips/string/bcopy.S
+++ b/lib/libc/arch/mips/string/bcopy.S
@@ -34,15 +34,23 @@
* SUCH DAMAGE.
*/
+#if MACHINE==pica
+#include <machine/asm.h>
+#else
#include <machine/machAsmDefs.h>
+#endif
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)bcopy.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: bcopy.S,v 1.1 1995/10/18 08:41:34 deraadt Exp $")
+ ASMSTR("$Id: bcopy.S,v 1.2 1996/05/16 11:16:04 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
/* bcopy(s1, s2, n) */
+
+#ifdef ABICALLS
+ .abicalls
+#endif
#ifdef MIPSEL
# define LWHI lwr
# define LWLO lwl
diff --git a/lib/libc/arch/mips/string/bzero.S b/lib/libc/arch/mips/string/bzero.S
index 2b695305013..c1ea25da295 100644
--- a/lib/libc/arch/mips/string/bzero.S
+++ b/lib/libc/arch/mips/string/bzero.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: @(#)bzero.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: bzero.S,v 1.1 1995/10/18 08:41:34 deraadt Exp $")
+ ASMSTR("$Id: bzero.S,v 1.2 1996/05/16 11:16:05 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
/* bzero(s1, n) */
LEAF(bzero)
diff --git a/lib/libc/arch/mips/string/ffs.S b/lib/libc/arch/mips/string/ffs.S
index 1d337ad3b24..d84b9fedc40 100644
--- a/lib/libc/arch/mips/string/ffs.S
+++ b/lib/libc/arch/mips/string/ffs.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: @(#)ffs.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: ffs.S,v 1.1 1995/10/18 08:41:34 deraadt Exp $")
+ ASMSTR("$Id: ffs.S,v 1.2 1996/05/16 11:16:05 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
/* bit = ffs(value) */
LEAF(ffs)
diff --git a/lib/libc/arch/mips/string/index.S b/lib/libc/arch/mips/string/index.S
index 4f0ecf4d78b..2d89a987645 100644
--- a/lib/libc/arch/mips/string/index.S
+++ b/lib/libc/arch/mips/string/index.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: @(#)index.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: index.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: index.S,v 1.2 1996/05/16 11:16:06 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(index)
lbu a2, 0(a0) # get a byte
addu a0, a0, 1
diff --git a/lib/libc/arch/mips/string/rindex.S b/lib/libc/arch/mips/string/rindex.S
index 21586b5a46e..bf1f1720495 100644
--- a/lib/libc/arch/mips/string/rindex.S
+++ b/lib/libc/arch/mips/string/rindex.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: @(#)rindex.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: rindex.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: rindex.S,v 1.2 1996/05/16 11:16:06 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(rindex)
move v0, zero # default if not found
1:
diff --git a/lib/libc/arch/mips/string/strcmp.S b/lib/libc/arch/mips/string/strcmp.S
index 2c4497afe82..4f46bc94a71 100644
--- a/lib/libc/arch/mips/string/strcmp.S
+++ b/lib/libc/arch/mips/string/strcmp.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: @(#)strcmp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: strcmp.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: strcmp.S,v 1.2 1996/05/16 11:16:06 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
/*
* NOTE: this version assumes unsigned chars in order to be "8 bit clean".
*/
diff --git a/lib/libc/arch/mips/string/strlen.S b/lib/libc/arch/mips/string/strlen.S
index 01eb17f1ed1..8c009ddd8cb 100644
--- a/lib/libc/arch/mips/string/strlen.S
+++ b/lib/libc/arch/mips/string/strlen.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: @(#)strlen.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: strlen.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: strlen.S,v 1.2 1996/05/16 11:16:07 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(strlen)
addu v1, a0, 1
1:
diff --git a/lib/libc/arch/mips/sys/Ovfork.S b/lib/libc/arch/mips/sys/Ovfork.S
index 36b5e054c6c..5ea5d2d6827 100644
--- a/lib/libc/arch/mips/sys/Ovfork.S
+++ b/lib/libc/arch/mips/sys/Ovfork.S
@@ -38,9 +38,13 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)Ovfork.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: Ovfork.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: Ovfork.S,v 1.2 1996/05/16 11:16:07 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
/*
* pid = vfork();
*
@@ -49,10 +53,16 @@
*/
LEAF(vfork)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
li v0, SYS_vfork # system call number for vfork
syscall
beq a3, zero, 1f # jump if no errors
- j _C_LABEL(cerror)
+ la t9, cerror
+ jr t9
1:
beq v1, zero, 2f # parent process ?
move v0, zero # return zero in child
diff --git a/lib/libc/arch/mips/sys/brk.S b/lib/libc/arch/mips/sys/brk.S
index f1da0f47741..797a798c7ae 100644
--- a/lib/libc/arch/mips/sys/brk.S
+++ b/lib/libc/arch/mips/sys/brk.S
@@ -38,9 +38,13 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)brk.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: brk.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: brk.S,v 1.2 1996/05/16 11:16:08 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
.globl minbrk
.globl curbrk
@@ -49,8 +53,13 @@ minbrk: .word _C_LABEL(end)
.text
LEAF(brk)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
lw v0, minbrk
- bgeu a0, v0, _C_LABEL(brk)
+ bgeu a0, v0, _C_LABEL(_brk)
move a0, v0 # dont allow break < minbrk
ALEAF(_brk)
li v0, SYS_break
@@ -60,5 +69,6 @@ ALEAF(_brk)
move v0, zero
j ra
1:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(brk)
diff --git a/lib/libc/arch/mips/sys/cerror.S b/lib/libc/arch/mips/sys/cerror.S
index f573616032e..c74a2449b83 100644
--- a/lib/libc/arch/mips/sys/cerror.S
+++ b/lib/libc/arch/mips/sys/cerror.S
@@ -38,9 +38,13 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)cerror.s 8.1 (Berkeley) 6/16/93")
- ASMSTR("$Id: cerror.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: cerror.S,v 1.2 1996/05/16 11:16:08 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
.globl _C_LABEL(errno)
LEAF(cerror)
.set noreorder
diff --git a/lib/libc/arch/mips/sys/exect.S b/lib/libc/arch/mips/sys/exect.S
index 3aa76ef4d54..6b5f30f8db0 100644
--- a/lib/libc/arch/mips/sys/exect.S
+++ b/lib/libc/arch/mips/sys/exect.S
@@ -38,14 +38,24 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)exect.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: exect.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: exect.S,v 1.2 1996/05/16 11:16:09 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(exect)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
li v0, SYS_execve
syscall
bne a3, zero, 1f
j ra
1:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(exect)
diff --git a/lib/libc/arch/mips/sys/fork.S b/lib/libc/arch/mips/sys/fork.S
index 91d46ea64bd..aa41a5918bb 100644
--- a/lib/libc/arch/mips/sys/fork.S
+++ b/lib/libc/arch/mips/sys/fork.S
@@ -38,10 +38,19 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)fork.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: fork.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: fork.S,v 1.2 1996/05/16 11:16:09 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(fork)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
li v0, SYS_fork # pid = fork()
syscall
bne a3, zero, 2f
@@ -50,5 +59,6 @@ LEAF(fork)
1:
j ra
2:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(fork)
diff --git a/lib/libc/arch/mips/sys/pipe.S b/lib/libc/arch/mips/sys/pipe.S
index b7e25d2e12f..9a8e549cf95 100644
--- a/lib/libc/arch/mips/sys/pipe.S
+++ b/lib/libc/arch/mips/sys/pipe.S
@@ -38,10 +38,19 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)pipe.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: pipe.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: pipe.S,v 1.2 1996/05/16 11:16:09 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(pipe)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
li v0, SYS_pipe # pipe(fildes) int fildes[2];
syscall
bne a3, zero, 1f
@@ -50,5 +59,6 @@ LEAF(pipe)
move v0, zero
j ra
1:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(pipe)
diff --git a/lib/libc/arch/mips/sys/ptrace.S b/lib/libc/arch/mips/sys/ptrace.S
index f46386efaa6..4f174b4e621 100644
--- a/lib/libc/arch/mips/sys/ptrace.S
+++ b/lib/libc/arch/mips/sys/ptrace.S
@@ -38,15 +38,25 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)ptrace.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: ptrace.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: ptrace.S,v 1.2 1996/05/16 11:16:10 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(ptrace)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
sw zero, _C_LABEL(errno)
li v0, SYS_ptrace
syscall
bne a3, zero, 1f
j ra
1:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(ptrace)
diff --git a/lib/libc/arch/mips/sys/reboot.S b/lib/libc/arch/mips/sys/reboot.S
index 7e77358c2a9..638f2fab47d 100644
--- a/lib/libc/arch/mips/sys/reboot.S
+++ b/lib/libc/arch/mips/sys/reboot.S
@@ -38,14 +38,26 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)reboot.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: reboot.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: reboot.S,v 1.2 1996/05/16 11:16:10 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(reboot)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+ subu sp, sp, 32
+ .cprestore 16
+#endif
li v0, SYS_reboot
syscall
bne a3, zero, 1f
jal _C_LABEL(abort)
1:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(reboot)
diff --git a/lib/libc/arch/mips/sys/sbrk.S b/lib/libc/arch/mips/sys/sbrk.S
index e16d4deb0ca..5d5ac98fe62 100644
--- a/lib/libc/arch/mips/sys/sbrk.S
+++ b/lib/libc/arch/mips/sys/sbrk.S
@@ -38,9 +38,13 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)sbrk.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: sbrk.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: sbrk.S,v 1.2 1996/05/16 11:16:11 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
.globl curbrk
.data
@@ -48,6 +52,11 @@ curbrk: .word _C_LABEL(end)
.text
LEAF(sbrk)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
lw v1, curbrk
li v0, SYS_break
addu a0, a0, v1 # compute current break
@@ -57,5 +66,6 @@ LEAF(sbrk)
sw a0, curbrk # save current val of curbrk from above
j ra
1:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(sbrk)
diff --git a/lib/libc/arch/mips/sys/setlogin.S b/lib/libc/arch/mips/sys/setlogin.S
index 0c0eb288b00..4b2b66a50b0 100644
--- a/lib/libc/arch/mips/sys/setlogin.S
+++ b/lib/libc/arch/mips/sys/setlogin.S
@@ -38,15 +38,25 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)setlogin.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: setlogin.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: setlogin.S,v 1.2 1996/05/16 11:16:11 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(setlogin)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
li v0, SYS_setlogin # setlogin(name)
syscall
bne a3, zero, 1f
sw zero, _C_LABEL(__logname_valid) # in getlogin()
j ra
1:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(setlogin)
diff --git a/lib/libc/arch/mips/sys/sigpending.S b/lib/libc/arch/mips/sys/sigpending.S
index 53b4789b341..1e23b009206 100644
--- a/lib/libc/arch/mips/sys/sigpending.S
+++ b/lib/libc/arch/mips/sys/sigpending.S
@@ -38,10 +38,19 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)sigpending.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: sigpending.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: sigpending.S,v 1.2 1996/05/16 11:16:12 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(sigpending)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
li v0, SYS_sigpending # setlogin(name)
syscall
bne a3, zero, 1f
@@ -49,5 +58,6 @@ LEAF(sigpending)
move v0, zero
j ra
1:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(sigpending)
diff --git a/lib/libc/arch/mips/sys/sigprocmask.S b/lib/libc/arch/mips/sys/sigprocmask.S
index c2d2e503714..2b2b51d4463 100644
--- a/lib/libc/arch/mips/sys/sigprocmask.S
+++ b/lib/libc/arch/mips/sys/sigprocmask.S
@@ -38,10 +38,19 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)sigprocmask.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: sigprocmask.S,v 1.1 1995/10/18 08:41:35 deraadt Exp $")
+ ASMSTR("$Id: sigprocmask.S,v 1.2 1996/05/16 11:16:12 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(sigprocmask) # sigprocmask(how, new, old) sigset_t *new, *old;
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
bne a1, zero, gotptr # if new sigset pointer not null
li a0, 1 # how = SIG_BLOCK
b doit # mask = zero
@@ -57,5 +66,6 @@ out:
move v0, zero
j ra
err:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(sigprocmask)
diff --git a/lib/libc/arch/mips/sys/sigreturn.S b/lib/libc/arch/mips/sys/sigreturn.S
index e94aa55f208..7af4c5be2ce 100644
--- a/lib/libc/arch/mips/sys/sigreturn.S
+++ b/lib/libc/arch/mips/sys/sigreturn.S
@@ -38,9 +38,13 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)sigreturn.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: sigreturn.S,v 1.1 1995/10/18 08:41:36 deraadt Exp $")
+ ASMSTR("$Id: sigreturn.S,v 1.2 1996/05/16 11:16:13 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
/*
* We must preserve the state of the registers as the user has set them up.
*/
diff --git a/lib/libc/arch/mips/sys/sigsuspend.S b/lib/libc/arch/mips/sys/sigsuspend.S
index 0941dcc4229..d7edf2a3077 100644
--- a/lib/libc/arch/mips/sys/sigsuspend.S
+++ b/lib/libc/arch/mips/sys/sigsuspend.S
@@ -38,10 +38,19 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)sigsuspend.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: sigsuspend.S,v 1.1 1995/10/18 08:41:36 deraadt Exp $")
+ ASMSTR("$Id: sigsuspend.S,v 1.2 1996/05/16 11:16:13 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
+#ifdef ABICALLS
+ .abicalls
+#endif
+
LEAF(sigsuspend)
+#ifdef ABICALLS
+ .set noreorder
+ .cpload t9
+ .set reorder
+#endif
lw a0, 0(a0) # indirect to mask arg
li v0, SYS_sigsuspend
syscall
@@ -49,5 +58,6 @@ LEAF(sigsuspend)
move v0, zero # should not happen
j ra
1:
- j _C_LABEL(cerror)
+ la t9, _C_LABEL(cerror)
+ jr t9
END(sigsuspend)
diff --git a/lib/libc/arch/mips/sys/syscall.S b/lib/libc/arch/mips/sys/syscall.S
index 4f0fd27a368..8ea3e16d6cb 100644
--- a/lib/libc/arch/mips/sys/syscall.S
+++ b/lib/libc/arch/mips/sys/syscall.S
@@ -38,9 +38,13 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)syscall.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: syscall.S,v 1.1 1995/10/18 08:41:36 deraadt Exp $")
+ ASMSTR("$Id: syscall.S,v 1.2 1996/05/16 11:16:13 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
#define SYS_syscall 0
+#ifdef ABICALLS
+ .abicalls
+#endif
+
RSYSCALL(syscall)