📄 start.s
字号:
/* * TOPPERS/JSP Kernel * Toyohashi Open Platform for Embedded Real-Time Systems/ * Just Standard Profile Kernel * * Copyright (C) 2000-2002 by Embedded and Real-Time Systems Laboratory * Toyohashi Univ. of Technology, JAPAN * Copyright (C) 2001,2002 by Industrial Technology Institute, * Miyagi Prefectural Government, JAPAN * * 惧淡螟侯涪荚は·Free Software Foundation によって给山されている * GNU General Public License の Version 2 に淡揭されている掘凤か·笆 * 布の(1)×(4)の掘凤を塔たす眷圭に嘎り·塑ソフトウェア∈塑ソフトウェ * アを猖恃したものを崔むˉ笆布票じ∷を蝗脱ˇ剩澜ˇ猖恃ˇ浩芹邵∈笆布· * 网脱と钙ぶ∷することを痰浸で钓满するˉ * (1) 塑ソフトウェアをソ〖スコ〖ドの妨で网脱する眷圭には·惧淡の螟侯 * 涪山绩·この网脱掘凤および布淡の痰瘦沮惮年が·そのままの妨でソ〖 * スコ〖ド面に崔まれていることˉ * (2) 塑ソフトウェアを浩网脱材墙なバイナリコ〖ド∈リロケ〖タブルオブ * ジェクトファイルやライブラリなど∷の妨で网脱する眷圭には·网脱 * に燃うドキュメント∈网脱荚マニュアルなど∷に·惧淡の螟侯涪山绩· * この网脱掘凤および布淡の痰瘦沮惮年を非很することˉ * (3) 塑ソフトウェアを浩网脱稍材墙なバイナリコ〖ドの妨または怠达に寥 * み哈んだ妨で网脱する眷圭には·肌のいずれかの掘凤を塔たすことˉ * (a) 网脱に燃うドキュメント∈网脱荚マニュアルなど∷に·惧淡の螟侯 * 涪山绩·この网脱掘凤および布淡の痰瘦沮惮年を非很することˉ * (b) 网脱の妨轮を·侍に年める数恕によって·惧淡螟侯涪荚に鼠桂する * ことˉ * (4) 塑ソフトウェアの网脱により木儡弄または粗儡弄に栏じるいかなる禄 * 巢からも·惧淡螟侯涪荚を倘勒することˉ * * 塑ソフトウェアは·痰瘦沮で捏丁されているものであるˉ惧淡螟侯涪荚は· * 塑ソフトウェアに簇して·その努脱材墙拉も崔めて·いかなる瘦沮も乖わ * ないˉまた·塑ソフトウェアの网脱により木儡弄または粗儡弄に栏じたい * かなる禄巢に簇しても·その勒扦を砷わないˉ * * @(#) $Id: start.S,v 1.5 2002/04/11 11:30:20 imai Exp $ */#define _MACRO_ONLY#include "sys_config.h"#include "cpu_config.h"/* リセットベクタの年盗 */#ifdef WITH_STUB 庙罢¨スタブ窗喇稿に年盗#else#define _reset_start _start#endif /* WITH_STUB */#define _init_stack STACKTOP#ifndef CQ_SH1_DEB .section ".vector","ax" .align 4 .long _reset_start /* パワ〖オンリセット */ .long _init_stack .long _reset_start /* マニュアルリセット */ .long _init_stack /* 荒りはデフォルトの毋嘲借妄 */ .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception .long _no_reg_exception/* * SH1脱スタ〖トアップモジュ〖ル * カ〖ネルはアプリケ〖ションとリンクして蝗脱する * だけなのでJSPカ〖ネルのみ蝗脱する。 */ .global _start .section .text .align 2_start: /* * SRを介袋步する。∈充哈み敦贿∷ * IPM=0xe * stub悸乖箕のみIPM=0xfとなる。 */ mov.l _init_sr,r0 ldc r0,sr /* * 润タスクコンテストのスタックをSTACKTOPに介袋步する * STACKTOPは、sys_config.hで年盗 */ mov.l _stack_k, r15 /* * _hardware_init_hook を钙び叫す。(0でない眷圭) * * ハ〖ドウェア巴赂に涩妥な介袋步借妄がある眷圭は· * hardware_init_hook という簇眶を脱罢すればよいˉ * 恶挛弄にはROM步の狠、RAMを蝗脱材墙にするための * バスコントロ〖ラの介袋步霹を乖う。 * sys_support.S 柒で hardware_init_hook を年盗してい * るˉ */start_0: mov.l _hardware_init_k, r0 tst r0,r0 bt start_1 jsr @r0 nop /* * bssセクションをクリア */start_1: mov.l _bss_start_k,r0 mov.l _end_k,r1 cmp/eq r0,r1 bt start_3 mov #0,r2start_2: /* * r0のインクリメントが鹃墓に斧えるが * mov.l r4,@r0+炭吾はない * ディスティネ〖ションのアドレスはディクリメントのみ */ mov.l r2,@r0 add #4,r0 cmp/hi r0,r1 bt start_2 /* * dataセクションを介袋步する∈ROM步滦炳∷ˉ * * __idata_start から __idata_end までを·__data_start 笆惯に * コピ〖するˉ */start_3:#ifndef USE_ICE /* 悸怠の眷圭 */ mov.l __idata_start_k,r1 mov.l __idata_end_k,r2 cmp/eq r1,r2 bt start_5 mov.l __data_start_k,r0start_4: mov.l @r1+,r4 mov.l r4,@r0 cmp/hi r1,r2 add #4,r0 bt start_4#endif /* USE_ICE */ /* * software_init_hook を钙び叫す∈0 でない眷圭∷ˉ * * ソフトウェア茨董∈泼にライブラリ∷に巴赂して涩妥な介袋步借 * 妄がある眷圭は·software_init_hook という簇眶を脱罢すれば * よいˉ */start_5: mov.l _software_init_hook_k, r0 tst r0,r0 bt start_6 jsr @r0 nopstart_6: /* * カ〖ネルを弹瓢する */ ! call the mainline mov.l _kernel_start_k,r0 jsr @r0 nop .align 4_intnest_k: .long _intnest_init_sr: .long MAX_IPM << 4_stack_k: .long STACKTOP_bss_start_k: .long __bss_start#ifdef USE_ICE /* ICEでスタック挝拌を囱弧する眷圭 */ /* 润タスクコンテキストの */ /* スタック挝拌も介袋步する */_end_k: .long STACKTOP#else /* 悸怠の眷圭 */_end_k: .long _end#endif /* USE_ICE */#ifndef USE_ICE /* 悸怠の眷圭 */__idata_start_k: .long __idata_start__idata_end_k: .long __idata_end__data_start_k: .long __data_start#endif /* USE_ICE */_kernel_start_k: .long _kernel_start_hardware_init_k: .long _hardware_init_hook_software_init_hook_k: .long _software_init_hook#endif /* CQ_SH1_DEB */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -