summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/arch/mips/SYS.h68
-rw-r--r--lib/libc/arch/mips/gen/setjmp.S6
-rw-r--r--lib/libc/arch/mips/sys/Ovfork.S8
-rw-r--r--lib/libc/arch/mips/sys/exect.S6
-rw-r--r--lib/libc/arch/mips/sys/fork.S6
-rw-r--r--lib/libc/arch/mips/sys/pipe.S6
-rw-r--r--lib/libc/arch/mips/sys/ptrace.S6
-rw-r--r--lib/libc/arch/mips/sys/sigpending.S6
-rw-r--r--lib/libc/arch/mips/sys/sigprocmask.S6
-rw-r--r--lib/libc/arch/mips/sys/sigsuspend.S6
10 files changed, 65 insertions, 59 deletions
diff --git a/lib/libc/arch/mips/SYS.h b/lib/libc/arch/mips/SYS.h
index 2b8a0aac50a..59d96fde4a1 100644
--- a/lib/libc/arch/mips/SYS.h
+++ b/lib/libc/arch/mips/SYS.h
@@ -33,48 +33,50 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: SYS.h,v 1.4 1996/08/19 08:15:49 tholo Exp $
+ * $OpenBSD: SYS.h,v 1.5 1999/01/19 01:38:54 d Exp $
*/
#include <sys/syscall.h>
#include <machine/asm.h>
#ifdef __STDC__
-#define RSYSCALL(x) \
- LEAF(x); \
+# define __ENTRY(p,x) ENTRY(p ## x)
+# define __DO_SYSCALL(x) \
li v0,SYS_ ## x; \
- syscall; \
- bne a3,zero,err; \
- j ra; \
- err: la t9, cerror; \
- jr t9; \
- END(x);
-#define PSEUDO(x,y) \
- LEAF(x); \
- li v0,SYS_ ## y; \
- syscall; \
- bne a3,zero,err; \
- j ra; \
- err: la t9, cerror; \
- jr t9; \
- END(x);
+ syscall
+# define __LEAF2(p,x) LEAF(p ## x)
+# define __END2(p,x) END(p ## x)
+# define __CLABEL2(p,x) _C_LABEL(p ## x)
#else
-#define RSYSCALL(x) \
- LEAF(x); \
+# define __ENTRY(p,x) ENTRY(p/**/x)
+# define __DO_SYSCALL(x) \
li v0,SYS_/**/x; \
- syscall; \
+ syscall
+# define __LEAF2(p,x) LEAF(p/**/x)
+# define __END2(p,x) END(p/**/x)
+# define __CLABEL2(p,x) _C_LABEL(p/**/x)
+#endif
+
+#define __PSEUDO(p,x,y) \
+ __LEAF2(p,x); \
+ __DO_SYSCALL(y); \
bne a3,zero,err; \
j ra; \
- err: la t9, cerror; \
+ err: la t9,_C_LABEL(cerror); \
jr t9; \
- END(x);
-#define PSEUDO(x,y) \
- LEAF(x); \
- li v0,SYS_/**/y; \
- syscall; \
- bne a3,zero,err; \
- j ra; \
- err: la t9, cerror; \
- jr t9; \
- END(x);
-#endif
+ __END2(p,x)
+
+#define __RSYSCALL(p,x) __PSEUDO(p,x,x)
+
+#ifdef _THREAD_SAFE
+# define RSYSCALL(x) __RSYSCALL(_thread_sys_,x)
+# define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y)
+# define SYSLEAF(x) __LEAF2(_thread_sys_,x)
+# define SYSEND(x) __END2(_thread_sys_,x)
+#else _THREAD_SAFE
+# define RSYSCALL(x) __RSYSCALL(,x)
+# define PSEUDO(x,y) __PSEUDO(,x,y)
+# define SYSLEAF(x) __LEAF2(,x)
+# define SYSEND(x) __END2(,x)
+#endif _THREAD_SAFE
+
diff --git a/lib/libc/arch/mips/gen/setjmp.S b/lib/libc/arch/mips/gen/setjmp.S
index 0abfed8948a..d7587830538 100644
--- a/lib/libc/arch/mips/gen/setjmp.S
+++ b/lib/libc/arch/mips/gen/setjmp.S
@@ -40,7 +40,7 @@
#if defined(LIBC_SCCS)
.text
- .asciz "$OpenBSD: setjmp.S,v 1.6 1997/07/23 20:55:25 kstailey Exp $"
+ .asciz "$OpenBSD: setjmp.S,v 1.7 1999/01/19 01:38:53 d Exp $"
#endif /* LIBC_SCCS */
/*
@@ -71,7 +71,11 @@ NON_LEAF(setjmp, SETJMP_FRAME_SIZE, ra)
sw v0, (1 * 4)(v1) # save sc_mask = sigblock(0)
move a0, zero
addu a1, sp, STAND_FRAME_SIZE # pointer to struct sigaltstack
+#ifndef _THREAD_SAFE
jal _C_LABEL(sigaltstack)
+#else
+ jal _C_LABEL(_thread_sys_sigaltstack)
+#endif
lw a0, SETJMP_FRAME_SIZE(sp) # restore jmpbuf
lw v1, STAND_FRAME_SIZE+8(sp) # get old ss_onstack
and v1, v1, 1 # extract onstack flag
diff --git a/lib/libc/arch/mips/sys/Ovfork.S b/lib/libc/arch/mips/sys/Ovfork.S
index 6d2e0cd6140..f901212411c 100644
--- a/lib/libc/arch/mips/sys/Ovfork.S
+++ b/lib/libc/arch/mips/sys/Ovfork.S
@@ -38,7 +38,7 @@
#if defined(SYSLIBC_SCCS)
.text
- .asciz "$OpenBSD: Ovfork.S,v 1.4 1996/08/19 08:16:18 tholo Exp $"
+ .asciz "$OpenBSD: Ovfork.S,v 1.5 1999/01/19 01:38:53 d Exp $"
#endif /* SYSLIBC_SCCS */
/*
@@ -48,16 +48,16 @@
* v0 == pid of child in parent, v0 == pid of parent in child.
*/
-LEAF(vfork)
+SYSLEAF(vfork)
.set reorder
li v0, SYS_vfork # system call number for vfork
syscall
beq a3, zero, 1f # jump if no errors
- la t9, cerror
+ la t9, _C_LABEL(cerror)
jr t9
1:
beq v1, zero, 2f # parent process ?
move v0, zero # return zero in child
2:
j ra
-END(vfork)
+SYSEND(vfork)
diff --git a/lib/libc/arch/mips/sys/exect.S b/lib/libc/arch/mips/sys/exect.S
index 4181bcfa97c..71d9796ffae 100644
--- a/lib/libc/arch/mips/sys/exect.S
+++ b/lib/libc/arch/mips/sys/exect.S
@@ -38,10 +38,10 @@
#if defined(SYSLIBC_SCCS)
.text
- .asciz "$OpenBSD: exect.S,v 1.4 1996/08/19 08:16:21 tholo Exp $"
+ .asciz "$OpenBSD: exect.S,v 1.5 1999/01/19 01:38:53 d Exp $"
#endif /* SYSLIBC_SCCS */
-LEAF(exect)
+SYSLEAF(exect)
.set reorder
li v0, SYS_execve
syscall
@@ -50,4 +50,4 @@ LEAF(exect)
1:
la t9, _C_LABEL(cerror)
jr t9
-END(exect)
+SYSEND(exect)
diff --git a/lib/libc/arch/mips/sys/fork.S b/lib/libc/arch/mips/sys/fork.S
index 604fec4b337..df4b9abaaf0 100644
--- a/lib/libc/arch/mips/sys/fork.S
+++ b/lib/libc/arch/mips/sys/fork.S
@@ -38,10 +38,10 @@
#if defined(SYSLIBC_SCCS)
.text
- .asciz "$OpenBSD: fork.S,v 1.4 1996/08/19 08:16:22 tholo Exp $"
+ .asciz "$OpenBSD: fork.S,v 1.5 1999/01/19 01:38:53 d Exp $"
#endif /* SYSLIBC_SCCS */
-LEAF(fork)
+SYSLEAF(fork)
.set reorder
li v0, SYS_fork # pid = fork()
syscall
@@ -53,4 +53,4 @@ LEAF(fork)
2:
la t9, _C_LABEL(cerror)
jr t9
-END(fork)
+SYSEND(fork)
diff --git a/lib/libc/arch/mips/sys/pipe.S b/lib/libc/arch/mips/sys/pipe.S
index 2181bdbf596..af15e39ce2b 100644
--- a/lib/libc/arch/mips/sys/pipe.S
+++ b/lib/libc/arch/mips/sys/pipe.S
@@ -38,10 +38,10 @@
#if defined(SYSLIBC_SCCS)
.text
- .asciz "$OpenBSD: pipe.S,v 1.4 1996/08/19 08:16:22 tholo Exp $"
+ .asciz "$OpenBSD: pipe.S,v 1.5 1999/01/19 01:38:53 d Exp $"
#endif /* SYSLIBC_SCCS */
-LEAF(pipe)
+SYSLEAF(pipe)
.set reorder
li v0, SYS_pipe # pipe(fildes) int fildes[2];
syscall
@@ -53,4 +53,4 @@ LEAF(pipe)
1:
la t9, _C_LABEL(cerror)
jr t9
-END(pipe)
+SYSEND(pipe)
diff --git a/lib/libc/arch/mips/sys/ptrace.S b/lib/libc/arch/mips/sys/ptrace.S
index 8f9f94b20e2..0d711c53615 100644
--- a/lib/libc/arch/mips/sys/ptrace.S
+++ b/lib/libc/arch/mips/sys/ptrace.S
@@ -38,10 +38,10 @@
#if defined(SYSLIBC_SCCS)
.text
- .asciz "$OpenBSD: ptrace.S,v 1.4 1996/08/19 08:16:23 tholo Exp $"
+ .asciz "$OpenBSD: ptrace.S,v 1.5 1999/01/19 01:38:53 d Exp $"
#endif /* SYSLIBC_SCCS */
-LEAF(ptrace)
+SYSLEAF(ptrace)
.set reorder
sw zero, _C_LABEL(errno)
li v0, SYS_ptrace
@@ -51,4 +51,4 @@ LEAF(ptrace)
1:
la t9, _C_LABEL(cerror)
jr t9
-END(ptrace)
+SYSEND(ptrace)
diff --git a/lib/libc/arch/mips/sys/sigpending.S b/lib/libc/arch/mips/sys/sigpending.S
index 846918fff6f..18d403564ab 100644
--- a/lib/libc/arch/mips/sys/sigpending.S
+++ b/lib/libc/arch/mips/sys/sigpending.S
@@ -38,10 +38,10 @@
#if defined(SYSLIBC_SCCS)
.text
- .asciz "$OpenBSD: sigpending.S,v 1.4 1996/08/19 08:16:26 tholo Exp $"
+ .asciz "$OpenBSD: sigpending.S,v 1.5 1999/01/19 01:38:53 d Exp $"
#endif /* SYSLIBC_SCCS */
-LEAF(sigpending)
+SYSLEAF(sigpending)
.set reorder
li v0, SYS_sigpending # setlogin(name)
syscall
@@ -52,4 +52,4 @@ LEAF(sigpending)
1:
la t9, _C_LABEL(cerror)
jr t9
-END(sigpending)
+SYSEND(sigpending)
diff --git a/lib/libc/arch/mips/sys/sigprocmask.S b/lib/libc/arch/mips/sys/sigprocmask.S
index 2a7d786ba1a..6066fe78d71 100644
--- a/lib/libc/arch/mips/sys/sigprocmask.S
+++ b/lib/libc/arch/mips/sys/sigprocmask.S
@@ -38,10 +38,10 @@
#if defined(SYSLIBC_SCCS)
.text
- .asciz "$OpenBSD: sigprocmask.S,v 1.4 1996/08/19 08:16:27 tholo Exp $"
+ .asciz "$OpenBSD: sigprocmask.S,v 1.5 1999/01/19 01:38:53 d Exp $"
#endif /* SYSLIBC_SCCS */
-LEAF(sigprocmask) # sigprocmask(how, new, old) sigset_t *new, *old;
+SYSLEAF(sigprocmask) # sigprocmask(how, new, old) sigset_t *new, *old;
.set reorder
bne a1, zero, gotptr # if new sigset pointer not null
li a0, 1 # how = SIG_BLOCK
@@ -60,4 +60,4 @@ out:
err:
la t9, _C_LABEL(cerror)
jr t9
-END(sigprocmask)
+SYSEND(sigprocmask)
diff --git a/lib/libc/arch/mips/sys/sigsuspend.S b/lib/libc/arch/mips/sys/sigsuspend.S
index f22b06cf5e7..c0ffa1a7be1 100644
--- a/lib/libc/arch/mips/sys/sigsuspend.S
+++ b/lib/libc/arch/mips/sys/sigsuspend.S
@@ -38,10 +38,10 @@
#if defined(SYSLIBC_SCCS)
.text
- .asciz "$OpenBSD: sigsuspend.S,v 1.4 1996/08/19 08:16:28 tholo Exp $"
+ .asciz "$OpenBSD: sigsuspend.S,v 1.5 1999/01/19 01:38:53 d Exp $"
#endif /* SYSLIBC_SCCS */
-LEAF(sigsuspend)
+SYSLEAF(sigsuspend)
.set reorder
lw a0, 0(a0) # indirect to mask arg
li v0, SYS_sigsuspend
@@ -52,4 +52,4 @@ LEAF(sigsuspend)
1:
la t9, _C_LABEL(cerror)
jr t9
-END(sigsuspend)
+SYSEND(sigsuspend)