source: rtems/c/src/lib/libbsp/m68k/shared/start.S @ 6693a68

4.104.114.84.95
Last change on this file since 6693a68 was 0162910, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 14, 1998 at 11:15:38 PM

Patch from Ralf Corsepius <corsepiu@…> to rename all
.s files to .S in conformance with GNU conventions. This is a
minor step along the way to supporting automake.

  • Property mode set to 100644
File size: 4.1 KB
Line 
1/*  entry.s
2 *
3 *  This file contains the entry point for the application.
4 *  The name of this entry point is compiler dependent.
5 *  It jumps to the BSP which is responsible for performing
6 *  all initialization.
7 *
8 *  COPYRIGHT (c) 1989-1998.
9 *  On-Line Applications Research Corporation (OAR).
10 *  Copyright assigned to U.S. Government, 1994.
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.OARcorp.com/rtems/license.html.
15 *
16 *  $Id$
17 */
18
19#include "asm.h"
20
21#if (M68K_COLDFIRE_ARCH == 0) /* All ColdFire BSPs must provide their own start vector */
22
23BEGIN_CODE
24                                        | Default entry points for:
25         PUBLIC (start)                 |   GNU
26         PUBLIC (M68Kvec)               |   Vector Table
27
28SYM (start):
29SYM (M68Kvec):                          | standard location for vectors
30        nop                             | for linkers with problem
31                                        | location zero
32        jmp      SYM (start_around)
33
34     /*
35      *  We can use the following space as our vector table
36      *  if the CPU has a VBR or we can save vector table in it
37      *  if the CPU does not.
38      */
39
40        .space   4088                   | to avoid initial intr stack
41                                        |   from 135BUG on MVME13?
42                                        |   and start code at 0x4000
43SYM (vectors):
44        .space   1016                   | reserve space for rest of vectors
45
46#if ( M68K_HAS_SEPARATE_STACKS == 1 )
47SYM (lowintstack):
48        .space   4092                   | reserve for interrupt stack
49SYM (hiintstack):
50        .space   4                      | end of interrupt stack
51#endif
52
53        PUBLIC (start_around)
54SYM (start_around):
55        move.w  sr, SYM (initial_sr)
56        oriw    #0x3700,sr              | SUPV MODE,INTERRUPTS OFF!!!
57#if ( M68K_HAS_SEPARATE_STACKS == 1 )
58        movec   isp,a0
59        move.l  a0, SYM (initial_isp)
60        movec   usp,a0
61        move.l  a0, SYM (initial_usp)
62        movec   msp,a0
63        move.l  a0, SYM (initial_msp)
64#else
65        move.l  a7, SYM (initial_msp)
66#endif
67
68        |
69        | zero out uninitialized data area
70        |
71zerobss:
72        moveal  # SYM (end),a0          | find end of .bss
73        moveal  # SYM (bss_start),a1    | find beginning of .bss
74        movel   #0,d0
75
76loop:   movel   #0,a1@+                 | to zero out uninitialized
77        cmpal   a0,a1
78        jlt     loop                    | loop until _end reached
79
80        movel   # SYM (stack_init),d0   | d0 = stop of stack
81        andl    #0xffffffc0,d0          | align it on 16 byte boundary
82        movw    #0x3700,sr              | SUPV MODE,INTERRUPTS OFF!!!
83        movel   d0,a7                   | set master stack pointer
84        movel   d0,a6                   | set base pointer
85
86      /*
87       *  RTEMS should maintain a separate interrupt stack on CPUs
88       *  without one in hardware.  This is currently not supported
89       *  on versions of the m68k without a HW intr stack.
90       */
91
92#if ( M68K_HAS_SEPARATE_STACKS == 1 )
93        lea     SYM (hiintstack),a0   | a0 = high end of intr stack
94        movec   a0,isp                | set interrupt stack
95#endif
96        movel   #0,a7@-               | push environp
97        movel   #0,a7@-               | push argv
98        movel   #0,a7@-               | push argc
99
100        jsr     SYM (boot_card)
101        addl    #12,a7
102
103#if ( M68K_HAS_SEPARATE_STACKS == 1 )
104        move.l  SYM (initial_isp),a0
105        movec   a0,isp
106        move.l  SYM (initial_usp),a0
107        movec   a0,usp
108        move.l  SYM (initial_msp),a0
109        movec   a0,msp
110#else
111        movea.l SYM (initial_msp),a7
112#endif
113        move.w  SYM (initial_sr),sr
114        rts
115
116END_CODE
117
118BEGIN_DATA
119
120        PUBLIC (start_frame)
121SYM (start_frame):
122        .space  4,0
123
124END_DATA
125
126BEGIN_BSS
127
128        PUBLIC (environ)
129        .align 2
130SYM (environ):
131        .long  0
132
133        PUBLIC (initial_isp)
134SYM (initial_isp):
135        .space  4
136
137        PUBLIC (initial_msp)
138SYM (initial_msp):
139        .space  4
140
141        PUBLIC (initial_usp)
142SYM (initial_usp):
143        .space  4
144
145         PUBLIC (initial_sr)
146SYM (initial_sr):
147        .space  2
148
149END_DATA
150#endif
151END
152
153
Note: See TracBrowser for help on using the repository browser.