source: rtems/bsps/sh/gensh2/start/start.S @ 4fea054c

5
Last change on this file since 4fea054c was ff081aee, checked in by Sebastian Huber <sebastian.huber@…>, on 11/06/18 at 15:58:02

score: Rename interrupt stack symbols

Rename

  • _Configuration_Interrupt_stack_area_begin in _ISR_Stack_area_begin,
  • _Configuration_Interrupt_stack_area_end in _ISR_Stack_area_end, and
  • _Configuration_Interrupt_stack_size in _ISR_Stack_size.

Move definitions to <rtems/score/isr.h>. The new names are considerable
shorter and in the right namespace.

Update #3459.

  • Property mode set to 100644
File size: 3.5 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 *  Modified to reflect Hitachi EDK SH7045F:
12 *  John M. Mills (jmills@tga.com)
13 *  TGA Technologies, Inc.
14 *  100 Pinnacle Way, Suite 140
15 *  Norcross, GA 30071 U.S.A.
16 *
17 *
18 *  This modified file may be copied and distributed in accordance
19 *  the above-referenced license. It is provided for critique and
20 *  developmental purposes without any warranty nor representation
21 *  by the authors or by TGA Technologies.
22 *
23 *  COPYRIGHT (c) 1999.
24 *  On-Line Applications Research Corporation (OAR).
25 *
26 *  The license and distribution terms for this file may be
27 *  found in the file LICENSE in this distribution or at
28 *  http://www.rtems.org/license/LICENSE.
29 */
30
31#include <rtems/asm.h>
32
33        BEGIN_CODE
34        PUBLIC(start)
35
36SYM (start):
37        ! install the stack pointer
38        mov.l   stack_k,r15
39
40#ifdef  START_HW_INIT   /* from $RTEMS_BSP.cfg */
41        ! Initialize minimal hardware
42        mov.l   hw_init_k, r0
43        jsr @r0
44        nop             !dead slot
45#endif /* START_HW_INIT */
46
47        ! zero out bss
48        mov.l   edata_k,r0
49        mov.l   end_k,r1
50        mov     #0,r2
510:
52        mov.l   r2,@r0
53        add     #4,r0
54        cmp/ge  r0,r1
55        bt      0b
56
57        ! copy the vector table from rom to ram
58        mov.l   vects_k,r0      ! vectab
59        mov     #0,r1           ! address of boot vector table
60        mov     #0,r2           ! number of bytes copied
61        mov.w   vects_size,r3   ! size of entries in vectab
621:
63        mov.l   @r1+,r4
64        mov.l   r4,@r0
65        add     #4,r0
66        add     #1,r2
67        cmp/hi  r3,r2
68        bf      1b
69
70#ifndef STANDALONE_EVB
71        ! overlay monitor vectors onto RTEMS table template
72        ! code adapted  from Hitachi EDK7045F User Manual: "Copyvect.s"
73        mova    vects_k,r0
74        mov.l   @r0, r1 ! Shadow vect tbl addr
75        stc             vbr, r2 ! Original vect tbl addr
76        and             #0, r0
77        mov             r0, r4  ! 0 in r4 and r0
78
79!trapa #32
80        or              #0x80, r0
81        mov.l   @(r0,r2), r3
82        mov.l   r3, @(r0, r1)
83        mov             r4, r0
84
85!cpu addr err
86        or              #0x24, r0
87        mov.l   @(r0, r2), r3
88        mov.l   r3, @(r0, r1)
89        mov             r4, r0
90
91!ill slot
92        or              #0x18, r0
93        mov.l   @(r0, r2), r3
94        mov.l   r3, @(r0, r1)
95        mov             r4, r0
96
97!ill inst
98        or              #0x10, r0
99        mov.l   @(r0, r2), r3
100        mov.l   r3, @(r0, r1)
101        mov             r4, r0
102
103!nmi
104        or              #0x2c, r0
105        mov.l   @(r0, r2), r3
106        mov.l   r3, @(r0, r1)
107        mov             r4, r0
108
109!User brk
110        or              #0x30, r0
111        mov.l   @(r0, r2), r3
112        mov.l   r3, @(r0, r1)
113        mov             r4, r0
114
115!sci0 err
116        or              #0x80, r0
117        rotl    r0
118        rotl    r0
119        mov.l   @(r0, r2), r3
120        mov.l   r3, @(r0, r1)
121        mov             r4, r0
122!sci rx
123        or              #0x81, r0
124        rotl    r0
125        rotl    r0
126        mov.l   @(r0, r2), r3
127        mov.l   r3, @(r0, r1)
128
129        stc     vbr,r3          ! capture copy of monitor vbr
130        mov.l   vbrtemp_k,r0
131        mov.l   r3, @r0
132        mov.l   vects_k,r0      ! point vbr to vectab
133        ldc     r0,vbr
134#endif /* ! STANDALONE_EVB */
135
136        ! call the mainline
137        mov #0,r4               ! command line
138        mov.l main_k,r0
139        jsr @r0
140        nop
141
142        ! call exit
143        mov     r0,r4
144        mov.l   exit_k,r0
145        jsr     @r0
146        or      r0,r0
147
148        mov.l   vbrtemp_k,r0    ! restore original vbr
149        mov.l   @r0,r3
150        ldc     r3, vbr
151        trapa   #13             ! UBR capture by monitor
152        nop             !debug dead-slot target
153
154        END_CODE
155
156        .align 2
157stack_k:
158        .long   SYM(_ISR_Stack_area_end)
159edata_k:
160        .long   SYM(edata)
161end_k:
162        .long   SYM(end)
163main_k:
164        .long   SYM(boot_card)
165exit_k:
166        .long   SYM(exit)
167#ifdef  START_HW_INIT   /* from $RTEMS_BSP.cfg */
168hw_init_k:
169        .long   SYM(early_hw_init)
170#endif /* START_HW_INIT */
171vbrtemp_k:
172        .long   SYM(vbrtemp)
173vects_k:
174        .long   SYM(vectab)
175vects_size:
176        .word   255
177
178#ifdef __ELF__
179        .section .bss,"aw"
180#else
181        .section .bss
182#endif
183SYM(vbrtemp):
184        .long   0x0
Note: See TracBrowser for help on using the repository browser.