source: rtems/c/src/lib/start/m68k/start.s @ 906577f4

4.104.114.84.95
Last change on this file since 906577f4 was 906577f4, checked in by Joel Sherrill <joel.sherrill@…>, on 08/01/98 at 14:41:20

Patch from David Fiddes <D.J.Fiddes@…> to not use this file for
ColdFires?. It is just too wrong to fix.

  • Property mode set to 100644
File size: 4.5 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,INTS OFF!!!
57#if ( M68K_HAS_SEPARATE_STACKS == 1 )
58        movec   isp,a0
59        move.l  a0, SYM (initial_isp)
60#endif
61        move    usp,a0
62        move.l  a0, SYM (initial_usp)
63        move.l  a7, SYM (initial_msp)
64
65        |
66        | zero out uninitialized data area
67        |
68zerobss:
69        moveal  # SYM (end),a0                | find end of .bss
70        moveal  # SYM (bss_start),a1          | find beginning of .bss
71        movel   #0,d0
72
73loop:   movel   #0,a1@+                | to zero out uninitialized
74        cmpal   a0,a1
75        jlt     loop                    | loop until _end reached
76
77        movel   # SYM (end),d0               | d0 = end of bss/start of heap
78        addl    # SYM (heap_size),d0          | d0 = end of heap
79        movel   d0, SYM (stack_start)  | Save for brk() routine
80        addl    # SYM (stack_size),d0         | make room for 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
97
98        movel   #0,a7@-               | push environp
99        movel   #0,a7@-               | push argv
100        movel   #0,a7@-               | push argc
101
102        jsr     SYM (boot_card)
103        addl    #12,a7
104
105#if ( M68K_HAS_SEPARATE_STACKS == 1 )
106        move.l  SYM (initial_isp),a0
107        movec   a0,isp
108        move.l  SYM (initial_usp),a0
109        movec   a0,usp
110        move.l  SYM (initial_msp),a0
111        movec   a0,msp
112#else
113        movea.l SYM (initial_msp),a7
114#endif
115        move.w  SYM (initial_sr),sr
116        rts
117
118END_CODE
119
120BEGIN_DATA
121
122        PUBLIC (start_frame)
123SYM (start_frame):
124        .space  4,0
125
126        PUBLIC (stack_start)
127SYM (stack_start):
128        .space  4,0
129END_DATA
130
131BEGIN_BSS
132
133        PUBLIC (environ)
134        .align 2
135SYM (environ):
136        .long  0
137
138        PUBLIC (initial_isp)
139SYM (initial_isp):
140        .space  4
141
142        PUBLIC (initial_msp)
143SYM (initial_msp):
144        .space  4
145
146        PUBLIC (initial_usp)
147SYM (initial_usp):
148        .space  4
149
150         PUBLIC (initial_sr)
151SYM (initial_sr):
152        .space  2
153
154        PUBLIC (heap_size)
155        .set   SYM (heap_size),0x2000
156
157        PUBLIC (stack_size)
158        .set   SYM (stack_size),0x1000
159
160
161END_DATA
162#endif
163END
164
165
Note: See TracBrowser for help on using the repository browser.