source: uKadecot/trunk/ssp/kernel/kernel.tf@ 101

Last change on this file since 101 was 101, checked in by coas-nagasima, 8 years ago

TOPPERS/uKadecotのソースコードを追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/plain
File size: 46.7 KB
Line 
1$ ======================================================================
2$
3$ TOPPERS/SSP Kernel
4$ Smallest Set Profile Kernel
5$
6$ Copyright (C) 2007 by TAKAGI Nobuhisa
7$ Copyright (C) 2007-2009 by Embedded and Real-Time Systems Laboratory
8$ Graduate School of Information Science, Nagoya Univ., JAPAN
9$ Copyright (C) 2010-2015 by Naoki Saito
10$ Nagoya Municipal Industrial Research Institute, JAPAN
11$
12$ ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì (1)`(4) ‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
13$ ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü•ÏE
14$ Ä”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
15$ (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ìŒ 
16$ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[ƒX
17$ ƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
18$ (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg—p
19$ ‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
20ƒƒ“ƒgi—˜—pŽÒƒ}
21$ ƒjƒ…
22ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•Û
23$ Ø‹K’è‚ðŒfÚ‚·‚邱‚ƁD
24$ (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg—p
25$ ‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±‚ƁD
26$ (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
27ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
28ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ì
29$ Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
30$ (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É•ñ
31$ ‚·‚邱‚ƁD
32$ (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹ŠQ
33$ ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD‚Ü‚½C
34$ –{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝—R‚ÉŠî‚Ã
35$ ‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
36$
37$ –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨‚æ
38$ ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I‚ɑ΂·
39$ ‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p
40$ ‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»‚̐ӔC‚ð•‰
41$ ‚í‚È‚¢D
42$
43$ ======================================================================
44
45$ ƒƒOo—Í
46$ Žw’肵‚½”‚¾‚¯s“ª‚Ƀ^ƒu‚ð‚‚¯‚Ä•\Ž¦‚·‚éD
47$ ƒR[ƒh‹y‚яo—͂̉“ǐ«‚ð‹“‚°‚邽‚ß‚ÉŽg‚¤D
48$ ˆø” : ARGV[1] : s“ª‚É‘}“ü‚·‚éƒ^ƒu‚̐”
49$ •Ô’l : ‹ó•¶Žš—ñ
50$ ’ˆÓ : RESULT‚𑀍삵‚Ä‚¢‚邽‚߁C‘¼‚̊֐”‚̏o—Í‚ð•Û‘¶‚·‚é‘O‚ɌĂяo‚·‚Ə㏑‚«‚³‚ê‚éD
51$
52$FUNCTION LOG$
53 $FOREACH i RANGE(1,ARGV[1])$$TAB$$END$
54 $RESULT = {}$
55$END$
56
57$ =====================================================================
58$ ˆ—‘O‚̃`ƒFƒbƒN
59$ =====================================================================
60
61$ ƒ^ƒXƒN‚ª1ŒÂˆÈã‘¶Ý‚·‚邱‚Ƃ̃`ƒFƒbƒN
62$IF !LENGTH(TSK.ID_LIST)$
63 $ERROR$$FORMAT("no task is registered")$$END$
64$END$
65
66$ =====================================================================
67$ kernel_cfg.h ‚̐¶¬
68$ =====================================================================
69
70$FILE "kernel_cfg.h"$
71
72/* kernel_cfg.h */$NL$
73#ifndef TOPPERS_KERNEL_CFG_H$NL$
74#define TOPPERS_KERNEL_CFG_H$NL$
75$NL$
76#define TNUM_TSKID $LENGTH(TSK.ID_LIST)$$NL$
77#define TNUM_FLGID $LENGTH(FLG.ID_LIST)$$NL$
78#define TNUM_DTQID $LENGTH(DTQ.ID_LIST)$$NL$
79#define TNUM_CYCID $LENGTH(CYC.ORDER_LIST)$$NL$
80#define TNUM_ALMID $LENGTH(ALM.ORDER_LIST)$$NL$
81$NL$
82
83$ // ƒ^ƒXƒNID‚ð‹N“®—Dæ“x(tskapri)‚̍‚‚¢‡‚É reallocate_tskapri ‚ÖŠ„‚è“–‚āC
84$ // ’è‹`‚ð kernel_cfg.h ‚֏o—Í‚·‚éD
85$tsk_apriorder_list={}$
86$tsk_epri_list={}$
87$tsk_index = 1$
88$FOREACH id SORT(TSK.ORDER_LIST, "TSK.ATSKPRI")$
89 $tsk_apriorder_list = APPEND(tsk_apriorder_list, TSK.TSKID[id])$
90 $reallocate_tskapri[TSK.TSKID[id]] = tsk_index$
91 #define $TSK.TSKID[id]$ $tsk_index$$NL$
92
93$ DEF_EPR ‚Å’è‹`‚³‚ê‚Ä‚¢‚È‚¢ƒ^ƒXƒN‚ÌŽÀsŽž—Dæ“x‚ªC‹N“®—Dæ“x‚Æ“¯‚¶‚É‚È‚é‚悤‚É‚·‚éD
94 $tsk_epri_list = APPEND(tsk_epri_list, ALT(TSK.EXEPRI[TSK.TSKID[id]], TSK.ATSKPRI[TSK.TSKID[id]]))$
95 $tsk_index = tsk_index + 1$
96$END$
97$FOREACH id FLG.ID_LIST$
98 #define $id$ $+id$$NL$
99$END$
100$FOREACH id DTQ.ID_LIST$
101 #define $id$ $+id$$NL$
102$END$
103$FOREACH id CYC.ID_LIST$
104 #define $id$ $+id$$NL$
105$END$
106$FOREACH id ALM.ID_LIST$
107 #define $id$ $+id$$NL$
108$END$
109
110#endif /* TOPPERS_KERNEL_CFG_H */$NL$
111
112$ =====================================================================
113$ kernel_cfg.c‚̐¶¬
114$ =====================================================================
115
116$FILE "kernel_cfg.c"$
117
118/* kernel_cfg.c */$NL$
119#include "kernel/kernel_int.h"$NL$
120#include "kernel_cfg.h"$NL$
121$NL$
122#ifndef TOPPERS_EMPTY_LABEL$NL$
123#define TOPPERS_EMPTY_LABEL(x,y) x y[0]$NL$
124#endif$NL$
125$NL$
126
127$ ---------------------------------------------------------------------
128$ ƒCƒ“ƒNƒ‹[ƒhƒfƒBƒŒƒNƒeƒBƒui#includej
129$ ---------------------------------------------------------------------
130/*$NL$
131$SPC$* Include Directives (#include)$NL$
132$SPC$*/$NL$
133$NL$
134$INCLUDES$
135$NL$
136
137$ ---------------------------------------------------------------------
138$ ƒIƒuƒWƒFƒNƒg‚ÌID”ԍ†‚ð•ÛŽ‚·‚é•Ï”
139$ ---------------------------------------------------------------------
140$IF USE_EXTERNAL_ID$
141 /*$NL$
142 $SPC$* Variables for Object ID$NL$
143 $SPC$*/$NL$
144 $NL$
145 $FOREACH id TSK.ID_LIST$
146 const ID $id$_id$SPC$=$SPC$$+id$;$NL$
147 $END$
148 $FOREACH id FLG.ID_LIST$
149 const ID $id$_id$SPC$=$SPC$$+id$;$NL$
150 $END$
151 $FOREACH id DTQ.ID_LIST$
152 const ID $id$_id$SPC$=$SPC$$+id$;$NL$
153 $END$
154 $FOREACH id CYC.ID_LIST$
155 const ID $id$_id$SPC$=$SPC$$+id$;$NL$
156 $END$
157 $FOREACH id ALM.ID_LIST$
158 const ID $id$_id$SPC$=$SPC$$+id$;$NL$
159 $END$
160$END$
161
162$ ---------------------------------------------------------------------
163$ ƒgƒŒ[ƒXƒƒOƒ}ƒNƒ‚̃fƒtƒHƒ‹ƒg’è‹`
164$ ---------------------------------------------------------------------
165/*$NL$
166$SPC$* Default Definitions of Trace Log Macros$NL$
167$SPC$*/$NL$
168$NL$
169#ifndef LOG_ISR_ENTER$NL$
170#define LOG_ISR_ENTER(intno)$NL$
171#endif /* LOG_ISR_ENTER */$NL$
172$NL$
173#ifndef LOG_ISR_LEAVE$NL$
174#define LOG_ISR_LEAVE(intno)$NL$
175#endif /* LOG_ISR_LEAVE */$NL$
176$NL$
177
178
179$ ---------------------------------------------------------------------
180$ ƒ^ƒXƒN‚ÉŠÖ‚·‚éo—Í
181$ ---------------------------------------------------------------------
182
183$
184$ ŽÀsŽž—Dæ“x‚̃Rƒ“ƒtƒBƒMƒ…
185ƒŒ[ƒVƒ‡ƒ“‚ɐ¬Œ÷‚µ‚½‚©‚Ç‚¤‚©
186$
187$ DEF_EPR ˆ—’†‚ɃGƒ‰[‚ª”­¶‚µ‚½ê‡C‚±‚̕ϐ”‚ª0‚É‚È‚éD
188$ DEF_EPR ˆ—’†‚ɃGƒ‰[‚ª”­¶‚µ‚½‚©‚Ç‚¤‚©‚ð”»’f‚µ‚Ä
189$ “Á’菈—‚ÌŽÀs‚ðƒuƒƒbƒN‚·‚邽‚ß‚ÉŽg—p‚·‚éD
190$
191$configurated_defepr_successfully = 1$
192
193/*$NL$
194$SPC$* Task Management Functions$NL$
195$SPC$*/$NL$
196$NL$
197
198$ ƒ^ƒXƒNID”ԍ†‚̍őå’l
199const ID _kernel_tmax_tskid = (TMIN_TSKID + TNUM_TSKID - 1);$NL$
200$NL$
201
202$ ready_primap ‚̏‰Šú’l
203$init_rdypmap = 0$
204$tsk_index = 1$
205
206$ ƒ^ƒXƒN‘®«D
207const ATR _kernel_tinib_tskatr[TNUM_TSKID] = {
208$JOINEACH tskid tsk_apriorder_list ","$
209$ // TA_ACT , TA_RSTR ‚Ü‚½‚Í TA_NULL ‚Å‚ ‚éiE_RSATRj
210 $IF (TSK.TSKATR[tskid] & ~(TA_ACT | TA_RSTR | ALT(TARGET_TSKATR,0))) != 0$
211 $ERROR TSK.TEXT_LINE[tskid]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "tskatr", TSK.TSKATR[tskid], tskid, "CRE_TSK")$$END$
212 $END$
213
214 ($TSK.TSKATR[tskid]$)
215
216 $IF TSK.TSKATR[tskid] & TA_ACT$
217 $init_rdypmap = init_rdypmap + tsk_index$
218 $END$
219 $tsk_index = tsk_index << 1$
220$END$
221};$NL$
222
223const uint_t$TAB$_kernel_init_rdypmap = $init_rdypmap$U;$NL$
224
225$ Šg’£î•ñ(exinf)D ƒGƒ‰[‚̓Rƒ“ƒpƒCƒ‹Žž‚Ü‚½‚̓AƒvƒŠ‚̃eƒXƒg‚ÅŒŸo‚·‚邽‚߁C‚±‚±‚Å‚Í‚µ‚È‚¢D
226const intptr_t _kernel_tinib_exinf[TNUM_TSKID] = {
227$JOINEACH tskid tsk_apriorder_list ","$
228 (intptr_t)($TSK.EXINF[tskid]$)
229$END$
230};$NL$
231
232$ ‹N“®”Ô’n(task)DƒGƒ‰[‚̓Rƒ“ƒpƒCƒ‹Žž‚Ü‚½‚̓AƒvƒŠ‚̃eƒXƒg‚ÅŒŸo‚·‚邽‚߁C‚±‚±‚Å‚Í‚µ‚È‚¢D
233const TASK _kernel_tinib_task[TNUM_TSKID] = {
234$JOINEACH tskid tsk_apriorder_list ","$
235 ($TSK.TASK[tskid]$)
236$END$
237};$NL$
238
239$ ‹N“®—Dæ“x(atskpri)D
240$FOREACH tskid tsk_apriorder_list$
241$ // atskpri ‚Í TMIN_TPRI ˆÈãCTMAX_TPRI ˆÈ‰º‚Å‚ ‚éDiE_PARj
242 $IF !(TMIN_TPRI <= TSK.ATSKPRI[tskid] && TSK.ATSKPRI[tskid] <= TMAX_TPRI)$
243 $ERROR TSK.TEXT_LINE[tskid]$E_PAR: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "atskpri", TSK.ATSKPRI[tskid], tskid, "CRE_TSK")$$END$
244 $END$
245
246$ // atskpri ‚͏d•¡‚ª‚È‚¢DiE_PARj
247 $FOREACH tskid2 tsk_apriorder_list$
248 $IF tskid != tskid2 && TSK.ATSKPRI[tskid] == TSK.ATSKPRI[tskid2] $
249 $ERROR TSK.TEXT_LINE[tskid]$E_PAR: $FORMAT(_("%1% of %2% (%3%) in %4% is duplicated"), "atskpri", tskid, TSK.ATSKPRI[tskid], "CRE_TSK")$$END$
250 $END$
251 $END$
252$END$
253
254$ ŽÀsŽž—Dæ“x(exepri)D
255const uint_t _kernel_tinib_epriority[TNUM_TSKID] = {
256$epri_allocated = 0$
257$tsk_index = 0$
258$JOINEACH tskid tsk_apriorder_list ","$
259 $epri = AT(tsk_epri_list, tsk_index)$
260
261$ // exepri ‚Í TMIN_TPRI ˆÈã‚©‚ TMAX_TPRI ˆÈ‰º‚Å‚ ‚éD(E_PAR)
262 $IF TMIN_TPRI > epri || TMAX_TPRI < epri$
263 $configurated_defepr_successfully = 0$
264 $ERROR TSK.TEXT_LINE[tskid]$E_PAR: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "exepri", epri, tskid, "DEF_EPR")$$END$
265 $END$
266
267$ // exepri ‚Í atskpri ˆÈ‰º‚Ì’l‚ð‚à‚Â(—Dæ“x‚Æ‚µ‚Ä‚Í“¯‚¶‚©‚»‚ê‚æ‚荂‚¢)D(E_ILUSE)
268 $IF epri <= TMAX_TPRI && epri > TSK.ATSKPRI[tskid]$
269 $configurated_defepr_successfully = 0$
270 $ERROR TSK.TEXT_LINE[tskid]$E_ILUSE: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "exepri", epri, tskid, "DEF_EPR")$$END$
271 $END$
272
273$ // exepri ‚Ì“à•”•\Œ»‚ðŒˆ’è‚µ reallocate_tskepri ‚ÉŠi”[D
274 $FOREACH tskid2 tsk_apriorder_list $
275 $IF epri_allocated != 1 && epri <= TSK.ATSKPRI[tskid2]$
276 INT_PRIORITY($reallocate_tskapri[TSK.TSKID[tskid2]]$)
277 $reallocate_tskepri[tskid] = reallocate_tskapri[TSK.TSKID[tskid2]]$
278 $epri_allocated = 1$
279 $END$
280 $END$
281 $epri_allocated = 0$
282 $tsk_index = tsk_index + 1$
283$END$
284};$NL$$NL$
285
286$
287$ // —Dæ“xŠ„‚è“–‚ÄŒ‹‰Ê‚ðo—Í
288$
289/*$NL$
290$SPC$* Task priority configuration result:$NL$
291$FOREACH tskid SORT(TSK.ORDER_LIST, "TSK.ATSKPRI")$
292$SPC$* $TAB$$TSK.TSKID[tskid]$:$TAB$ IPRI = $reallocate_tskapri[TSK.TSKID[tskid]]$, EXEPRI = $reallocate_tskepri[tskid]$$NL$
293$END$
294$SPC$*/$NL$$NL$
295
296$
297$ ƒ^ƒXƒN‚̍őåƒXƒ^ƒbƒNŽg—p—Ê‚ÌŒvŽZ
298$
299
300$ ƒXƒ^ƒbƒNƒTƒCƒY‚ÉŠÖ‚·‚éƒGƒ‰[ƒ`ƒFƒbƒN
301$FOREACH tskid TSK.ID_LIST$
302$ // stksz‚ª0‚©Cƒ^[ƒQƒbƒg’è‹`‚̍ŏ¬’liTARGET_MIN_STKSZj‚æ‚è‚à¬‚³‚¢ê‡iE_PARj
303 $IF TSK.STKSZ[tskid] == 0 || (LENGTH(TARGET_MIN_STKSZ) &&
304 TSK.STKSZ[tskid] < TARGET_MIN_STKSZ)$
305 $ERROR TSK.TEXT_LINE[tskid]$E_PAR: $FORMAT(_("%1% `%2%\' of `%3%\' in %4% is too small"), "stksz", TSK.STKSZ[tskid], tskid, "CRE_TSK")$$END$
306 $END$
307$END$
308
309$
310$ ŠÖ”’è‹`
311$
312$
313$ ŠÖ”1: ‹N“®Žž—Dæ“x‚Ì’á‚¢‡‚Ƀ\[ƒeƒBƒ“ƒO‚·‚邽‚ß‚Ì”äŠrŠÖ”
314$
315$FUNCTION compare_tskapri_rev$
316 $RESULT = reallocate_tskapri[ARGV[2]] - reallocate_tskapri[ARGV[1]]$
317$END$
318
319$
320$ ŠÖ”2: Žw’肵‚½ƒ^ƒXƒN‚ɑ΂·‚éƒXƒ^ƒbƒNŽg—p—ʂ̍őå‚ðŒvŽZ‚·‚éŠÖ”
321$ ˆø” : ARGV[1] : ƒ^ƒXƒNID(“à•”•\Œ», ‹N“®Žž—Dæ“x‚Ì“à•”•\Œ»‚É“™‚µ‚¢)
322$ •Ô’l : RESULT : “–ŠYƒ^ƒXƒN‚ɑ΂·‚éƒXƒ^ƒbƒNŽg—p—ʂ̍őå’lD
323$ ‚±‚Ì’l‚́C“–ŠYƒ^ƒXƒN‚ÌŽÀsŠJŽn‚©‚çI—¹‚Ü‚Å‚ÌŠÔ‚É
324$ ‚»‚̃^ƒXƒN‚ɑ΂·‚éƒvƒŠƒGƒ“ƒvƒg‚ðl—¶‚µ‚ăXƒ^ƒbƒNŽg—p—Ê‚ð
325$ ŒvŽZ‚µ‚½ê‡‚ɁC‰Â”\«‚Ì‚ ‚é‘g‚ݍ‡‚킹‚Ì’†‚ōőå‚Æ‚È‚é’l‚ð•Ô‚·D
326$
327$nest_level = 0$
328$
329$FUNCTION calc_stksz$
330$ // •Ï”ƒŠƒXƒg
331 $nest_level = nest_level + 1$
332 $arg[nest_level] = ARGV[1]$
333 $calculated_stack_size = 0$
334
335$ // ˆ—ŠJŽn
336$SPC$* $LOG(nest_level-1)$Calculation start (Task ID = $arg[nest_level]$, StackSize[$arg[nest_level]$]=$TSK.STKSZ[arg[nest_level]]$)$NL$
337
338$ // Žw’肵‚½ƒ^ƒXƒNID ‚̃Xƒ^ƒbƒNŒvŽZ‚ªŠ®—¹‚µ‚Ä‚¢‚é‚©
339 $IF LENGTH(done[arg[nest_level]]) == 0$
340
341$SPC$* $LOG(nest_level)$Task list with higher priority than $arg[nest_level]$ = $higher_pri_tsklist[arg[nest_level]]$$NL$
342
343$ // (1) Š®—¹‚µ‚Ä‚¢‚È‚¢ê‡
344$ // •Ï”‚̏‰Šú‰»
345 $max_stksz[arg[nest_level]] = 0$
346 $higher_pri_maxstksz[arg[nest_level]] = 0$
347
348$ // “–ŠYƒ^ƒXƒNID ‚ÌŽÀsŽž—Dæ“x‚æ‚荂‚¢‹N“®—Dæ“x‚ðŽ‚Âƒ^ƒXƒN‚ª‘¶Ý‚·‚éê‡
349 $IF LENGTH(higher_pri_tsklist[arg[nest_level]]) > 0$
350$ // ‚»‚ꂼ‚ê‚̍‚—Dæ“xƒ^ƒXƒN‚ɑ΂µ
351 $FOREACH id higher_pri_tsklist[arg[nest_level]]$
352$ // Ä‹AŒÄo‚·‚é‚ƕϐ”‚ªã‘‚«‚³‚ê‚邽‚߁C•Û‘¶‚µ‚Ä‚¨‚­
353 $id_saved[nest_level] = id$
354$ // ƒXƒ^ƒbƒNŒvŽZ‚ðŽÀs‚·‚é
355 $calculated_stack_size = calc_stksz(id_saved[nest_level])$
356$ // •Û‘¶‚µ‚½•Ï”‚𕜋A
357 $id = id_saved[nest_level]$
358
359 $IF higher_pri_maxstksz[arg[nest_level]] < calculated_stack_size$
360$ // ‹L‰¯‚µ‚Ä‚¨‚­
361 $higher_pri_maxstksz[arg[nest_level]] = calculated_stack_size$
362 $END$
363 $END$
364 $END$
365
366$SPC$* $LOG(nest_level)$higher_pri_maxstksz[$arg[nest_level]$] = $higher_pri_maxstksz[arg[nest_level]]$$NL$
367
368$ // ‚—Dæ“xƒ^ƒXƒN‚̃Xƒ^ƒbƒNŽg—p—ʂɁC“–ŠYƒ^ƒXƒN‚ÌŽg—p—Ê‚ð‰ÁŽZ‚·‚é
369 $max_stksz[arg[nest_level]] = higher_pri_maxstksz[arg[nest_level]] + TSK.STKSZ[arg[nest_level]]$
370
371$SPC$* $LOG(nest_level)$DONE(max_stksz[$arg[nest_level]$] = $max_stksz[arg[nest_level]]$)$NL$
372
373$ // “–ŠYƒ^ƒXƒNID‚ɑ΂µ‚Ä‚ÍŒvŽZ‚ðÏ‚Ü‚¹‚½‚Æ‚¢‚¤‹L˜^‚ðŽc‚µ‚Ä‚¨‚­
374 $done[arg[nest_level]] = 1$
375
376 $ELSE$
377$ // (2) ŒvŽZ‚ªŠù‚ÉŠ®—¹‚µ‚Ä‚¢‚éê‡CŒvŽZ‚ðƒXƒLƒbƒv‚·‚éD
378
379$SPC$* $LOG(nest_level)$SKIP(max_stksz[$arg[nest_level]$] = $max_stksz[arg[nest_level]]$)$NL$
380 $END$
381
382$ // Œ©Ï‚à‚è‚̍őå’l‚ð•Ô‚·
383 $RESULT = max_stksz[arg[nest_level]]$
384 $nest_level = nest_level - 1$
385$END$
386
387$
388$ ŠÖ”’è‹`‚±‚±‚܂ŁC‚±‚±‚©‚çƒXƒ^ƒbƒNŒvŽZˆ—‚ÌŠJŽn
389$
390
391$
392$ ‚Ü‚¸‚͖؍\‘¢‚̃f[ƒ^\‘¢ì¬
393$
394$FOREACH id LSORT(tsk_apriorder_list, "compare_tskapri_rev")$
395
396$ // Šeƒ^ƒXƒN–ˆ‚ɁC‚»‚ÌŽÀsŽž—Dæ“x‚æ‚è‚à‚‚¢‹N“®Žž—Dæ“x‚ðŽ‚Âƒ^ƒXƒN‚̃ŠƒXƒg‚ðì‚éD
397$ // ‚»‚ê‚̓vƒŠƒGƒ“ƒvƒg‚³‚ê‚é‰Â”\«‚Ì‚ ‚éƒ^ƒXƒN‚̈ꗗ‚Æ‚È‚éD
398 $FOREACH id2 LSORT(tsk_apriorder_list, "compare_tskapri_rev")$
399 $IF reallocate_tskepri[id] > reallocate_tskapri[id2]$
400 $higher_pri_tsklist[id] = APPEND(higher_pri_tsklist[id], id2)$
401 $END$
402 $END$
403
404$ // ƒvƒŠƒGƒ“ƒvƒg‚·‚éE‚³‚ê‚éŠÖŒW‚ðŽ¦‚·–؍\‘¢‚̍ª(root)‚Æ‚È‚éƒ^ƒXƒN‚Ì’TõD
405$ // ‘Ώۃ^ƒXƒN(id)‚Ì‹N“®Žž—Dæ“x(reallocate_tskapri[id])‚æ‚è’á‚¢
406$ // (’l‚Æ‚µ‚Ä‚Í‘å‚«‚¢)‹N“®Žž—Dæ“x‚ð‚à‚ƒ^ƒXƒN‚Ì higher_pri_tsklist ‚ɁC
407$ // ‘Ώۃ^ƒXƒN(id) ‚ªŠÜ‚Ü‚ê‚È‚¯‚ê‚΁Cª‚Æ‚È‚éD
408 $is_root = 1$
409 $FOREACH id2 LSORT(tsk_apriorder_list, "compare_tskapri_rev")$
410 $IF (is_root == 1) && (reallocate_tskapri[id] < reallocate_tskapri[id2])$
411 $IF LENGTH(FIND(higher_pri_tsklist[id2], id)) > 0$
412 $is_root = 0$
413 $END$
414 $END$
415 $END$
416$ // ª(root)‚Æ‚È‚éƒ^ƒXƒN‚È‚ç‚΁CƒŠƒXƒg‚֒ljÁ
417 $IF is_root == 1$
418 $root_apri = APPEND(root_apri, id)$
419 $END$
420$END$
421
422$
423$ o—ÍŠJŽn
424$
425
426/* $NL$
427$SPC$* Task Stack Size Estimation: $NL$
428$SPC$* $NL$
429
430$ // ª‚Æ‚È‚éŠeƒ^ƒXƒN‚ɑ΂µ‚āC‚»‚̍őåƒ^ƒXƒNŽg—p—Ê‚ðŒvŽZ‚µCƒŠƒXƒg‚֒ljÁ‚·‚éD
431$FOREACH root_id root_apri$
432 $stksz_estimated = APPEND(stksz_estimated, calc_stksz(root_id))$
433$END$
434
435$ // ƒ^ƒXƒN‚̃Xƒ^ƒbƒNŽg—p—ʂ̍őå’l‚ðŒˆ’è
436$ // ƒŠƒXƒg’†‚Ì—v‘f‚̍őå’l‚ªƒ^ƒXƒN‚̍őåƒXƒ^ƒbƒNŽg—p—Ê‚Æ‚È‚éD
437$max_tsk_stksz = 0$
438$FOREACH size stksz_estimated$
439 $IF size > max_tsk_stksz$
440 $max_tsk_stksz = size$
441 $END$
442$END$
443
444$ // Šm”F
445$SPC$* List of Estimated Total Stack Sizes of Tasks = $stksz_estimated$$NL$
446$SPC$* Estimated Maximum Total Stack Size of Tasks = $max_tsk_stksz$$NL$
447$SPC$*/ $NL$
448#define TOPPERS_TSTKSZ ($max_tsk_stksz$)$NL$$NL$
449
450
451$ ‘S‚Ă̏ˆ—’PˆÊ‚̃Xƒ^ƒbƒN‚Í‹¤—L‚³‚ê‚éD
452$ ‚»‚Ì‚½‚߁CƒXƒ^ƒbƒNƒTƒCƒY‚ÉŠÖ‚·‚éƒ`ƒFƒbƒN‚Í
453$ ‹¤—LƒXƒ^ƒbƒNÝ’è‚Ì‚Æ‚±‚ë‚ł܂Ƃ߂čs‚¤D
454
455$ ƒXƒ^ƒbƒN‚̐擪”Ô’n(stk)D
456$FOREACH tskid tsk_apriorder_list$
457$ // í‚É NULL ‚Å‚ ‚éD(E_PAR)
458 $IF !EQ(TSK.STK[tskid], "NULL")$
459 $ERROR TSK.TEXT_LINE[tskid]$E_PAR: $FORMAT(("'%1%' of %2% must be NULL."), "stk", "CRE_TSK")$$END$
460 $END$
461$END$
462
463$ ---------------------------------------------------------------------
464$ ƒCƒxƒ“ƒgƒtƒ‰ƒO
465$ ---------------------------------------------------------------------
466/*$NL$
467$SPC$* Eventflag Functions$NL$
468$SPC$*/$NL$
469$NL$
470
471$ ƒGƒ“ƒgƒŠ‚ª (UINT8_MAX - TMIN_FLGID)ŒÂ‚æ‚葽‚¢ê‡‚́CƒGƒ‰[‚Æ‚·‚é --> Œ»Žž“_‚ł̓Rƒƒ“ƒgƒAƒEƒg
472$ $IF LENGTH(ALM.ORDER_LIST) > (UINT8_MAX - TMIN_FLGID)$
473$ $ERROR$$FORMAT("The number of CRE_FLG must be equal to or less than (UINT8_MAX - TMIN_FLGID).")$$END$
474$ $END$
475
476$ ƒCƒxƒ“ƒgƒtƒ‰ƒOID”ԍ†‚̍őå’l
477const ID _kernel_tmax_flgid = (TMIN_FLGID + TNUM_FLGID - 1);$NL$
478$NL$
479
480$ // iflgptn‚ªFLGPTN‚ÉŠi”[‚Å‚«‚È‚¢ê‡iE_PARj
481$FOREACH flgid FLG.ORDER_LIST$
482 $IF (FLG.IFLGPTN[flgid] & ~((1 << TBIT_FLGPTN) - 1)) != 0$
483 $ERROR FLG.TEXT_LINE[flgid]$E_PAR: $FORMAT(_("too large %1% `%2%\' of `%3%\' in %4%"), "iflgptn", FLG.IFLGPTN[flgid], flgid, "CRE_FLG")$$END$
484 $END$
485$END$
486
487$ ƒCƒxƒ“ƒgƒtƒ‰ƒO‰Šú‰»ƒuƒƒbƒN‚̐¶¬
488$IF LENGTH(FLG.ID_LIST)$
489
490$ ƒCƒxƒ“ƒgƒtƒ‰ƒO‘®«
491 const ATR _kernel_flginib_atr[TNUM_FLGID] = {
492 $JOINEACH flgid FLG.ORDER_LIST ","$
493$ // flgatr‚ªimTA_CLRnj‚Å‚È‚¢ê‡iE_RSATRj
494 $IF (FLG.FLGATR[flgid] & ~(TA_CLR)) != 0$
495 $ERROR FLG.TEXT_LINE[flgid]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "flgatr", FLG.FLGATR[flgid], flgid, "CRE_FLG")$$END$
496 $END$
497 ($FLG.FLGATR[flgid]$)
498 $END$
499 };$NL$
500
501$ ƒCƒxƒ“ƒgƒtƒ‰ƒOƒpƒ^[ƒ“‚̏‰Šú’l
502 const FLGPTN _kernel_flginib_iflgptn[TNUM_FLGID] = {
503 $JOINEACH flgid FLG.ORDER_LIST ","$
504 ($FLG.IFLGPTN[flgid]$)
505 $END$
506 };$NL$
507
508$ // ƒCƒxƒ“ƒgƒtƒ‰ƒO‚ÌŒ»Ý‚̃tƒ‰ƒOƒpƒ^[ƒ“‚ðŠi”[‚·‚é•Ï”
509 FLGPTN _kernel_flgcb_flgptn[TNUM_FLGID];$NL$
510$ELSE$
511 TOPPERS_EMPTY_LABEL(const ATR, _kernel_flginib_atr);$NL$
512 TOPPERS_EMPTY_LABEL(const FLGPTN, _kernel_flginib_iflgptn);$NL$
513 TOPPERS_EMPTY_LABEL(FLGPTN, _kernel_flgcb_flgptn);$NL$
514$END$
515$NL$
516
517$ ---------------------------------------------------------------------
518$ ƒf[ƒ^ƒLƒ…
519[
520$ ---------------------------------------------------------------------
521/*$NL$
522$SPC$* Dataqueue Functions$NL$
523$SPC$*/$NL$
524$NL$
525
526$ ƒf[ƒ^ƒLƒ…
527[ID”ԍ†‚̍őå’l
528const ID _kernel_tmax_dtqid = (TMIN_DTQID + TNUM_DTQID - 1);$NL$
529$NL$
530
531$IF LENGTH(DTQ.ID_LIST)$
532 $FOREACH dtqid DTQ.ORDER_LIST$
533$ // dtqatr‚ª TA_NULL ‚Å‚È‚¢ê‡iE_RSATRj
534 $IF (DTQ.DTQATR[dtqid] != TA_NULL) $
535 $ERROR DTQ.TEXT_LINE[dtqid]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "dtqatr", DTQ.DTQATR[dtqid], dtqid, "CRE_DTQ")$$END$
536 $END$
537
538$ // dtqmb‚ªNULL‚Å‚È‚¢ê‡iE_NOSPTj
539 $IF !EQ(DTQ.DTQMB[dtqid], "NULL")$
540 $ERROR DTQ.TEXT_LINE[dtqid]$E_NOSPT: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "dtqmb", DTQ.DTQMB[dtqid], dtqid, "CRE_DTQ")$$END$
541 $END$
542
543$ // dtqcnt‚ª0‚Å‚ ‚éê‡
544 $IF EQ(+DTQ.DTQCNT[dtqid], 0)$
545 $ERROR DTQ.TEXT_LINE[dtqid]$E_PAR: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "dtqmb", DTQ.DTQCNT[dtqid], dtqid, "CRE_DTQ")$$END$
546 $END$
547
548
549$ // ƒf[ƒ^ƒLƒ…
550[—̈æ
551 $IF DTQ.DTQCNT[dtqid]$
552 static intptr_t _kernel_dtqmb_$dtqid$[$DTQ.DTQCNT[dtqid]$];$NL$
553 $END$
554 $END$
555
556$ // ƒf[ƒ^ƒLƒ…
557[‰Šú‰»ƒuƒƒbƒN‚̐¶¬(‘®«)
558 const ATR _kernel_dtqinib_atr[TNUM_DTQID] = {
559 $JOINEACH dtqid DTQ.ORDER_LIST ",\n"$
560 $SPC$($DTQ.DTQATR[dtqid]$)
561 $END$
562 };$NL$
563 $NL$
564
565$ // ƒf[ƒ^ƒLƒ…
566[‰Šú‰»ƒuƒƒbƒN‚̐¶¬(ƒTƒCƒY)
567 const uint8_t _kernel_dtqinib_size[TNUM_DTQID] = {
568 $JOINEACH dtqid DTQ.ORDER_LIST ",\n"$
569 $SPC$($DTQ.DTQCNT[dtqid]$)
570 $END$
571 };$NL$
572 $NL$
573
574$ // ƒf[ƒ^ƒLƒ…
575[‰Šú‰»ƒuƒƒbƒN‚̐¶¬(ŠÇ——̈æ)
576 intptr_t * const _kernel_dtqinib_data[TNUM_DTQID] = {
577 $JOINEACH dtqid DTQ.ORDER_LIST ",\n"$
578 $IF DTQ.DTQCNT[dtqid]$(_kernel_dtqmb_$dtqid$)$ELSE$NULL$END$
579 $END$
580 };$NL$
581 $NL$
582
583$ // ƒf[ƒ^ƒLƒ…
584[ƒRƒ“ƒgƒ[ƒ‹ƒuƒƒbƒN
585 uint8_t _kernel_dtqcb_count[TNUM_DTQID];$NL$
586 uint8_t _kernel_dtqcb_head[TNUM_DTQID];$NL$
587 uint8_t _kernel_dtqcb_tail[TNUM_DTQID];$NL$
588$ELSE$
589 TOPPERS_EMPTY_LABEL(const ATR, _kernel_dtqinib_atr);$NL$
590 TOPPERS_EMPTY_LABEL(intptr_t * const, _kernel_dtqinib_data);$NL$
591 TOPPERS_EMPTY_LABEL(const uint8_t, _kernel_dtqinib_size);$NL$
592 TOPPERS_EMPTY_LABEL(uint8_t, _kernel_dtqcb_count);$NL$
593 TOPPERS_EMPTY_LABEL(uint8_t, _kernel_dtqcb_head);$NL$
594 TOPPERS_EMPTY_LABEL(uint8_t, _kernel_dtqcb_tail);$NL$
595$END$
596$NL$
597
598
599$ ---------------------------------------------------------------------
600$ Š„ž‚ÝŠÇ—‹@”\
601$ ---------------------------------------------------------------------
602/*$NL$
603$SPC$* Interrupt Management Functions$NL$
604$SPC$*/$NL$
605$NL$
606
607$ // INTNO_ATTISR_VALID ‚Ì—v‘f‚ªd•¡‚µ‚Ä‚¢‚È‚¢‚©‚Ç‚¤‚©‚̃`ƒFƒbƒN
608$i = 0$
609$FOREACH intno INTNO_ATTISR_VALID$
610 $j = 0$
611 $FOREACH intno2 INTNO_ATTISR_VALID$
612 $IF i < j && intno == intno2$
613 $ERROR$ $FORMAT(_("intno (%1%) of INTNO_ATTISR_VALID is duplicated"), intno)$$END$
614 $END$
615 $j = j + 1$
616 $END$
617 $i = i + 1$
618$END$
619
620$ // INHNO_ATTISR_VALID ‚Ì—v‘f‚ªd•¡‚µ‚Ä‚¢‚È‚¢‚©‚Ç‚¤‚©‚̃`ƒFƒbƒN
621$i = 0$
622$FOREACH intno INHNO_ATTISR_VALID$
623 $j = 0$
624 $FOREACH intno2 INHNO_ATTISR_VALID$
625 $IF i < j && intno == intno2$
626 $ERROR$ $FORMAT(_("intno (%1%) of INHNO_ATTISR_VALID is duplicated"), intno)$$END$
627 $END$
628 $j = j + 1$
629 $END$
630 $i = i + 1$
631$END$
632
633
634$ // ATT_ISR ‚ÅŽg—p‰Â”\‚ÈŠ„ž‚ݔԍ†‚ƁC‚»‚ê‚ɑΉž‚·‚銄ž‚݃nƒ“ƒhƒ‰”ԍ†‚̐”‚ª“¯‚¶‚©‚Ç‚¤‚©
635$ // ŠeƒŠƒXƒg‚Ì—v‘f‚͏d•¡‚µ‚Ä‚¢‚È‚¢‚±‚Æ‚ð‘O’ñ‚Æ‚µ‚Ä‚¢‚éD
636$IF LENGTH(INTNO_ATTISR_VALID) != LENGTH(INHNO_ATTISR_VALID)$
637 $ERROR$length of `INTNO_ATTISR_VALID' is different from length of `INHNO_ATTISR_VALID'$END$
638$END$
639
640
641$ // Š„ž‚ݔԍ†‚ÆŠ„ž‚݃nƒ“ƒhƒ‰”ԍ†‚Ì•ÏŠ·ƒe[ƒuƒ‹‚̍쐬
642$ // Š„ž‚ݔԍ†‚̃ŠƒXƒg‚ÆŠ„ž‚݃nƒ“ƒhƒ‰”ԍ†‚̃ŠƒXƒg‚͑Ήž‚·‚é—v‘f‚ª“¯‚¶‡”Ô‚Å
643$ // Œ»‚ê‚é‚悤‚É•À‚ׂç‚ê‚Ä‚¢‚邱‚Æ‚ð‘O’ñ‚Æ‚·‚éD
644$i = 0$
645$FOREACH intno INTNO_ATTISR_VALID$
646
647$ // INTNO_ATTISR_VALID ‚ÉŠÜ‚Ü‚ê‚é’l‚Í INTNO_CFGINT_VALID ‚É‚àŠÜ‚Ü‚ê‚é‚ׂ«‚Å‚ ‚éD
648$ // INTNO_ATTISR_VALID ‚Í INTNO_CFGINT_VALID ‚Ì•”•ªW‡‚É‚È‚é‚Í‚¸D
649 $IF LENGTH(FIND(INTNO_CFGINT_VALID, intno)) == 0$
650 $ERROR$all elements of `INTNO_ATTISR_VALID' must be included in `INTNO_CFGINT_VALID'$END$
651 $END$
652
653 $inhno = AT(INHNO_ATTISR_VALID, i)$
654 $INHNO[intno] = inhno$
655 $INTNO[inhno] = intno$
656 $i = i + 1$
657$END$
658
659
660$ // INTNO_CFGINT_VALID ‚Ì—v‘f‚ª INTNO_VALID ‚ÉŠÜ‚Ü‚ê‚é‚©‚Ç‚¤‚©‚̃`ƒFƒbƒN
661$ // INTNO_CFGINT_VALID ‚Í INTNO_VALID ‚Ì•”•ªW‡‚É‚È‚é‚Í‚¸D
662$FOREACH intno INTNO_CFGINT_VALID$
663 $IF LENGTH(FIND(INTNO_VALID, intno)) == 0$
664 $ERROR$all elements of `INTNO_CFGINT_VALID' must be included in `INTNO_VALID'$END$
665 $END$
666$END$
667
668
669$ // INHNO_ATTISR_VALID ‚Ì—v‘f‚ª INHNO_VALID ‚ÉŠÜ‚Ü‚ê‚é‚©‚Ç‚¤‚©‚̃`ƒFƒbƒN
670$ // INHNO_ATTISR_VALID ‚Í INHNO_VALID ‚Ì•”•ªW‡‚É‚È‚é‚Í‚¸D
671$FOREACH inhno INHNO_ATTISR_VALID$
672 $IF LENGTH(FIND(INHNO_VALID, inhno)) == 0$
673 $ERROR$all elements of `INHNO_ATTISR_VALID' must be included in `INHNO_VALID'$END$
674 $END$
675$END$
676
677
678$ // Š„ž‚Ý—v‹ƒ‰ƒCƒ“‚ÉŠÖ‚·‚éƒGƒ‰[ƒ`ƒFƒbƒN
679$i = 0$
680$FOREACH intno INT.ORDER_LIST$
681$ // intno‚ªCFG_INT‚ɑ΂·‚銄ž‚ݔԍ†‚Æ‚µ‚Đ³‚µ‚­‚È‚¢ê‡iE_PARj
682 $IF !LENGTH(FIND(INTNO_CFGINT_VALID, INT.INTNO[intno]))$
683 $ERROR INT.TEXT_LINE[intno]$E_PAR: $FORMAT(_("illegal %1% `%2%\' in %3%"), "intno", INT.INTNO[intno], "CFG_INT")$$END$
684 $END$
685
686$ // intno‚ªCFG_INT‚É‚æ‚Á‚ĐݒèÏ‚݂̏ꍇiE_OBJj
687 $j = 0$
688 $FOREACH intno2 INT.ORDER_LIST$
689 $IF INT.INTNO[intno] == INT.INTNO[intno2] && j < i$
690 $ERROR INT.TEXT_LINE[intno]$E_OBJ: $FORMAT(_("%1% `%2%\' in %3% is duplicated"), "intno", INT.INTNO[intno], "CFG_INT")$$END$
691 $END$
692 $j = j + 1$
693 $END$
694
695$ // intatr‚ª TA_ENAINT, TA_EDGE, ‚Ü‚½‚Í‚»‚Ì‘¼ƒ^[ƒQƒbƒg‚Å—˜—p‰Â”\‚È‘®«‚Ì‚¢‚¸‚ê‚Å‚à‚È‚¢ê‡iE_RSATRj
696 $IF (INT.INTATR[intno] & ~(TA_ENAINT|TA_EDGE|ALT(TARGET_INTATR,0))) != 0$
697 $ERROR INT.TEXT_LINE[intno]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"), "intatr", INT.INTATR[intno], "intno", INT.INTNO[intno], "CFG_INT")$$END$
698 $END$
699
700$ // intpri‚ªCFG_INT‚ɑ΂·‚銄ž‚Ý—Dæ“x‚Æ‚µ‚Đ³‚µ‚­‚È‚¢ê‡iE_PARj
701 $IF !LENGTH(FIND(INTPRI_CFGINT_VALID, INT.INTPRI[intno]))$
702 $ERROR INT.TEXT_LINE[intno]$E_PAR: $FORMAT(_("illegal %1% `%2%\' in %3%"), "intpri", INT.INTPRI[intno], "CFG_INT")$$END$
703 $END$
704
705$ // ƒJ[ƒlƒ‹ŠÇ—‚ÌŠ„ž‚Ý‚Æ‚µ‚ČŒ肳‚ê‚Ä‚¢‚銄ž‚݂ɁCTMIN_INTPRI ‚æ‚è‚à¬‚³‚¢’l‚ªŽw’肳‚ꂽê‡iE_OBJj
706 $IF LENGTH(FIND(INTNO_FIX_KERNEL, intno))$
707 $IF INT.INTPRI[intno] < TMIN_INTPRI$
708 $ERROR INT.TEXT_LINE[intno]$E_OBJ: $FORMAT(_("%1% `%2%\' must not have higher priority than %3%"), "intno", INT.INTNO[intno], "TMIN_INTPRI")$$END$
709 $END$
710 $END$
711
712$ // ƒJ[ƒlƒ‹ŠÇ—ŠO‚ÌŠ„ž‚Ý‚Æ‚µ‚ČŒ肳‚ê‚Ä‚¢‚銄ž‚݂ɁCTMIN_INTPRI ‚æ‚è‚à¬‚³‚¢’l‚ªŽw’肳‚ê‚È‚©‚Á‚½ê‡iE_OBJj
713 $IF LENGTH(FIND(INTNO_FIX_NONKERNEL, intno))$
714 $IF INT.INTPRI[intno] >= TMIN_INTPRI$
715 $ERROR INT.TEXT_LINE[intno]$E_OBJ: $FORMAT(_("%1% `%2%\' must have higher priority than %3%"), "intno", INT.INTNO[intno], "TMIN_INTPRI")$$END$
716 $END$
717 $END$
718 $i = i + 1$
719$END$
720
721
722$ Š„ž‚݃nƒ“ƒhƒ‰‚ÉŠÖ‚·‚éƒGƒ‰[ƒ`ƒFƒbƒN
723$i = 0$
724$FOREACH inhno INH.ORDER_LIST$
725$ // Š„ž‚݃nƒ“ƒhƒ‰”ԍ†(inhno)‚ª³‚µ‚­‚È‚¢ê‡iE_PARj
726 $IF !LENGTH(FIND(INHNO_DEFINH_VALID, INH.INHNO[inhno]))$
727 $ERROR INH.TEXT_LINE[inhno]$E_PAR: $FORMAT(_("illegal %1% `%2%\' in %3%"), "inhno", INH.INHNO[inhno], "DEF_INH")$$END$
728 $END$
729
730$ // “¯‚¶Š„ž‚݃nƒ“ƒhƒ‰”ԍ†‚ɑ΂·‚éDEF_INH‚ª•¡”‘¶Ý‚·‚éê‡iE_OBJj
731 $j = 0$
732 $FOREACH inhno2 INH.ORDER_LIST$
733 $IF INH.INHNO[inhno] == INH.INHNO[inhno2] && j < i$
734 $ERROR INH.TEXT_LINE[inhno]$E_OBJ: $FORMAT(_("%1% `%2%\' in %3% is duplicated"), "inhno", INH.INHNO[inhno], "DEF_INH")$$END$
735 $END$
736 $j = j + 1$
737 $END$
738
739$ // Š„ž‚݃nƒ“ƒhƒ‰‘®«(inhatr) ‚ª TA_NULL, TA_NONKERNEL, ‹y‚Ñ‚»‚Ì‘¼ƒ^[ƒQƒbƒgˆË‘¶‚Å—˜—p‰Â”\‚È‘®«‚Ì‚¢‚¸‚ê‚Å‚à‚È‚¢iE_RSATRj
740 $IF (INH.INHATR[inhno] & ~(TA_NONKERNEL|ALT(TARGET_INHATR,0))) != 0$
741 $ERROR INH.TEXT_LINE[inhno]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"), "inhatr", INH.INHATR[inhno], "inhno", INH.INHNO[inhno], "DEF_INH")$$END$
742 $END$
743
744$ // ƒJ[ƒlƒ‹ŠÇ—‚ɌŒ肳‚ê‚Ä‚¢‚銄ž‚݃nƒ“ƒhƒ‰‚ɁCTA_NONKERNEL ‘®«‚ªÝ’肳‚ê‚Ä‚¢‚éiE_RSATRj
745 $IF LENGTH(FIND(INHNO_FIX_KERNEL, inhno))$
746 $IF (INH.INHATR[inhno] & TA_NONKERNEL) != 0$
747 $ERROR INH.TEXT_LINE[inhno]$E_RSATR: $FORMAT(_("%1% `%2%\' must not be non-kernel interrupt"), "inhno", INH.INHNO[inhno])$$END$
748 $END$
749 $END$
750
751$ // ƒJ[ƒlƒ‹ŠÇ—ŠO‚ɌŒ肳‚ê‚Ä‚¢‚銄ž‚݃nƒ“ƒhƒ‰‚ɁCTA_NONKERNEL ‘®«‚ªÝ’肳‚ê‚Ä‚¢‚È‚¢iE_RSATRj
752 $IF LENGTH(FIND(INHNO_FIX_NONKERNEL, inhno))$
753 $IF (INH.INHATR[inhno] & TA_NONKERNEL) == 0$
754 $ERROR INH.TEXT_LINE[inhno]$E_RSATR: $FORMAT(_("%1% `%2%\' must be non-kernel interrupt"), "inhno", INH.INHNO[inhno])$$END$
755 $END$
756 $END$
757
758
759$ // Š„ž‚ݔԍ†‚Æ1‘Î1‘Ήž‚·‚銄ž‚݃nƒ“ƒhƒ‰”ԍ†(ATT_ISR‚ÅŽw’è‰Â”\‚ÈŠ„ž‚݃nƒ“ƒhƒ‰”ԍ†)‚́CˆÈ‰º‚̃`ƒFƒbƒN‚às‚¤D
760$ // INHNO_ATTISR_VALID ‚ÉŠÜ‚Ü‚ê‚È‚¢Š„ž‚݃nƒ“ƒhƒ‰”ԍ†‚̓`ƒFƒbƒN‚³‚ê‚È‚¢‚±‚Æ‚É‚È‚éD
761 $IF LENGTH(INTNO[INH.INHNO[inhno]]) > 0$
762 $intno = INTNO[INH.INHNO[inhno]]$
763
764$ // Š„ž‚݃nƒ“ƒhƒ‰“o˜^æ‚ÌŠ„ž‚Ý—v‹ƒ‰ƒCƒ“‚ª‘®«Ý’肳‚ê‚Ä‚¢‚È‚¢(CFG_INT‚ª‚È‚¢)iE_OBJj
765 $IF !LENGTH(INT.INTNO[intno])$
766 $ERROR INH.TEXT_LINE[inhno]$E_OBJ: $FORMAT(_("%1% `%2%\' corresponding to %3% `%4%\' is not configured with %5%"), "intno", INT.INTNO[intno], "inhno", INH.INHNO[inhno], "CFG_INT")$$END$
767 $ELSE$
768 $IF (INH.INHATR[inhno] & TA_NONKERNEL) == 0$
769$ // inhatr‚ÉTA_NONKERNEL‚ªŽw’肳‚ê‚Ä‚¨‚炸Cinhno‚ɑΉž
770$ // ‚·‚éintno‚ɑ΂µ‚ÄCFG_INT‚Őݒ肳‚ꂽŠ„ž‚Ý—Dæ“x‚ª
771$ // TMIN_INTPRI‚æ‚è‚à¬‚³‚¢ê‡iE_OBJj
772 $IF INT.INTPRI[intno] < TMIN_INTPRI$
773 $ERROR INT.TEXT_LINE[intno]$E_OBJ: $FORMAT(_("%1% `%2%\' configured for %3% `%4%\' is higher than %5%"), "intpri", INT.INTPRI[intno], "inhno", INH.INHNO[inhno], "TMIN_INTPRI")$$END$
774 $END$
775 $ELSE$
776$ // inhatr‚ÉTA_NONKERNEL‚ªŽw’肳‚ê‚Ä‚¨‚èCinhno‚ɑΉž
777$ // ‚·‚éintno‚ɑ΂µ‚ÄCFG_INT‚Őݒ肳‚ꂽŠ„ž‚Ý—Dæ“x‚ª
778$ // TMIN_INTPRIˆÈã‚Å‚ ‚éê‡iE_OBJj
779 $IF INT.INTPRI[intno] >= TMIN_INTPRI$
780 $ERROR INT.TEXT_LINE[intno]$E_OBJ: $FORMAT(_("%1% `%2%\' configured for %3% `%4%\' is lower than or equal to %5%"), "intpri", INT.INTPRI[intno], "inhno", INH.INHNO[inhno], "TMIN_INTPRI")$$END$
781 $END$
782 $END$
783 $END$
784 $END$
785 $i = i + 1$
786$END$
787
788$ Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“iISRj‚ÉŠÖ‚·‚éƒGƒ‰[ƒ`ƒFƒbƒN‚ÆŠ„ž‚݃nƒ“ƒhƒ‰‚̐¶¬
789$FOREACH order ISR.ORDER_LIST$
790$ // isratr‚ªiTA_NULLj‚Å‚È‚¢ê‡iE_RSATRj
791 $IF (ISR.ISRATR[order] & ~ALT(TARGET_ISRATR,0)) != 0$
792 $ERROR ISR.TEXT_LINE[order]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"), "isratr", ISR.ISRATR[order], "isr", ISR.ISR[order], "ATT_ISR")$$END$
793 $END$
794
795$ // intno‚ªATT_ISR‚ɑ΂·‚銄ž‚ݔԍ†‚Æ‚µ‚Đ³‚µ‚­‚È‚¢ê‡iE_PARj
796 $IF !LENGTH(FIND(INTNO_ATTISR_VALID, ISR.INTNO[order]))$
797 $ERROR ISR.TEXT_LINE[order]$E_PAR: $FORMAT(_("illegal %1% `%2%\' in %3%"), "intno", ISR.INTNO[order], "ATT_ISR")$$END$
798 $END$
799
800$ // (TMIN_ISRPRI <= isrpri && isrpri <= TMAX_ISRPRI)‚Å‚È‚¢ê‡iE_PARj
801 $IF !(TMIN_ISRPRI <= ISR.ISRPRI[order] && ISR.ISRPRI[order] <= TMAX_ISRPRI)$
802 $ERROR ISR.TEXT_LINE[order]$E_PAR: $FORMAT(_("illegal %1% `%2%\' in %3%"), "isrpri", ISR.ISRPRI[order], "ATT_ISR")$$END$
803 $END$
804$END$
805
806
807$FOREACH intno INTNO_ATTISR_VALID$
808 $inhno = INHNO[intno]$
809
810$ // Š„ž‚ݔԍ†intno‚ɑ΂µ‚Ä“o˜^‚³‚ꂽISR‚̃ŠƒXƒg‚̍쐬
811 $isr_order_list = {}$
812 $FOREACH order ISR.ORDER_LIST$
813 $IF ISR.INTNO[order] == intno$
814 $isr_order_list = APPEND(isr_order_list, order)$
815 $order_for_error = order$
816 $END$
817 $END$
818
819$ // Š„ž‚ݔԍ†intno‚ɑ΂µ‚Ä“o˜^‚³‚ꂽISR‚ª‘¶Ý‚·‚éê‡
820 $IF LENGTH(isr_order_list) > 0$
821$ // intno‚ɑΉž‚·‚éinhno‚ɑ΂µ‚ÄDEF_INH‚ª‚ ‚éê‡iE_OBJj
822 $IF LENGTH(INH.INHNO[inhno])$
823 $ERROR ISR.TEXT_LINE[order_for_error]$E_OBJ: $FORMAT(_("%1% `%2%\' in %3% is duplicated with %4% `%5%\'"), "intno", ISR.INTNO[order_for_error], "ATT_ISR", "inhno", INH.INHNO[inhno])$$END$
824 $END$
825
826$ // intno‚ɑ΂·‚éCFG_INT‚ª‚È‚¢ê‡iE_OBJj
827 $IF !LENGTH(INT.INTNO[intno])$
828 $ERROR ISR.TEXT_LINE[order_for_error]$E_OBJ: $FORMAT(_("%1% `%2%\' is not configured with %3%"), "intno", ISR.INTNO[order_for_error], "CFG_INT")$$END$
829 $ELSE$
830$ // intno‚ɑ΂µ‚ÄCFG_INT‚Őݒ肳‚ꂽŠ„ž‚Ý—Dæ“x‚ªTMIN_INTPRI
831$ // ‚æ‚è‚à¬‚³‚¢ê‡iE_OBJj
832 $IF INT.INTPRI[intno] < TMIN_INTPRI$
833 $ERROR INT.TEXT_LINE[intno]$E_OBJ: $FORMAT(_("%1% `%2%\' configured for %3% `%4%\' is higher than %5%"), "intpri", INT.INTPRI[intno], "intno", ISR.INTNO[order_for_error], "TMIN_INTPRI")$$END$
834 $END$
835 $END$
836
837$ // DEF_INH(inhno, { TA_NULL, _kernel_inthdr_<intno> } );
838 $INH.INHNO[inhno] = inhno$
839 $INH.INHATR[inhno] = VALUE("TA_NULL", 0)$
840 $INH.INTHDR[inhno] = CONCAT("_kernel_inthdr_", intno)$
841 $INH.ORDER_LIST = APPEND(INH.ORDER_LIST, inhno)$
842
843$ // ISR—p‚ÌŠ„ž‚݃nƒ“ƒhƒ‰
844 void$NL$
845 _kernel_inthdr_$intno$(void)$NL$
846 {$NL$
847 $IF LENGTH(isr_order_list) > 1$
848 $TAB$PRI saved_ipm;$NL$
849 $NL$
850 $TAB$i_begin_int($intno$);$NL$
851 $TAB$saved_ipm = i_get_ipm();$NL$
852 $ELSE$
853 $TAB$i_begin_int($intno$);$NL$
854 $END$
855$ // ISR‚ð—Dæ“x‡‚ɌĂяo‚·
856 $JOINEACH order SORT(isr_order_list, "ISR.ISRPRI") "\tif (i_sense_lock()) {\n\t\ti_unlock_cpu();\n\t}\n\ti_set_ipm(saved_ipm);\n"$
857 $TAB$LOG_ISR_ENTER($intno$);$NL$
858 $TAB$((ISR)($ISR.ISR[order]$))((intptr_t)($ISR.EXINF[order]$));$NL$
859 $TAB$LOG_ISR_LEAVE($intno$);$NL$
860 $END$
861 $TAB$i_end_int($intno$);$NL$
862 }$NL$
863 $END$
864$END$
865$NL$
866
867$
868$ Š„ž‚ÝŠÇ—‹@”\‚Ì‚½‚ß‚Ì•W€“I‚ȏ‰Šú‰»î•ñ‚̐¶¬
869$
870$ Š„ž‚݃nƒ“ƒhƒ‰‚̏‰Šú‰»‚É•K—v‚ȏî•ñ
871$IF !OMIT_INITIALIZE_INTERRUPT || ALT(USE_INHINIB_TABLE,0)$
872
873$ Š„ž‚݃nƒ“ƒhƒ‰”
874#define TNUM_INHNO $LENGTH(INH.ORDER_LIST)$$NL$
875const uint_t _kernel_tnum_inhno = TNUM_INHNO;$NL$
876$NL$
877$FOREACH inhno INH.ORDER_LIST$
878 INTHDR_ENTRY($INH.INHNO[inhno]$, $+INH.INHNO[inhno]$, $INH.INTHDR[inhno]$)$NL$$NL$
879$END$
880
881$ Š„ž‚݃nƒ“ƒhƒ‰‰Šú‰»ƒe[ƒuƒ‹
882$IF LENGTH(INH.ORDER_LIST)$
883 const INHNO _kernel_inhinib_inhno[TNUM_INHNO] = {
884 $JOINEACH inhno INH.ORDER_LIST ","$
885 ($INH.INHNO[inhno]$)
886 $END$
887 };$NL$
888
889 const ATR _kernel_inhinib_inhatr[TNUM_INHNO] = {
890 $JOINEACH inhno INH.ORDER_LIST ","$
891 ($INH.INHATR[inhno]$)
892 $END$
893 };$NL$
894
895 const FP _kernel_inhinib_entry[TNUM_INHNO] = {
896 $JOINEACH inhno INH.ORDER_LIST ","$
897 (FP)(INT_ENTRY($INH.INHNO[inhno]$, $INH.INTHDR[inhno]$))
898 $END$
899 };$NL$
900$ELSE$
901 TOPPERS_EMPTY_LABEL(const INHNO, _kernel_inhinib_inhno);$NL$
902 TOPPERS_EMPTY_LABEL(const ATR, _kernel_inhinib_inhatr);$NL$
903 TOPPERS_EMPTY_LABEL(const FP, _kernel_inhinib_entry);$NL$
904$END$$NL$
905$END$
906
907$ Š„ž‚Ý—v‹ƒ‰ƒCƒ“‚̏‰Šú‰»‚É•K—v‚ȏî•ñ
908$IF !OMIT_INITIALIZE_INTERRUPT || ALT(USE_INTINIB_TABLE,0)$
909
910$ Š„ž‚Ý—v‹ƒ‰ƒCƒ“”
911#define TNUM_INTNO $LENGTH(INT.ORDER_LIST)$$NL$
912const uint_t _kernel_tnum_intno = TNUM_INTNO;$NL$
913$NL$
914
915$ Š„ž‚Ý—v‹ƒ‰ƒCƒ“‰Šú‰»ƒe[ƒuƒ‹
916$IF LENGTH(INT.ORDER_LIST)$
917 const INTNO _kernel_intinib_intno[TNUM_INTNO] = {
918 $JOINEACH intno INT.ORDER_LIST ","$
919 ($INT.INTNO[intno]$)
920 $END$
921 };$NL$
922
923 const ATR _kernel_intinib_intatr[TNUM_INTNO] = {
924 $JOINEACH intno INT.ORDER_LIST ","$
925 ($INT.INTATR[intno]$)
926 $END$
927 };$NL$
928
929 const PRI _kernel_intinib_intpri[TNUM_INTNO] = {
930 $JOINEACH intno INT.ORDER_LIST ","$
931 ($INT.INTPRI[intno]$)
932 $END$
933 };$NL$
934$ELSE$
935 TOPPERS_EMPTY_LABEL(const INTNO, _kernel_intinib_intno);$NL$
936 TOPPERS_EMPTY_LABEL(const ATR, _kernel_intinib_intatr);$NL$
937 TOPPERS_EMPTY_LABEL(const PRI, _kernel_intinib_intpri);$NL$
938$END$
939$NL$
940$END$
941
942$ ---------------------------------------------------------------------
943$ CPU—áŠOƒnƒ“ƒhƒ‰
944$ ---------------------------------------------------------------------
945/*$NL$
946$SPC$* CPU Exception Handler$NL$
947$SPC$*/$NL$
948$NL$
949
950$ // EXCNO_DEFEXC_VALID ‚Ì—v‘f‚ª EXCNO_VALID ‚ÉŠÜ‚Ü‚ê‚é‚©‚Ç‚¤‚©‚̃`ƒFƒbƒN
951$ // EXCNO_DEFEXC_VALID ‚Í EXCNO_VALID ‚Ì•”•ªW‡‚É‚È‚é‚Í‚¸D
952$FOREACH excno EXCNO_DEFEXC_VALID$
953 $IF LENGTH(FIND(EXCNO_VALID, excno)) == 0$
954 $ERROR$all elements of `EXCNO_DEFEXC_VALID' must be included in `EXCNO_VALID'$END$
955 $END$
956$END$
957
958
959$ CPU—áŠOƒnƒ“ƒhƒ‰‚ÉŠÖ‚·‚éƒGƒ‰[ƒ`ƒFƒbƒN
960$i = 0$
961$FOREACH excno EXC.ORDER_LIST$
962$ // excno‚ªDEF_EXC‚ɑ΂·‚éCPU—áŠOƒnƒ“ƒhƒ‰”ԍ†‚Æ‚µ‚Đ³‚µ‚­‚È‚¢ê‡iE_PARj
963 $IF !LENGTH(FIND(EXCNO_DEFEXC_VALID, EXC.EXCNO[excno]))$
964 $ERROR EXC.TEXT_LINE[excno]$E_PAR: $FORMAT(_("illegal %1% `%2%\' in %3%"), "excno", EXC.EXCNO[excno], "DEF_EXC")$$END$
965 $END$
966
967$ // excno‚ªDEF_EXC‚É‚æ‚Á‚ĐݒèÏ‚݂̏ꍇiE_OBJj
968 $j = 0$
969 $FOREACH excno2 EXC.ORDER_LIST$
970 $IF EXC.EXCNO[excno] == EXC.EXCNO[excno2] && j < i$
971 $ERROR EXC.TEXT_LINE[excno]$E_OBJ: $FORMAT(_("%1% `%2%\' in %3% is duplicated"), "excno", EXC.EXCNO[excno], "DEF_EXC")$$END$
972 $END$
973 $j = j + 1$
974 $END$
975
976$ // excatr‚ªiTA_NULLj‚Å‚È‚¢ê‡iE_RSATRj
977 $IF (EXC.EXCATR[excno] & ~ALT(TARGET_EXCATR,0)) != 0$
978 $ERROR EXC.TEXT_LINE[excno]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"), "excatr", EXC.EXCATR[excno], "excno", EXC.EXCNO[excno], "DEF_EXC")$$END$
979 $END$
980 $i = i + 1$
981$END$
982
983$ CPU—áŠOƒnƒ“ƒhƒ‰‚Ì‚½‚ß‚Ì•W€“I‚ȏ‰Šú‰»î•ñ‚̐¶¬
984$IF !ALT(OMIT_INITIALIZE_EXCEPTION,0)$
985
986$ CPU—áŠOƒnƒ“ƒhƒ‰”
987#define TNUM_EXCNO $LENGTH(EXC.ORDER_LIST)$$NL$
988const uint_t _kernel_tnum_excno = TNUM_EXCNO;$NL$
989$NL$
990$FOREACH excno EXC.ORDER_LIST$
991 EXCHDR_ENTRY($EXC.EXCNO[excno]$, $+EXC.EXCNO[excno]$, $EXC.EXCHDR[excno]$)$NL$$NL$
992$END$
993
994$ CPU—áŠOƒnƒ“ƒhƒ‰‰Šú‰»ƒe[ƒuƒ‹
995$IF LENGTH(EXC.ORDER_LIST)$
996 const EXCNO _kernel_excinib_excno[TNUM_EXCNO] = {
997 $JOINEACH excno EXC.ORDER_LIST ","$
998 ($EXC.EXCNO[excno]$)
999 $END$
1000 };$NL$
1001
1002 const ATR _kernel_excinib_excatr[TNUM_EXCNO] = {
1003 $JOINEACH excno EXC.ORDER_LIST ","$
1004 ($EXC.EXCATR[excno]$)
1005 $END$
1006 };$NL$
1007
1008 const FP _kernel_excinib_entry[TNUM_EXCNO] = {
1009 $JOINEACH excno EXC.ORDER_LIST ","$
1010 (FP)(EXC_ENTRY($EXC.EXCNO[excno]$, $EXC.EXCHDR[excno]$))
1011 $END$
1012 };$NL$
1013$ELSE$
1014 TOPPERS_EMPTY_LABEL(const EXCNO, _kernel_excinib_excno);$NL$
1015 TOPPERS_EMPTY_LABEL(const ATR, _kernel_excinib_excatr);$NL$
1016 TOPPERS_EMPTY_LABEL(const FP, _kernel_excinib_entry);$NL$
1017$END$
1018$NL$
1019$END$
1020
1021
1022$ ---------------------------------------------------------------------
1023$ ŽüŠúƒnƒ“ƒhƒ‰
1024$ ---------------------------------------------------------------------
1025
1026/*$NL$
1027$SPC$* Cyclic Handler Functions$NL$
1028$SPC$*/$NL$
1029$NL$
1030
1031$ ŽüŠúƒnƒ“ƒhƒ‰ID”ԍ†‚̍őå’l
1032const ID _kernel_tmax_cycid = (TMIN_CYCID + TNUM_CYCID - 1);$NL$
1033
1034$ ŽüŠúƒnƒ“ƒhƒ‰‚̃^ƒCƒ€ƒCƒxƒ“ƒgIDƒIƒtƒZƒbƒg
1035$ ŽüŠúƒnƒ“ƒhƒ‰‚̃^ƒCƒ€ƒCƒxƒ“ƒgID‚Í0‚©‚çŠJŽn
1036const uint_t _kernel_cycevtid_offset = 0;$NL$
1037$NL$
1038
1039$ ƒGƒ“ƒgƒŠ‚ª TMAX_MAXCYC(kernel.h) ŒÂ‚æ‚葽‚¢ê‡‚́CƒGƒ‰[‚Æ‚·‚é
1040$IF LENGTH(CYC.ORDER_LIST) > TMAX_MAXCYC$
1041 $ERROR$$FORMAT(_("The number of CRE_CYC must be equal to or less than %1%."), +VALUE("TMAX_MAXCYC", TMAX_MAXCYC))$$END$
1042$END$
1043
1044$IF LENGTH(CYC.ORDER_LIST)$
1045$ ŽüŠúƒnƒ“ƒhƒ‰‘®«
1046 $CYCACT = 0$
1047 $FOREACH cycid CYC.ORDER_LIST$
1048$ // ŽüŠúƒnƒ“ƒhƒ‰‘®«(cycatr) ‚ª TA_NULL, TA_STA ‚Ì‚¢‚¸‚ê‚Å‚à‚È‚¢iE_RSATRj
1049 $IF (CYC.CYCATR[cycid] & ~TA_STA) != 0$
1050 $ERROR CYC.TEXT_LINE[cycid]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "cycatr", CYC.CYCATR[cycid], cycid, "CRE_CYC")$$END$
1051 $END$
1052
1053 $IF(CYC.CYCATR[cycid] & TA_STA)$
1054 $CYCACT = CYCACT | (1 << (cycid-1))$
1055 $END$
1056 $END$
1057 const uint16_t _kernel_cycinib_cycact = $CYCACT$;$NL$
1058
1059$ ŽüŠúƒnƒ“ƒhƒ‰Šg’£î•ñ
1060 const intptr_t _kernel_cycinib_exinf[TNUM_CYCID] = {
1061 $JOINEACH cycid CYC.ORDER_LIST ","$
1062 (intptr_t)($CYC.EXINF[cycid]$)
1063 $END$
1064 };$NL$
1065
1066$ ŽüŠúƒnƒ“ƒhƒ‰ƒAƒhƒŒƒX
1067 const CYCHDR _kernel_cycinib_cychdr[TNUM_CYCID] = {
1068 $JOINEACH cycid CYC.ORDER_LIST ","$
1069 ($CYC.CYCHDR[cycid]$)
1070 $END$
1071 };$NL$
1072
1073$ ŽüŠúƒnƒ“ƒhƒ‰ŽüŠú
1074 const RELTIM _kernel_cycinib_cyctim[TNUM_CYCID] = {
1075 $JOINEACH cycid CYC.ORDER_LIST ","$
1076$ // cyctim ‚Í 0 ‚æ‚è‘å‚«‚­CTMAX_RELTIM ˆÈ‰º‚Å‚ ‚éD(E_PAR)
1077 $IF CYC.CYCTIM[cycid] <= 0 || TMAX_RELTIM < CYC.CYCTIM[cycid] $
1078 $ERROR CYC.TEXT_LINE[cycid]$E_PAR: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "cyctim", CYC.CYCTIM[cycid], cycid, "CRE_CYC")$$END$
1079 $END$
1080
1081 ($CYC.CYCTIM[cycid]$)
1082 $END$
1083 };$NL$
1084
1085$ ŽüŠúƒnƒ“ƒhƒ‰ˆÊ‘Š
1086 const RELTIM _kernel_cycinib_cycphs[TNUM_CYCID] = {
1087 $JOINEACH cycid CYC.ORDER_LIST ","$
1088$ // cycphs ‚Í 0 ˆÈãCTMAX_RELTIM ˆÈ‰º‚Å‚ ‚éD(E_PAR)
1089 $IF CYC.CYCPHS[cycid] < 0 || TMAX_RELTIM < CYC.CYCPHS[cycid] $
1090 $ERROR CYC.TEXT_LINE[cycid]$E_PAR: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "cycphs", CYC.CYCPHS[cycid], cycid, "CRE_CYC")$$END$
1091 $END$
1092
1093$ // ˆÊ‘Š‚ª0‚©‚C‘®«‚ª TA_STA ‚̏ꍇ‚ÍŒx
1094 $IF CYC.CYCPHS[cycid] == 0 && (CYC.CYCATR[cycid] & TA_STA) != 0$
1095 $WARNING CYC.TEXT_LINE[cycid]$$FORMAT(_("%1% is not recommended when %2% is set to %3% in %4%"), "cycphs==0", "TA_STA", "cycatr", "CRE_CYC")$$END$
1096 $END$
1097
1098 ($CYC.CYCPHS[cycid]$)
1099 $END$
1100 };$NL$
1101 $NL$
1102
1103$ ŽüŠúƒnƒ“ƒhƒ‰‚ÌŽŸ‰ñ‹N“®Žž
1104EVTTIM _kernel_cyccb_evttim[TNUM_CYCID];$NL$
1105
1106$ELSE$
1107 const uint16_t _kernel_cycinib_cycact = 0;$NL$
1108 TOPPERS_EMPTY_LABEL(const intptr_t, _kernel_cycinib_exinf);$NL$
1109 TOPPERS_EMPTY_LABEL(const CYCHDR, _kernel_cycinib_cychdr);$NL$
1110 TOPPERS_EMPTY_LABEL(const RELTIM, _kernel_cycinib_cyctim);$NL$
1111 TOPPERS_EMPTY_LABEL(const RELTIM, _kernel_cycinib_cycphs);$NL$
1112 TOPPERS_EMPTY_LABEL(EVTTIM, _kernel_cyccb_evttim);$NL$
1113$END$
1114
1115$ ŽüŠúƒnƒ“ƒhƒ‰“®ìó‘Ô
1116uint16_t _kernel_cyccb_cycact;$NL$
1117
1118$NL$
1119$NL$
1120
1121$ ---------------------------------------------------------------------
1122$ ƒAƒ‰[ƒ€ƒnƒ“ƒhƒ‰
1123$ ---------------------------------------------------------------------
1124
1125/*$NL$
1126$SPC$* Alarm Handler Functions$NL$
1127$SPC$*/$NL$
1128$NL$
1129
1130$ ƒGƒ“ƒgƒŠ‚ª TMAX_MAXALM(kernel.h) ŒÂ‚æ‚葽‚¢ê‡‚́CƒGƒ‰[‚Æ‚·‚é
1131$IF LENGTH(ALM.ORDER_LIST) > TMAX_MAXALM$
1132 $ERROR$$FORMAT(_("The number of CRE_ALM must be equal to or less than %1%."), +VALUE("TMAX_MAXALM",TMAX_MAXALM))$$END$
1133$END$
1134
1135$ ƒAƒ‰[ƒ€ƒnƒ“ƒhƒ‰‚̍őåID’l
1136const ID _kernel_tmax_almid = (TMIN_ALMID + TNUM_ALMID - 1);$NL$
1137
1138$ ƒAƒ‰[ƒ€ƒnƒ“ƒhƒ‰‚̃^ƒCƒ€ƒCƒxƒ“ƒgIDƒIƒtƒZƒbƒg
1139const uint_t _kernel_almevtid_offset = $LENGTH(CYC.ORDER_LIST)$;$NL$
1140$NL$
1141
1142$FOREACH almid ALM.ORDER_LIST$
1143$ // almatr‚ªiTA_NULLj‚Å‚È‚¢ê‡iE_RSATRj
1144 $IF ALM.ALMATR[almid] != 0$
1145 $ERROR ALM.TEXT_LINE[almid]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"), "almatr", ALM.ALMATR[almid], almid, "CRE_ALM")$$END$
1146 $END$
1147$END$
1148
1149$IF LENGTH(ALM.ORDER_LIST)$
1150$ ƒAƒ‰[ƒ€ƒnƒ“ƒhƒ‰æ“ª”Ô’n
1151 const ALMHDR _kernel_alminib_almhdr[TNUM_ALMID] = {
1152 $JOINEACH almid ALM.ORDER_LIST ","$
1153 ($ALM.ALMHDR[almid]$)
1154 $END$
1155 };$NL$
1156
1157$ ƒAƒ‰[ƒ€ƒnƒ“ƒhƒ‰Šg’£î•ñ
1158 const intptr_t _kernel_alminib_exinf[TNUM_ALMID] = {
1159 $JOINEACH almid ALM.ORDER_LIST ","$
1160 (intptr_t)($ALM.EXINF[almid]$)
1161 $END$
1162 };$NL$
1163$NL$
1164$ELSE$
1165 TOPPERS_EMPTY_LABEL(const ALMHDR, _kernel_alminib_almhdr);$NL$
1166 TOPPERS_EMPTY_LABEL(const intptr_t, _kernel_alminib_exinf);$NL$
1167$NL$
1168$END$
1169
1170$ ƒAƒ‰[ƒ€ƒnƒ“ƒhƒ‰ó‘Ô
1171uint16_t _kernel_almcb_almact;$NL$
1172$NL$
1173
1174
1175$ ---------------------------------------------------------------------
1176$ ƒ^ƒCƒ€ƒCƒxƒ“ƒgŠÇ—
1177$ ---------------------------------------------------------------------
1178
1179/*$NL$
1180$SPC$* Time Event Management$NL$
1181$SPC$*/$NL$
1182$NL$
1183
1184$TNUM_TMEVT = LENGTH(CYC.ORDER_LIST) + LENGTH(ALM.ORDER_LIST)$
1185
1186#define TNUM_TMEVT $TNUM_TMEVT$$NL$
1187$NL$
1188
1189$ ƒ^ƒCƒ€ƒCƒxƒ“ƒgƒuƒƒbƒN‚̃TƒCƒY
1190const uint_t _kernel_tnum_tmevt_queue = TNUM_TMEVT;$NL$$NL$
1191
1192$IF TNUM_TMEVT != 0$
1193$ ƒ^ƒCƒ€ƒCƒxƒ“ƒgƒLƒ…
1194[
1195 QUEUE _kernel_tmevt_queue[TNUM_TMEVT+1];$NL$
1196$ ƒ^ƒCƒ€ƒCƒxƒ“ƒgŽžŠÔ
1197 EVTTIM _kernel_tmevt_time[TNUM_TMEVT];$NL$
1198$ ƒ^ƒCƒ€ƒCƒxƒ“ƒg‚̃R[ƒ‹ƒoƒbƒN
1199 CBACK _kernel_tmevt_callback[TNUM_TMEVT];$NL$
1200$ ƒ^ƒCƒ€ƒCƒxƒ“ƒgƒR[ƒ‹ƒoƒbƒN‚̈ø”
1201 uintptr_t _kernel_tmevt_arg[TNUM_TMEVT];$NL$
1202 $NL$$NL$
1203$ELSE$
1204 TOPPERS_EMPTY_LABEL(QUEUE, _kernel_tmevt_queue);$NL$
1205 TOPPERS_EMPTY_LABEL(EVTTIM, _kernel_tmevt_time);$NL$
1206 TOPPERS_EMPTY_LABEL(CBACK, _kernel_tmevt_callback);$NL$
1207 TOPPERS_EMPTY_LABEL(uintptr_t, _kernel_tmevt_arg);$NL$
1208 $NL$$NL$
1209$END$
1210
1211$ ---------------------------------------------------------------------
1212$ ”ñƒ^ƒXƒNƒRƒ“ƒeƒLƒXƒg—pƒXƒ^ƒbƒN—̈æ
1213$ ---------------------------------------------------------------------
1214/*$NL$
1215$SPC$* Interrupt Context Stack Size$NL$
1216$SPC$*/$NL$$NL$
1217
1218$ // •Ï”’è‹`
1219$ // ”ñƒ^ƒXƒNƒRƒ“ƒeƒLƒXƒg—pƒXƒ^ƒbƒN—̈æ‚̃TƒCƒY
1220$interrupt_context_stksz = 0$
1221
1222$ // DEF_ICS ‚̃Gƒ“ƒgƒŠ‚ª‘¶Ý‚·‚é‚©?
1223$IF !LENGTH(ICS.ORDER_LIST)$
1224$ // ‚È‚¢ê‡DƒTƒCƒY‚ÍŠù’è’l (DEFAULT_ISTKSZ) ‚ðŽg‚¤
1225 #define TOPPERS_ISTKSZ DEFAULT_ISTKSZ$NL$$NL$
1226 $interrupt_context_stksz = DEFAULT_ISTKSZ$
1227$ELSE$
1228$ // DEF_ICS ‚̃Gƒ“ƒgƒŠ‚ª‚ ‚éê‡
1229
1230$
1231$ // ƒGƒ‰[ƒ`ƒFƒbƒN
1232$
1233$ // Ã“IAPIuDEF_ICSv‚ª•¡”‚ ‚éiE_OBJj
1234 $IF LENGTH(ICS.ORDER_LIST) > 1$
1235 $ERROR$E_OBJ: $FORMAT(_("too many %1%"), "DEF_ICS")$$END$
1236 $END$
1237$ // DEF_ICS ‚Å0‚ðŽw’肵‚½ê‡(E_PAR)
1238 $IF ICS.ISTKSZ[1] == 0$
1239 $ERROR ICS.TEXT_LINE[1]$E_PAR: $FORMAT(_("%1% in %2% is 0"), "istksz", "DEF_ICS")$$END$
1240 $END$
1241$ // í‚É NULL ‚Å‚ ‚éD(E_PAR)
1242 $IF !EQ(ICS.ISTK[1], "NULL")$
1243 $ERROR ICS.TEXT_LINE[1]$E_PAR: $FORMAT(("'%1%' of %2% must be NULL."), "istk", "DEF_ICS")$$END$
1244 $END$
1245
1246 #define TOPPERS_ISTKSZ ($ICS.ISTKSZ[1]$)$NL$
1247 $interrupt_context_stksz = ICS.ISTKSZ[1]$
1248 $NL$
1249$END$
1250$NL$
1251
1252$ ---------------------------------------------------------------------
1253$ ‹¤—LƒXƒ^ƒbƒN—̈æ
1254$ SSP‚Å‚Í‚·‚ׂĂ̏ˆ—’PˆÊ‚̃Xƒ^ƒbƒN‚ð‹¤—L‚·‚邽‚߁C
1255$ ‚±‚±‚ŃVƒXƒeƒ€‘S‘̂̃Xƒ^ƒbƒN—̈æ‚ðŠm•Û‚·‚éD
1256$ ---------------------------------------------------------------------
1257
1258$
1259$ ‹¤—LƒXƒ^ƒbƒN‚̃Rƒ“ƒtƒBƒMƒ…
1260ƒŒ[ƒVƒ‡ƒ“‚ɐ¬Œ÷‚µ‚½‚©‚Ç‚¤‚©
1261$
1262$ DEF_STK ˆ—’†‚ɃGƒ‰[‚ª”­¶‚µ‚½ê‡C‚±‚̕ϐ”‚ª0‚É‚È‚éD
1263$ DEF_STK ˆ—’†‚ɃGƒ‰[‚ª”­¶‚µ‚½‚©‚Ç‚¤‚©‚ð”»’f‚µ‚Ä
1264$ “Á’菈—‚ÌŽÀs‚ðƒuƒƒbƒN‚·‚邽‚ß‚ÉŽg—p‚·‚éD
1265$
1266$configurated_defstk_successfully = 1$
1267
1268/*$NL$
1269$SPC$* Stack Area for System$NL$
1270$SPC$*/$NL$
1271$NL$
1272
1273$ // •Ï”’è‹`
1274$ // Š„‚è“–‚Ä‚ç‚ꂽ‹¤—LƒXƒ^ƒbƒN—̈æ‚̃TƒCƒY
1275$allocated_stack_size = 0$
1276
1277$ // DEF_STK ‚̃Gƒ“ƒgƒŠ‚ª‘¶Ý‚·‚é‚©?
1278$IF !LENGTH(STK.ORDER_LIST)$
1279$ // (1) DEF_STK ‚̃Gƒ“ƒgƒŠ‚ª‚È‚¢ê‡
1280 static STK_T _kernel_stack[COUNT_STK_T(TOPPERS_TSTKSZ+TOPPERS_ISTKSZ)];$NL$
1281 #define TOPPERS_STK _kernel_stack$NL$
1282 #define TOPPERS_STKSZ ROUND_STK_T(TOPPERS_TSTKSZ+TOPPERS_ISTKSZ)$NL$
1283 $NL$
1284
1285 $allocated_stack_size = max_tsk_stksz + interrupt_context_stksz$
1286$ELSE$
1287$ // (2) DEF_STK ‚̃Gƒ“ƒgƒŠ‚ª‚ ‚éê‡
1288
1289$ // ƒGƒ‰[ƒ`ƒFƒbƒN
1290$ // Ã“IAPIuDEF_STKv‚ª•¡”‚ ‚éiE_OBJj
1291 $IF LENGTH(STK.ORDER_LIST) > 1$
1292 $configurated_defstk_successfully = 0$
1293 $ERROR$E_OBJ: $FORMAT(_("too many %1%"), "DEF_STK")$$END$
1294 $END$
1295$ // DEF_STK ‚Ì stksz ‚Å 0 ‚ðŽw’肵‚½ê‡(E_PAR)
1296 $IF STK.STKSZ[1] == 0$
1297 $configurated_defstk_successfully = 0$
1298 $ERROR STK.TEXT_LINE[1]$E_PAR: $FORMAT(_("%1% in %2% is 0"), "stksz", "DEF_STK")$$END$
1299 $END$
1300
1301 $IF EQ(STK.STK[1], "NULL")$
1302$ // stk ‚ª NULL ‚̏ꍇCƒXƒ^ƒbƒN—̈æ‚ðŽ©“®Š„•t‚¯
1303 static STK_T _kernel_stack[COUNT_STK_T($STK.STKSZ[1]$)];$NL$
1304 #define TOPPERS_STK _kernel_stack$NL$
1305 #define TOPPERS_STKSZ ROUND_STK_T($STK.STKSZ[1]$)$NL$
1306 $ELSE$
1307$ // stk ‚ª NULL ˆÈŠO‚̏ꍇiƒAƒvƒŠ‘¤‚ŃXƒ^ƒbƒN—̈æ‚ð—pˆÓ‚·‚éê‡j
1308
1309$ // stksz‚ªƒ^[ƒQƒbƒg–ˆ‚É’è‚Ü‚éƒAƒ‰ƒCƒƒ“ƒgƒTƒCƒY‚Ì”{”‚ɃAƒ‰ƒCƒƒ“ƒg‚³‚ê‚Ä‚¢‚È‚¢ê‡iE_PARj
1310 $IF LENGTH(CHECK_STKSZ_ALIGN) && (STK.STKSZ[1] & (CHECK_STKSZ_ALIGN - 1))$
1311 $configurated_defstk_successfully = 0$
1312 $ERROR STK.TEXT_LINE[1]$E_PAR: $FORMAT(_("%1% `%2%\' in %3% is not aligned"), "stksz", STK.STKSZ[1], "DEF_STK")$$END$
1313 $END$
1314
1315 #define TOPPERS_STK ($STK.STK[1]$)$NL$
1316 #define TOPPERS_STKSZ ($STK.STKSZ[1]$)$NL$
1317 $END$
1318
1319 $allocated_stack_size = STK.STKSZ[1]$
1320$END$
1321$NL$
1322
1323$ ‹¤—LƒXƒ^ƒbƒN—p‚̃Xƒ^ƒbƒN—̈æ
1324const SIZE _kernel_stksz = TOPPERS_STKSZ;$NL$
1325STK_T *const _kernel_stk = TOPPERS_STK;$NL$
1326$NL$
1327#ifdef TOPPERS_ISTKPT$NL$
1328STK_T *const _kernel_istkpt = TOPPERS_ISTKPT(TOPPERS_STK, TOPPERS_STKSZ);$NL$
1329#endif /* TOPPERS_ISTKPT */$NL$
1330$NL$
1331
1332$
1333$ // —Dæ“xŠ„‚è“–‚Ä‚¨‚æ‚уXƒ^ƒbƒNÝ’è‚ÉŠÖ‚·‚錋‰Ê‚ð•W€o—Í‚Ö•\Ž¦
1334$
1335$IF configurated_defepr_successfully == 1 && configurated_defstk_successfully == 1$
1336 $FILE "stdout"$
1337 =====================================$NL$
1338 Task priority configuration result:$NL$
1339 $FOREACH tskid SORT(TSK.ORDER_LIST, "TSK.ATSKPRI")$
1340 $TAB$$TSK.TSKID[tskid]$:$TAB$ IPRI = $reallocate_tskapri[TSK.TSKID[tskid]]$, EXEPRI = $reallocate_tskepri[tskid]$$NL$
1341 $END$
1342 =====================================$NL$
1343
1344 =====================================$NL$
1345 Stack size configuration result:$NL$
1346 $TAB$Estimated task stack size = $max_tsk_stksz$$NL$
1347 $TAB$Specified interrupt stack size = $interrupt_context_stksz$(value=$FORMAT("%d",+interrupt_context_stksz)$)$NL$
1348 $TAB$Allocated total stack size = $allocated_stack_size$(value=$FORMAT("%d",+allocated_stack_size)$)$NL$
1349$ // ƒTƒCƒY‚̃`ƒFƒbƒNDƒXƒ^ƒbƒNƒTƒCƒY‚̐„’è’l‚ªŽÀÛ‚ÉŠ„“–‚Ä‚ç‚ꂽƒTƒCƒY‚æ‚è‘å‚«‚¢ê‡CŒx‚·‚éD
1350 $IF (max_tsk_stksz+interrupt_context_stksz) > allocated_stack_size$
1351 $TAB$!!!WARNING!!!: Estimated stack size is more than the allocated stack size.$NL$
1352 $WARNING STK.TEXT_LINE[1]$ $FORMAT("Estimated stack size is more than the allocated stack size.")$$END$
1353 $END$
1354 =====================================$NL$
1355$END$
1356$
1357$ // o—͐æ‚ðŒ³‚É–ß‚µ‚Ä‚¨‚­
1358$
1359$FILE "kernel_cfg.c"$
1360
1361
1362$ ---------------------------------------------------------------------
1363$ Šeƒ‚ƒWƒ…
1364[ƒ‹‚̏‰Šú‰»ŠÖ”
1365$ ---------------------------------------------------------------------
1366/*$NL$
1367$SPC$* Module Initialization Function$NL$
1368$SPC$*/$NL$
1369$NL$
1370void$NL$
1371_kernel_initialize_object(void)$NL$
1372{$NL$
1373$IF TNUM_TMEVT > 0$
1374$TAB$_kernel_initialize_time_event();$NL$
1375$END$
1376$TAB$_kernel_initialize_task();$NL$
1377$TAB$_kernel_initialize_interrupt();$NL$
1378$TAB$_kernel_initialize_exception();$NL$
1379$IF LENGTH(CYC.ID_LIST)$
1380 $TAB$_kernel_initialize_cyclic();$NL$
1381$END$
1382$IF LENGTH(ALM.ID_LIST)$
1383 $TAB$_kernel_initialize_alarm();$NL$
1384$END$
1385$IF LENGTH(FLG.ID_LIST)$
1386 $TAB$_kernel_initialize_eventflag();$NL$
1387$END$
1388$IF LENGTH(DTQ.ID_LIST)$
1389 $TAB$_kernel_initialize_dataqueue();$NL$
1390$END$
1391}$NL$
1392$NL$
1393
1394$ ---------------------------------------------------------------------
1395$ ‰Šú‰»ƒ‹[ƒ`ƒ“‚ÌŽÀsŠÖ”
1396$ ---------------------------------------------------------------------
1397/*$NL$
1398$SPC$* Initialization Routine$NL$
1399$SPC$*/$NL$
1400$NL$
1401void$NL$
1402_kernel_call_inirtn(void)$NL$
1403{$NL$
1404$FOREACH order INI.ORDER_LIST$
1405$ // iniatr‚ªiTA_NULLj‚Å‚È‚¢ê‡iE_RSATRj
1406 $IF INI.INIATR[order] != 0$
1407 $ERROR INI.TEXT_LINE[order]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"), "iniatr", INI.INIATR[order], "inirtn", INI.INIRTN[order], "ATT_INI")$$END$
1408 $END$
1409 $TAB$((INIRTN)($INI.INIRTN[order]$))((intptr_t)($INI.EXINF[order]$));$NL$
1410$END$
1411}$NL$
1412$NL$
1413
1414$ ---------------------------------------------------------------------
1415$ I—¹ˆ—ƒ‹[ƒ`ƒ“‚ÌŽÀsŠÖ”
1416$ ---------------------------------------------------------------------
1417/*$NL$
1418$SPC$* Termination Routine$NL$
1419$SPC$*/$NL$
1420$NL$
1421void$NL$
1422_kernel_call_terrtn(void)$NL$
1423{$NL$
1424$FOREACH rorder TER.RORDER_LIST$
1425$ // teratr‚ªiTA_NULLj‚Å‚È‚¢ê‡iE_RSATRj
1426 $IF TER.TERATR[rorder] != 0$
1427 $ERROR TER.TEXT_LINE[rorder]$E_RSATR: $FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"), "teratr", TER.TERATR[rorder], "terrtn", TER.TERRTN[rorder], "ATT_TER")$$END$
1428 $END$
1429 $TAB$((TERRTN)($TER.TERRTN[rorder]$))((intptr_t)($TER.EXINF[rorder]$));$NL$
1430$END$
1431}$NL$
1432$NL$
1433
1434
Note: See TracBrowser for help on using the repository browser.