source: rtems/c/src/lib/libbsp/sh/shsim/start/start.S @ 820d1ab0

4.104.115
Last change on this file since 820d1ab0 was 820d1ab0, checked in by Chris Johns <chrisj@…>, on 04/28/09 at 06:34:00

2009-04-28 Chris Johns <chrisj@…>

  • start/start.S: Update for boot_card command line change.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
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.rtems.com/license/LICENSE.
18 *
19 *  $Id$
20 */
21
22#include <rtems/asm.h>
23
24#warning Call to boot_card has changed and needs checking.
25#warning The call is "void boot_card(const char* cmdline);"
26#warning You need to pass a NULL.
27#warning Please check and remove these warnings.
28       
29        BEGIN_CODE
30        PUBLIC(start)
31SYM (start):
32        ! install the stack pointer
33        mov.l   stack_k,r15
34
35        ! zero out bss
36        mov.l   edata_k,r0
37        mov.l   end_k,r1
38        mov     #0,r2
390:
40        mov.l   r2,@r0
41        add     #4,r0
42        cmp/ge  r0,r1
43        bt      0b
44
45        ! copy the vector table from rom to ram
46        mov.l   vects_k,r0      ! vectab
47        mov     #0,r1           ! address of boot vector table
48        mov     #0,r2           ! number of bytes copied
49        mov.w   vects_size,r3   ! size of entries in vectab
501:
51        mov.l   @r1+,r4
52        mov.l   r4,@r0
53        add     #4,r0
54        add     #1,r2
55        cmp/hi  r3,r2
56        bf      1b
57
58        mov.l   vects_k,r0      ! update vbr to point to vectab
59        ldc     r0,vbr
60
61        ! call the mainline
62        mov #0,r4               ! command line
63        mov.l main_k,r0
64        jsr @r0
65       
66
67        ! call exit
68        mov     r0,r4
69        mov.l   exit_k,r0
70        jsr     @r0
71        or      r0,r0
72
73        END_CODE
74
75        .align 2
76stack_k:
77        .long   SYM(stack)
78edata_k:
79        .long   SYM(edata)
80end_k:
81        .long   SYM(end)
82main_k:
83        .long   SYM(boot_card)
84exit_k:
85        .long   SYM(_sys_exit)
86
87vects_k:
88        .long   SYM(vectab)
89vects_size:
90        .word   255
91
92#ifdef __ELF__
93        .section .stack,"aw"
94#else
95        .section .stack
96#endif
97SYM(stack):
98        .long   0xdeaddead
99monvects_k:
100        .long   SYM(monvects)
Note: See TracBrowser for help on using the repository browser.