source: rtems/c/src/lib/start/m68k/start.s @ 26e5cd4

4.104.114.84.95
Last change on this file since 26e5cd4 was 7e19c72b, checked in by Joel Sherrill <joel.sherrill@…>, on 08/13/98 at 14:22:48

fixed spacing

  • 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,INTERRUPTS 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        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
124        PUBLIC (stack_start)
125SYM (stack_start):
126        .space  4,0
127END_DATA
128
129BEGIN_BSS
130
131        PUBLIC (environ)
132        .align 2
133SYM (environ):
134        .long  0
135
136        PUBLIC (initial_isp)
137SYM (initial_isp):
138        .space  4
139
140        PUBLIC (initial_msp)
141SYM (initial_msp):
142        .space  4
143
144        PUBLIC (initial_usp)
145SYM (initial_usp):
146        .space  4
147
148         PUBLIC (initial_sr)
149SYM (initial_sr):
150        .space  2
151
152        PUBLIC (heap_size)
153        .set   SYM (heap_size),0x2000
154
155        PUBLIC (stack_size)
156        .set   SYM (stack_size),0x1000
157
158
159END_DATA
160#endif
161END
162
163
Note: See TracBrowser for help on using the repository browser.