source: asp_ewarm/asp-1.7.0/arch/arm_m_iccarm/start.S@ 61

Last change on this file since 61 was 61, checked in by ertl-honda, 11 years ago

ASP for EWARM のコミット.

File size: 4.3 KB
Line 
1/*
2 * TOPPERS Software
3 * Toyohashi Open Platform for Embedded Real-Time Systems
4 *
5 * Copyright (C) 2008 by Embedded and Real-Time Systems Laboratory
6 * Graduate School of Information Science, Nagoya Univ., JAPAN
7 *
8 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
9 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
10 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
11 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
12 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
13 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
14 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
15 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
16ƒƒ“ƒgi—˜—p
17 * ŽÒƒ}ƒjƒ…
18ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
19 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
20 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
21 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
22 * ‚ƁD
23 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
24ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
25ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
26 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
27 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
28 * •ñ‚·‚邱‚ƁD
29 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
30 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
31 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
32 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
33 * –Ɛӂ·‚邱‚ƁD
34 *
35 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
36 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
37 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
38 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
39 * ‚̐ӔC‚𕉂í‚È‚¢D
40 *
41 */
42 NAME start
43/*
44 * ƒJ[ƒlƒ‹—p‚̃Xƒ^[ƒgƒAƒbƒvƒ‚ƒWƒ…
45[ƒ‹(ARM-M—p)
46 */
47#define TOPPERS_MACRO_ONLY
48#define UINT_C(val) (val) /* uint_tŒ^‚̒萔‚ðì‚éƒ}ƒNƒ */
49#define ULONG_C(val) (val) /* ulong_tŒ^‚̒萔‚ðì‚éƒ}ƒNƒ */
50#define CAST(type, val) (val) /* Œ^ƒLƒƒƒXƒg‚ðs‚¤ƒ}ƒNƒ */
51#define IAR
52
53#include "kernel_impl.h"
54#include "arm_m.h"
55
56/*
57 * ƒXƒ^[ƒgƒAƒbƒvƒ‹[ƒ`ƒ“
58 *
59 * Threadƒ‚[ƒh‚ŌĂяo‚³‚ê‚邱‚Æ‚ð‘O’ñ‚Æ‚µ‚Ä‚éD
60 */
61 PUBLIC _start
62 PUBLIC main
63 IMPORT _kernel_istkpt
64 EXTWEAK hardware_init_hook
65 EXTWEAK software_init_hook
66 IMPORT sta_ker
67 IMPORT __iar_data_init3
68 EXTWEAK __bss_start
69 EXTWEAK __bss_end
70 EXTWEAK __idata_start
71 EXTWEAK __idata_end
72 EXTWEAK __data_start
73
74 SECTION CSTACK:DATA:NOROOT(3)
75 SECTION .text : CODE (2)
76 THUMB
77
78_start:
79 cpsid f /* Š„ž‚݃ƒbƒNó‘Ô‚Ö */
80
81#ifdef INIT_MSP
82 /*
83 * MSP‚̐ݒè
84 */
85 mov r0, #CONTROL_MSP /* MSP‚ð—LŒø‚É */
86 msr control, r0
87 isb /* control ‚Ì‘€ìŒã‚É•K—v */
88 ldr r0,=_kernel_istkpt
89 ldr r1,[r0]
90 msr msp, r1
91#endif /* INIT_MSP */
92
93 /*
94 * hardware_init_hook‚̌Ăяo‚µ i0‚Å‚È‚¢ê‡j
95 *
96 * ƒ^[ƒQƒbƒgƒn[ƒhƒEƒFƒA‚Ɉˑ¶‚µ‚Ä•K—v‚ȏ‰Šú‰»ˆ—‚ª‚ ‚éê‡
97 * ‚́Chardware_init_hook ‚Æ‚¢‚¤ŠÖ”‚ð—pˆÓ‚·‚é
98 */
99 ldr r0, =hardware_init_hook
100 cbz r0, start_1
101 blx r0
102
103start_1:
104#ifdef IAR
105 mov r4, r13
106 ldr r13, =sfe(CSTACK)
107 bl __iar_data_init3
108 mov r13, r4
109#else
110#ifndef OMIT_BSS_INIT
111 /*
112 * BSSƒZƒNƒVƒ‡ƒ“‰Šú‰»
113 */
114 mov r0, #0
115 ldr r1, =__bss_start
116 ldr r2, =__bss_end
117 cmp r1, r2
118 bhs start_3
119start_2:
120 str r0, [r1]
121 add r1,r1, #4
122 cmp r1, r2
123 blo start_2
124#endif /* OMIT_BSS_INIT */
125
126
127start_3:
128
129#ifndef OMIT_DATA_INIT
130 /*
131 * DATAƒZƒNƒVƒ‡ƒ“‰Šú‰»
132 * __idata_start ‚©‚ç __idata_end ‚Ü‚Å‚ðC__data_start ˆÈ~‚É
133 * ƒRƒs[‚·‚é
134 */
135 ldr r1, =__idata_start
136 ldr r2, =__idata_end
137 cmp r1, r2
138 bhs start_5
139 ldr r3, =__data_start
140start_4:
141 ldr r0, [r1]
142 str r0, [r3]
143 add r1, r2, #4
144 add r3, r1, #4
145 cmp r1, r2
146 blo start_4
147#endif /* OMIT_DATA_INIT */
148#endif /* IAR */
149
150 /*
151 * software_init_hook ‚ðŒÄo‚µi0 ‚Å‚È‚¢ê‡j
152 *
153 * ƒ\ƒtƒgƒEƒFƒAŠÂ‹«i“Á‚Ƀ‰ƒCƒuƒ‰ƒŠj‚Ɉˑ¶‚µ‚Ä•K—v‚ȏ‰Šú‰»ˆ
154 * —‚ª‚ ‚éê‡‚́Csoftware_init_hook ‚Æ‚¢‚¤ŠÖ”‚ð—pˆÓ‚·‚ê‚Î
155 * ‚æ‚¢D
156 */
157start_5:
158 ldr r0, =software_init_hook
159 cbz r0, start_6
160 blx r0
161
162start_6:
163 bl sta_ker
164
165main:
166l_end:
167 b l_end
168
169 END
Note: See TracBrowser for help on using the repository browser.