source: trunk/libs/newlib/src/libgloss/tic6x/crt0.S @ 621

Last change on this file since 621 was 444, checked in by satin@…, 7 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 2.0 KB
Line 
1/* crt0.S for the TI C6X series of processors
2
3   Copyright (c) 2010 CodeSourcery, Inc.
4   All rights reserved.
5
6   Redistribution and use in source and binary forms, with or without
7   modification, are permitted provided that the following conditions are met:
8    * Redistributions of source code must retain the above copyright
9      notice, this list of conditions and the following disclaimer.
10    * Redistributions in binary form must reproduce the above copyright
11      notice, this list of conditions and the following disclaimer in the
12      documentation and/or other materials provided with the distribution.
13    * Neither the name of CodeSourcery nor the
14      names of its contributors may be used to endorse or promote products
15      derived from this software without specific prior written permission.
16
17    THIS SOFTWARE IS PROVIDED BY CODESOURCERY, INC. ``AS IS'' AND ANY
18    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CODESOURCERY BE LIABLE
21    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
23    OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
27    USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
28    DAMAGE.  */
29
30        .text
31        .align  2
32
33        .global _start
34_start:
35        /* Start by setting up a stack */
36        mvkl .s2        _STACK_START - 4, B15
37        mvkh .s2        _STACK_START - 4, B15
38        and .s2         -8, B15, B15
39
40        mvkl .s2        __c6xabi_DSBT_BASE, B14
41        mvkh .s2        __c6xabi_DSBT_BASE, B14
42
43#ifdef __DSBT__
44        stw .d2t2       B14, *B14
45#endif
46        /* Zero the memory in the .bss section.  */
47
48        /* Set up GOT pointer.  */
49
50        mvkl .s2        1f, B3
51        mvkh .s2        1f, B3
52        call .s2        _init
53        nop             5
541:
55
56        mvkl .s2        1f, B3
57        mvkh .s2        1f, B3
58        call .s2        main
59        nop             5
601:
61
62        b .s2           exit
63        nop             5
Note: See TracBrowser for help on using the repository browser.