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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [sysdeps/] [linux/] [sh64/] [crt0.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/* Startup code for SH5 & ELF.
2
   Copyright (C) 1999 Free Software Foundation, Inc.
3
   Copyright (C) 2001 Hewlett-Packard Australia
4
 
5
   This file is part of the GNU C Library.
6
 
7
   The GNU C Library is free software; you can redistribute it and/or
8
   modify it under the terms of the GNU Library General Public License as
9
   published by the Free Software Foundation; either version 2 of the
10
   License, or (at your option) any later version.
11
 
12
   The GNU C Library is distributed in the hope that it will be useful,
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
   Library General Public License for more details.
16
 
17
   You should have received a copy of the GNU Library General Public
18
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
19
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
   Boston, MA 02111-1307, USA.  */
21
 
22
/* This is the canonical entry point, usually the first thing in the text
23
   segment.
24
 
25
        At this entry point, most registers' values are unspecified, except:
26
 
27
   sp           The stack contains the arguments and environment:
28
                0(sp)                   argc
29
                4(sp)                   argv[0]
30
                ...
31
                (4*argc)(sp)            NULL
32
                (4*(argc+1))(sp)        envp[0]
33
                ...
34
                                        NULL
35
*/
36
 
37
        .file   "crt0.S"
38
 
39
        .globl _start
40
        .globl __main
41
 
42
        .type   __uClibc_start_main,@function
43
 
44
        .section .text64,"xa"
45
        .align 2        /* 2^2 = 4 */
46
 
47
_start:
48
        /* Clear the frame pointer since this is the outermost frame.  */
49
###     mov #0, r14     # qqq
50
 
51
        /* Pop argc off the stack and save a pointer to argv */
52
        ld.l    r15, 0, r2      /* argc */
53
        addi    r15, 4, r3      /* argv */
54
 
55
        /* set up the value for the environment pointer r4 = (argc+1)*4+argv */
56
        addi    r2, 1, r4       /* envp = argc + 1 */
57
        shlli   r4, 2, r4       /* envp = envp * 4 */
58
        add     r3, r4, r4      /* envp = envp + argv */
59
 
60
        /* call main() */
61
        movi    __uClibc_start_main,r17
62
        ptabs/l r17,tr0
63
        blink   tr0,r18
64
 
65
        /* should never get here....*/
66
###     movi    abort@lh,r17
67
###     shori   abort@ll,r17
68
        ptabs/l r17,tr0
69
        blink   tr0,r63 /* call abort() => (r63) do not come back ... */
70
 
71
        /*
72
         *      The following is a stub to stop the GNU toolchain
73
         *      from calling its C-RTL initialization routines.
74
         */
75
__main:
76
        ptabs/l r18,tr0
77
        blink   tr0,r63
78
 

powered by: WebSVN 2.1.0

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