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

4.104.114.84.95
Last change on this file since b812f84 was b812f84, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 1, 2000 at 8:01:14 PM

Added sim68000 BSP for the BSVC simulator. This BSP includes the
alias simcpu32 that supports the CPU32 simulator in BSVC. At this
point, it is still under development.

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