summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2003-01-02 21:40:44 +0000
committermiod <miod@openbsd.org>2003-01-02 21:40:44 +0000
commit66c90ecad6779d83b774b9a26f7fe0c19fb800d0 (patch)
treede1a897a1aec613d6c00a258e4deaf8c84cc6764 /lib/libc
parentRename cerror to __cerror and curbrk to __curbrk, to avoid namespace (diff)
downloadwireguard-openbsd-66c90ecad6779d83b774b9a26f7fe0c19fb800d0.tar.xz
wireguard-openbsd-66c90ecad6779d83b774b9a26f7fe0c19fb800d0.zip
Adapt to recent changes in libc/libc_r wrt weak symbols, so that programs
can link against libc without unresolved symbols again. Anyone who correctly guessed that my m88k hard drive has been recovered, wins a strawberry lollipop.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/arch/m88k/SYS.h86
-rw-r--r--lib/libc/arch/m88k/sys/Ovfork.S6
-rw-r--r--lib/libc/arch/m88k/sys/sigprocmask.S6
-rw-r--r--lib/libc/arch/m88k/sys/sigreturn.S6
-rw-r--r--lib/libc/arch/m88k/sys/sigsuspend.S6
-rw-r--r--lib/libc/arch/m88k/sys/syscall.S6
6 files changed, 66 insertions, 50 deletions
diff --git a/lib/libc/arch/m88k/SYS.h b/lib/libc/arch/m88k/SYS.h
index a47c2da54c9..a09414d6b34 100644
--- a/lib/libc/arch/m88k/SYS.h
+++ b/lib/libc/arch/m88k/SYS.h
@@ -1,4 +1,4 @@
-/* * $OpenBSD: SYS.h,v 1.6 2003/01/02 20:25:29 miod Exp $*/
+/* * $OpenBSD: SYS.h,v 1.7 2003/01/02 21:40:44 miod Exp $*/
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -42,43 +42,59 @@
#include <machine/asm.h>
#ifdef __STDC__
+#define __ENTRY(p,x) ENTRY(p##x)
+#define __DO_SYSCALL(x) or r13,r0,SYS_##x
+#define __ALIAS(prefix,name) WEAK_ALIAS(name,prefix##name)
+#else
+#define __ENTRY(p,x) ENTRY(p/**/x)
+#define __DO_SYSCALL(x) or r13,r0,SYS_/**/x
+#define __ALIAS(prefix,name) WEAK_ALIAS(name,prefix/**/name)
+#endif
-#define _SYSCALL(x,y) align 8; \
- ENTRY(x); \
- ld r10,r31,32; \
- ld r11,r31,36; \
- ld r12,r31,40; \
- or r13,r0, SYS_ ## y; \
- tb0 0, r0, 128; \
- br __cerror
-#define SYSCALL(x) _SYSCALL(x,x)
-#define RSYSCALL(x) SYSCALL(x) ;\
- jmp r1
-#define PSEUDO(x,y) _SYSCALL(x,y); \
- jmp r1
-#define PSEUDO_NOERROR(x,y) ENTRY(x); ;\
- or r13,r0, SYS_ ## y; \
- tb0 0,r0,128; or r0,r0,r0;jmp r1
+#define __SYSCALL(p,x,y) \
+ align 8; \
+ __ENTRY(p,x); \
+ ld r10,r31,32; \
+ ld r11,r31,36; \
+ ld r12,r31,40; \
+ __DO_SYSCALL(y); \
+ tb0 0, r0, 128; \
+ br __cerror
-#else /* !__STDC__ */
+#define __PSEUDO(p,x,y) \
+ __SYSCALL(p,x,y); \
+ jmp r1
-#define _SYSCALL(x,y) align 8; \
- ENTRY(x); \
- ld r10,r31,32; \
- ld r11,r31,36; \
- ld r12,r31,40; \
- or r13,r0, SYS_/**/y; \
- tb0 0, r0, 128; \
- br __cerror
-#define SYSCALL(x) _SYSCALL(x,x)
-#define RSYSCALL(x) SYSCALL(x); \
- jmp r1
-#define PSEUDO(x,y) _SYSCALL(x,y); \
- jmp r1
-#define PSEUDO_NOERROR(x,y) ENTRY(x); \
- or r13,r0, SYS_/**/y; \
- tb0 0,r0,128; or r0,r0,r0; jmp r1
-#endif /* !__STDC__ */
+#if 0
+#define __PSEUDO_NOERROR(p,x,y) \
+ __SYSCALL(p,x,y); \
+ jmp r1
+#else
+/* XXX is this correct??? */
+#define __PSEUDO_NOERROR(p,x,y) \
+ align 8; \
+ __ENTRY(p,x); \
+ __DO_SYSCALL(y); \
+ tb0 0, r0, 128; \
+ or r0, r0, r0; \
+ jmp r1
+#endif
+
+/*
+ * For the thread_safe versions, we prepend _thread_sys_ to the function
+ * name so that the 'C' wrapper can go around the real name.
+ */
+
+#define SYSCALL(x) __ALIAS(_thread_sys_,x); \
+ __SYSCALL(_thread_sys_,x,x)
+#define RSYSCALL(x) __ALIAS(_thread_sys_,x); \
+ __PSEUDO(_thread_sys_,x,x)
+#define PSEUDO(x,y) __ALIAS(_thread_sys_,x); \
+ __PSEUDO(_thread_sys_,x,y)
+#define PSEUDO_NOERROR(x,y) __ALIAS(_thread_sys_,x); \
+ __PSEUDO_NOERROR(_thread_sys_,x,y)
+#define SYSENTRY(x) __ALIAS(_thread_sys_,x); \
+ __ENTRY(_thread_sys_,x)
#define ASMSTR .asciz
diff --git a/lib/libc/arch/m88k/sys/Ovfork.S b/lib/libc/arch/m88k/sys/Ovfork.S
index e546710dcd8..e59567862cb 100644
--- a/lib/libc/arch/m88k/sys/Ovfork.S
+++ b/lib/libc/arch/m88k/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.2 2000/03/01 17:31:21 todd Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.3 2003/01/02 21:40:46 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,7 +40,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
.data
/*.asciz "from: @(#)fork.s 5.1 (Berkeley) 5/12/90"*/
- .asciz "$OpenBSD: Ovfork.S,v 1.2 2000/03/01 17:31:21 todd Exp $"
+ .asciz "$OpenBSD: Ovfork.S,v 1.3 2003/01/02 21:40:46 miod Exp $"
.text
#endif /* LIBC_SCCS and not lint */
@@ -48,7 +48,7 @@
/* r2 = pid. r3 = 0 in parent, 1 in child */
-SYSCALL(vfork)
+SYSENTRY(vfork)
bcnd eq0,r3,parent
or r2,r0,0
or r3,r0,0
diff --git a/lib/libc/arch/m88k/sys/sigprocmask.S b/lib/libc/arch/m88k/sys/sigprocmask.S
index 65576ac01cd..a1cb4c4608d 100644
--- a/lib/libc/arch/m88k/sys/sigprocmask.S
+++ b/lib/libc/arch/m88k/sys/sigprocmask.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigprocmask.S,v 1.3 2003/01/02 20:25:31 miod Exp $ */
+/* $OpenBSD: sigprocmask.S,v 1.4 2003/01/02 21:40:46 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,13 +40,13 @@
#if defined(LIBC_SCCS) && !defined(lint)
.data
/*.asciz "from: @(#)sigprocmask.s 5.2 (Berkeley) 6/6/90"*/
- .asciz "$OpenBSD: sigprocmask.S,v 1.3 2003/01/02 20:25:31 miod Exp $"
+ .asciz "$OpenBSD: sigprocmask.S,v 1.4 2003/01/02 21:40:46 miod Exp $"
.text
#endif /* LIBC_SCCS and not lint */
#include "SYS.h"
-ENTRY(sigprocmask)
+SYSENTRY(sigprocmask)
bcnd ne0,r3,L1 /* if new sigset pointer is null */
or r2,r0,1 /* how = SIG_BLOCK and do it */
br L2
diff --git a/lib/libc/arch/m88k/sys/sigreturn.S b/lib/libc/arch/m88k/sys/sigreturn.S
index 7898aaf7c2e..88aa80b05cf 100644
--- a/lib/libc/arch/m88k/sys/sigreturn.S
+++ b/lib/libc/arch/m88k/sys/sigreturn.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigreturn.S,v 1.2 2000/03/01 17:31:22 todd Exp $ */
+/* $OpenBSD: sigreturn.S,v 1.3 2003/01/02 21:40:46 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,7 +40,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
.data
/*.asciz "from: @(#)sigreturn.s 5.1 (Berkeley) 5/12/90"*/
- .asciz "$OpenBSD: sigreturn.S,v 1.2 2000/03/01 17:31:22 todd Exp $"
+ .asciz "$OpenBSD: sigreturn.S,v 1.3 2003/01/02 21:40:46 miod Exp $"
.text
#endif /* LIBC_SCCS and not lint */
@@ -51,4 +51,4 @@
* Not sure what should be done XXX nivas
*/
-RSYSCALL(sigreturn)
+SYSENTRY(sigreturn)
diff --git a/lib/libc/arch/m88k/sys/sigsuspend.S b/lib/libc/arch/m88k/sys/sigsuspend.S
index 9817729e62b..77916849c2a 100644
--- a/lib/libc/arch/m88k/sys/sigsuspend.S
+++ b/lib/libc/arch/m88k/sys/sigsuspend.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigsuspend.S,v 1.3 2003/01/02 20:25:31 miod Exp $ */
+/* $OpenBSD: sigsuspend.S,v 1.4 2003/01/02 21:40:46 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,7 +40,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
.data
/*.asciz "from: @(#)sigsuspend.s 5.2 (Berkeley) 6/6/90"*/
- .asciz "$OpenBSD: sigsuspend.S,v 1.3 2003/01/02 20:25:31 miod Exp $"
+ .asciz "$OpenBSD: sigsuspend.S,v 1.4 2003/01/02 21:40:46 miod Exp $"
.text
#endif /* LIBC_SCCS and not lint */
@@ -53,7 +53,7 @@
* sigset_t != sizeof int.
*/
-ENTRY(sigsuspend)
+SYSENTRY(sigsuspend)
ld r2,r2,0 /* dereference the pointer mask */
or r13,r0,SYS_sigsuspend
tb0 0,r0,128
diff --git a/lib/libc/arch/m88k/sys/syscall.S b/lib/libc/arch/m88k/sys/syscall.S
index dfbf1119e05..83021764886 100644
--- a/lib/libc/arch/m88k/sys/syscall.S
+++ b/lib/libc/arch/m88k/sys/syscall.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall.S,v 1.3 2003/01/02 20:25:31 miod Exp $ */
+/* $OpenBSD: syscall.S,v 1.4 2003/01/02 21:40:46 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,13 +40,13 @@
#if defined(LIBC_SCCS) && !defined(lint)
.data
/*.asciz "from: @(#)syscall.s 5.1 (Berkeley) 5/12/90"*/
- .asciz "$OpenBSD: syscall.S,v 1.3 2003/01/02 20:25:31 miod Exp $"
+ .asciz "$OpenBSD: syscall.S,v 1.4 2003/01/02 21:40:46 miod Exp $"
.text
#endif /* LIBC_SCCS and not lint */
#include "SYS.h"
-ENTRY(syscall)
+SYSENTRY(syscall)
ld r10,r31,32
ld r11,r31,36
ld r12,r31,40