exect.S revision 285830
1223695Sdfr/*-
2223695Sdfr * Copyright (c) 2002 Peter Grehan.
3223695Sdfr * All rights reserved.
4223695Sdfr *
5223695Sdfr * Redistribution and use in source and binary forms, with or without
6223695Sdfr * modification, are permitted provided that the following conditions
7223695Sdfr * are met:
8223695Sdfr * 1. Redistributions of source code must retain the above copyright
9223695Sdfr *    notice, this list of conditions and the following disclaimer.
10223695Sdfr * 2. Redistributions in binary form must reproduce the above copyright
11223695Sdfr *    notice, this list of conditions and the following disclaimer in the
12223695Sdfr *    documentation and/or other materials provided with the distribution.
13223695Sdfr *
14223695Sdfr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15223695Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16223695Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17223695Sdfr * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18223695Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19223695Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20223695Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21223695Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22223695Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23223695Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24223695Sdfr * SUCH DAMAGE.
25223695Sdfr */
26223695Sdfr/*      $NetBSD: exect.S,v 1.3 1998/05/25 15:28:03 ws Exp $     */
27223695Sdfr
28223695Sdfr#include <machine/asm.h>
29223695Sdfr__FBSDID("$FreeBSD: releng/10.2/lib/libc/powerpc64/sys/exect.S 218824 2011-02-18 21:44:53Z nwhitehorn $");
30223695Sdfr
31223695Sdfr#include "SYS.h"
32223695Sdfr
33223695SdfrENTRY(exect)
34223695Sdfr	li	%r0,SYS_execve
35223695Sdfr	sc
36223695Sdfr	bso	1f
37223695Sdfr	blr
38223695Sdfr1:
39223695Sdfr	mflr	%r0
40223695Sdfr	std	%r0,16(%r1)
41223695Sdfr	stdu	%r1,-48(%r1)
42223695Sdfr	bl	HIDENAME(cerror)
43223695Sdfr	nop
44223695Sdfr	ld	%r1,0(%r1)
45223695Sdfr	ld	%r0,16(%r1)
46223695Sdfr	mtlr	%r0
47223695Sdfr	blr
48223695Sdfr
49223695Sdfr	.section .note.GNU-stack,"",%progbits
50223695Sdfr