summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-05-05 07:56:21 +0000
committerpeter <peter@FreeBSD.org>1996-05-05 07:56:21 +0000
commit4b7195c99191637bf59fd4ad626297296bf3610f (patch)
treebea8a07c70223c0e39939063c6dbbdf8eb9d0f17 /lib/libc/amd64
parent93f1aa601a7bda9bd9b83bf5098c3f05f6edd744 (diff)
downloadFreeBSD-src-4b7195c99191637bf59fd4ad626297296bf3610f.zip
FreeBSD-src-4b7195c99191637bf59fd4ad626297296bf3610f.tar.gz
Add support to enable libc to be compiled in ELF format. (#ifdef __ELF__)
In a nutshell, this macroizes the local/global symbol scoping rules that are different in a.out and ELF. It also makes the i386 assembler stubs conform to i386 PIC calling conventions - the a.out ld.so didn't object, but the ELF one needs it as it implements PIC jumps via PLT's as well as calls. The a.out rtld only worked because it was accidently snooping the grandparent calling function's return address off the stack.. This also affects the libc_r code a little, because of cpp macro nesting.
Diffstat (limited to 'lib/libc/amd64')
-rw-r--r--lib/libc/amd64/SYS.h33
-rw-r--r--lib/libc/amd64/gen/setjmp.S16
-rw-r--r--lib/libc/amd64/gen/sigsetjmp.S16
-rw-r--r--lib/libc/amd64/sys/brk.S33
-rw-r--r--lib/libc/amd64/sys/cerror.S27
-rw-r--r--lib/libc/amd64/sys/exect.S9
-rw-r--r--lib/libc/amd64/sys/pipe.S10
-rw-r--r--lib/libc/amd64/sys/ptrace.S13
-rw-r--r--lib/libc/amd64/sys/sbrk.S39
-rw-r--r--lib/libc/amd64/sys/setlogin.S10
-rw-r--r--lib/libc/amd64/sys/sigreturn.S19
-rw-r--r--lib/libc/amd64/sys/vfork.S28
12 files changed, 132 insertions, 121 deletions
diff --git a/lib/libc/amd64/SYS.h b/lib/libc/amd64/SYS.h
index 9e989e5..caea98f 100644
--- a/lib/libc/amd64/SYS.h
+++ b/lib/libc/amd64/SYS.h
@@ -35,7 +35,7 @@
*
* from: @(#)SYS.h 5.5 (Berkeley) 5/7/91
*
- * $Id: SYS.h,v 1.2 1994/08/05 01:17:57 wollman Exp $
+ * $Id: SYS.h,v 1.3 1996/01/22 00:00:51 julian Exp $
*/
#include <sys/syscall.h>
@@ -61,28 +61,27 @@
#define PIC_GOTOFF(x) x
#endif
-#define SYSCALL(x) 2: jmp cerror; ENTRY(x); lea SYS_/**/x,%eax; LCALL(7,0); jb 2b
+#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); ENTRY(x); lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b
#define RSYSCALL(x) SYSCALL(x); ret
-#ifdef _THREAD_SAFE
/*
- * Support for user-space threads which require that some syscalls be
- * private to the threaded library.
+ * 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 PSYSCALL(x) 2: jmp cerror; ENTRY(_thread_sys_/**/x); lea SYS_/**/x,%eax; LCALL(7,0); jb 2b
-#else
-/*
- * The non-threaded library defaults to traditional syscalls where
- * the function name matches the syscall name.
- */
-#define PSYSCALL(x) SYSCALL(x)
+#ifdef _THREAD_SAFE /* in case */
+#define PSYSCALL(x,y) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); ENTRY(y); lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b
+#define PRSYSCALL(x,y) PSYSCALL(x,y); ret
#endif
-#define PRSYSCALL(x) PSYSCALL(x); ret
-#define PSEUDO(x,y) ENTRY(x); lea SYS_/**/y, %eax; ; LCALL(7,0); ret
-#define CALL(x,y) call _/**/y; addl $4*x,%esp
+
+#define PSEUDO(x,y) ENTRY(x); lea __CONCAT(SYS_,y), %eax; KERNCALL; ret
+#define CALL(x,y) call CNAME(y); addl $4*x,%esp
/* gas fucks up offset -- although we don't currently need it, do for BCS */
#define LCALL(x,y) .byte 0x9a ; .long y; .word x
-#define ASMSTR .asciz
+#ifdef __ELF__
+#define KERNCALL int $0x80 /* Faster */
+#else
+#define KERNCALL LCALL(7,0) /* The old way */
+#endif
- .globl cerror
+#define ASMSTR .asciz
diff --git a/lib/libc/amd64/gen/setjmp.S b/lib/libc/amd64/gen/setjmp.S
index 89efa92..078b2eb 100644
--- a/lib/libc/amd64/gen/setjmp.S
+++ b/lib/libc/amd64/gen/setjmp.S
@@ -33,12 +33,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: setjmp.S,v 1.3 1995/01/23 01:27:08 davidg Exp $
+ * $Id: setjmp.S,v 1.4 1996/01/22 00:00:53 julian Exp $
*/
#if defined(LIBC_RCS) && !defined(lint)
.text
- .asciz "$Id: setjmp.S,v 1.3 1995/01/23 01:27:08 davidg Exp $"
+ .asciz "$Id: setjmp.S,v 1.4 1996/01/22 00:00:53 julian Exp $"
#endif /* LIBC_RCS and not lint */
/*
@@ -59,13 +59,15 @@ ENTRY(_thread_sys_setjmp)
#else
ENTRY(setjmp)
#endif
+ PIC_PROLOGUE
pushl $0
#ifdef _THREAD_SAFE
- call PIC_PLT(__thread_sys_sigblock)
+ call PIC_PLT(CNAME(_thread_sys_sigblock))
#else
- call PIC_PLT(_sigblock)
+ call PIC_PLT(CNAME(sigblock))
#endif
popl %edx
+ PIC_EPILOGUE
movl 4(%esp),%ecx
movl 0(%esp),%edx
movl %edx, 0(%ecx)
@@ -85,13 +87,15 @@ ENTRY(_thread_sys_longjmp)
ENTRY(longjmp)
#endif
movl 4(%esp),%edx
+ PIC_PROLOGUE
pushl 24(%edx)
#ifdef _THREAD_SAFE
- call PIC_PLT(__thread_sys_sigsetmask)
+ call PIC_PLT(CNAME(_thread_sys_sigsetmask))
#else
- call PIC_PLT(_sigsetmask) /* XXX this is not reentrant */
+ call PIC_PLT(CNAME(sigsetmask)) /* XXX this is not reentrant */
#endif
popl %eax
+ PIC_EPILOGUE
movl 4(%esp),%edx
movl 8(%esp),%eax
movl 0(%edx),%ecx
diff --git a/lib/libc/amd64/gen/sigsetjmp.S b/lib/libc/amd64/gen/sigsetjmp.S
index 5cc00f0..1d56f29 100644
--- a/lib/libc/amd64/gen/sigsetjmp.S
+++ b/lib/libc/amd64/gen/sigsetjmp.S
@@ -33,12 +33,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sigsetjmp.S,v 1.5 1996/01/22 00:00:54 julian Exp $
+ * $Id: sigsetjmp.S,v 1.6 1996/02/17 12:25:21 peter Exp $
*/
#if defined(LIBC_RCS) && !defined(lint)
.text
- .asciz "$Id: sigsetjmp.S,v 1.5 1996/01/22 00:00:54 julian Exp $"
+ .asciz "$Id: sigsetjmp.S,v 1.6 1996/02/17 12:25:21 peter Exp $"
#endif /* LIBC_RCS and not lint */
#include "DEFS.h"
@@ -69,13 +69,15 @@ ENTRY(sigsetjmp)
movl %eax,32(%ecx)
testl %eax,%eax
jz 1f
+ PIC_PROLOGUE
pushl $0
#ifdef _THREAD_SAFE
- call PIC_PLT(__thread_sys_sigblock)
+ call PIC_PLT(CNAME(_thread_sys_sigblock))
#else
- call PIC_PLT(_sigblock)
+ call PIC_PLT(CNAME(sigblock))
#endif
addl $4,%esp
+ PIC_EPILOGUE
movl 4(%esp),%ecx
movl %eax,24(%ecx)
1: movl 0(%esp),%edx
@@ -97,13 +99,15 @@ ENTRY(siglongjmp)
movl 4(%esp),%edx
cmpl $0,32(%edx)
jz 1f
+ PIC_PROLOGUE
pushl 24(%edx)
#ifdef _THREAD_SAFE
- call PIC_PLT(__thread_sys_sigsetmask)
+ call PIC_PLT(CNAME(_thread_sys_sigsetmask))
#else
- call PIC_PLT(_sigsetmask)
+ call PIC_PLT(CNAME(sigsetmask))
#endif
addl $4,%esp
+ PIC_EPILOGUE
1: movl 4(%esp),%edx
movl 8(%esp),%eax
movl 0(%edx),%ecx
diff --git a/lib/libc/amd64/sys/brk.S b/lib/libc/amd64/sys/brk.S
index c8311bb..1636858 100644
--- a/lib/libc/amd64/sys/brk.S
+++ b/lib/libc/amd64/sys/brk.S
@@ -33,20 +33,18 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: brk.S,v 1.1 1994/08/05 01:18:39 wollman Exp $
+ * $Id: brk.S,v 1.2 1995/01/23 01:29:39 davidg Exp $
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id$"
+ .asciz "$Id: brk.S,v 1.2 1995/01/23 01:29:39 davidg Exp $"
#endif /* SYSLIBC_RCS and not lint */
#include "SYS.h"
-#define SYS_brk 17
-
- .globl curbrk
- .globl minbrk
+ .globl HIDENAME(curbrk)
+ .globl HIDENAME(minbrk)
ENTRY(_brk)
jmp ok
@@ -54,39 +52,40 @@ ENTRY(brk)
#ifdef PIC
movl 4(%esp),%eax
PIC_PROLOGUE
- movl PIC_GOT(curbrk),%edx # set up GOT addressing
- movl PIC_GOT(minbrk),%ecx #
+ movl PIC_GOT(HIDENAME(curbrk)),%edx # set up GOT addressing
+ movl PIC_GOT(HIDENAME(minbrk)),%ecx #
cmpl %eax,(%ecx)
PIC_EPILOGUE
jl ok
movl (%ecx),%eax
movl %eax,4(%esp)
ok:
- lea SYS_brk,%eax
- LCALL(7,0)
+ lea SYS_break,%eax
+ KERNCALL
jb err
movl 4(%esp),%eax
movl %eax,(%edx)
movl $0,%eax
ret
err:
- jmp PIC_PLT(cerror)
+ PIC_PROLOGUE
+ jmp PIC_PLT(HIDENAME(cerror))
#else
movl 4(%esp),%eax
- cmpl %eax,minbrk
+ cmpl %eax,HIDENAME(minbrk)
jl ok
- movl minbrk,%eax
+ movl HIDENAME(minbrk),%eax
movl %eax,4(%esp)
ok:
- lea SYS_brk,%eax
- LCALL(7,0)
+ lea SYS_break,%eax
+ KERNCALL
jb err
movl 4(%esp),%eax
- movl %eax,curbrk
+ movl %eax,HIDENAME(curbrk)
movl $0,%eax
ret
err:
- jmp cerror
+ jmp HIDENAME(cerror)
#endif
diff --git a/lib/libc/amd64/sys/cerror.S b/lib/libc/amd64/sys/cerror.S
index 2cbb0f9..926dcd9 100644
--- a/lib/libc/amd64/sys/cerror.S
+++ b/lib/libc/amd64/sys/cerror.S
@@ -33,28 +33,31 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cerror.S,v 1.3 1995/01/23 01:29:43 davidg Exp $
+ * $Id: cerror.S,v 1.4 1996/01/22 00:00:57 julian Exp $
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id: cerror.S,v 1.3 1995/01/23 01:29:43 davidg Exp $"
+ .asciz "$Id: cerror.S,v 1.4 1996/01/22 00:00:57 julian Exp $"
#endif /* SYSLIBC_RCS and not lint */
#include "SYS.h"
+ .globl HIDENAME(cerror)
+
#ifdef _THREAD_SAFE
/*
* Threaded version using __error().
*/
- .globl ___error
- .type ___error,@function
-cerror:
+ .globl CNAME(__error)
+ .type CNAME(__error),@function
+HIDENAME(cerror):
pushl %eax
#ifdef PIC
- call PIC_PLT(___error)
+ /* The caller must execute the PIC prologue before jumping to cerror. */
+ call PIC_PLT(CNAME(__error))
#else
- call ___error
+ call CNAME(__error)
#endif
popl %ecx
movl %ecx,(%eax)
@@ -66,15 +69,15 @@ cerror:
/*
* Non-threaded version using global errno.
*/
- .globl _errno
-cerror:
+ .globl CNAME(errno)
+HIDENAME(cerror):
#ifdef PIC
- PIC_PROLOGUE
- movl PIC_GOT(_errno),%ecx
+ /* The caller must execute the PIC prologue before jumping to cerror. */
+ movl PIC_GOT(CNAME(errno)),%ecx
movl %eax,(%ecx)
PIC_EPILOGUE
#else
- movl %eax,_errno
+ movl %eax,CNAME(errno)
#endif
movl $-1,%eax
movl $-1,%edx
diff --git a/lib/libc/amd64/sys/exect.S b/lib/libc/amd64/sys/exect.S
index 74a055b..59ce389 100644
--- a/lib/libc/amd64/sys/exect.S
+++ b/lib/libc/amd64/sys/exect.S
@@ -33,12 +33,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: exect.S,v 1.1 1994/08/05 01:18:42 wollman Exp $
+ * $Id: exect.S,v 1.2 1995/01/23 01:29:46 davidg Exp $
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id$"
+ .asciz "$Id: exect.S,v 1.2 1995/01/23 01:29:46 davidg Exp $"
#endif /* SYSLIBC_RCS and not lint */
#include "SYS.h"
@@ -51,5 +51,6 @@ ENTRY(exect)
orl $ PSL_T,%edx
pushl %edx
popf
- LCALL(7,0)
- jmp cerror /* exect(file, argv, env); */
+ KERNCALL
+ PIC_PROLOGUE
+ jmp PIC_PLT(HIDENAME(cerror)) /* exect(file, argv, env); */
diff --git a/lib/libc/amd64/sys/pipe.S b/lib/libc/amd64/sys/pipe.S
index 809445f..0dcf857 100644
--- a/lib/libc/amd64/sys/pipe.S
+++ b/lib/libc/amd64/sys/pipe.S
@@ -33,17 +33,21 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pipe.S,v 1.2 1995/01/23 01:29:57 davidg Exp $
+ * $Id: pipe.S,v 1.3 1996/01/22 00:00:58 julian Exp $
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id: pipe.S,v 1.2 1995/01/23 01:29:57 davidg Exp $"
+ .asciz "$Id: pipe.S,v 1.3 1996/01/22 00:00:58 julian Exp $"
#endif /* SYSLIBC_RCS and not lint */
#include "SYS.h"
-PSYSCALL(pipe)
+#ifdef _THREAD_SAFE
+PSYSCALL(pipe,_thread_sys_pipe)
+#else
+SYSCALL(pipe)
+#endif
movl 4(%esp),%ecx
movl %eax,(%ecx)
movl %edx,4(%ecx)
diff --git a/lib/libc/amd64/sys/ptrace.S b/lib/libc/amd64/sys/ptrace.S
index e3ac3a5..993c9be 100644
--- a/lib/libc/amd64/sys/ptrace.S
+++ b/lib/libc/amd64/sys/ptrace.S
@@ -33,12 +33,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ptrace.S,v 1.1 1994/08/05 01:18:47 wollman Exp $
+ * $Id: ptrace.S,v 1.2 1995/01/23 01:29:59 davidg Exp $
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id$"
+ .asciz "$Id: ptrace.S,v 1.2 1995/01/23 01:29:59 davidg Exp $"
#endif /* SYSLIBC_RCS and not lint */
#include "SYS.h"
@@ -47,15 +47,16 @@ ENTRY(ptrace)
xorl %eax,%eax
#ifdef PIC
PIC_PROLOGUE
- movl PIC_GOT(_errno),%edx
+ movl PIC_GOT(CNAME(errno)),%edx
movl %eax,(%edx)
PIC_EPILOGUE
#else
- movl %eax,_errno
+ movl %eax,CNAME(errno)
#endif
lea SYS_ptrace,%eax
- LCALL(7,0)
+ KERNCALL
jb err
ret
err:
- jmp cerror
+ PIC_PROLOGUE
+ jmp PIC_PLT(HIDENAME(cerror))
diff --git a/lib/libc/amd64/sys/sbrk.S b/lib/libc/amd64/sys/sbrk.S
index 2d65b59..d5c48ddc 100644
--- a/lib/libc/amd64/sys/sbrk.S
+++ b/lib/libc/amd64/sys/sbrk.S
@@ -33,64 +33,63 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sbrk.S,v 1.2 1995/01/23 01:30:04 davidg Exp $
+ * $Id: sbrk.S,v 1.3 1995/10/04 15:58:57 phk Exp $
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id: sbrk.S,v 1.2 1995/01/23 01:30:04 davidg Exp $"
+ .asciz "$Id: sbrk.S,v 1.3 1995/10/04 15:58:57 phk Exp $"
#endif /* SYSLIBC_RCS and not lint */
#include "SYS.h"
-#define SYS_brk 17
-
- .globl _end
- .globl minbrk
- .globl curbrk
+ .globl CNAME(end)
+ .globl HIDENAME(minbrk)
+ .globl HIDENAME(curbrk)
.data
-minbrk: .long _end
-curbrk: .long _end
+HIDENAME(minbrk): .long CNAME(end)
+HIDENAME(curbrk): .long CNAME(end)
.text
ENTRY(sbrk)
#ifdef PIC
movl 4(%esp),%ecx
PIC_PROLOGUE
- movl PIC_GOT(curbrk),%edx
+ movl PIC_GOT(HIDENAME(curbrk)),%edx
movl (%edx),%eax
PIC_EPILOGUE
testl %ecx,%ecx
jz back
addl %eax,4(%esp)
- lea SYS_brk,%eax
- LCALL(7,0)
+ lea SYS_break,%eax
+ KERNCALL
jb err
PIC_PROLOGUE
- movl PIC_GOT(curbrk),%edx
+ movl PIC_GOT(HIDENAME(curbrk)),%edx
movl (%edx),%eax
addl %ecx,(%edx)
PIC_EPILOGUE
back:
ret
err:
- jmp PIC_PLT(cerror)
+ PIC_PROLOGUE
+ jmp PIC_PLT(HIDENAME(cerror))
#else /* !PIC */
movl 4(%esp),%ecx
- movl curbrk,%eax
+ movl HIDENAME(curbrk),%eax
testl %ecx,%ecx
jz back
addl %eax,4(%esp)
- lea SYS_brk,%eax
- LCALL(7,0)
+ lea SYS_break,%eax
+ KERNCALL
jb err
- movl curbrk,%eax
- addl %ecx,curbrk
+ movl HIDENAME(curbrk),%eax
+ addl %ecx,HIDENAME(curbrk)
back:
ret
err:
- jmp cerror
+ jmp HIDENAME(cerror)
#endif /* PIC */
diff --git a/lib/libc/amd64/sys/setlogin.S b/lib/libc/amd64/sys/setlogin.S
index 96c7886..1ec31b9 100644
--- a/lib/libc/amd64/sys/setlogin.S
+++ b/lib/libc/amd64/sys/setlogin.S
@@ -33,27 +33,27 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: setlogin.S,v 1.1 1994/08/05 01:18:50 wollman Exp $
+ * $Id: setlogin.S,v 1.2 1995/01/23 01:30:06 davidg Exp $
*/
#if defined(LIBC_RCS) && !defined(lint)
.text
- .asciz "$Id$"
+ .asciz "$Id: setlogin.S,v 1.2 1995/01/23 01:30:06 davidg Exp $"
#endif /* LIBC_RCS and not lint */
#include "SYS.h"
-.globl __logname_valid /* in getlogin() */
+.globl CNAME(_logname_valid) /* in getlogin() */
SYSCALL(setlogin)
#ifdef PIC
PIC_PROLOGUE
pushl %eax
- movl PIC_GOT(__logname_valid),%eax
+ movl PIC_GOT(CNAME(_logname_valid)),%eax
movl $0,(%eax)
popl %eax
PIC_EPILOGUE
#else
- movl $0,__logname_valid
+ movl $0,CNAME(_logname_valid)
#endif
ret /* setlogin(name) */
diff --git a/lib/libc/amd64/sys/sigreturn.S b/lib/libc/amd64/sys/sigreturn.S
index 6f3f571..cce518b 100644
--- a/lib/libc/amd64/sys/sigreturn.S
+++ b/lib/libc/amd64/sys/sigreturn.S
@@ -33,25 +33,24 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sigreturn.S,v 1.2 1995/01/23 01:30:16 davidg Exp $
+ * $Id: sigreturn.S,v 1.3 1996/01/22 00:01:00 julian Exp $
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id: sigreturn.S,v 1.2 1995/01/23 01:30:16 davidg Exp $"
+ .asciz "$Id: sigreturn.S,v 1.3 1996/01/22 00:01:00 julian Exp $"
#endif /* SYSLIBC_RCS and not lint */
#include "SYS.h"
/*
- * We must preserve the state of the registers as the user has set them up.
+ * NOTE: If the profiling ENTRY() code ever changes any registers, they
+ * must be saved. On FreeBSD, this is not the case.
*/
-#ifdef PROF
-#undef ENTRY
-#define ENTRY(x) \
- .globl _/**/x; .align 2; _/**/x: pusha ; \
- .data; 1:; .long 0; .text; movl $1b,%eax; call mcount; popa ; nop
-#endif /* PROF */
-PSYSCALL(sigreturn)
+#ifdef _THREAD_SAFE
+PSYSCALL(sigreturn,_thread_sys_sigreturn)
+#else
+SYSCALL(sigreturn)
+#endif
ret
diff --git a/lib/libc/amd64/sys/vfork.S b/lib/libc/amd64/sys/vfork.S
index 341b75c..2b69ca0 100644
--- a/lib/libc/amd64/sys/vfork.S
+++ b/lib/libc/amd64/sys/vfork.S
@@ -33,14 +33,15 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: Ovfork.S,v 1.2 1995/01/23 01:29:37 davidg Exp $
+ * $Id: Ovfork.S,v 1.3 1996/01/22 00:00:56 julian Exp $
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id: Ovfork.S,v 1.2 1995/01/23 01:29:37 davidg Exp $"
+ .asciz "$Id: Ovfork.S,v 1.3 1996/01/22 00:00:56 julian Exp $"
#endif /* SYSLIBC_RCS and not lint */
+#include "DEFS.h"
#include "SYS.h"
/*
@@ -50,14 +51,11 @@
* %eax == pid of child in parent, %eax == pid of parent in child.
*
*/
- .set vfork,66
-.globl _vfork
-.type _vfork,@function
-_vfork:
+ENTRY(vfork)
popl %ecx /* my rta into ecx */
- movl $vfork, %eax
- LCALL(7,0)
+ lea SYS_vfork,%eax
+ KERNCALL
jb verror
vforkok:
cmpl $0,%edx /* child process? */
@@ -67,14 +65,14 @@ vforkok:
/*
* Threaded version using __error().
*/
- .globl ___error
- .type ___error,@function
+ .globl CNAME(__error)
+ .type CNAME(__error),@function
verror:
pushl %eax
#ifdef PIC
- call PIC_PLT(___error)
+ call PIC_PLT(CNAME(__error))
#else
- call ___error
+ call CNAME(__error)
#endif
popl %ecx
movl %ecx,(%eax)
@@ -84,15 +82,15 @@ verror:
/*
* Non-threaded version using global errno.
*/
- .globl _errno
+ .globl CNAME(errno)
verror:
#ifdef PIC
PIC_PROLOGUE
- movl PIC_GOT(_errno), %edx
+ movl PIC_GOT(CNAME(errno)), %edx
movl %eax,(%edx)
PIC_EPILOGUE
#else
- movl %eax,_errno
+ movl %eax,CNAME(errno)
#endif
movl $-1,%eax
#endif /* !_THREAD_SAFE */
OpenPOWER on IntegriCloud