1/*!
2 * \file	crt0_l4env_freebsd.S
3 * \brief	Startup code for L4env applications for l4env_freebsd mode
4 *
5 * \date	06/03/2003
6 * \author	Frank Mehnert <fm3@os.inf.tu-dresden.de> */
7
8/*
9 * (c) 2003-2009 Author(s)
10 *     economic rights: Technische Universität Dresden (Germany)
11 * This file is part of TUD:OS and distributed under the terms of the
12 * GNU Lesser General Public License 2.1.
13 * Please see the COPYING-LGPL-2.1 file for details.
14 */
15
16#define __ASSEMBLY__
17#include <l4/sys/compiler.h>
18
19/*--- .text (program code) -------------------------*/
20	.text
21
22	.globl	_start
23_start:
24	/* Clear the base pointer so that stack backtraces will work.  */
25	xorl	%ebp,%ebp
26
27	pop	%eax
28	push    %esp
29	push    %eax
30
31	/* Jump into C code (init backends, call constructors, call main). */
32	call	__main
33
34	/* We should never get here since l4env_startup() does not return */
351:	int	$3
36	jmp	2f
37	.ascii	"__main() returned."
382:	jmp	1b
39
40
41/*--- .ctors (array of pointers to constructors) ---*/
42	.section .ctors,"a",@progbits
43	.p2align(2)
44ctors:
45
46
47/*--- .dtors (array of pointers to destructors) ----*/
48	.section .dtors,"a",@progbits
49	.p2align(2)
50dtors:
51
52
53/*--- .anno (annoations used by OSKit) --------------*/
54	.section .anno,"aw",@progbits
55	.p2align(4)
56	.globl	__ANNO_START__
57__ANNO_START__:
58
59
60/*--- .data (initialized data) ---------------------*/
61	.data
62
63	.globl	__dso_handle
64__dso_handle:
65	.long	0
66
67
68/*--- .eh_frame (exception frames) -----------------*/
69	.section .eh_frame,"a"
70	.globl	__EH_FRAME_BEGIN__
71__EH_FRAME_BEGIN__:
72
73