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	xor	%rbp,%rbp
26
27	pop	%rdi
28	mov	%rsp, %rsi
29
30	/* Jump into C code (init backends, call constructors, call main). */
31	call	__main
32
33	/* We should never get here since l4env_startup() does not return */
341:	int	$3
35	jmp	2f
36	.ascii	"__main() returned."
372:	jmp	1b
38
39
40/*--- .ctors (array of pointers to constructors) ---*/
41	.section .ctors,"a",@progbits
42	.p2align(2)
43ctors:
44
45
46/*--- .dtors (array of pointers to destructors) ----*/
47	.section .dtors,"a",@progbits
48	.p2align(2)
49dtors:
50
51
52/*--- .anno (annoations used by OSKit) --------------*/
53	.section .anno,"aw",@progbits
54	.p2align(4)
55	.globl	__ANNO_START__
56__ANNO_START__:
57
58
59/*--- .data (initialized data) ---------------------*/
60	.data
61
62	.globl	__dso_handle
63__dso_handle:
64	.long	0
65
66
67/*--- .eh_frame (exception frames) -----------------*/
68	.section .eh_frame,"a"
69	.globl	__EH_FRAME_BEGIN__
70__EH_FRAME_BEGIN__:
71
72