source: rtems/c/src/lib/libbsp/sh/gensh1/start/start.S @ c669bf30

4.104.115
Last change on this file since c669bf30 was c669bf30, checked in by Joel Sherrill <joel.sherrill@…>, on 04/24/10 at 21:45:57

2010-04-24 Joel Sherrill <joel.sherrill@…>

  • start/start.S: Verify boot_card is invoked properly with argc, argv.
  • Property mode set to 100644
File size: 1.6 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        BEGIN_CODE
25        PUBLIC(start)
26SYM (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
340:
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
451:
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               ! command line
58        mov.l main_k,r0
59        jsr @r0
60
61        ! call exit
62        mov     r0,r4
63        mov.l   exit_k,r0
64        jsr     @r0
65        or      r0,r0
66
67        END_CODE
68
69        .align 2
70stack_k:
71        .long   SYM(stack)
72edata_k:
73        .long   SYM(edata)
74end_k:
75        .long   SYM(end)
76main_k:
77        .long   SYM(boot_card)
78exit_k:
79        .long   SYM(exit)
80
81vects_k:
82        .long   SYM(vectab)
83vects_size:
84        .word   255
85
86#ifdef __ELF__
87        .section .stack,"aw"
88#else
89        .section .stack
90#endif
91SYM(stack):
92        .long   0xdeaddead
Note: See TracBrowser for help on using the repository browser.