OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [linux/] [uClibc/] [libc/] [sysdeps/] [linux/] [sparc/] [crt0.c] - Blame information for rev 1765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/* vi: set sw=4 ts=4: */
2
/* uClibc/sysdeps/linux/i386/crt0.S
3
 * Pull stuff off the stack and get uClibc moving.
4
 *
5
 * Copyright (C) 2000,2001 by Erik Andersen <andersen@uclibc.org>
6
 *
7
 * This program is free software; you can redistribute it and/or modify it
8
 * under the terms of the GNU Library General Public License as published by
9
 * the Free Software Foundation; either version 2 of the License, or (at your
10
 * option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful, but WITHOUT
13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
15
 * for more details.
16
 *
17
 * You should have received a copy of the GNU Library General Public License
18
 * along with this program; if not, write to the Free Software Foundation,
19
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
 */
21
 
22
/* Stick in a dummy reference to main(), so that if an application
23
 * is linking when the main() function is in a static library (.a)
24
 * we can be sure that main() actually gets linked in */
25
extern void main(int argc,void *argv,void *envp);
26
void (*mainp)(int argc,void *argv,void *envp) = main;
27
 
28
extern void __uClibc_main(int argc,void *argv,void *envp);
29
 
30
 
31
void _start(unsigned int first_arg)
32
{
33
        unsigned int argc;
34
        char **argv, **envp;
35
        unsigned long *stack;
36
 
37
        stack = (unsigned long*) &first_arg;
38
        argc = *(stack - 1);
39
        argv = (char **) stack;
40
        envp = (char **)stack + argc + 1;
41
 
42
        __uClibc_main(argc, argv, envp);
43
}
44
 

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.