__vfork14.S revision 1.1
11.1Sthorpej/*	$NetBSD: __vfork14.S,v 1.1 1998/01/04 20:58:11 thorpej Exp $	*/
21.1Sthorpej
31.1Sthorpej/*-
41.1Sthorpej * Copyright (c) 1991, 1993
51.1Sthorpej *	The Regents of the University of California.  All rights reserved.
61.1Sthorpej *
71.1Sthorpej * This code is derived from software contributed to Berkeley by
81.1Sthorpej * Ralph Campbell.
91.1Sthorpej *
101.1Sthorpej * Redistribution and use in source and binary forms, with or without
111.1Sthorpej * modification, are permitted provided that the following conditions
121.1Sthorpej * are met:
131.1Sthorpej * 1. Redistributions of source code must retain the above copyright
141.1Sthorpej *    notice, this list of conditions and the following disclaimer.
151.1Sthorpej * 2. Redistributions in binary form must reproduce the above copyright
161.1Sthorpej *    notice, this list of conditions and the following disclaimer in the
171.1Sthorpej *    documentation and/or other materials provided with the distribution.
181.1Sthorpej * 3. All advertising materials mentioning features or use of this software
191.1Sthorpej *    must display the following acknowledgement:
201.1Sthorpej *	This product includes software developed by the University of
211.1Sthorpej *	California, Berkeley and its contributors.
221.1Sthorpej * 4. Neither the name of the University nor the names of its contributors
231.1Sthorpej *    may be used to endorse or promote products derived from this software
241.1Sthorpej *    without specific prior written permission.
251.1Sthorpej *
261.1Sthorpej * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
271.1Sthorpej * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
281.1Sthorpej * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
291.1Sthorpej * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
301.1Sthorpej * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
311.1Sthorpej * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
321.1Sthorpej * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
331.1Sthorpej * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
341.1Sthorpej * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
351.1Sthorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
361.1Sthorpej * SUCH DAMAGE.
371.1Sthorpej */
381.1Sthorpej
391.1Sthorpej#include "SYS.h"
401.1Sthorpej
411.1Sthorpej#if defined(LIBC_SCCS) && !defined(lint)
421.1Sthorpej	ASMSTR("from: @(#)Ovfork.s	8.1 (Berkeley) 6/4/93")
431.1Sthorpej	ASMSTR("$NetBSD: __vfork14.S,v 1.1 1998/01/04 20:58:11 thorpej Exp $")
441.1Sthorpej#endif /* LIBC_SCCS and not lint */
451.1Sthorpej
461.1Sthorpej#ifdef ABICALLS
471.1Sthorpej	.abicalls
481.1Sthorpej#endif
491.1Sthorpej
501.1Sthorpej/*
511.1Sthorpej * pid = vfork();
521.1Sthorpej *
531.1Sthorpej * v1 == 0 in parent process, v1 == 1 in child process.
541.1Sthorpej * v0 == pid of child in parent, v0 == pid of parent in child.
551.1Sthorpej */
561.1Sthorpej
571.1SthorpejLEAF(__vfork14)
581.1Sthorpej#ifdef ABICALLS
591.1Sthorpej	.set	noreorder
601.1Sthorpej	.cpload	t9
611.1Sthorpej	.set	reorder
621.1Sthorpej#endif
631.1Sthorpej	li	v0, SYS___vfork14	# system call number for vfork
641.1Sthorpej	syscall
651.1Sthorpej	beq	a3, zero, 1f		# jump if no errors
661.1Sthorpej	la	t9, cerror
671.1Sthorpej	jr	t9
681.1Sthorpej1:
691.1Sthorpej	beq	v1, zero, 2f		# parent process ?
701.1Sthorpej	move	v0, zero		# return zero in child
711.1Sthorpej2:
721.1Sthorpej	j	ra
731.1SthorpejEND(__vfork14)
74