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

4.104.114.84.95
Last change on this file since 3a4ae6c was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 11, 1995 at 7:35:39 PM

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • 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, 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
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
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.