1657b1f3dSraf/* 2657b1f3dSraf * CDDL HEADER START 3657b1f3dSraf * 4657b1f3dSraf * The contents of this file are subject to the terms of the 5657b1f3dSraf * Common Development and Distribution License (the "License"). 6657b1f3dSraf * You may not use this file except in compliance with the License. 7657b1f3dSraf * 8657b1f3dSraf * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9657b1f3dSraf * or http://www.opensolaris.org/os/licensing. 10657b1f3dSraf * See the License for the specific language governing permissions 11657b1f3dSraf * and limitations under the License. 12657b1f3dSraf * 13657b1f3dSraf * When distributing Covered Code, include this CDDL HEADER in each 14657b1f3dSraf * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15657b1f3dSraf * If applicable, add the following below this CDDL HEADER, with the 16657b1f3dSraf * fields enclosed by brackets "[]" replaced with your own identifying 17657b1f3dSraf * information: Portions Copyright [yyyy] [name of copyright owner] 18657b1f3dSraf * 19657b1f3dSraf * CDDL HEADER END 20657b1f3dSraf */ 21657b1f3dSraf 22657b1f3dSraf/* Copyright (c) 1988 AT&T */ 23657b1f3dSraf/* All Rights Reserved */ 24657b1f3dSraf 25657b1f3dSraf/* 26657b1f3dSraf * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 27657b1f3dSraf * Use is subject to license terms. 28657b1f3dSraf */ 29657b1f3dSraf 30*9a70fc3bSMark J. Nelson .file "forkallx.s" 31657b1f3dSraf 32657b1f3dSraf#include "SYS.h" 33657b1f3dSraf 34657b1f3dSraf/* 35657b1f3dSraf * pid = __forkallx(flags); 36657b1f3dSraf * 37657b1f3dSraf * syscall trap: forksys(1, flags) 38657b1f3dSraf * 39657b1f3dSraf * From the syscall: 40657b1f3dSraf * %o1 == 0 in parent process, %o1 == 1 in child process. 41657b1f3dSraf * %o0 == pid of child in parent, %o0 == pid of parent in child. 42657b1f3dSraf * 43657b1f3dSraf * The child gets a zero return value. 44657b1f3dSraf * The parent gets the pid of the child. 45657b1f3dSraf */ 46657b1f3dSraf 47657b1f3dSraf ENTRY(__forkallx) 48657b1f3dSraf mov %o0, %o1 49657b1f3dSraf mov 1, %o0 50657b1f3dSraf SYSTRAP_2RVALS(forksys) 51657b1f3dSraf SYSCERROR 52657b1f3dSraf movrnz %o1, 0, %o0 53657b1f3dSraf RET 54657b1f3dSraf SET_SIZE(__forkallx) 55