Random cleanup.
This commit is contained in:
parent
9c8862a970
commit
22e614ce10
|
@ -34,12 +34,12 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)Ovfork.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: Ovfork.S,v 1.5 1994/01/27 04:10:20 mycroft Exp $
|
||||
* $Id: Ovfork.S,v 1.6 1994/01/27 06:34:59 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: Ovfork.S,v 1.5 1994/01/27 04:10:20 mycroft Exp $"
|
||||
.asciz "$Id: Ovfork.S,v 1.6 1994/01/27 06:34:59 mycroft Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
@ -51,29 +51,24 @@
|
|||
* %eax == pid of child in parent, %eax == pid of parent in child.
|
||||
*
|
||||
*/
|
||||
.set vfork,66
|
||||
ENTRY(vfork)
|
||||
popl %ecx /* my rta into ecx */
|
||||
movl $vfork, %eax
|
||||
movl $(SYS_vfork),%eax
|
||||
LCALL(7,0)
|
||||
jb verror
|
||||
vforkok:
|
||||
testl %edx,%edx /* child process? */
|
||||
jnz child /* yes */
|
||||
jmp parent
|
||||
.globl _errno
|
||||
verror:
|
||||
jc err
|
||||
testl %edx,%edx /* %edx == 0 in parent, 1 in child */
|
||||
jz 1f
|
||||
xorl %eax,%eax
|
||||
1:
|
||||
jmp %ecx
|
||||
err:
|
||||
#ifdef PIC
|
||||
PIC_PROLOGUE
|
||||
movl PIC_GOT(_errno), %edx
|
||||
movl %eax,(%edx)
|
||||
movl PIC_GOT(_errno),%edx
|
||||
PIC_EPILOGUE
|
||||
movl %eax,(%edx)
|
||||
#else
|
||||
movl %eax,_errno
|
||||
#endif
|
||||
movl $-1,%eax
|
||||
jmp %ecx
|
||||
child:
|
||||
xorl %eax,%eax
|
||||
parent:
|
||||
jmp %ecx
|
||||
|
|
|
@ -34,57 +34,59 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)brk.s 5.2 (Berkeley) 12/17/90
|
||||
* $Id: brk.S,v 1.6 1994/01/27 04:30:34 mycroft Exp $
|
||||
* $Id: brk.S,v 1.7 1994/01/27 06:35:00 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: brk.S,v 1.6 1994/01/27 04:30:34 mycroft Exp $"
|
||||
.asciz "$Id: brk.S,v 1.7 1994/01/27 06:35:00 mycroft Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.globl curbrk
|
||||
.globl minbrk
|
||||
#if 0
|
||||
ENTRY(_brk)
|
||||
jmp ok
|
||||
#endif
|
||||
|
||||
ENTRY(brk)
|
||||
#ifdef PIC
|
||||
movl 4(%esp),%eax
|
||||
movl 4(%esp),%ecx
|
||||
PIC_PROLOGUE
|
||||
movl PIC_GOT(curbrk),%edx # set up GOT addressing
|
||||
movl PIC_GOT(minbrk),%ecx #
|
||||
cmpl %eax,(%ecx)
|
||||
movl PIC_GOT(minbrk),%edx
|
||||
PIC_EPILOGUE
|
||||
jl ok
|
||||
movl (%ecx),%eax
|
||||
movl %eax,4(%esp)
|
||||
ok:
|
||||
cmpl %ecx,(%edx)
|
||||
jl 1f
|
||||
movl (%edx),%ecx
|
||||
movl %ecx,4(%esp)
|
||||
1:
|
||||
movl $(SYS_break),%eax
|
||||
LCALL(7,0)
|
||||
jb err
|
||||
movl 4(%esp),%eax
|
||||
movl %eax,(%edx)
|
||||
jc err
|
||||
PIC_PROLOGUE
|
||||
movl PIC_GOT(curbrk),%edx # set up GOT addressing
|
||||
PIC_EPILOGUE
|
||||
xorl %eax,%eax
|
||||
movl %ecx,(%edx)
|
||||
ret
|
||||
err:
|
||||
jmp PIC_PLT(cerror)
|
||||
|
||||
#else
|
||||
|
||||
movl 4(%esp),%eax
|
||||
cmpl %eax,minbrk
|
||||
jl ok
|
||||
movl minbrk,%eax
|
||||
movl %eax,4(%esp)
|
||||
ok:
|
||||
movl 4(%esp),%ecx
|
||||
cmpl %ecx,minbrk
|
||||
jl 1f
|
||||
movl minbrk,%ecx
|
||||
movl %ecx,4(%esp)
|
||||
1:
|
||||
movl $(SYS_break),%eax
|
||||
LCALL(7,0)
|
||||
jb err
|
||||
movl 4(%esp),%eax
|
||||
movl %eax,curbrk
|
||||
jc err
|
||||
xorl %eax,%eax
|
||||
movl %ecx,curbrk
|
||||
ret
|
||||
err:
|
||||
jmp cerror
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)cerror.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: cerror.S,v 1.2 1993/10/21 02:19:27 jtc Exp $
|
||||
* $Id: cerror.S,v 1.3 1994/01/27 06:35:02 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: cerror.S,v 1.2 1993/10/21 02:19:27 jtc Exp $"
|
||||
.asciz "$Id: cerror.S,v 1.3 1994/01/27 06:35:02 mycroft Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
@ -49,8 +49,8 @@ cerror:
|
|||
#ifdef PIC
|
||||
PIC_PROLOGUE
|
||||
movl PIC_GOT(_errno),%ecx
|
||||
movl %eax,(%ecx)
|
||||
PIC_EPILOGUE
|
||||
movl %eax,(%ecx)
|
||||
#else
|
||||
movl %eax,_errno
|
||||
#endif
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)exect.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: exect.S,v 1.4 1994/01/27 04:14:53 mycroft Exp $
|
||||
* $Id: exect.S,v 1.5 1994/01/27 06:35:04 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: exect.S,v 1.4 1994/01/27 04:14:53 mycroft Exp $"
|
||||
.asciz "$Id: exect.S,v 1.5 1994/01/27 06:35:04 mycroft Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
@ -49,8 +49,12 @@ ENTRY(exect)
|
|||
movl $(SYS_execve),%eax
|
||||
pushf
|
||||
popl %edx
|
||||
orl $PSL_T,%edx
|
||||
orl $(PSL_T),%edx
|
||||
pushl %edx
|
||||
popf
|
||||
LCALL(7,0)
|
||||
#ifdef PIC
|
||||
jmp PIC_PLT(cerror) /* exect(file, argv, env); */
|
||||
#else
|
||||
jmp cerror
|
||||
#endif
|
||||
|
|
|
@ -34,29 +34,33 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)ptrace.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: ptrace.S,v 1.4 1994/01/27 04:14:56 mycroft Exp $
|
||||
* $Id: ptrace.S,v 1.5 1994/01/27 06:35:05 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: ptrace.S,v 1.4 1994/01/27 04:14:56 mycroft Exp $"
|
||||
.asciz "$Id: ptrace.S,v 1.5 1994/01/27 06:35:05 mycroft Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
ENTRY(ptrace)
|
||||
xorl %eax,%eax
|
||||
#ifdef PIC
|
||||
xorl %eax,%eax
|
||||
PIC_PROLOGUE
|
||||
movl PIC_GOT(_errno),%edx
|
||||
movl %eax,(%edx)
|
||||
PIC_EPILOGUE
|
||||
movl %eax,(%edx)
|
||||
#else
|
||||
movl %eax,_errno
|
||||
movl $0,_errno
|
||||
#endif
|
||||
movl $(SYS_ptrace),%eax
|
||||
LCALL(7,0)
|
||||
jb err
|
||||
jc err
|
||||
ret
|
||||
err:
|
||||
#ifdef PIC
|
||||
jmp PIC_PLT(cerror)
|
||||
#else
|
||||
jmp cerror
|
||||
#endif
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)sbrk.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: sbrk.S,v 1.4 1994/01/27 04:30:46 mycroft Exp $
|
||||
* $Id: sbrk.S,v 1.5 1994/01/27 06:35:07 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: sbrk.S,v 1.4 1994/01/27 04:30:46 mycroft Exp $"
|
||||
.asciz "$Id: sbrk.S,v 1.5 1994/01/27 06:35:07 mycroft Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
@ -58,17 +58,17 @@ ENTRY(sbrk)
|
|||
movl 4(%esp),%ecx
|
||||
PIC_PROLOGUE
|
||||
movl PIC_GOT(curbrk),%edx
|
||||
movl (%edx),%eax
|
||||
PIC_EPILOGUE
|
||||
movl (%edx),%eax
|
||||
addl %eax,4(%esp)
|
||||
movl $(SYS_break),%eax
|
||||
LCALL(7,0)
|
||||
jb err
|
||||
jc err
|
||||
PIC_PROLOGUE
|
||||
movl PIC_GOT(curbrk),%edx
|
||||
PIC_EPILOGUE
|
||||
movl (%edx),%eax
|
||||
addl %ecx,(%edx)
|
||||
PIC_EPILOGUE
|
||||
ret
|
||||
err:
|
||||
jmp PIC_PLT(cerror)
|
||||
|
@ -80,7 +80,7 @@ err:
|
|||
addl %eax,4(%esp)
|
||||
movl $(SYS_break),%eax
|
||||
LCALL(7,0)
|
||||
jb err
|
||||
jc err
|
||||
movl curbrk,%eax
|
||||
addl %ecx,curbrk
|
||||
ret
|
||||
|
|
|
@ -34,27 +34,25 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)setlogin.s 5.2 (Berkeley) 4/12/91
|
||||
* $Id: setlogin.S,v 1.4 1993/12/18 01:02:47 jtc Exp $
|
||||
* $Id: setlogin.S,v 1.5 1994/01/27 06:35:08 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: setlogin.S,v 1.4 1993/12/18 01:02:47 jtc Exp $"
|
||||
.asciz "$Id: setlogin.S,v 1.5 1994/01/27 06:35:08 mycroft Exp $"
|
||||
#endif
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.globl ___logname_valid /* in getlogin() */
|
||||
|
||||
.globl ___logname_valid /* in getlogin() */
|
||||
SYSCALL(setlogin)
|
||||
xorl %eax,%eax
|
||||
#ifdef PIC
|
||||
PIC_PROLOGUE
|
||||
pushl %eax
|
||||
movl PIC_GOT(___logname_valid),%eax
|
||||
movl $0,(%eax)
|
||||
popl %eax
|
||||
movl PIC_GOT(___logname_valid),%edx
|
||||
PIC_EPILOGUE
|
||||
movl %eax,(%edx)
|
||||
#else
|
||||
movl $0,___logname_valid
|
||||
movl %eax,___logname_valid
|
||||
#endif
|
||||
ret /* setlogin(name) */
|
||||
|
|
|
@ -34,19 +34,16 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)sigprocmask.s 5.2 (Berkeley) 12/17/90
|
||||
* $Id: sigprocmask.S,v 1.6 1994/01/27 04:10:22 mycroft Exp $
|
||||
* $Id: sigprocmask.S,v 1.7 1994/01/27 06:35:09 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: sigprocmask.S,v 1.6 1994/01/27 04:10:22 mycroft Exp $"
|
||||
.asciz "$Id: sigprocmask.S,v 1.7 1994/01/27 06:35:09 mycroft Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
err:
|
||||
jmp PIC_PLT(cerror)
|
||||
|
||||
ENTRY(sigprocmask)
|
||||
movl 8(%esp),%ecx # fetch new sigset pointer
|
||||
testl %ecx,%ecx # check new sigset pointer
|
||||
|
@ -58,7 +55,7 @@ ENTRY(sigprocmask)
|
|||
movl %ecx,8(%esp) # to new mask arg
|
||||
2: movl $(SYS_sigprocmask),%eax
|
||||
LCALL(0x7,0)
|
||||
jb err
|
||||
jc err
|
||||
movl 12(%esp),%ecx # fetch old mask requested
|
||||
testl %ecx,%ecx # test if old mask requested
|
||||
jz out
|
||||
|
@ -66,3 +63,9 @@ ENTRY(sigprocmask)
|
|||
out:
|
||||
xorl %eax,%eax
|
||||
ret
|
||||
err:
|
||||
#ifdef PIC
|
||||
jmp PIC_PLT(cerror)
|
||||
#else
|
||||
jmp cerror
|
||||
#endif
|
||||
|
|
|
@ -34,25 +34,28 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)sigsuspend.s 5.2 (Berkeley) 12/17/90
|
||||
* $Id: sigsuspend.S,v 1.4 1994/01/27 04:10:23 mycroft Exp $
|
||||
* $Id: sigsuspend.S,v 1.5 1994/01/27 06:35:11 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: sigsuspend.S,v 1.4 1994/01/27 04:10:23 mycroft Exp $"
|
||||
.asciz "$Id: sigsuspend.S,v 1.5 1994/01/27 06:35:11 mycroft Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
err:
|
||||
jmp PIC_PLT(cerror)
|
||||
|
||||
ENTRY(sigsuspend)
|
||||
movl 4(%esp),%eax # fetch mask arg
|
||||
movl (%eax),%eax # indirect to mask arg
|
||||
movl %eax,4(%esp)
|
||||
movl $(SYS_sigsuspend),%eax
|
||||
LCALL(0x7,0)
|
||||
jb err
|
||||
jc err
|
||||
xorl %eax,%eax # shouldn t happen
|
||||
ret
|
||||
err:
|
||||
#ifdef PIC
|
||||
jmp PIC_PLT(cerror)
|
||||
#else
|
||||
jmp cerror
|
||||
#endif
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)syscall.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: syscall.S,v 1.3 1993/12/06 23:28:12 pk Exp $
|
||||
* $Id: syscall.S,v 1.4 1994/01/27 06:35:12 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: syscall.S,v 1.3 1993/12/06 23:28:12 pk Exp $"
|
||||
.asciz "$Id: syscall.S,v 1.4 1994/01/27 06:35:12 mycroft Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
@ -50,7 +50,11 @@ ENTRY(syscall)
|
|||
push %ecx
|
||||
LCALL(7,0)
|
||||
push %ecx /* Keep stack frame consistant */
|
||||
jb 1f
|
||||
jc err
|
||||
ret
|
||||
1:
|
||||
err:
|
||||
#ifdef PIC
|
||||
jmp PIC_PLT(cerror)
|
||||
#else
|
||||
jmp cerror
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue