1*eb9395f8Suwe/* $NetBSD: compat_Ovfork.S,v 1.1 2005/10/15 22:11:22 uwe Exp $ */ 2*eb9395f8Suwe 3*eb9395f8Suwe/* 4*eb9395f8Suwe * Copyright (c) 1992, 1993 5*eb9395f8Suwe * The Regents of the University of California. All rights reserved. 6*eb9395f8Suwe * 7*eb9395f8Suwe * This software was developed by the Computer Systems Engineering group 8*eb9395f8Suwe * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 9*eb9395f8Suwe * contributed to Berkeley. 10*eb9395f8Suwe * 11*eb9395f8Suwe * Redistribution and use in source and binary forms, with or without 12*eb9395f8Suwe * modification, are permitted provided that the following conditions 13*eb9395f8Suwe * are met: 14*eb9395f8Suwe * 1. Redistributions of source code must retain the above copyright 15*eb9395f8Suwe * notice, this list of conditions and the following disclaimer. 16*eb9395f8Suwe * 2. Redistributions in binary form must reproduce the above copyright 17*eb9395f8Suwe * notice, this list of conditions and the following disclaimer in the 18*eb9395f8Suwe * documentation and/or other materials provided with the distribution. 19*eb9395f8Suwe * 3. Neither the name of the University nor the names of its contributors 20*eb9395f8Suwe * may be used to endorse or promote products derived from this software 21*eb9395f8Suwe * without specific prior written permission. 22*eb9395f8Suwe * 23*eb9395f8Suwe * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24*eb9395f8Suwe * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25*eb9395f8Suwe * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26*eb9395f8Suwe * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27*eb9395f8Suwe * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28*eb9395f8Suwe * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29*eb9395f8Suwe * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30*eb9395f8Suwe * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31*eb9395f8Suwe * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32*eb9395f8Suwe * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33*eb9395f8Suwe * SUCH DAMAGE. 34*eb9395f8Suwe * 35*eb9395f8Suwe * from: Header: Ovfork.s,v 1.1 91/07/06 13:05:56 torek Exp 36*eb9395f8Suwe */ 37*eb9395f8Suwe 38*eb9395f8Suwe#include <machine/asm.h> 39*eb9395f8Suwe#if defined(SYSLIBC_SCCS) && !defined(lint) 40*eb9395f8Suwe#if 0 41*eb9395f8Suwe .asciz "@(#)Ovfork.s 8.1 (Berkeley) 6/4/93" 42*eb9395f8Suwe#else 43*eb9395f8Suwe RCSID("$NetBSD: compat_Ovfork.S,v 1.1 2005/10/15 22:11:22 uwe Exp $") 44*eb9395f8Suwe#endif 45*eb9395f8Suwe#endif /* SYSLIBC_SCCS and not lint */ 46*eb9395f8Suwe 47*eb9395f8Suwe/* 48*eb9395f8Suwe * pid = vfork(); 49*eb9395f8Suwe * 50*eb9395f8Suwe * %o1 == 0 in parent process, 1 in child process. 51*eb9395f8Suwe * %o0 == pid of child in parent, pid of parent in child. 52*eb9395f8Suwe */ 53*eb9395f8Suwe 54*eb9395f8Suwe#include "SYS.h" 55*eb9395f8Suwe 56*eb9395f8SuweWARN_REFERENCES(vfork, \ 57*eb9395f8Suwe "warning: reference to compatibility vfork(); include <unistd.h> for correct reference") 58*eb9395f8Suwe 59*eb9395f8SuweSYSCALL(vfork) 60*eb9395f8Suwe dec %o1 ! from 1 to 0 in child, 0 to -1 in parent 61*eb9395f8Suwe retl 62*eb9395f8Suwe and %o0, %o1, %o0 ! return 0 in child, pid in parent 63