Back to home page

LXR

 
 

    


Warning, /bsps/sh/gensh2/start/start.rom is written in an unsupported language. File is not indexed.

0001 /*
0002  *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
0003  *           Bernd Becker (becker@faw.uni-ulm.de)
0004  *
0005  *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
0006  *
0007  *  This program is distributed in the hope that it will be useful,
0008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0010  *
0011  *
0012  *  COPYRIGHT (c) 1998.
0013  *  On-Line Applications Research Corporation (OAR).
0014  *
0015  *  The license and distribution terms for this file may be
0016  *  found in the file LICENSE in this distribution or at
0017  *  http://www.rtems.org/license/LICENSE.
0018  */
0019 
0020 #include "asm.h"
0021 
0022         BEGIN_CODE
0023         PUBLIC(start)
0024 SYM (start):
0025         ! install the stack pointer
0026         mov.l   stack_k,r15
0027 
0028         ! zero out bss
0029         mov.l   edata_k,r0
0030         mov.l   end_k,r1
0031         mov     #0,r2
0032 0:
0033         mov.l   r2,@r0
0034         add     #4,r0
0035         cmp/ge  r0,r1
0036         bt      0b
0037 
0038         ! copy the vector table from rom to ram
0039         mov.l   vects_k,r0      ! vectab
0040         mov     #0,r1           ! address of boot vector table
0041         mov     #0,r2           | number of bytes copied
0042         mov.w   vects_size,r3   ! size of entries in vectab
0043 1:
0044         mov.l   @r1+,r4
0045         mov.l   r4,@r0
0046         add     #4,r0
0047         add     #1,r2
0048         cmp/hi  r3,r2
0049         bf      1b
0050 
0051         mov.l   vects_k,r0      ! update vbr to point to vectab
0052         ldc     r0,vbr
0053 
0054         ! call the mainline     
0055         mov #0,r4               ! argc
0056         mov.l main_k,r0
0057         jsr @r0
0058         mov #0,r5               ! argv
0059 
0060         ! call exit
0061         mov     r0,r4
0062         mov.l   exit_k,r0
0063         jsr     @r0
0064         or      r0,r0
0065 
0066         END_CODE
0067 
0068         .align 2
0069 stack_k:
0070         .long   SYM(_ISR_Stack_area_end)
0071 edata_k:
0072         .long   SYM(edata)
0073 end_k:
0074         .long   SYM(end)
0075 main_k:
0076         .long   SYM(boot_card)
0077 exit_k:
0078         .long   SYM(exit)
0079 
0080 vects_k:
0081         .long   SYM(vectab)
0082 vects_size:
0083         .word   255