]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re-core/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/i960/crt0.S
Update
[l4.git] / l4 / pkg / l4re-core / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / i960 / crt0.S
1 #
2 # crt0.S, part of the i960 support for the uClibc library.
3 #
4 # Copyright (C) 2002 by Okiok Data Ltd.  http://www.okiok.com/
5 #
6 # This program is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU Library General Public License as published by the Free
8 # Software Foundation; either version 2 of the License, or (at your option) any
9 # later version.
10 #
11 # This program is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
14 # details.
15 #
16 # You should have received a copy of the GNU Library General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #
19
20 /*
21  *
22  * The behavior in this file is tightly coupled with how the linux kernel sets things up
23  * on the stack before calling us.
24  *
25  * Currently fs/binfmt_flat.c (for STACK_GROWS_UP) and arch/i960/kernel/process.c
26  * build things so that a pointer to argc is left in g13 by start_thread().
27  *
28  * ^
29  * |                        <- sp somewhere around here, after being aligned.
30  * |
31  * |envp    -> envp[0]
32  * |argv    -> argv[0]
33  * |argc                    <- g13
34  *
35  * A complete picture of how things are set up can be seen in the comments of
36  * create_flat_tables_stack_grows_up in fs/binfmt_flat.c
37  *
38  * I believe having to use this register could probably be avoided.
39  *
40  */
41
42         .globl  start
43 start:
44         mov     g13, r3
45         ldt     (r3), g0
46         callx   ___uClibc_main
47
48 /* We might want to add some instruction so that it crashes if main returns */
49
50 /* Define a symbol for the first piece of initialized data.  */
51         .data
52         .globl __data_start
53 __data_start:
54         .long 0
55         .weak data_start
56         data_start = __data_start
57