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

4.104.114.84.95
Last change on this file since 1d2cfc0 was 1d2cfc0, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 27, 2000 at 4:59:57 PM

2000-11-27 Joel Sherrill <joel@…>

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