1*787e823fSmatt/* $NetBSD: execle.S,v 1.5 2011/01/25 02:38:15 matt Exp $ */ 2d6a6aa87Sragge/* 3d6a6aa87Sragge * Copyright (c) 2001 Ludd, University of Lule}, Sweden. All rights reserved. 4d6a6aa87Sragge * 5d6a6aa87Sragge * Redistribution and use in source and binary forms, with or without 6d6a6aa87Sragge * modification, are permitted provided that the following conditions 7d6a6aa87Sragge * are met: 8d6a6aa87Sragge * 1. Redistributions of source code must retain the above copyright 9d6a6aa87Sragge * notice, this list of conditions and the following disclaimer. 10d6a6aa87Sragge * 2. Redistributions in binary form must reproduce the above copyright 11d6a6aa87Sragge * notice, this list of conditions and the following disclaimer in the 12d6a6aa87Sragge * documentation and/or other materials provided with the distribution. 13d6a6aa87Sragge * 3. All advertising materials mentioning features or use of this software 14d6a6aa87Sragge * must display the following acknowledgement: 15d6a6aa87Sragge * This product includes software developed at Ludd, University of 16d6a6aa87Sragge * Lule}, Sweden and its contributors. 17d6a6aa87Sragge * 4. The name of the author may not be used to endorse or promote products 18d6a6aa87Sragge * derived from this software without specific prior written permission 19d6a6aa87Sragge * 20d6a6aa87Sragge * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21d6a6aa87Sragge * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22d6a6aa87Sragge * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23d6a6aa87Sragge * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24d6a6aa87Sragge * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25d6a6aa87Sragge * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26d6a6aa87Sragge * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27d6a6aa87Sragge * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28d6a6aa87Sragge * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29d6a6aa87Sragge * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30d6a6aa87Sragge */ 31d6a6aa87Sragge 32d6a6aa87Sragge#include "SYS.h" 33d6a6aa87Sragge 34*787e823fSmatt#ifdef SYSLIBC_SCCS 35*787e823fSmattRCSID("$NetBSD: execle.S,v 1.5 2011/01/25 02:38:15 matt Exp $") 36*787e823fSmatt#endif 37*787e823fSmatt 380303d5baSragge#ifdef WEAK_ALIAS 390303d5baSraggeWEAK_ALIAS(execle, _execle) 400303d5baSragge#endif 410303d5baSragge 420303d5baSraggeENTRY(_execle, 0) 430ce5ca14Smatt movl (%ap),%r0 # Get number of args 440ce5ca14Smatt pushl (%ap)[%r0] # Push last arg (envp) 450ce5ca14Smatt pushal 8(%ap) # Push pointer to argv vector 460ce5ca14Smatt pushl 4(%ap) # Push path 47d6a6aa87Sragge calls $3,_C_LABEL(execve) 48d6a6aa87Sragge ret 49*787e823fSmattEND(_execle) 50