1 /* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
2 Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
3 On-Line Applications Research Corporation.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 In addition to the permissions in the GNU Lesser General Public
12 License, the Free Software Foundation gives you unlimited
13 permission to link the compiled version of this file with other
14 programs, and to distribute those programs without any restriction
15 coming from the use of this file. (The GNU Lesser General Public
16 License restrictions do apply in other respects; for example, they
17 cover modification of the file, and distribution when not linked
18 into another program.)
20 Note that people who make modified versions of this file are not
21 obligated to grant this special exception for their modified
22 versions; it is their choice whether to do so. The GNU Lesser
23 General Public License gives permission to release a modified
24 version without this exception; this exception also makes it
25 possible to release a modified version which carries forward this
28 The GNU C Library is distributed in the hope that it will be useful,
29 but WITHOUT ANY WARRANTY; without even the implied warranty of
30 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31 Lesser General Public License for more details.
33 You should have received a copy of the GNU Lesser General Public
34 License along with the GNU C Library; if not, write to the Free
35 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
40 * This file contains the entry point for the application.
41 * The name of this entry point is compiler dependent.
42 * It jumps to the BSP which is responsible for performing
47 .globl start | Default entry point
48 .globl _start | Default entry point
49 .globl M68Kvec | Vector Table
50 .globl _M68Kvec | Vector Table
54 M68Kvec: | standard location for vectors
55 _M68Kvec: | standard location for vectors
56 nop | for linkers with problem
57 | using location zero as entry
59 .space 4088 | to avoid initial intr stack
60 | from 135BUG on MVME13? as entry
61 | and start code at 0x4000
63 move.w %sr,initial_sr | save initial values
70 oriw #0x0700,%sr | INTERRUPTS OFF!!!
75 | zero out uninitialized data area
78 moveal #end,%a0 | find end of .bss
79 moveal #_bss_start,%a1 | find beginning of .bss
82 loop: movel #0,%a1@+ | to zero out uninitialized
84 jlt loop | loop until _end reached
86 movel #heap_size,__C_heap_size | set ___C_heap_size
87 movel #heap_memory,__C_heap_start | set ___C_heap_start
88 moveal #interrupt_stack_end,%a0 | set interrupt stack pointer
90 moveal #stack_end,%a0 | set master stack pointer
92 moveal #stack_end,%a6 | set base pointer
93 movw #0x3000,%sr | SUPV MODE,INTERRUPTS ON!!!
95 #ifdef NEED_UNDERSCORES
96 jsr __Board_Initialize | initialize the board
98 jsr _Board_Initialize | initialize the board
101 move.l #0,%sp@- | envp = NULL
102 move.l #0,%sp@- | argv = NULL
103 move.l #0,%sp@- | argc = NULL
104 #ifdef NEED_UNDERSCORES
105 jsr ___libc_init | initialize the library and
108 jsr __libc_init | initialize the library and
113 move.l #0,%sp@- | argc = NULL
114 jsr __exit | call the Board specific exit
117 move.l initial_isp,%a0 | if __exit returns then we can
118 movec %a0,%isp | restore the initial values
119 move.l initial_usp,%a0
121 move.l initial_msp,%a0
123 move.w initial_sr,%sr
130 * So initial stack registers and status register can be saved.
133 #define DECLARE_SPACE(_name,_space,_align) \
136 _name##: .space _space
138 #define DECLARE_LABEL(_name) \
142 #define DECLARE_PTR(_name) DECLARE_SPACE(_name,4,2)
143 #define DECLARE_U32(_name) DECLARE_SPACE(_name,4,2)
144 #define DECLARE_U16(_name) DECLARE_SPACE(_name,2,1)
146 DECLARE_U32(initial_isp)
147 DECLARE_U32(initial_msp)
148 DECLARE_U32(initial_usp)
149 DECLARE_U16(initial_sr)
152 * Require environment stuff
155 DECLARE_LABEL(_environ)
158 DECLARE_LABEL(__errno)
159 DECLARE_LABEL(_errno)
163 * Stack Size and Space
166 .set stack_size, 0x20000
168 DECLARE_SPACE(stack_memory,stack_size,4)
169 DECLARE_LABEL(stack_end)
171 DECLARE_SPACE(interrupt_stack_memory,0x1000,4)
172 DECLARE_LABEL(interrupt_stack_end)