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

4.104.114.84.95
Last change on this file since cba119c9 was f05b2ac, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 21, 2004 at 4:01:48 PM

Remove duplicate white lines.

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