1281197Sandrew/*-
2281197Sandrew * Copyright (c) 2014 Andrew Turner
3281197Sandrew * All rights reserved.
4281197Sandrew *
5281197Sandrew * Redistribution and use in source and binary forms, with or without
6281197Sandrew * modification, are permitted provided that the following conditions
7281197Sandrew * are met:
8281197Sandrew * 1. Redistributions of source code must retain the above copyright
9281197Sandrew *    notice, this list of conditions and the following disclaimer.
10281197Sandrew * 2. Redistributions in binary form must reproduce the above copyright
11281197Sandrew *    notice, this list of conditions and the following disclaimer in the
12281197Sandrew *    documentation and/or other materials provided with the distribution.
13281197Sandrew *
14281197Sandrew * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15281197Sandrew * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16281197Sandrew * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17281197Sandrew * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18281197Sandrew * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19281197Sandrew * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20281197Sandrew * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21281197Sandrew * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22281197Sandrew * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23281197Sandrew * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24281197Sandrew * SUCH DAMAGE.
25281197Sandrew *
26281197Sandrew */
27281197Sandrew
28281197Sandrew#include <machine/asm.h>
29281197Sandrew__FBSDID("$FreeBSD: releng/11.0/lib/libc/aarch64/sys/vfork.S 281197 2015-04-07 09:52:14Z andrew $");
30281197Sandrew#include "SYS.h"
31281197Sandrew
32281197SandrewENTRY(__sys_vfork)
33281197Sandrew	WEAK_REFERENCE(__sys_vfork, vfork)
34281197Sandrew	WEAK_REFERENCE(__sys_vfork, _vfork)
35281197Sandrew	mov	x2, lr
36281197Sandrew	_SYSCALL(vfork)
37281197Sandrew	b.cs	cerror
38281197Sandrew	sub	x1, x1, #1
39281197Sandrew	and	x0, x0, x1
40281197Sandrew	mov	lr, x2
41281197Sandrew	ret
42281197SandrewEND(__sys_vfork)
43