source: rtems/c/src/lib/libbsp/m68k/shared/start.S @ 69537ca9

4.104.114.84.95
Last change on this file since 69537ca9 was 69537ca9, checked in by Joel Sherrill <joel.sherrill@…>, on 01/12/00 at 16:38:56

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