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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [libgloss/] [cris/] [crt0.S] - Blame information for rev 309

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

Line No. Rev Author Line
1 207 jeremybenn
/* Generic simplistic start-up-stub for CRIS/CRISv32.
2
   Copyright (C) 1993-2005, 2007 Axis Communications.
3
   All rights reserved.
4
 
5
   Redistribution and use in source and binary forms, with or without
6
   modification, are permitted provided that the following conditions
7
   are met:
8
 
9
   1. Redistributions of source code must retain the above copyright
10
      notice, this list of conditions and the following disclaimer.
11
 
12
   2. Neither the name of Axis Communications nor the names of its
13
      contributors may be used to endorse or promote products derived
14
      from this software without specific prior written permission.
15
 
16
   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
17
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
20
   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21
   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25
   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
26
   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
   POSSIBILITY OF SUCH DAMAGE.  */
28
 
29
#undef cris
30
#undef L
31
#ifdef __NO_UNDERSCORES__
32
#define L(x) x
33
#else
34
#define L(x) _ ## x
35
#endif
36
 
37
; Rudimentary v0..v32-compatible startup stub.
38
 
39
#ifdef __ELF__
40
 .section .startup,"ax"
41
#endif
42
 .global __start
43
 nop
44
__start:
45
 move.d 0f,$r9
46
 jump $r9
47
 setf
48
 
49
#ifndef __ELF__
50
 
51
; For a.out, everything read-only and code-wise goes into a
52
; single section, so we can't separate the interrupt table from
53
; the startup code if we want to have files in-between.
54
#define IN_CRT0
55
#include "irqtable.S"
56
 
57
#else
58
 
59
; The interrupt table (at offset 12, irq #3) is expected here.
60
; The simplest way to make sure we link it in, is to sacrifice
61
; some memory and refer to it with a relocation.
62
 .text
63
 .dword __irqtable_at_irq3
64
 
65
#endif /* __ELF__ */
66
 
67
0:
68
 move.d __setup,$r9
69
 jsr $r9
70
 nop
71
#ifdef __ELF__
72
 jsr L(_init)
73
 nop
74
 move.d L(_fini),$r10
75
 jsr L(atexit)
76
 nop
77
#endif
78
 jsr L(main)
79
 nop
80
 jsr L(exit)
81
 nop
82
0:
83
 nop
84
 ba 0b
85
 nop

powered by: WebSVN 2.1.0

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