source: rtems/c/src/lib/libbsp/sh/shsim/start/start.S @ 76c6828d

4.104.114.84.95
Last change on this file since 76c6828d was 76c6828d, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 12, 2001 at 9:12:58 PM

2001-10-12 Joel Sherrill <joel@…>

  • start/start.S: Fixed typo.
  • Property mode set to 100644
File size: 1.7 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.OARcorp.com/rtems/license.html.
18 *
19 *  $Id$
20 */
21
22#include "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               ! 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
71stack_k:
72        .long   SYM(stack)     
73edata_k:
74        .long   SYM(edata)
75end_k:
76        .long   SYM(end)
77main_k:
78        .long   SYM(boot_card)
79exit_k:
80        .long   SYM(exit)
81
82vects_k:
83        .long   SYM(vectab)
84vects_size:
85        .word   255
86
87#ifdef __ELF__
88        .section .stack,"aw"
89#else
90        .section .stack
91#endif
92SYM(stack):
93        .long   0xdeaddead
94monvects_k:
95        .long   SYM(monvects)
Note: See TracBrowser for help on using the repository browser.