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

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on May 11, 1995 at 5:39:37 PM

Initial revision

  • Property mode set to 100644
File size: 4.4 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, 1990, 1991, 1992, 1993, 1994.
9 *  On-Line Applications Research Corporation (OAR).
10 *  All rights assigned to U.S. Government, 1994.
11 *
12 *  This material may be reproduced by or for the U.S. Government pursuant
13 *  to the copyright license under the clause at DFARS 252.227-7013.  This
14 *  notice must appear in all copies of this file and its derivatives.
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
100        jsr     SYM (bsp_start)
101#if ( M68K_HAS_SEPARATE_STACKS == 1 )
102        move.l  SYM (initial_isp),a0
103        movec   a0,isp
104        move.l  SYM (initial_usp),a0
105        movec   a0,usp
106        move.l  SYM (initial_msp),a0
107        movec   a0,msp
108#else
109        movea.l SYM (initial_msp),a7
110#endif
111        move.w  SYM (initial_sr),sr
112        rts
113
114END_CODE
115
116BEGIN_DATA
117
118        PUBLIC (start_frame)
119SYM (start_frame):
120        .space  4,0
121
122        PUBLIC (stack_start)
123SYM (stack_start):
124        .space  4,0
125END_DATA
126
127BEGIN_BSS
128
129        PUBLIC (environ)
130        .align 2
131SYM (environ):
132        .long  0
133
134        PUBLIC (initial_isp)
135SYM (initial_isp):
136        .space  4
137
138        PUBLIC (initial_msp)
139SYM (initial_msp):
140        .space  4
141
142        PUBLIC (initial_usp)
143SYM (initial_usp):
144        .space  4
145
146         PUBLIC (initial_sr)
147SYM (initial_sr):
148        .space  2
149
150        PUBLIC (heap_size)
151        .set   SYM (heap_size),0x2000
152
153        PUBLIC (stack_size)
154        .set   SYM (stack_size),0x1000
155
156
157END_DATA
158END
159
160
Note: See TracBrowser for help on using the repository browser.