source: rtems/bsps/m68k/shared/start/start.S

Last change on this file was a9a99164, checked in by Joel Sherrill <joel@…>, on 07/08/22 at 13:58:37

bsps/m68k/shared: Change license to BSD-2

Updates #3053.

  • Property mode set to 100644
File size: 5.0 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/*  entry.s
4 *
5 *  This file contains the entry point for the application.
6 *  The name of this entry point is compiler dependent.
7 *  It jumps to the BSP which is responsible for performing
8 *  all initialization.
9 *
10 *  COPYRIGHT (c) 1989-1999.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 *    notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 *    notice, this list of conditions and the following disclaimer in the
20 *    documentation and/or other materials provided with the distribution.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 */
34
35#include <rtems/asm.h>
36
37#if (M68K_COLDFIRE_ARCH == 0) /* All ColdFire BSPs must provide their own start vector */
38
39BEGIN_CODE
40                                        | Default entry points for:
41         PUBLIC (start)                 |   GNU
42         PUBLIC (M68Kvec)               |   Vector Table
43
44SYM (start):
45SYM (M68Kvec):                          | standard location for vectors
46        nop                             | for linkers with problem
47                                        | location zero
48        jmp      SYM (start_around)
49
50     /*
51      *  We can use the following space as our vector table
52      *  if the CPU has a VBR or we can save vector table in it
53      *  if the CPU does not.
54      */
55
56        .space   4088                   | to avoid initial intr stack
57                                        |   from 135BUG on MVME13?
58                                        |   and start code at 0x4000
59SYM (vectors):
60        .space   1016                   | reserve space for rest of vectors
61
62#if ( M68K_HAS_SEPARATE_STACKS == 1 )
63SYM (lowintstack):
64        .space   4092                   | reserve for interrupt stack
65SYM (hiintstack):
66        .space   4                      | end of interrupt stack
67#endif
68
69        PUBLIC (start_around)
70SYM (start_around):
71        move.w  sr, SYM (initial_sr)
72        oriw    #0x3700,sr              | SUPV MODE,INTERRUPTS OFF!!!
73#if ( M68K_HAS_SEPARATE_STACKS == 1 )
74        movec   isp,a0
75        move.l  a0, SYM (initial_isp)
76        movec   usp,a0
77        move.l  a0, SYM (initial_usp)
78        movec   msp,a0
79        move.l  a0, SYM (initial_msp)
80#else
81        move.l  a7, SYM (initial_msp)
82#endif
83
84        |
85        | zero out uninitialized data area
86        |
87zerobss:
88        moveal  # SYM (bsp_section_bss_end),a0     | find end of .bss
89        moveal  # SYM (bsp_section_bss_begin),a1   | find beginning of .bss
90        movel   #0,d0
91
92loop:   movel   #0,a1@+                 | to zero out uninitialized
93        cmpal   a0,a1
94        jlt     loop                    | loop until _end reached
95
96        movel   # SYM (_ISR_Stack_area_end),d0 | d0 = stop of stack
97        movw    #0x3700,sr              | SUPV MODE,INTERRUPTS OFF!!!
98        movel   d0,a7                   | set master stack pointer
99        movel   d0,a6                   | set base pointer
100
101      /*
102       *  RTEMS should maintain a separate interrupt stack on CPUs
103       *  without one in hardware.  This is currently not supported
104       *  on versions of the m68k without a HW intr stack.
105       */
106
107#if ( M68K_HAS_SEPARATE_STACKS == 1 )
108        lea     SYM (hiintstack),a0   | a0 = high end of intr stack
109        movec   a0,isp                | set interrupt stack
110#endif
111
112        movel   #0,a7@-               | push command line
113        jsr     SYM (boot_card)
114        addl    #12,a7
115
116#if ( M68K_HAS_SEPARATE_STACKS == 1 )
117        move.l  SYM (initial_isp),a0
118        movec   a0,isp
119        move.l  SYM (initial_usp),a0
120        movec   a0,usp
121        move.l  SYM (initial_msp),a0
122        movec   a0,msp
123#else
124        movea.l SYM (initial_msp),a7
125#endif
126        move.w  SYM (initial_sr),sr
127        rts
128
129END_CODE
130
131BEGIN_DATA
132
133        PUBLIC (start_frame)
134SYM (start_frame):
135        .space  4,0
136
137END_DATA
138
139BEGIN_BSS
140
141        PUBLIC (initial_isp)
142SYM (initial_isp):
143        .space  4
144
145        PUBLIC (initial_msp)
146SYM (initial_msp):
147        .space  4
148
149        PUBLIC (initial_usp)
150SYM (initial_usp):
151        .space  4
152
153         PUBLIC (initial_sr)
154SYM (initial_sr):
155        .space  2
156
157END_DATA
158#endif
159END
Note: See TracBrowser for help on using the repository browser.