source: rtems/c/src/lib/libbsp/m68k/sim68000/start/start.S @ 37b2f34

4.104.114.84.95
Last change on this file since 37b2f34 was 37b2f34, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 30, 2001 at 2:30:08 PM

2001-10-30 Joel Sherrill <joel@…>

  • start/start.S: Use mcpu32 instead of mcpu32 and change sense of conditional so cpu32 does not attempt to use 68000 style interrupt vectoring.
  • Property mode set to 100644
File size: 10.4 KB
Line 
1/* 
2 *  $Id$
3 *
4 *  Re-written the gen68302 start-up code.
5 * 
6 *  Uses gas syntax only, removed the OAR asm.h.
7 * 
8 *  Supplies a complete vector table in ROM.
9 * 
10 *  Manages all vectors with seperate handlers to trap unhandled
11 *  execptions.
12 * 
13 *  Uses the target specific header file to get the runtime
14 *  configuration
15 * 
16 *  COPYRIGHT (c) 1996
17 *  Objective Design Systems Pty Ltd (ODS)
18 *       
19 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
20 *  On-Line Applications Research Corporation (OAR).
21 *  All rights assigned to U.S. Government, 1994.
22 *
23 *  This material may be reproduced by or for the U.S. Government pursuant
24 *  to the copyright license under the clause at DFARS 252.227-7013.  This
25 *  notice must appear in all copies of this file and its derivatives.
26 *
27 */
28
29#define STACK_AT_RESET    0x0
30
31|
32| Boot boot code in a special section, ld postions
33|
34| Initial stack pointer is in the dual ported RAM
35|
36        .sect   .text
37
38        .global _start                  | program entry
39        .global M68Kvec                 | Vector Table
40       
41_start:                                 | standard name for program entry
42M68Kvec:                                | standard location for vectors
43       
44|
45| Make relative, can have the code positioned any where
46|
47
48V___ISSP: .long  STACK_AT_RESET
49V____IPC: .long  start - V___ISSP
50       
51|
52| Create the rest of the vector table to point to the unhandled expection
53| handler
54|
55| Lots of macros, how-ever it creates a simple ROM vector table
56|
57
58#if defined(__mcpu32__)
59        .space   1016                   | reserve space for rest of vectors
60#else
61#define MAKE_EXCEPTION_VECTOR(n) V___##n: .long (_CPU_ISR_jump_table  + (n * 10))
62
63MAKE_EXCEPTION_VECTOR(2)
64MAKE_EXCEPTION_VECTOR(3)
65MAKE_EXCEPTION_VECTOR(4)
66MAKE_EXCEPTION_VECTOR(5)
67MAKE_EXCEPTION_VECTOR(6)
68MAKE_EXCEPTION_VECTOR(7)
69MAKE_EXCEPTION_VECTOR(8)
70MAKE_EXCEPTION_VECTOR(9)
71       
72MAKE_EXCEPTION_VECTOR(10)
73MAKE_EXCEPTION_VECTOR(11)
74MAKE_EXCEPTION_VECTOR(12)
75MAKE_EXCEPTION_VECTOR(13)
76MAKE_EXCEPTION_VECTOR(14)
77MAKE_EXCEPTION_VECTOR(15)
78MAKE_EXCEPTION_VECTOR(16)
79MAKE_EXCEPTION_VECTOR(17)
80MAKE_EXCEPTION_VECTOR(18)
81MAKE_EXCEPTION_VECTOR(19)
82
83MAKE_EXCEPTION_VECTOR(20)
84MAKE_EXCEPTION_VECTOR(21)
85MAKE_EXCEPTION_VECTOR(22)
86MAKE_EXCEPTION_VECTOR(23)
87MAKE_EXCEPTION_VECTOR(24)
88MAKE_EXCEPTION_VECTOR(25)
89MAKE_EXCEPTION_VECTOR(26)
90MAKE_EXCEPTION_VECTOR(27)
91MAKE_EXCEPTION_VECTOR(28)
92MAKE_EXCEPTION_VECTOR(29)
93       
94MAKE_EXCEPTION_VECTOR(30)
95MAKE_EXCEPTION_VECTOR(31)
96MAKE_EXCEPTION_VECTOR(32)
97MAKE_EXCEPTION_VECTOR(33)
98MAKE_EXCEPTION_VECTOR(34)
99MAKE_EXCEPTION_VECTOR(35)
100MAKE_EXCEPTION_VECTOR(36)
101MAKE_EXCEPTION_VECTOR(37)
102MAKE_EXCEPTION_VECTOR(38)
103MAKE_EXCEPTION_VECTOR(39)
104       
105MAKE_EXCEPTION_VECTOR(40)
106MAKE_EXCEPTION_VECTOR(41)
107MAKE_EXCEPTION_VECTOR(42)
108MAKE_EXCEPTION_VECTOR(43)
109MAKE_EXCEPTION_VECTOR(44)
110MAKE_EXCEPTION_VECTOR(45)
111MAKE_EXCEPTION_VECTOR(46)
112MAKE_EXCEPTION_VECTOR(47)
113MAKE_EXCEPTION_VECTOR(48)
114MAKE_EXCEPTION_VECTOR(49)
115       
116MAKE_EXCEPTION_VECTOR(50)
117MAKE_EXCEPTION_VECTOR(51)
118MAKE_EXCEPTION_VECTOR(52)
119MAKE_EXCEPTION_VECTOR(53)
120MAKE_EXCEPTION_VECTOR(54)
121MAKE_EXCEPTION_VECTOR(55)
122MAKE_EXCEPTION_VECTOR(56)
123MAKE_EXCEPTION_VECTOR(57)
124MAKE_EXCEPTION_VECTOR(58)
125MAKE_EXCEPTION_VECTOR(59)
126       
127MAKE_EXCEPTION_VECTOR(60)
128MAKE_EXCEPTION_VECTOR(61)
129MAKE_EXCEPTION_VECTOR(62)
130MAKE_EXCEPTION_VECTOR(63)
131MAKE_EXCEPTION_VECTOR(64)
132MAKE_EXCEPTION_VECTOR(65)
133MAKE_EXCEPTION_VECTOR(66)
134MAKE_EXCEPTION_VECTOR(67)
135MAKE_EXCEPTION_VECTOR(68)
136MAKE_EXCEPTION_VECTOR(69)
137       
138MAKE_EXCEPTION_VECTOR(70)
139MAKE_EXCEPTION_VECTOR(71)
140MAKE_EXCEPTION_VECTOR(72)
141MAKE_EXCEPTION_VECTOR(73)
142MAKE_EXCEPTION_VECTOR(74)
143MAKE_EXCEPTION_VECTOR(75)
144MAKE_EXCEPTION_VECTOR(76)
145MAKE_EXCEPTION_VECTOR(77)
146MAKE_EXCEPTION_VECTOR(78)
147MAKE_EXCEPTION_VECTOR(79)
148       
149MAKE_EXCEPTION_VECTOR(80)
150MAKE_EXCEPTION_VECTOR(81)
151MAKE_EXCEPTION_VECTOR(82)
152MAKE_EXCEPTION_VECTOR(83)
153MAKE_EXCEPTION_VECTOR(84)
154MAKE_EXCEPTION_VECTOR(85)
155MAKE_EXCEPTION_VECTOR(86)
156MAKE_EXCEPTION_VECTOR(87)
157MAKE_EXCEPTION_VECTOR(88)
158MAKE_EXCEPTION_VECTOR(89)
159       
160MAKE_EXCEPTION_VECTOR(90)
161MAKE_EXCEPTION_VECTOR(91)
162MAKE_EXCEPTION_VECTOR(92)
163MAKE_EXCEPTION_VECTOR(93)
164MAKE_EXCEPTION_VECTOR(94)
165MAKE_EXCEPTION_VECTOR(95)
166MAKE_EXCEPTION_VECTOR(96)
167MAKE_EXCEPTION_VECTOR(97)
168MAKE_EXCEPTION_VECTOR(98)
169MAKE_EXCEPTION_VECTOR(99)
170       
171MAKE_EXCEPTION_VECTOR(100)
172MAKE_EXCEPTION_VECTOR(101)
173MAKE_EXCEPTION_VECTOR(102)
174MAKE_EXCEPTION_VECTOR(103)
175MAKE_EXCEPTION_VECTOR(104)
176MAKE_EXCEPTION_VECTOR(105)
177MAKE_EXCEPTION_VECTOR(106)
178MAKE_EXCEPTION_VECTOR(107)
179MAKE_EXCEPTION_VECTOR(108)
180MAKE_EXCEPTION_VECTOR(109)
181       
182MAKE_EXCEPTION_VECTOR(110)
183MAKE_EXCEPTION_VECTOR(111)
184MAKE_EXCEPTION_VECTOR(112)
185MAKE_EXCEPTION_VECTOR(113)
186MAKE_EXCEPTION_VECTOR(114)
187MAKE_EXCEPTION_VECTOR(115)
188MAKE_EXCEPTION_VECTOR(116)
189MAKE_EXCEPTION_VECTOR(117)
190MAKE_EXCEPTION_VECTOR(118)
191MAKE_EXCEPTION_VECTOR(119)
192
193MAKE_EXCEPTION_VECTOR(120)
194MAKE_EXCEPTION_VECTOR(121)
195MAKE_EXCEPTION_VECTOR(122)
196MAKE_EXCEPTION_VECTOR(123)
197MAKE_EXCEPTION_VECTOR(124)
198MAKE_EXCEPTION_VECTOR(125)
199MAKE_EXCEPTION_VECTOR(126)
200MAKE_EXCEPTION_VECTOR(127)
201MAKE_EXCEPTION_VECTOR(128)
202MAKE_EXCEPTION_VECTOR(129)
203       
204MAKE_EXCEPTION_VECTOR(130)
205MAKE_EXCEPTION_VECTOR(131)
206MAKE_EXCEPTION_VECTOR(132)
207MAKE_EXCEPTION_VECTOR(133)
208MAKE_EXCEPTION_VECTOR(134)
209MAKE_EXCEPTION_VECTOR(135)
210MAKE_EXCEPTION_VECTOR(136)
211MAKE_EXCEPTION_VECTOR(137)
212MAKE_EXCEPTION_VECTOR(138)
213MAKE_EXCEPTION_VECTOR(139)
214                       
215MAKE_EXCEPTION_VECTOR(140)
216MAKE_EXCEPTION_VECTOR(141)
217MAKE_EXCEPTION_VECTOR(142)
218MAKE_EXCEPTION_VECTOR(143)
219MAKE_EXCEPTION_VECTOR(144)
220MAKE_EXCEPTION_VECTOR(145)
221MAKE_EXCEPTION_VECTOR(146)
222MAKE_EXCEPTION_VECTOR(147)
223MAKE_EXCEPTION_VECTOR(148)
224MAKE_EXCEPTION_VECTOR(149)
225       
226MAKE_EXCEPTION_VECTOR(150)
227MAKE_EXCEPTION_VECTOR(151)
228MAKE_EXCEPTION_VECTOR(152)
229MAKE_EXCEPTION_VECTOR(153)
230MAKE_EXCEPTION_VECTOR(154)
231MAKE_EXCEPTION_VECTOR(155)
232MAKE_EXCEPTION_VECTOR(156)
233MAKE_EXCEPTION_VECTOR(157)
234MAKE_EXCEPTION_VECTOR(158)
235MAKE_EXCEPTION_VECTOR(159)
236                       
237MAKE_EXCEPTION_VECTOR(160)
238MAKE_EXCEPTION_VECTOR(161)
239MAKE_EXCEPTION_VECTOR(162)
240MAKE_EXCEPTION_VECTOR(163)
241MAKE_EXCEPTION_VECTOR(164)
242MAKE_EXCEPTION_VECTOR(165)
243MAKE_EXCEPTION_VECTOR(166)
244MAKE_EXCEPTION_VECTOR(167)
245MAKE_EXCEPTION_VECTOR(168)
246MAKE_EXCEPTION_VECTOR(169)
247       
248MAKE_EXCEPTION_VECTOR(170)
249MAKE_EXCEPTION_VECTOR(171)
250MAKE_EXCEPTION_VECTOR(172)
251MAKE_EXCEPTION_VECTOR(173)
252MAKE_EXCEPTION_VECTOR(174)
253MAKE_EXCEPTION_VECTOR(175)
254MAKE_EXCEPTION_VECTOR(176)
255MAKE_EXCEPTION_VECTOR(177)
256MAKE_EXCEPTION_VECTOR(178)
257MAKE_EXCEPTION_VECTOR(179)
258                       
259MAKE_EXCEPTION_VECTOR(180)
260MAKE_EXCEPTION_VECTOR(181)
261MAKE_EXCEPTION_VECTOR(182)
262MAKE_EXCEPTION_VECTOR(183)
263MAKE_EXCEPTION_VECTOR(184)
264MAKE_EXCEPTION_VECTOR(185)
265MAKE_EXCEPTION_VECTOR(186)
266MAKE_EXCEPTION_VECTOR(187)
267MAKE_EXCEPTION_VECTOR(188)
268MAKE_EXCEPTION_VECTOR(189)
269       
270MAKE_EXCEPTION_VECTOR(190)
271MAKE_EXCEPTION_VECTOR(191)
272MAKE_EXCEPTION_VECTOR(192)
273MAKE_EXCEPTION_VECTOR(193)
274MAKE_EXCEPTION_VECTOR(194)
275MAKE_EXCEPTION_VECTOR(195)
276MAKE_EXCEPTION_VECTOR(196)
277MAKE_EXCEPTION_VECTOR(197)
278MAKE_EXCEPTION_VECTOR(198)
279MAKE_EXCEPTION_VECTOR(199)
280       
281MAKE_EXCEPTION_VECTOR(200)
282MAKE_EXCEPTION_VECTOR(201)
283MAKE_EXCEPTION_VECTOR(202)
284MAKE_EXCEPTION_VECTOR(203)
285MAKE_EXCEPTION_VECTOR(204)
286MAKE_EXCEPTION_VECTOR(205)
287MAKE_EXCEPTION_VECTOR(206)
288MAKE_EXCEPTION_VECTOR(207)
289MAKE_EXCEPTION_VECTOR(208)
290MAKE_EXCEPTION_VECTOR(209)
291                     
292MAKE_EXCEPTION_VECTOR(210)
293MAKE_EXCEPTION_VECTOR(211)
294MAKE_EXCEPTION_VECTOR(212)
295MAKE_EXCEPTION_VECTOR(213)
296MAKE_EXCEPTION_VECTOR(214)
297MAKE_EXCEPTION_VECTOR(215)
298MAKE_EXCEPTION_VECTOR(216)
299MAKE_EXCEPTION_VECTOR(217)
300MAKE_EXCEPTION_VECTOR(218)
301MAKE_EXCEPTION_VECTOR(219)
302                     
303MAKE_EXCEPTION_VECTOR(220)
304MAKE_EXCEPTION_VECTOR(221)
305MAKE_EXCEPTION_VECTOR(222)
306MAKE_EXCEPTION_VECTOR(223)
307MAKE_EXCEPTION_VECTOR(224)
308MAKE_EXCEPTION_VECTOR(225)
309MAKE_EXCEPTION_VECTOR(226)
310MAKE_EXCEPTION_VECTOR(227)
311MAKE_EXCEPTION_VECTOR(228)
312MAKE_EXCEPTION_VECTOR(229)
313                     
314MAKE_EXCEPTION_VECTOR(230)
315MAKE_EXCEPTION_VECTOR(231)
316MAKE_EXCEPTION_VECTOR(232)
317MAKE_EXCEPTION_VECTOR(233)
318MAKE_EXCEPTION_VECTOR(234)
319MAKE_EXCEPTION_VECTOR(235)
320MAKE_EXCEPTION_VECTOR(236)
321MAKE_EXCEPTION_VECTOR(237)
322MAKE_EXCEPTION_VECTOR(238)
323MAKE_EXCEPTION_VECTOR(239)
324                     
325MAKE_EXCEPTION_VECTOR(240)
326MAKE_EXCEPTION_VECTOR(241)
327MAKE_EXCEPTION_VECTOR(242)
328MAKE_EXCEPTION_VECTOR(243)
329MAKE_EXCEPTION_VECTOR(244)
330MAKE_EXCEPTION_VECTOR(245)
331MAKE_EXCEPTION_VECTOR(246)
332MAKE_EXCEPTION_VECTOR(247)
333MAKE_EXCEPTION_VECTOR(248)
334MAKE_EXCEPTION_VECTOR(249)
335                     
336MAKE_EXCEPTION_VECTOR(250)
337MAKE_EXCEPTION_VECTOR(251)
338MAKE_EXCEPTION_VECTOR(252)
339MAKE_EXCEPTION_VECTOR(253)
340MAKE_EXCEPTION_VECTOR(254)
341MAKE_EXCEPTION_VECTOR(255)                               
342#endif
343
344|
345| Start
346|
347| Entered from a hardware reset.
348|
349       
350        .global start                           | Default entry point for GNU
351start:
352
353        |
354        | Copy initialized data area from ROM to RAM
355        |
356
357copy_data:
358        moveal  #_etext,%a0                     | find the end of .text
359        moveal  #_copy_start,%a1                | find the beginning of .data
360        moveal  #_edata,%a2                     | find the end of .data
361       
362copy_data_loop:
363       
364        movel   %a0@+,%a1@+                     | copy the data
365        cmpal   %a2,%a1
366        jlt     copy_data_loop                  | loop until edata reached
367                               
368        |
369        | zero out uninitialized data area
370        |
371
372zerobss:
373        moveal  #_clear_end,%a0                 | find end of .bss
374        moveal  #_clear_start,%a1               | find beginning of .bss
375        moveq   #0,%d0
376       
377zerobss_loop:
378       
379        movel   %d0,%a1@+                       | to zero out uninitialized
380        cmpal   %a0,%a1
381        jlt     zerobss_loop                    | loop until _end reached
382
383        movel   #_stack_init,%d0                | load stack top
384
385        movw    #0x3700,%sr                     | SUPV MODE,INTERRUPTS OFF!!!
386        movel   %d0,%a7                         | set master stack pointer
387        movel   %d0,%a6                         | set base pointer
388
389        pea     env                             | push environp
390        pea     arg                             | push argv
391        movel   #0,%a7@-                        | push argc
392        jsr     boot_card
393        | if this returns, what do we do???
394
395        .global bsp_exitted
396bsp_exitted:
397        jmp     bsp_exitted
398
399
400|               
401| Initialised data
402|
403
404        .sect   .data
405       
406|
407| Uninitialised data
408|
409
410        .sect   .bss
411       
412env: .long  0
413arg: .long  0
414
415        .global environ
416        .align  2
417       
418environ:
419        .long   env
420
Note: See TracBrowser for help on using the repository browser.