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