source: ssp_qb_r5f100le_cs/trunk/kernel/kernel_impl.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: 5.2 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) 2004-2008 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 *
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/*
46 * TOPPERS/SSPƒJ[ƒlƒ‹“à•”Œü‚¯•W€ƒwƒbƒ_ƒtƒ@ƒCƒ‹
47 *
48 * ‚±‚̃wƒbƒ_ƒtƒ@ƒCƒ‹‚́CƒJ[ƒlƒ‹‚ð\¬‚·‚éƒvƒƒOƒ‰ƒ€‚̃\[ƒXƒtƒ@ƒCƒ‹
49 * ‚Å•K‚¸ƒCƒ“ƒNƒ‹[ƒh‚·‚é‚ׂ«•W€ƒwƒbƒ_ƒtƒ@ƒCƒ‹‚Å‚ ‚éD
50 *
51 * ƒAƒZƒ“ƒuƒŠŒ¾Œê‚̃\[ƒXƒtƒ@ƒCƒ‹‚©‚炱‚̃tƒ@ƒCƒ‹‚ðƒCƒ“ƒNƒ‹[ƒh‚·‚鎞
52 * ‚́CTOPPERS_MACRO_ONLY‚ð’è‹`‚µ‚Ä‚¨‚­D‚±‚ê‚É‚æ‚èCƒ}ƒNƒ’è‹`ˆÈŠO‚ð
53 * œ‚­‚悤‚É‚È‚Á‚Ä‚¢‚éD
54 */
55
56#ifndef TOPPERS_KERNEL_IMPL_H
57#define TOPPERS_KERNEL_IMPL_H
58
59/*
60 * ƒJ[ƒlƒ‹‚Ì“à•”Ž¯•Ê–¼‚̃Šƒl[ƒ€
61 */
62#include "kernel_rename.h"
63
64/*
65 * ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚Æ‹¤’ʂ̃wƒbƒ_ƒtƒ@ƒCƒ‹
66 */
67#include <kernel.h>
68
69/*
70 * ƒVƒXƒeƒ€ƒƒO‹@”\‚Ì‚½‚ß‚Ì’è‹`
71 */
72#include <t_syslog.h>
73
74/*
75 * Œ^ƒLƒƒƒXƒg‚ðs‚¤ƒ}ƒNƒ‚Ì’è‹`
76 */
77#ifndef CAST
78#define CAST(type, val) ((type)(val))
79#endif /* CAST */
80
81/*
82 * ƒ^[ƒQƒbƒgˆË‘¶î•ñ‚Ì’è‹`
83 */
84#include "target_config.h"
85
86/*
87 * ‚·‚ׂĂ̊֐”‚ðƒRƒ“ƒpƒCƒ‹‚·‚邽‚ß‚Ì’è‹`
88 */
89#ifdef ALLFUNC
90#include "allfunc.h"
91#endif /* ALLFUNC */
92
93/*
94 * ƒrƒbƒgƒtƒB[ƒ‹ƒh‚Å‚Ì•„†–³‚µ®”Œ^
95 *
96 * 8ƒrƒbƒgˆÈ‰º‚Ì•‚̃rƒbƒgƒtƒB[ƒ‹ƒh‚ŁC•„†–³‚µ®”’l‚ð•ÛŽ‚µ‚½‚¢ê‡
97 * ‚É—p‚¢‚é‚ׂ«ƒf[ƒ^Œ^DANSI C‚ł́CƒrƒbƒgƒtƒB[ƒ‹ƒh‚̃f[ƒ^Œ^‚É‚Í
98 * int‚Æunsigned int‚µ‚©‹–‚³‚ê‚È‚¢‚½‚߁CƒfƒtƒHƒ‹ƒg‚Ì’è‹`‚Íunsigned
99 * int‚Æ‚µ‚Ä‚¢‚邪Cƒ^[ƒQƒbƒg‚¨‚æ‚уc[ƒ‹ˆË‘¶‚ŁCunsigned char‚Ü‚½‚Í
100 * unsigned short‚É’è‹`‚µ‚½•û‚ªŒø—¦‚ª—Ç‚¢ê‡‚ª‚ ‚éD
101 */
102#ifndef BIT_FIELD_UINT
103#define BIT_FIELD_UINT unsigned int
104#endif /* BIT_FIELD_UINT */
105
106/*
107 * ƒrƒbƒgƒtƒB[ƒ‹ƒh‚ł̃u[ƒ‹Œ^
108 *
109 * 1ƒrƒbƒg•‚̃rƒbƒgƒtƒB[ƒ‹ƒh‚ŁCƒu[ƒ‹’l‚ð•ÛŽ‚µ‚½‚¢ê‡‚É—p‚¢‚é‚ׂ«
110 * ƒf[ƒ^Œ^DƒfƒtƒHƒ‹ƒg‚Å‚ÍBIT_FIELD_UINT‚Æ“¯ˆê‚É’è‹`‚µ‚Ä‚¢‚邪Cƒu[
111 * ƒ‹’l‚ð•ÛŽ‚·‚邱‚Ƃ𖾎¦‚·‚邽‚ß‚É•Ê‚Ì–¼Ì‚Æ‚µ‚Ä‚¢‚éD
112 */
113#ifndef BIT_FIELD_BOOL
114#define BIT_FIELD_BOOL BIT_FIELD_UINT
115#endif /* BIT_FIELD_BOOL */
116
117/*
118 * ƒIƒuƒWƒFƒNƒgID‚̍ŏ¬’l‚Ì’è‹`
119 */
120#define TMIN_TSKID 1 /* ƒ^ƒXƒNID‚̍ŏ¬’l */
121#define TMIN_FLGID 1 /* ƒCƒxƒ“ƒgƒtƒ‰ƒOID‚̍ŏ¬’l */
122#define TMIN_DTQID 1 /* ƒf[ƒ^ƒLƒ…
123[ID‚̍ŏ¬’l */
124#define TMIN_CYCID 1 /* ŽüŠúƒnƒ“ƒhƒ‰ID‚̍ŏ¬’l */
125#define TMIN_ALMID 1 /* ƒAƒ‰[ƒ€ƒnƒ“ƒhƒ‰ID‚̍ŏ¬’l */
126
127/*
128 * —Dæ“x‚Ì’iŠK”‚Ì’è‹`
129 */
130#define TNUM_TPRI (TMAX_TPRI - TMIN_TPRI + 1)
131#define TNUM_INTPRI (TMAX_INTPRI - TMIN_INTPRI + 1)
132
133/*
134 * ƒwƒbƒ_ƒtƒ@ƒCƒ‹‚ðŽ‚½‚È‚¢ƒ‚ƒWƒ…
135[ƒ‹‚̊֐”E•Ï”‚̐錾
136 */
137#ifndef TOPPERS_MACRO_ONLY
138
139/*
140 * Šeƒ‚ƒWƒ…
141[ƒ‹‚̏‰Šú‰»ikernel_cfg.cj
142 */
143extern void initialize_object(void);
144
145/*
146 * ‰Šú‰»ƒ‹[ƒ`ƒ“‚ÌŽÀsikernel_cfg.cj
147 */
148extern void call_inirtn(void);
149
150/*
151 * I—¹ˆ—ƒ‹[ƒ`ƒ“‚ÌŽÀsikernel_cfg.cj
152 */
153extern void call_terrtn(void);
154
155/*
156 * ”ñƒ^ƒXƒNƒRƒ“ƒeƒLƒXƒg—p‚̃Xƒ^ƒbƒN—̈æikernel_cfg.cj
157 */
158extern const SIZE istksz; /* ƒXƒ^ƒbƒN—̈æ‚̃TƒCƒYiŠÛ‚ß‚½’lj */
159extern STK_T *const istk; /* ƒXƒ^ƒbƒN—̈æ‚̐擪”Ô’n */
160#ifdef TOPPRES_ISTKPT
161extern STK_T *const istkpt; /* ƒXƒ^ƒbƒNƒ|ƒCƒ“ƒ^‚̏‰Šú’l */
162#endif /* TOPPERS_ISTKPT */
163
164/*
165 * ƒJ[ƒlƒ‹“®ìó‘Ôƒtƒ‰ƒOistartup.cj
166 */
167extern bool_t kerflg;
168
169/*
170 * ƒJ[ƒlƒ‹‚Ì‹N“®istartup.cj
171 */
172extern void sta_ker(void);
173
174/*
175 * ƒJ[ƒlƒ‹‚̏I—¹ˆ—istartup.cj
176 */
177extern void exit_kernel(void);
178
179#endif /* TOPPERS_MACRO_ONLY */
180#endif /* TOPPERS_KERNEL_IMPL_H */
Note: See TracBrowser for help on using the repository browser.