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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [sh/] [gensh1/] [start/] [start.S] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
3
 *           Bernd Becker (becker@faw.uni-ulm.de)
4
 *
5
 *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
6
 *
7
 *  This program is distributed in the hope that it will be useful,
8
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 *
11
 *
12
 *  COPYRIGHT (c) 1998.
13
 *  On-Line Applications Research Corporation (OAR).
14
 *  Copyright assigned to U.S. Government, 1994.
15
 *
16
 *  The license and distribution terms for this file may be
17
 *  found in the file LICENSE in this distribution or at
18
 *  http://www.OARcorp.com/rtems/license.html.
19
 *
20
 *  $Id: start.S,v 1.2 2001-09-27 12:01:11 chris Exp $
21
 */
22
 
23
#include "asm.h"
24
 
25
        BEGIN_CODE
26
        PUBLIC(start)
27
SYM (start):
28
        ! install the stack pointer
29
        mov.l   stack_k,r15
30
 
31
        ! zero out bss
32
        mov.l   edata_k,r0
33
        mov.l   end_k,r1
34
        mov     #0,r2
35
0:
36
        mov.l   r2,@r0
37
        add     #4,r0
38
        cmp/ge  r0,r1
39
        bt      0b
40
 
41
        ! copy the vector table from rom to ram
42
        mov.l   vects_k,r0      ! vectab
43
        mov     #0,r1           ! address of boot vector table
44
        mov     #0,r2           ! number of bytes copied
45
        mov.w   vects_size,r3   ! size of entries in vectab
46
1:
47
        mov.l   @r1+,r4
48
        mov.l   r4,@r0
49
        add     #4,r0
50
        add     #1,r2
51
        cmp/hi  r3,r2
52
        bf      1b
53
 
54
        mov.l   vects_k,r0      ! update vbr to point to vectab
55
        ldc     r0,vbr
56
 
57
        ! call the mainline
58
        mov #0,r4               ! argc
59
        mov.l main_k,r0
60
        jsr @r0
61
        mov #0,r5               ! argv
62
 
63
        ! call exit
64
        mov     r0,r4
65
        mov.l   exit_k,r0
66
        jsr     @r0
67
        or      r0,r0
68
 
69
        END_CODE
70
 
71
        .align 2
72
stack_k:
73
        .long   SYM(stack)
74
edata_k:
75
        .long   SYM(edata)
76
end_k:
77
        .long   SYM(end)
78
main_k:
79
        .long   SYM(boot_card)
80
exit_k:
81
        .long   SYM(exit)
82
 
83
vects_k:
84
        .long   SYM(vectab)
85
vects_size:
86
        .word   255
87
 
88
#ifdef __ELF__
89
        .section .stack,"aw"
90
#else
91
        .section .stack
92
#endif
93
SYM(stack):
94
        .long   0xdeaddead

powered by: WebSVN 2.1.0

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