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

4.104.114.84.95
Last change on this file since e8a7a46 was e8a7a46, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 24, 2001 at 7:10:38 PM

2001-01-24 Ralf Corsepius <corsepiu@…>

  • Makefile.am, README, console/console-io.c, start/start.S, startup/linkcmds: Update to make shsim closer to functional.
  • 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 *  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$
21 */
22
23#include "asm.h"
24
25        BEGIN_CODE
26        PUBLIC(start)
27SYM (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
350:
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
461:
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
72stack_k:
73        .long   SYM(stack)     
74edata_k:
75        .long   SYM(edata)
76end_k:
77        .long   SYM(end)
78main_k:
79        .long   SYM(boot_card)
80exit_k:
81        .long   SYM(exit)
82
83vects_k:
84        .long   SYM(vectab)
85vects_size:
86        .word   255
87
88#ifdef __ELF__
89        .section .stack,"aw"
90#else
91        .section .stack
92#endif
93SYM(stack):
94        .long   0xdeaddead
95monvects_k:
96        .long   SYM(monvects)
Note: See TracBrowser for help on using the repository browser.