1 | /* entry.s |
---|
2 | * |
---|
3 | * This file contains the entry point for the application. |
---|
4 | * The name of this entry point is compiler dependent. |
---|
5 | * It jumps to the BSP which is responsible for performing |
---|
6 | * all initialization. |
---|
7 | * |
---|
8 | * COPYRIGHT (c) 1989-1999. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.org/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #include <rtems/asm.h> |
---|
17 | |
---|
18 | #if (M68K_COLDFIRE_ARCH == 0) /* All ColdFire BSPs must provide their own start vector */ |
---|
19 | |
---|
20 | BEGIN_CODE |
---|
21 | | Default entry points for: |
---|
22 | PUBLIC (start) | GNU |
---|
23 | PUBLIC (M68Kvec) | Vector Table |
---|
24 | |
---|
25 | SYM (start): |
---|
26 | SYM (M68Kvec): | standard location for vectors |
---|
27 | nop | for linkers with problem |
---|
28 | | location zero |
---|
29 | jmp SYM (start_around) |
---|
30 | |
---|
31 | /* |
---|
32 | * We can use the following space as our vector table |
---|
33 | * if the CPU has a VBR or we can save vector table in it |
---|
34 | * if the CPU does not. |
---|
35 | */ |
---|
36 | |
---|
37 | .space 4088 | to avoid initial intr stack |
---|
38 | | from 135BUG on MVME13? |
---|
39 | | and start code at 0x4000 |
---|
40 | SYM (vectors): |
---|
41 | .space 1016 | reserve space for rest of vectors |
---|
42 | |
---|
43 | #if ( M68K_HAS_SEPARATE_STACKS == 1 ) |
---|
44 | SYM (lowintstack): |
---|
45 | .space 4092 | reserve for interrupt stack |
---|
46 | SYM (hiintstack): |
---|
47 | .space 4 | end of interrupt stack |
---|
48 | #endif |
---|
49 | |
---|
50 | PUBLIC (start_around) |
---|
51 | SYM (start_around): |
---|
52 | move.w sr, SYM (initial_sr) |
---|
53 | oriw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!! |
---|
54 | #if ( M68K_HAS_SEPARATE_STACKS == 1 ) |
---|
55 | movec isp,a0 |
---|
56 | move.l a0, SYM (initial_isp) |
---|
57 | movec usp,a0 |
---|
58 | move.l a0, SYM (initial_usp) |
---|
59 | movec msp,a0 |
---|
60 | move.l a0, SYM (initial_msp) |
---|
61 | #else |
---|
62 | move.l a7, SYM (initial_msp) |
---|
63 | #endif |
---|
64 | |
---|
65 | | |
---|
66 | | zero out uninitialized data area |
---|
67 | | |
---|
68 | zerobss: |
---|
69 | moveal # SYM (bsp_section_bss_end),a0 | find end of .bss |
---|
70 | moveal # SYM (bsp_section_bss_begin),a1 | find beginning of .bss |
---|
71 | movel #0,d0 |
---|
72 | |
---|
73 | loop: movel #0,a1@+ | to zero out uninitialized |
---|
74 | cmpal a0,a1 |
---|
75 | jlt loop | loop until _end reached |
---|
76 | |
---|
77 | movel # SYM (_Configuration_Interrupt_stack_area_end),d0 | d0 = stop of stack |
---|
78 | movw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!! |
---|
79 | movel d0,a7 | set master stack pointer |
---|
80 | movel d0,a6 | set base pointer |
---|
81 | |
---|
82 | /* |
---|
83 | * RTEMS should maintain a separate interrupt stack on CPUs |
---|
84 | * without one in hardware. This is currently not supported |
---|
85 | * on versions of the m68k without a HW intr stack. |
---|
86 | */ |
---|
87 | |
---|
88 | #if ( M68K_HAS_SEPARATE_STACKS == 1 ) |
---|
89 | lea SYM (hiintstack),a0 | a0 = high end of intr stack |
---|
90 | movec a0,isp | set interrupt stack |
---|
91 | #endif |
---|
92 | |
---|
93 | movel #0,a7@- | push command line |
---|
94 | jsr SYM (boot_card) |
---|
95 | addl #12,a7 |
---|
96 | |
---|
97 | #if ( M68K_HAS_SEPARATE_STACKS == 1 ) |
---|
98 | move.l SYM (initial_isp),a0 |
---|
99 | movec a0,isp |
---|
100 | move.l SYM (initial_usp),a0 |
---|
101 | movec a0,usp |
---|
102 | move.l SYM (initial_msp),a0 |
---|
103 | movec a0,msp |
---|
104 | #else |
---|
105 | movea.l SYM (initial_msp),a7 |
---|
106 | #endif |
---|
107 | move.w SYM (initial_sr),sr |
---|
108 | rts |
---|
109 | |
---|
110 | END_CODE |
---|
111 | |
---|
112 | BEGIN_DATA |
---|
113 | |
---|
114 | PUBLIC (start_frame) |
---|
115 | SYM (start_frame): |
---|
116 | .space 4,0 |
---|
117 | |
---|
118 | END_DATA |
---|
119 | |
---|
120 | BEGIN_BSS |
---|
121 | |
---|
122 | PUBLIC (initial_isp) |
---|
123 | SYM (initial_isp): |
---|
124 | .space 4 |
---|
125 | |
---|
126 | PUBLIC (initial_msp) |
---|
127 | SYM (initial_msp): |
---|
128 | .space 4 |
---|
129 | |
---|
130 | PUBLIC (initial_usp) |
---|
131 | SYM (initial_usp): |
---|
132 | .space 4 |
---|
133 | |
---|
134 | PUBLIC (initial_sr) |
---|
135 | SYM (initial_sr): |
---|
136 | .space 2 |
---|
137 | |
---|
138 | END_DATA |
---|
139 | #endif |
---|
140 | END |
---|