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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [sysdeps/] [linux/] [or32/] [crt1.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/*
2
 * uClibc/sysdeps/linux/or32/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
void __uClibc_main(int argc,void *argv,void *envp);
29
 
30
void _uClibc_start(unsigned int first_arg)
31
{
32
        unsigned int argc;
33
        char **argv, **envp;
34
        unsigned long *stack;
35
 
36
        stack = (unsigned long*) first_arg;
37
        argc = *(stack);
38
        argv = (char **)(stack + 1);
39
        envp = (char **)(stack + 1 + argc + 1);
40
 
41
        __uClibc_main(argc, argv, envp);
42
}
43
 
44
void __main() { }
45
 

powered by: WebSVN 2.1.0

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