1*83762a71Sderaadt/* $OpenBSD: Ovfork.S,v 1.16 2023/12/10 16:45:51 deraadt Exp $ */ 20bda0189Smickey 30bda0189Smickey/* 4361d719bSmickey * Copyright (c) 1999,2002 Michael Shalayeff 50bda0189Smickey * All rights reserved. 60bda0189Smickey * 70bda0189Smickey * Redistribution and use in source and binary forms, with or without 80bda0189Smickey * modification, are permitted provided that the following conditions 90bda0189Smickey * are met: 100bda0189Smickey * 1. Redistributions of source code must retain the above copyright 110bda0189Smickey * notice, this list of conditions and the following disclaimer. 120bda0189Smickey * 2. Redistributions in binary form must reproduce the above copyright 130bda0189Smickey * notice, this list of conditions and the following disclaimer in the 140bda0189Smickey * documentation and/or other materials provided with the distribution. 150bda0189Smickey * 160bda0189Smickey * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 170bda0189Smickey * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 180bda0189Smickey * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 190bda0189Smickey * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, 200bda0189Smickey * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 210bda0189Smickey * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 220bda0189Smickey * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 230bda0189Smickey * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 240bda0189Smickey * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 250bda0189Smickey * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 260bda0189Smickey * THE POSSIBILITY OF SUCH DAMAGE. 270bda0189Smickey */ 280bda0189Smickey 29c9d8341bSmickey#include "SYS.h" 30c9d8341bSmickey 31fe38b55cSguentherSYSENTRY_HIDDEN(vfork) 32361d719bSmickey .import errno, data 33361d719bSmickey copy rp, t4 34361d719bSmickey ldil L%SYSCALLGATE, r1 35*83762a71Sderaadt99: ble 4(sr7, r1) 36*83762a71Sderaadt PINSYSCALL(__CONCAT(SYS_,vfork), 99b) 37361d719bSmickey ldi __CONCAT(SYS_,vfork), t1 38fe38b55cSguenther comb,= r0, t1, 1f 39361d719bSmickey copy t4, rp 40fe38b55cSguenther /* set errno */ 41fe38b55cSguenther mfctl cr27, r1 42fe38b55cSguenther stw t1, TCB_OFFSET_ERRNO(r1) 43fe38b55cSguenther ldi -1, ret0 44fe38b55cSguenther1: bv r0(rp) 4526e1ecc8Sguenther nop 46fe38b55cSguentherSYSEXIT_HIDDEN(vfork) 47c9d8341bSmickey 48c9d8341bSmickey .end 49