Use A1 to save the return address, since A0 is no longer preserved across
system calls.
This commit is contained in:
parent
4cc90c99f2
commit
c762ba1426
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: Ovfork.S,v 1.11 1999/10/25 23:48:16 thorpej Exp $ */
|
||||
/* $NetBSD: Ovfork.S,v 1.12 2000/12/07 14:13:43 scw Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)Ovfork.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: Ovfork.S,v 1.11 1999/10/25 23:48:16 thorpej Exp $")
|
||||
RCSID("$NetBSD: Ovfork.S,v 1.12 2000/12/07 14:13:43 scw Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -67,17 +67,17 @@ WARN_REFERENCES(vfork, \
|
||||
*/
|
||||
|
||||
ENTRY(vfork)
|
||||
movl %sp@+,%a0
|
||||
movl %sp@+,%a1
|
||||
movl #SYS_vfork,%d0
|
||||
trap #0
|
||||
jcs err
|
||||
subql #1,%d1 /* from 1 to 0 in child, 0 to -1 in parent */
|
||||
andl %d1,%d0
|
||||
jmp %a0@
|
||||
jmp %a1@
|
||||
err:
|
||||
#ifdef _REENTRANT
|
||||
.globl _C_LABEL(__errno)
|
||||
movl %a0,%sp@-
|
||||
movl %a1,%sp@-
|
||||
movl %d0,%sp@-
|
||||
#if defined(PIC) && !defined(__ELF__)
|
||||
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),%a1
|
||||
@ -93,22 +93,22 @@ err:
|
||||
movl %d0,%a1
|
||||
movl %sp@+,%a1@
|
||||
#endif /* __SVR4_ABI__ */
|
||||
movl %sp@+,%a0
|
||||
movl %sp@+,%a1
|
||||
#else
|
||||
.globl _C_LABEL(errno)
|
||||
#ifdef PIC
|
||||
#ifdef __ELF__
|
||||
lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),%a1
|
||||
movl %a1@(_C_LABEL(errno)@GOT:w),%a1
|
||||
lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),%a0
|
||||
movl %a0@(_C_LABEL(errno)@GOT:w),%a0
|
||||
#else
|
||||
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),%a1
|
||||
lea %pc@(0,a1:l),%a1
|
||||
movl %a1@(_C_LABEL(errno):w),%a1
|
||||
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),%a0
|
||||
lea %pc@(0,a0:l),%a0
|
||||
movl %a0@(_C_LABEL(errno):w),%a0
|
||||
#endif
|
||||
movl %d0,%a1@
|
||||
movl %d0,%a0@
|
||||
#else
|
||||
movl %d0,_C_LABEL(errno)
|
||||
#endif /* PIC */
|
||||
#endif /* _REENTRANT */
|
||||
moveq #-1,%d0
|
||||
jmp %a0@
|
||||
jmp %a1@
|
||||
|
Loading…
Reference in New Issue
Block a user