source: rtems/c/src/lib/start/m68k/start.S @ eb299afc

4.104.114.84.95
Last change on this file since eb299afc was 0162910, checked in by Joel Sherrill <joel.sherrill@…>, on 12/14/98 at 23:15:38

Patch from Ralf Corsepius <corsepiu@…> to rename all
.s files to .S in conformance with GNU conventions. This is a
minor step along the way to supporting automake.

  • Property mode set to 100644
File size: 4.1 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 *
[60b791ad]8 *  COPYRIGHT (c) 1989-1998.
[ac7d5ef0]9 *  On-Line Applications Research Corporation (OAR).
[03f2154e]10 *  Copyright assigned to U.S. Government, 1994.
[ac7d5ef0]11 *
[98e4ebf5]12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
[03f2154e]14 *  http://www.OARcorp.com/rtems/license.html.
[ac7d5ef0]15 *
16 *  $Id$
17 */
18
19#include "asm.h"
20
[906577f4]21#if (M68K_COLDFIRE_ARCH == 0) /* All ColdFire BSPs must provide their own start vector */
22
[ac7d5ef0]23BEGIN_CODE
24                                        | Default entry points for:
25         PUBLIC (start)                 |   GNU
26         PUBLIC (M68Kvec)               |   Vector Table
27
28SYM (start):
[7e19c72b]29SYM (M68Kvec):                          | standard location for vectors
[ac7d5ef0]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)
[7e19c72b]56        oriw    #0x3700,sr              | SUPV MODE,INTERRUPTS OFF!!!
[ac7d5ef0]57#if ( M68K_HAS_SEPARATE_STACKS == 1 )
58        movec   isp,a0
59        move.l  a0, SYM (initial_isp)
[9898425]60        movec   usp,a0
[ac7d5ef0]61        move.l  a0, SYM (initial_usp)
[9898425]62        movec   msp,a0
63        move.l  a0, SYM (initial_msp)
64#else
[ac7d5ef0]65        move.l  a7, SYM (initial_msp)
[9898425]66#endif
[ac7d5ef0]67
68        |
69        | zero out uninitialized data area
70        |
71zerobss:
[7e19c72b]72        moveal  # SYM (end),a0          | find end of .bss
73        moveal  # SYM (bss_start),a1    | find beginning of .bss
[ac7d5ef0]74        movel   #0,d0
75
[7e19c72b]76loop:   movel   #0,a1@+                 | to zero out uninitialized
[ac7d5ef0]77        cmpal   a0,a1
78        jlt     loop                    | loop until _end reached
79
[db88957]80        movel   # SYM (stack_init),d0   | d0 = stop of stack
[7e19c72b]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
[ac7d5ef0]85
86      /*
[e2a2ec60]87       *  RTEMS should maintain a separate interrupt stack on CPUs
[ac7d5ef0]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 )
[7e19c72b]93        lea     SYM (hiintstack),a0   | a0 = high end of intr stack
[ac7d5ef0]94        movec   a0,isp                | set interrupt stack
95#endif
[3a4ae6c]96        movel   #0,a7@-               | push environp
97        movel   #0,a7@-               | push argv
98        movel   #0,a7@-               | push argc
99
[e2a2ec60]100        jsr     SYM (boot_card)
[3a4ae6c]101        addl    #12,a7
102
[ac7d5ef0]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
124END_DATA
125
126BEGIN_BSS
127
128        PUBLIC (environ)
129        .align 2
130SYM (environ):
131        .long  0
132
133        PUBLIC (initial_isp)
134SYM (initial_isp):
135        .space  4
136
137        PUBLIC (initial_msp)
138SYM (initial_msp):
139        .space  4
140
141        PUBLIC (initial_usp)
142SYM (initial_usp):
143        .space  4
144
145         PUBLIC (initial_sr)
146SYM (initial_sr):
147        .space  2
148
149END_DATA
[906577f4]150#endif
[ac7d5ef0]151END
152
153
Note: See TracBrowser for help on using the repository browser.