xref: /openbsd-src/lib/libc/arch/riscv64/sys/Ovfork.S (revision 7ecb72fe0d4a784959d47a5dd7c81ac725e35700)
1*7ecb72feSdrahn/*	$OpenBSD: Ovfork.S,v 1.1 2021/04/29 18:33:36 drahn Exp $	*/
2*7ecb72feSdrahn/*
3*7ecb72feSdrahn * Copyright (c) 2020 Brian Bamsch <bbamsch@google.com>
4*7ecb72feSdrahn * All rights reserved.
5*7ecb72feSdrahn *
6*7ecb72feSdrahn * Redistribution and use in source and binary forms, with or without
7*7ecb72feSdrahn * modification, are permitted provided that the following conditions
8*7ecb72feSdrahn * are met:
9*7ecb72feSdrahn * 1. Redistributions of source code must retain the above copyright
10*7ecb72feSdrahn *    notice, this list of conditions and the following disclaimer.
11*7ecb72feSdrahn * 2. Redistributions in binary form must reproduce the above copyright
12*7ecb72feSdrahn *    notice, this list of conditions and the following disclaimer in the
13*7ecb72feSdrahn *    documentation and/or other materials provided with the distribution.
14*7ecb72feSdrahn * 3. Neither the name of the copyright holder nor the names of contributors
15*7ecb72feSdrahn *    may be used to endorse or promote products derived from this software
16*7ecb72feSdrahn *    without specific prior written permission.
17*7ecb72feSdrahn *
18*7ecb72feSdrahn * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
19*7ecb72feSdrahn * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*7ecb72feSdrahn * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*7ecb72feSdrahn * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
22*7ecb72feSdrahn * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*7ecb72feSdrahn * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*7ecb72feSdrahn * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*7ecb72feSdrahn * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*7ecb72feSdrahn * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*7ecb72feSdrahn * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*7ecb72feSdrahn * SUCH DAMAGE.
29*7ecb72feSdrahn */
30*7ecb72feSdrahn
31*7ecb72feSdrahn#include "SYS.h"
32*7ecb72feSdrahn
33*7ecb72feSdrahnSYSENTRY_HIDDEN(vfork)
34*7ecb72feSdrahn	RETGUARD_SETUP(vfork, t6)
35*7ecb72feSdrahn	mv	a2, ra
36*7ecb72feSdrahn	SYSTRAP(vfork)
37*7ecb72feSdrahn	HANDLE_ERROR()
38*7ecb72feSdrahn	mv	ra, a2
39*7ecb72feSdrahn	RETGUARD_CHECK(vfork, t6)
40*7ecb72feSdrahn	ret
41*7ecb72feSdrahnSYSCALL_END_HIDDEN(vfork)
42