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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [sh/] [gensh2/] [start/] [start.rom] - Blame information for rev 1026

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

Line No. Rev Author Line
1 1026 ivang
/*
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
 *
15
 *  The license and distribution terms for this file may be
16
 *  found in the file LICENSE in this distribution or at
17
 *  http://www.OARcorp.com/rtems/license.html.
18
 *
19
 *  start.rom,v 1.2 2001/10/12 21:05:26 joel Exp
20
 */
21
 
22
#include "asm.h"
23
 
24
        BEGIN_CODE
25
        PUBLIC(start)
26
SYM (start):
27
        ! install the stack pointer
28
        mov.l   stack_k,r15
29
 
30
        ! zero out bss
31
        mov.l   edata_k,r0
32
        mov.l   end_k,r1
33
        mov     #0,r2
34
0:
35
        mov.l   r2,@r0
36
        add     #4,r0
37
        cmp/ge  r0,r1
38
        bt      0b
39
 
40
        ! copy the vector table from rom to ram
41
        mov.l   vects_k,r0      ! vectab
42
        mov     #0,r1           ! address of boot vector table
43
        mov     #0,r2           | number of bytes copied
44
        mov.w   vects_size,r3   ! size of entries in vectab
45
1:
46
        mov.l   @r1+,r4
47
        mov.l   r4,@r0
48
        add     #4,r0
49
        add     #1,r2
50
        cmp/hi  r3,r2
51
        bf      1b
52
 
53
        mov.l   vects_k,r0      ! update vbr to point to vectab
54
        ldc     r0,vbr
55
 
56
        ! call the mainline
57
        mov #0,r4               ! argc
58
        mov.l main_k,r0
59
        jsr @r0
60
        mov #0,r5               ! argv
61
 
62
        ! call exit
63
        mov     r0,r4
64
        mov.l   exit_k,r0
65
        jsr     @r0
66
        or      r0,r0
67
 
68
        END_CODE
69
 
70
        .align 2
71
stack_k:
72
        .long   SYM(stack)
73
edata_k:
74
        .long   SYM(edata)
75
end_k:
76
        .long   SYM(end)
77
main_k:
78
        .long   SYM(boot_card)
79
exit_k:
80
        .long   SYM(exit)
81
 
82
vects_k:
83
        .long   SYM(vectab)
84
vects_size:
85
        .word   255
86
 
87
#ifdef __ELF__
88
        .section .stack,"aw"
89
#else
90
        .section .stack
91
#endif
92
SYM(stack):
93
        .long   0xdeaddead

powered by: WebSVN 2.1.0

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