1: /* 2: * Copyright (c) 1987 Regents of the University of California. 3: * All rights reserved. The Berkeley software License Agreement 4: * specifies the terms and conditions for redistribution. 5: */ 6: 7: #ifdef SYSLIBC_SCCS 8: _sccsid: <@(#)execl.s 2.6 (2.11BSD GTE) 1995/05/08\0> 9: .even 10: #endif SYSLIBC_SCCS 11: 12: /* 13: * XXX - this routine can't use SYSCALL!!! 14: */ 15: #include "SYS.h" 16: 17: .globl _environ 18: 19: ENTRY(execl) 20: mov _environ,-(sp) / pass default environment 21: mov sp,r0 / calculate and pass address of first argv 22: add $6.,r0 / element (can't use "mov sp,-(sp)") 23: mov r0,-(sp) 24: mov 6(sp),-(sp) / pass the name 25: tst -(sp) / simulate return address stack spacing 26: SYS(execve) / and go for it ... / / trap 59 -> [kernel] -> syscall() -> via sysent[] -> handler: execve / 27: add $8.,sp / if we get back it's an error 28: jmp x_error