source: anotherchoice/tags/jsp-1.4.4-full-UTF8/config/cfv2/start.S@ 26

Last change on this file since 26 was 26, checked in by ykominami, 10 years ago

initial

File size: 12.4 KB
Line 
1/*
2 * TOPPERS/JSP Kernel
3 * Toyohashi Open Platform for Embedded Real-Time Systems/
4 * Just Standard Profile Kernel
5 *
6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
7 * Toyohashi Univ. of Technology, JAPAN
8 * Copyright (C) 2007 by KURUSUGAWA Electronics Industry Inc, JAPAN
9 * Copyright (C) 2008 by Takahisa Yokota
10 *
11 * 上記著作権者
12は,以下の (1)〜(4) の条件か,Free Software Foundation
13 * によってå…
14¬è¡¨ã•ã‚Œã¦ã„ã‚‹ GNU General Public License の Version 2 に記
15 * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
16 * を改変したものを含む.以下同じ)を使用・複製・改変・再é…
17å¸ƒï¼ˆä»¥ä¸‹ï¼Œ
18 * 利用と呼ぶ)することを無償で許諾する.
19 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
20 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
21 * スコード中に含まれていること.
22 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
23 * 用できる形で再é…
24å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œå†é…
25å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨
26 * 者
27マニュアルなど)に,上記の著作権表示,この利用条件および下記
28 * の無保証規定を掲載すること.
29 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
30 * 用できない形で再é…
31å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œæ¬¡ã®ã„ずれかの条件を満たすこ
32 * と.
33 * (a) 再é…
34å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨è€…
35マニュアルなど)に,上記の著
36 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
37 * (b) 再é…
38å¸ƒã®å½¢æ…
39‹ã‚’,別に定める方法によって,TOPPERSプロジェクトに
40 * 報告すること.
41 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
42 * 害からも,上記著作権者
43およびTOPPERSプロジェクトをå…
44è²¬ã™ã‚‹ã“と.
45 *
46 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者
47お
48 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
49 * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
50 * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
51 *
52 * @(#) $Id: start.S,v 1.6 2003/06/04 01:51:39 hiro Exp $
53 */
54
55/*
56 * カーネル用のスタートアップモジュール(COLDFIRE用)
57 */
58
59#define _MACRO_ONLY
60#include <t_config.h>
61/*
62 *  例外ベクタの定義(COLDFIRE用)
63 *   ここではリセット時に必
64要な最低限のベクタしか用意しない
65 *   cpu_initialize()で例外ベクタの移動(VBRの書き換え)を行う
66 */
67#ifdef KERNEL_HAS_A_VECTOR_TABLE
68
69/*
70 * 以下の例外要因でデフォルトとは異なる例外ベクタを定義
71 * する場合は、sys_config.hで該当するマクロを定義する。
72 */
73 .section ".vector","ax"
74 .align 2
75 .long INIT_STACK /* 0:スタックポインタの初期値 */
76 .long TO_ASM(RESET_VECTOR) /* 1:パワーオンリセット */
77 .long TO_ASM(ACC_VECTOR) /* 2:アクセスエラー */
78 .long TO_ASM(ADD_VECTOR) /* 3:アドレスエラー */
79 .long TO_ASM(II_VECTOR) /* 4:一般不当命令 */
80 .long TO_ASM(RESERVED_VECTOR) /* 5:d zero */
81 .long TO_ASM(RESERVED_VECTOR) /* 6:予約 */
82 .long TO_ASM(II_VECTOR) /* 7:システム予約 */
83 .long TO_ASM(RESERVED_VECTOR) /* 8:pvシステム予約 */
84 .long TO_ASM(RESERVED_VECTOR) /* 9:trace */
85 .long TO_ASM(RESERVED_VECTOR) /* 10:line a emulator */
86 .long TO_ASM(RESERVED_VECTOR) /* 11:line f emulator */
87 .long TO_ASM(RESERVED_VECTOR) /* 12:システム予約 */
88 .long TO_ASM(RESERVED_VECTOR) /* 13:システム予約 */
89 .long TO_ASM(RESERVED_VECTOR) /* 14:システム予約 */
90 .long TO_ASM(RESERVED_VECTOR) /* 15:システム予約 */
91 .long TO_ASM(RESERVED_VECTOR) /* 16:システム予約 */
92 .long TO_ASM(RESERVED_VECTOR) /* 17:システム予約 */
93 .long TO_ASM(RESERVED_VECTOR) /* 18:システム予約 */
94 .long TO_ASM(RESERVED_VECTOR) /* 19:システム予約 */
95 .long TO_ASM(RESERVED_VECTOR) /* 20:システム予約 */
96 .long TO_ASM(RESERVED_VECTOR) /* 21:システム予約 */
97 .long TO_ASM(RESERVED_VECTOR) /* 22:システム予約 */
98 .long TO_ASM(RESERVED_VECTOR) /* 23:システム予約 */
99 .long TO_ASM(RESERVED_VECTOR) /* 24:スプリアス割り込み */
100 .long TO_ASM(RESERVED_VECTOR) /* 残りはデフォルトの例外処理 */
101 .long TO_ASM(RESERVED_VECTOR)
102 .long TO_ASM(RESERVED_VECTOR)
103 .long TO_ASM(RESERVED_VECTOR)
104 .long TO_ASM(RESERVED_VECTOR)
105 .long TO_ASM(RESERVED_VECTOR)
106 .long TO_ASM(RESERVED_VECTOR)
107 .long TO_ASM(RESERVED_VECTOR)
108 .long TO_ASM(RESERVED_VECTOR)
109 .long TO_ASM(RESERVED_VECTOR)
110 .long TO_ASM(RESERVED_VECTOR)
111 .long TO_ASM(RESERVED_VECTOR)
112 .long TO_ASM(RESERVED_VECTOR)
113 .long TO_ASM(RESERVED_VECTOR)
114 .long TO_ASM(RESERVED_VECTOR)
115 .long TO_ASM(RESERVED_VECTOR)
116 .long TO_ASM(RESERVED_VECTOR)
117 .long TO_ASM(RESERVED_VECTOR)
118 .long TO_ASM(RESERVED_VECTOR)
119 .long TO_ASM(RESERVED_VECTOR)
120 .long TO_ASM(RESERVED_VECTOR)
121 .long TO_ASM(RESERVED_VECTOR)
122 .long TO_ASM(RESERVED_VECTOR)
123 .long TO_ASM(RESERVED_VECTOR)
124 .long TO_ASM(RESERVED_VECTOR)
125 .long TO_ASM(RESERVED_VECTOR)
126 .long TO_ASM(RESERVED_VECTOR)
127 .long TO_ASM(RESERVED_VECTOR)
128 .long TO_ASM(RESERVED_VECTOR)
129 .long TO_ASM(RESERVED_VECTOR)
130 .long TO_ASM(RESERVED_VECTOR)
131 .long TO_ASM(RESERVED_VECTOR)
132 .long TO_ASM(RESERVED_VECTOR)
133 .long TO_ASM(RESERVED_VECTOR)
134 .long TO_ASM(RESERVED_VECTOR)
135 .long TO_ASM(RESERVED_VECTOR)
136 .long TO_ASM(RESERVED_VECTOR)
137 .long TO_ASM(RESERVED_VECTOR)
138 .long TO_ASM(RESERVED_VECTOR)
139 .long TO_ASM(RESERVED_VECTOR)
140 .long TO_ASM(RESERVED_VECTOR)
141 .long TO_ASM(RESERVED_VECTOR)
142 .long TO_ASM(RESERVED_VECTOR)
143 .long TO_ASM(RESERVED_VECTOR)
144 .long TO_ASM(RESERVED_VECTOR)
145 .long TO_ASM(RESERVED_VECTOR)
146 .long TO_ASM(RESERVED_VECTOR)
147 .long TO_ASM(RESERVED_VECTOR)
148 .long TO_ASM(RESERVED_VECTOR)
149 .long TO_ASM(RESERVED_VECTOR)
150 .long TO_ASM(RESERVED_VECTOR)
151 .long TO_ASM(RESERVED_VECTOR)
152 .long TO_ASM(RESERVED_VECTOR)
153 .long TO_ASM(RESERVED_VECTOR)
154 .long TO_ASM(RESERVED_VECTOR)
155 .long TO_ASM(RESERVED_VECTOR)
156 .long TO_ASM(RESERVED_VECTOR)
157 .long TO_ASM(RESERVED_VECTOR)
158 .long TO_ASM(RESERVED_VECTOR)
159 .long TO_ASM(RESERVED_VECTOR)
160 .long TO_ASM(RESERVED_VECTOR)
161 .long TO_ASM(RESERVED_VECTOR)
162 .long TO_ASM(RESERVED_VECTOR)
163 .long TO_ASM(RESERVED_VECTOR)
164 .long TO_ASM(RESERVED_VECTOR)
165 .long TO_ASM(RESERVED_VECTOR)
166 .long TO_ASM(RESERVED_VECTOR)
167 .long TO_ASM(RESERVED_VECTOR)
168 .long TO_ASM(RESERVED_VECTOR)
169 .long TO_ASM(RESERVED_VECTOR)
170 .long TO_ASM(RESERVED_VECTOR)
171 .long TO_ASM(RESERVED_VECTOR)
172 .long TO_ASM(RESERVED_VECTOR)
173 .long TO_ASM(RESERVED_VECTOR)
174 .long TO_ASM(RESERVED_VECTOR)
175 .long TO_ASM(RESERVED_VECTOR)
176 .long TO_ASM(RESERVED_VECTOR)
177 .long TO_ASM(RESERVED_VECTOR)
178 .long TO_ASM(RESERVED_VECTOR)
179 .long TO_ASM(RESERVED_VECTOR)
180 .long TO_ASM(RESERVED_VECTOR)
181 .long TO_ASM(RESERVED_VECTOR)
182 .long TO_ASM(RESERVED_VECTOR)
183 .long TO_ASM(RESERVED_VECTOR)
184 .long TO_ASM(RESERVED_VECTOR)
185 .long TO_ASM(RESERVED_VECTOR)
186 .long TO_ASM(RESERVED_VECTOR)
187 .long TO_ASM(RESERVED_VECTOR)
188 .long TO_ASM(RESERVED_VECTOR)
189 .long TO_ASM(RESERVED_VECTOR)
190 .long TO_ASM(RESERVED_VECTOR)
191 .long TO_ASM(RESERVED_VECTOR)
192 .long TO_ASM(RESERVED_VECTOR)
193 .long TO_ASM(RESERVED_VECTOR)
194 .long TO_ASM(RESERVED_VECTOR)
195 .long TO_ASM(RESERVED_VECTOR)
196 .long TO_ASM(RESERVED_VECTOR)
197 .long TO_ASM(RESERVED_VECTOR)
198 .long TO_ASM(RESERVED_VECTOR)
199 .long TO_ASM(RESERVED_VECTOR)
200 .long TO_ASM(RESERVED_VECTOR)
201 .long TO_ASM(RESERVED_VECTOR)
202 .long TO_ASM(RESERVED_VECTOR)
203 .long TO_ASM(RESERVED_VECTOR)
204 .long TO_ASM(RESERVED_VECTOR)
205 .long TO_ASM(RESERVED_VECTOR)
206 .long TO_ASM(RESERVED_VECTOR)
207 .long TO_ASM(RESERVED_VECTOR)
208 .long TO_ASM(RESERVED_VECTOR)
209 .long TO_ASM(RESERVED_VECTOR)
210 .long TO_ASM(RESERVED_VECTOR)
211 .long TO_ASM(RESERVED_VECTOR)
212 .long TO_ASM(RESERVED_VECTOR)
213 .long TO_ASM(RESERVED_VECTOR)
214 .long TO_ASM(RESERVED_VECTOR)
215 .long TO_ASM(RESERVED_VECTOR)
216 .long TO_ASM(RESERVED_VECTOR)
217 .long TO_ASM(RESERVED_VECTOR)
218 .long TO_ASM(RESERVED_VECTOR)
219 .long TO_ASM(RESERVED_VECTOR)
220 .long TO_ASM(RESERVED_VECTOR)
221 .long TO_ASM(RESERVED_VECTOR)
222 .long TO_ASM(RESERVED_VECTOR)
223 .long TO_ASM(RESERVED_VECTOR)
224 .long TO_ASM(RESERVED_VECTOR)
225 .long TO_ASM(RESERVED_VECTOR)
226 .long TO_ASM(RESERVED_VECTOR)
227 .long TO_ASM(RESERVED_VECTOR)
228 .long TO_ASM(RESERVED_VECTOR)
229 .long TO_ASM(RESERVED_VECTOR)
230 .long TO_ASM(RESERVED_VECTOR)
231 .long TO_ASM(RESERVED_VECTOR)
232 .long TO_ASM(RESERVED_VECTOR)
233 .long TO_ASM(RESERVED_VECTOR)
234 .long TO_ASM(RESERVED_VECTOR)
235 .long TO_ASM(RESERVED_VECTOR)
236 .long TO_ASM(RESERVED_VECTOR)
237 .long TO_ASM(RESERVED_VECTOR)
238 .long TO_ASM(RESERVED_VECTOR)
239 .long TO_ASM(RESERVED_VECTOR)
240 .long TO_ASM(RESERVED_VECTOR)
241 .long TO_ASM(RESERVED_VECTOR)
242 .long TO_ASM(RESERVED_VECTOR)
243 .long TO_ASM(RESERVED_VECTOR)
244 .long TO_ASM(RESERVED_VECTOR)
245 .long TO_ASM(RESERVED_VECTOR)
246 .long TO_ASM(RESERVED_VECTOR)
247 .long TO_ASM(RESERVED_VECTOR)
248 .long TO_ASM(RESERVED_VECTOR)
249 .long TO_ASM(RESERVED_VECTOR)
250 .long TO_ASM(RESERVED_VECTOR)
251 .long TO_ASM(RESERVED_VECTOR)
252 .long TO_ASM(RESERVED_VECTOR)
253 .long TO_ASM(RESERVED_VECTOR)
254 .long TO_ASM(RESERVED_VECTOR)
255 .long TO_ASM(RESERVED_VECTOR)
256 .long TO_ASM(RESERVED_VECTOR)
257 .long TO_ASM(RESERVED_VECTOR)
258 .long TO_ASM(RESERVED_VECTOR)
259 .long TO_ASM(RESERVED_VECTOR)
260 .long TO_ASM(RESERVED_VECTOR)
261 .long TO_ASM(RESERVED_VECTOR)
262 .long TO_ASM(RESERVED_VECTOR)
263 .long TO_ASM(RESERVED_VECTOR)
264 .long TO_ASM(RESERVED_VECTOR)
265 .long TO_ASM(RESERVED_VECTOR)
266 .long TO_ASM(RESERVED_VECTOR)
267
268 /* CF-Flash Protection Field */
269 .org 0x400
270 .long 0xFFFFFFFF
271 .long 0xFFFFFFFF
272 .long 0x00000000
273 .long 0x00000000
274 .long 0x00000000
275 .long 0xFFFFFFFF
276
277#endif /* KERNEL_HAS_A_VECTOR_TABLE */
278 .text
279 .globl start
280 .align 2
281start:
282 /*
283 * プロセッサモードとスタックポインタの初期化
284 */
285 move.l #0x2700, %d0
286 move.w %d0, %sr
287
288 /* SRAMベースアドレスの初期化 */
289 move.l #0x20000000, %d0
290 add.l #0x21, %d0
291 .long 0x4e7b0C05 /* movec %d0, %rambar1 */
292
293 /* ROMベースアドレスの初期化 */
294 move.l #0x00000000, %d0
295 add.l #0x21, %d0
296 .long 0x4e7b0C04 /* movec %d0, %flashbar */
297
298 movea.l #INIT_STACK, %sp /* フレームポインタの初期化 */
299 movea.l #0, %fp
300 /*
301 * hardware_init_hook の呼出し(0 でない場合)
302 *
303 * ターゲットハードウェアに依存して必
304要な初期化処理がある場合
305 * は,hardware_init_hook という関数を用意する.
306 */
307 lea hardware_init_hook, %a0
308 tst.l %a0
309 jbeq start_1
310 jsr %a0@
311start_1:
312 move.l #__bss_start, %a0
313 move.l #_end, %d0
314 sub.l %a0, %d0
315 jbeq start_3
316start_2:
317 clr.b (%a0)+
318 subq.l #1, %d0
319 bne start_2
320 clr.w %d0
321 subq.l #1, %d0
322 jbcc start_2
323
324 /*
325 * dataセクションの初期化(ROM化対応)
326 *
327 * __idata_start から __idata_end までを,__data_start 以降に
328 * コピーする.
329 */
330start_3:
331 move.l #__idata_end, %d0
332 sub.l #__idata_start, %d0
333 jbls start_5
334 move.l #__idata_start, %a0
335 move.l #__data_start, %a1
336start_4:
337 move.b (%a0)+, (%a1)+
338 subq.l #1, %d0
339 bne start_4
340 clr.w %d0
341 subq.l #1, %d0
342 jbcc start_4
343
344 /*
345 * software_init_hook を呼出し(0 でない場合)
346 *
347 * ソフトウェア環境(特にライブラリ)に依存して必
348要な初期化処
349 * 理がある場合は,software_init_hook という関数を用意すれば
350 * よい.
351 */
352start_5:
353 lea software_init_hook, %a0
354 tst.l %a0
355 jbeq start_6
356 jsr %a0@
357
358 /*
359 * カーネルを起動する.
360 */
361start_6:
362 jmp kernel_start
Note: See TracBrowser for help on using the repository browser.