source: rtems/c/src/lib/libbsp/m68k/sim68000/start/start.S @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on May 3, 2012 at 3:09:24 PM

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

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