source: rtems/c/src/lib/libbsp/sh/gensh2/start/start.rom @ 4a238002

4.104.114.84.95
Last change on this file since 4a238002 was 4a238002, checked in by Joel Sherrill <joel.sherrill@…>, on 11/18/99 at 21:22:58

Patch from "John M. Mills" <jmills@…> with subsequent cleanup from
Ralf Corsepius <corsepiu@…> that adds initial Hitachi SH-2
support to RTEMS. Ralf's comments are:

Changes:
------

  1. SH-Port:
  • Many files renamed.
  • CONSOLE_DEVNAME and MHZ defines removed from libcpu.
  • console.c moved to libbsp/sh/shared, build in libbsp/sh/<BSP>/console applying VPATH.
  • CONSOLE_DEVNAME made BSP-specific, replacement is defined in bsp.h
  • MHZ define replaced with HZ (extendent resolution) in custom/*.cfg
  • -DHZ=HZ used in bspstart.c, only
  • Makefile variable HZ used in bsp-dependent directories only.
  1. SH1-Port
  • clock-driver rewritten to provide better resolution for odd CPU frequencies. This driver is only partially tested on hardware, ie. sightly experimental, but I don't expect severe problems with it.
  • Polling SCI-driver added. This driver is experimental and completly untested yet. Therefore it is not yet used for the console (/dev/console is still pointing to /dev/null, cf. gensh1/bsp.h).
  • minor changes to the timer driver
  • SH1 specific delay()/CPU_delay() now is implemented as a function
  1. SH2-Port
  • Merged
  • IMO, the code is still in its infancy. Therefore I have interspersed comments (FIXME) it for items which I think John should look after.
  • sci and console drivers partially rewritten and extended (John, I hope you don't mind).
  • Copyright notices are not yet adapted
  • 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
Note: See TracBrowser for help on using the repository browser.