source: rtems/c/src/lib/start/m68k/start.s @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on 04/22/97 at 17:20:27

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • Property mode set to 100644
File size: 4.4 KB
RevLine 
[ac7d5ef0]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 *
[03f2154e]8 *  COPYRIGHT (c) 1989-1997.
[ac7d5ef0]9 *  On-Line Applications Research Corporation (OAR).
[03f2154e]10 *  Copyright assigned to U.S. Government, 1994.
[ac7d5ef0]11 *
[03f2154e]12 *  The license and distribution terms for this file may in
13 *  the file LICENSE in this distribution or at
14 *  http://www.OARcorp.com/rtems/license.html.
[ac7d5ef0]15 *
16 *  $Id$
17 */
18
19#include "asm.h"
20
21BEGIN_CODE
22                                        | Default entry points for:
23         PUBLIC (start)                 |   GNU
24         PUBLIC (M68Kvec)               |   Vector Table
25
26SYM (start):
27SYM (M68Kvec):                           | standard location for vectors
28        nop                             | for linkers with problem
29                                        | location zero
30        jmp      SYM (start_around)
31
32     /*
33      *  We can use the following space as our vector table
34      *  if the CPU has a VBR or we can save vector table in it
35      *  if the CPU does not.
36      */
37
38        .space   4088                   | to avoid initial intr stack
39                                        |   from 135BUG on MVME13?
40                                        |   and start code at 0x4000
41SYM (vectors):
42        .space   1016                   | reserve space for rest of vectors
43
44#if ( M68K_HAS_SEPARATE_STACKS == 1 )
45SYM (lowintstack):
46        .space   4092                   | reserve for interrupt stack
47SYM (hiintstack):
48        .space   4                      | end of interrupt stack
49#endif
50
51        PUBLIC (start_around)
52SYM (start_around):
53        move.w  sr, SYM (initial_sr)
54#if ( M68K_HAS_SEPARATE_STACKS == 1 )
55        movec   isp,a0
56        move.l  a0, SYM (initial_isp)
57        movec   usp,a0
58        move.l  a0, SYM (initial_usp)
59        movec   msp,a0
60        move.l  a0, SYM (initial_msp)
61#else
62        move.l  a7, SYM (initial_msp)
63#endif
64        oriw    #0x0700,sr             | INTERRUPTS OFF!!!
65
66
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 (end),d0               | d0 = end of bss/start of heap
81        addl    # SYM (heap_size),d0          | d0 = end of heap
82        movel   d0, SYM (stack_start)  | Save for brk() routine
83        addl    # SYM (stack_size),d0         | make room for stack
84        andl    #0xffffffc0,d0         | align it on 16 byte boundary
85        movw    #0x3700,sr             | SUPV MODE,INTERRUPTS OFF!!!
86        movel   d0,a7                 | set master stack pointer
87        movel   d0,a6                 | set base pointer
88
89      /*
90       *  RTEMS should maintiain a separate interrupt stack on CPUs
91       *  without one in hardware.  This is currently not supported
92       *  on versions of the m68k without a HW intr stack.
93       */
94
95#if ( M68K_HAS_SEPARATE_STACKS == 1 )
96        lea     SYM (hiintstack),a0          | a0 = high end of intr stack
97        movec   a0,isp                | set interrupt stack
98#endif
99
[3a4ae6c]100
101        movel   #0,a7@-               | push environp
102        movel   #0,a7@-               | push argv
103        movel   #0,a7@-               | push argc
104
105        jsr     SYM (main)
106        addl    #12,a7
107
[ac7d5ef0]108#if ( M68K_HAS_SEPARATE_STACKS == 1 )
109        move.l  SYM (initial_isp),a0
110        movec   a0,isp
111        move.l  SYM (initial_usp),a0
112        movec   a0,usp
113        move.l  SYM (initial_msp),a0
114        movec   a0,msp
115#else
116        movea.l SYM (initial_msp),a7
117#endif
118        move.w  SYM (initial_sr),sr
119        rts
120
121END_CODE
122
123BEGIN_DATA
124
125        PUBLIC (start_frame)
126SYM (start_frame):
127        .space  4,0
128
129        PUBLIC (stack_start)
130SYM (stack_start):
131        .space  4,0
132END_DATA
133
134BEGIN_BSS
135
136        PUBLIC (environ)
137        .align 2
138SYM (environ):
139        .long  0
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
157        PUBLIC (heap_size)
158        .set   SYM (heap_size),0x2000
159
160        PUBLIC (stack_size)
161        .set   SYM (stack_size),0x1000
162
163
164END_DATA
165END
166
167
Note: See TracBrowser for help on using the repository browser.