1 /* $MirOS: src/lib/csu/common_elf/common.h,v 1.7 2009/08/30 18:02:08 tg Exp $
2  * derived from the following files:
3  * $NetBSD: common.h,v 1.10 2004/08/26 20:57:47 thorpej Exp $
4  */
5 
6 /*
7  * Copyright (c) 2003, 2004, 2005
8  *	Thorsten "mirabilos" Glaser <tg@MirBSD.de>
9  * Copyright (c) 1995 Christopher G. Demetriou
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  * 3. All advertising materials mentioning features or use of this software
21  *    must display the following acknowledgement:
22  *          This product includes software developed for the
23  *          NetBSD Project.  See http://www.NetBSD.org/ for
24  *          information about NetBSD.
25  * 4. The name of the author may not be used to endorse or promote products
26  *    derived from this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
29  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
30  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
31  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
32  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
33  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
37  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38  *
39  * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
40  */
41 
42 #ifndef	_COMMON_H
43 #define	_COMMON_H
44 
45 #include <sys/param.h>
46 #include <sys/exec.h>
47 #include <sys/syscall.h>
48 #include <stdlib.h>
49 
50 __RCSID("$MirOS: src/lib/csu/common_elf/common.h,v 1.7 2009/08/30 18:02:08 tg Exp $");
51 
52 typedef void Obj_Entry;
53 
54 extern char *__progname;
55 extern char **environ;
56 
57 extern void _init(void);
58 extern void _fini(void);
59 static char *_strrchr(char *, int);
60 
61 #ifdef MCRT0
62 extern void monstartup(u_long, u_long);
63 extern void _mcleanup(void);
64 extern unsigned char _etext, _eprol;
65 #endif
66 
67 __dead void ___start(int argc, char **argv, char **envp,
68     void (*cleanup) (void), const Obj_Entry *obj,
69     struct ps_strings *ps_strings);
70 int main(int argc, char **argv, char **envp);
71 
72 #endif
73