1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* 23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ident "%Z%%M% %I% %E% SMI" 28 29 #include <sys/asm_linkage.h> 30 31 #if defined(lint) 32 33 void 34 _start(void) 35 { 36 } 37 38 #else /* lint */ 39 40 /* 41 * C language startup routine for the lx brand shared library. 42 */ 43 ENTRY_NP(_start) 44 pushl $0 / Build a stack frame. retpc = NULL 45 pushl $0 / fp = NULL 46 movl %esp, %ebp / first stack frame 47 48 /* 49 * Calculate the location of the envp array by adding the size of 50 * the argv array to the start of the argv array. 51 */ 52 movl 8(%ebp), %eax / argc in %eax 53 leal 16(%ebp,%eax,4), %edx / envp in %edx 54 andl $-16, %esp 55 pushl %edx / push envp 56 leal 12(%ebp),%edx / compute &argv[0] 57 pushl %edx / push argv 58 pushl %eax / push argc 59 call lx_init 60 /* 61 * lx_init will never return. 62 */ 63 SET_SIZE(_start) 64 65 #endif /* lint */