source: ssp_qb_r5f100le_cs/trunk/kernel/check.h@ 93

Last change on this file since 93 was 93, checked in by nmir-saito, 8 years ago

add Combined package of SSP kernel for QB-R5F100LE-TB(RL78 processor)

File size: 7.4 KB
Line 
1/*
2 * TOPPERS/SSP Kernel
3 * Smallest Set Profile Kernel
4 *
5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
6 * Toyohashi Univ. of Technology, JAPAN
7 * Copyright (C) 2005-2007 by Embedded and Real-Time Systems Laboratory
8 * Graduate School of Information Science, Nagoya Univ., JAPAN
9 * Copyright (C) 2010 by Naoki Saito
10 * Nagoya Municipal Industrial Research Institute, JAPAN
11 * Copyright (C) 2011 by Meika Sugimoto
12 *
13 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
14 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
15 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
16 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
17 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
18 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
19 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
20 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
21ƒƒ“ƒgi—˜—p
22 * ŽÒƒ}ƒjƒ…
23ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
24 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
25 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
26 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
27 * ‚ƁD
28 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
29ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
30ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
31 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
32 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
33 * •ñ‚·‚邱‚ƁD
34 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
35 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
36 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
37 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
38 * –Ɛӂ·‚邱‚ƁD
39 *
40 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
41 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
42 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
43 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
44 * ‚̐ӔC‚𕉂í‚È‚¢D
45 *
46 * @(#) $Id: exception.h 648 2007-12-15 09:35:35Z hiro $
47 */
48/*
49 * TOPPERS/ASP Kernel
50 * Toyohashi Open Platform for Embedded Real-Time Systems/
51 * Advanced Standard Profile Kernel
52 *
53 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
54 * Toyohashi Univ. of Technology, JAPAN
55 * Copyright (C) 2005-2007 by Embedded and Real-Time Systems Laboratory
56 * Graduate School of Information Science, Nagoya Univ., JAPAN
57 *
58 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
59 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
60 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
61 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
62 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
63 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
64 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
65 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
66ƒƒ“ƒgi—˜—p
67 * ŽÒƒ}ƒjƒ…
68ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
69 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
70 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
71 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
72 * ‚ƁD
73 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
74ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
75ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
76 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
77 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
78 * •ñ‚·‚邱‚ƁD
79 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
80 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
81 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
82 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
83 * –Ɛӂ·‚邱‚ƁD
84 *
85 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
86 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
87 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
88 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
89 * ‚̐ӔC‚𕉂í‚È‚¢D
90 *
91 * @(#) $Id: check.h 1139 2008-06-19 07:03:34Z ertl-hiro $
92 */
93
94/*
95 * ƒGƒ‰[ƒ`ƒFƒbƒN—pƒ}ƒNƒ
96 */
97
98#ifndef TOPPERS_CHECK_H
99#define TOPPERS_CHECK_H
100
101/*
102 * ƒ^ƒXƒN—Dæ“x‚͈̔͂̔»’è
103 */
104#define VALID_TPRI(tpri) (TMIN_TPRI <= (tpri) && (tpri) <= TMAX_TPRI)
105
106/*
107 * Š„ž‚ݔԍ†‚̃`ƒFƒbƒNiE_PARj
108 */
109#define CHECK_INTNO_DISINT(intno) { \
110 if (!VALID_INTNO_DISINT(intno)) { \
111 ercd = E_PAR; \
112 goto error_exit; \
113 } \
114}
115
116/*
117 * ‚»‚Ì‘¼‚̃pƒ‰ƒ[ƒ^ƒGƒ‰[‚̃`ƒFƒbƒNiE_PARj
118 */
119#define CHECK_PAR(exp) { \
120 if (!(exp)) { \
121 ercd = E_PAR; \
122 goto error_exit; \
123 } \
124}
125
126/*
127 * ƒIƒuƒWƒFƒNƒgID‚͈̔͂̔»’è
128 */
129#define VALID_TSKID(tskid) \
130 (((ID)TMIN_TSKID <= (tskid)) && ((ID)(tskid) <= tmax_tskid))
131#define VALID_FLGID(flgid) \
132 (((ID)TMIN_FLGID <= (flgid)) && ((ID)(flgid) <= tmax_flgid))
133#define VALID_DTQID(dtqid) \
134 (((ID)TMIN_DTQID <= (dtqid)) && ((ID)(dtqid) <= tmax_dtqid))
135#define VALID_CYCID(cycid) \
136 ((((ID)TMIN_CYCID) <= (cycid)) && ((ID)(cycid) <= tmax_cycid))
137#define VALID_ALMID(almid) \
138 (((ID)TMIN_ALMID <= (almid)) && ((ID)(almid) <= tmax_almid))
139
140/*
141 * ƒIƒuƒWƒFƒNƒgID‚̃`ƒFƒbƒNiE_IDj
142 */
143#define CHECK_TSKID(tskid) { \
144 if ((!VALID_TSKID(tskid))) { \
145 ercd = E_ID; \
146 goto error_exit; \
147 } \
148}
149
150#define CHECK_TSKID_SELF(tskid) { \
151 if (!(VALID_TSKID(tskid) || ((tskid) == TSK_SELF))) { \
152 ercd = E_ID; \
153 goto error_exit; \
154 } \
155}
156
157
158#define CHECK_FLGID(flgid) { \
159 if (!VALID_FLGID(flgid)) { \
160 ercd = E_ID; \
161 goto error_exit; \
162 } \
163}
164
165#define CHECK_DTQID(dtqid) { \
166 if (!VALID_DTQID(dtqid)) { \
167 ercd = E_ID; \
168 goto error_exit; \
169 } \
170}
171
172#define CHECK_CYCID(cycid) { \
173 if ((!VALID_CYCID(cycid))) { \
174 ercd = E_ID; \
175 goto error_exit; \
176 } \
177}
178
179#define CHECK_ALMID(almid) { \
180 if (!VALID_ALMID(almid)) { \
181 ercd = E_ID; \
182 goto error_exit; \
183 } \
184}
185
186/*
187 * ŒÄo‚µƒRƒ“ƒeƒLƒXƒg‚̃`ƒFƒbƒNiE_CTXj
188 */
189#define CHECK_TSKCTX() { \
190 if (sense_context()) { \
191 ercd = E_CTX; \
192 goto error_exit; \
193 } \
194}
195
196#define CHECK_INTCTX() { \
197 if (!sense_context()) { \
198 ercd = E_CTX; \
199 goto error_exit; \
200 } \
201}
202
203/*
204 * ŒÄo‚µƒRƒ“ƒeƒLƒXƒg‚ÆCPUƒƒbƒNó‘Ԃ̃`ƒFƒbƒNiE_CTXj
205 */
206#define CHECK_TSKCTX_UNL() { \
207 if ((sense_context()) || (t_sense_lock())) { \
208 ercd = E_CTX; \
209 goto error_exit; \
210 } \
211}
212
213#define CHECK_INTCTX_UNL() { \
214 if ((!sense_context()) || (i_sense_lock())) { \
215 ercd = E_CTX; \
216 goto error_exit; \
217 } \
218}
219
220/*
221 * ‚»‚Ì‘¼‚̃Rƒ“ƒeƒLƒXƒgƒGƒ‰[‚̃`ƒFƒbƒNiE_CTXj
222 */
223#define CHECK_CTX(exp) { \
224 if (!(exp)) { \
225 ercd = E_CTX; \
226 goto error_exit; \
227 } \
228}
229
230#endif /* TOPPERS_CHECK_H */
Note: See TracBrowser for help on using the repository browser.