[363] | 1 | /*
|
---|
| 2 | * TOPPERS/JSP Kernel
|
---|
| 3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
| 4 | * Just Standard Profile Kernel
|
---|
| 5 | *
|
---|
| 6 | * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
|
---|
| 7 | * Toyohashi Univ. of Technology, JAPAN
|
---|
| 8 | *
|
---|
| 9 | * ä¸è¨èä½æ¨©è
|
---|
| 10 | ã¯ï¼ä»¥ä¸ã® (1)ã(4) ã®æ¡ä»¶ãï¼Free Software Foundation
|
---|
| 11 | * ã«ãã£ã¦å
|
---|
| 12 | ¬è¡¨ããã¦ãã GNU General Public License ã® Version 2 ã«è¨
|
---|
| 13 | * è¿°ããã¦ããæ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ã¢ï¼æ¬ã½ããã¦ã§ã¢
|
---|
| 14 | * ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹å¤ã»åé
|
---|
| 15 | å¸ï¼ä»¥ä¸ï¼
|
---|
| 16 | * å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
| 17 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
| 18 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
| 19 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
| 20 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 21 | * ç¨ã§ããå½¢ã§åé
|
---|
| 22 | å¸ããå ´åã«ã¯ï¼åé
|
---|
| 23 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
| 24 | * è
|
---|
| 25 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
| 26 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 27 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 28 | * ç¨ã§ããªãå½¢ã§åé
|
---|
| 29 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
| 30 | * ã¨ï¼
|
---|
| 31 | * (a) åé
|
---|
| 32 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
| 33 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
| 34 | * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 35 | * (b) åé
|
---|
| 36 | å¸ã®å½¢æ
|
---|
| 37 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
| 38 | * å ±åãããã¨ï¼
|
---|
| 39 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
| 40 | * 害ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 41 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
| 42 | 責ãããã¨ï¼
|
---|
| 43 | *
|
---|
| 44 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
|
---|
| 45 | ã
|
---|
| 46 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ãã®é©ç¨å¯è½æ§ã
|
---|
| 47 | * å«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´
|
---|
| 48 | * æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼
|
---|
| 49 | *
|
---|
| 50 | * @(#) $Id: jsp_staticapi.cpp,v 1.16 2003/12/24 07:33:26 takayuki Exp $
|
---|
| 51 | */
|
---|
| 52 |
|
---|
| 53 | // $Header: /home/CVS/configurator/jsp/jsp_staticapi.cpp,v 1.16 2003/12/24 07:33:26 takayuki Exp $
|
---|
| 54 |
|
---|
| 55 | #include "jsp/jsp_defs.h"
|
---|
| 56 |
|
---|
| 57 | #include "base/parser.h"
|
---|
| 58 | #include "base/mpstrstream.h"
|
---|
| 59 | #include <iostream>
|
---|
| 60 |
|
---|
| 61 | using namespace std;
|
---|
| 62 |
|
---|
| 63 | DECLARE_API(INCLUDE,"INCLUDE")
|
---|
| 64 | {
|
---|
| 65 | Token token;
|
---|
| 66 | Directory * node;
|
---|
| 67 | Directory * scope;
|
---|
| 68 |
|
---|
| 69 | last = NULL;
|
---|
| 70 | p.getToken(token, Token::STRINGLITERAL);
|
---|
| 71 | token.chopLiteral();
|
---|
| 72 |
|
---|
| 73 | if( (token[0] != '\"' || token[token.size()-1] != '\"') &&
|
---|
| 74 | (token[0] != '<' || token[token.size()-1] != '>') )
|
---|
| 75 | ExceptionMessage("An include filename must be enclosed with \"...\" or <...>","ãã¡ã¤ã«å㯠\"...\" ã <...> ã®å½¢ã§ãªããã°ãªãã¾ãã").throwException();
|
---|
| 76 |
|
---|
| 77 | node = container.openChild(OBJECTTREE,INCLUDEFILE,NULL);
|
---|
| 78 | last = node;
|
---|
| 79 |
|
---|
| 80 | //éè¤ãã§ãã¯
|
---|
| 81 | scope = node->getFirstChild();
|
---|
| 82 | while(scope != 0)
|
---|
| 83 | {
|
---|
| 84 | if(token.compare((*scope).toString()) == 0)
|
---|
| 85 | {
|
---|
| 86 | cerr << p.getStreamLocation() << ' ' << (Message("Include file % was already specified (ignored).","ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«%ãè¤æ°åæå®ããã¾ãã (ç¡è¦ãã¾ã)") << token) << endl;
|
---|
| 87 | return;
|
---|
| 88 | }
|
---|
| 89 | scope = scope->getNext();
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | node->addChild(new Directory(token));
|
---|
| 93 | }
|
---|
| 94 |
|
---|
| 95 | DECLARE_API(CRE_TSK,"CRE_TSK")
|
---|
| 96 | {
|
---|
| 97 | Token token;
|
---|
| 98 | string work;
|
---|
| 99 | Directory * node;
|
---|
| 100 |
|
---|
| 101 | p.getToken(token);
|
---|
| 102 | node = allocate(container[OBJECTTREE], token, TASK);
|
---|
| 103 | (*node)["position"] = p.getStreamLocation();
|
---|
| 104 |
|
---|
| 105 | p.getToken(",","{",NULL);
|
---|
| 106 | parseParameters(p,node,"tskatr,exinf,task,itskpri,stksz");
|
---|
| 107 | p.getToken(",","NULL","}",NULL);
|
---|
| 108 |
|
---|
| 109 | (*node)["texatr"] = "TA_NULL";
|
---|
| 110 | (*node)["texrtn"] = "NULL";
|
---|
| 111 |
|
---|
| 112 | if(container["/cpu"].toString().compare("nios32") == 0)
|
---|
| 113 | {
|
---|
| 114 | (*node)["hi_limit"] = "TSK_HI_LIMIT";
|
---|
| 115 | (*node)["lo_limit"] = "TSK_LO_LIMIT";
|
---|
| 116 | }
|
---|
| 117 | }
|
---|
| 118 |
|
---|
| 119 | DECLARE_API(VATT_TRW,"VATT_TRW")
|
---|
| 120 | {
|
---|
| 121 | Token token;
|
---|
| 122 | Directory * node;
|
---|
| 123 |
|
---|
| 124 | if(container["/cpu"].toString().compare("nios32") != 0)
|
---|
| 125 | ExceptionMessage("VATT_TRW is not supported except for the processor 'nios32'.","VATT_TRWã¯nios32ããã»ããµã§ã®ã¿ãµãã¼ãããã¾ã").throwException();
|
---|
| 126 |
|
---|
| 127 | p.getToken(token);
|
---|
| 128 | node = find(container[OBJECTTREE], token, TASK);
|
---|
| 129 |
|
---|
| 130 | p.getToken(",","{",NULL);
|
---|
| 131 | parseParameters(p, node, "hi_limit,lo_limit");
|
---|
| 132 | p.getToken("}");
|
---|
| 133 | }
|
---|
| 134 |
|
---|
| 135 | DECLARE_API(DEF_TEX,"DEF_TEX")
|
---|
| 136 | {
|
---|
| 137 | Token token;
|
---|
| 138 | Directory * node;
|
---|
| 139 |
|
---|
| 140 | p.getToken(token);
|
---|
| 141 | node = find(container[OBJECTTREE], token, TASK);
|
---|
| 142 |
|
---|
| 143 | p.getToken(",","{",NULL);
|
---|
| 144 | parseParameters(p, node, "texatr,texrtn");
|
---|
| 145 | p.getToken("}");
|
---|
| 146 | }
|
---|
| 147 |
|
---|
| 148 | DECLARE_API(CRE_SEM,"CRE_SEM")
|
---|
| 149 | {
|
---|
| 150 | Token token;
|
---|
| 151 | Directory * node;
|
---|
| 152 |
|
---|
| 153 | p.getToken(token);
|
---|
| 154 | node = allocate(container[OBJECTTREE], token, SEMAPHORE);
|
---|
| 155 | (*node)["position"] = p.getStreamLocation();
|
---|
| 156 |
|
---|
| 157 | p.getToken(",","{",NULL);
|
---|
| 158 | parseParameters(p,node,"sematr,isemcnt,maxsem");
|
---|
| 159 | p.getToken("}");
|
---|
| 160 | }
|
---|
| 161 |
|
---|
| 162 | DECLARE_API(CRE_FLG,"CRE_FLG")
|
---|
| 163 | {
|
---|
| 164 | Token token;
|
---|
| 165 | Directory * node;
|
---|
| 166 |
|
---|
| 167 | p.getToken(token);
|
---|
| 168 | node = allocate(container[OBJECTTREE], token, EVENTFLAG);
|
---|
| 169 | (*node)["position"] = p.getStreamLocation();
|
---|
| 170 |
|
---|
| 171 | p.getToken(",","{",NULL);
|
---|
| 172 | parseParameters(p,node,"flgatr,iflgptn");
|
---|
| 173 | p.getToken("}");
|
---|
| 174 | }
|
---|
| 175 |
|
---|
| 176 | DECLARE_API(CRE_DTQ,"CRE_DTQ")
|
---|
| 177 | {
|
---|
| 178 | Token token;
|
---|
| 179 | Directory * node;
|
---|
| 180 |
|
---|
| 181 | p.getToken(token);
|
---|
| 182 | node = allocate(container[OBJECTTREE], token, DATAQUEUE);
|
---|
| 183 | (*node)["position"] = p.getStreamLocation();
|
---|
| 184 |
|
---|
| 185 | p.getToken(",","{",NULL);
|
---|
| 186 | parseParameters(p,node,"dtqatr,dtqcnt");
|
---|
| 187 | p.getToken(",","NULL","}",NULL);
|
---|
| 188 | }
|
---|
| 189 |
|
---|
| 190 | DECLARE_API(CRE_MBX,"CRE_MBX")
|
---|
| 191 | {
|
---|
| 192 | Token token;
|
---|
| 193 | Directory * node;
|
---|
| 194 |
|
---|
| 195 | p.getToken(token);
|
---|
| 196 | node = allocate(container[OBJECTTREE], token, MAILBOX);
|
---|
| 197 | (*node)["position"] = p.getStreamLocation();
|
---|
| 198 |
|
---|
| 199 | p.getToken(",","{",NULL);
|
---|
| 200 | parseParameters(p,node,"mbxatr,maxmpri");
|
---|
| 201 | p.getToken(",","NULL","}",NULL);
|
---|
| 202 | }
|
---|
| 203 |
|
---|
| 204 | DECLARE_API(CRE_MPF,"CRE_MPF")
|
---|
| 205 | {
|
---|
| 206 | Token token;
|
---|
| 207 | Directory * node;
|
---|
| 208 |
|
---|
| 209 | p.getToken(token);
|
---|
| 210 | node = allocate(container[OBJECTTREE], token, FIXEDSIZEMEMORYPOOL);
|
---|
| 211 | (*node)["position"] = p.getStreamLocation();
|
---|
| 212 |
|
---|
| 213 | p.getToken(",","{",NULL);
|
---|
| 214 | parseParameters(p,node,"mpfatr,blkcnt,blksz");
|
---|
| 215 | p.getToken(",","NULL","}",NULL);
|
---|
| 216 | }
|
---|
| 217 |
|
---|
| 218 | DECLARE_API(CRE_CYC,"CRE_CYC")
|
---|
| 219 | {
|
---|
| 220 | Token token;
|
---|
| 221 | Directory * node;
|
---|
| 222 |
|
---|
| 223 | p.getToken(token);
|
---|
| 224 | node = allocate(container[OBJECTTREE], token, CYCLICHANDLER);
|
---|
| 225 | (*node)["position"] = p.getStreamLocation();
|
---|
| 226 |
|
---|
| 227 | p.getToken(",","{",NULL);
|
---|
| 228 | parseParameters(p,node,"cycatr,exinf,cychdr,cyctim,cycphs");
|
---|
| 229 | p.getToken("}");
|
---|
| 230 | }
|
---|
| 231 |
|
---|
| 232 | DECLARE_API(DEF_INH,"DEF_INH")
|
---|
| 233 | {
|
---|
| 234 | Token token;
|
---|
| 235 | Directory * node;
|
---|
| 236 |
|
---|
| 237 | p.getToken(token);
|
---|
| 238 | node = allocate(container[OBJECTTREE], token, INTERRUPTHANDLER, false);
|
---|
| 239 | (*node)["position"] = p.getStreamLocation();
|
---|
| 240 |
|
---|
| 241 | p.getToken(",","{",NULL);
|
---|
| 242 | parseParameters(p,node,"inhatr,inthdr");
|
---|
| 243 | p.getToken("}");
|
---|
| 244 | }
|
---|
| 245 |
|
---|
| 246 | DECLARE_API(DEF_EXC,"DEF_EXC")
|
---|
| 247 | {
|
---|
| 248 | Token token;
|
---|
| 249 | Directory * node;
|
---|
| 250 |
|
---|
| 251 | p.getToken(token);
|
---|
| 252 | node = allocate(container[OBJECTTREE], token, EXCEPTIONHANDLER, false);
|
---|
| 253 | (*node)["position"] = p.getStreamLocation();
|
---|
| 254 |
|
---|
| 255 | p.getToken(",","{",NULL);
|
---|
| 256 | parseParameters(p,node,"excatr,exchdr");
|
---|
| 257 | p.getToken("}");
|
---|
| 258 | }
|
---|
| 259 |
|
---|
| 260 | DECLARE_API(ATT_INI,"ATT_INI")
|
---|
| 261 | {
|
---|
| 262 | Token token;
|
---|
| 263 | Directory * node;
|
---|
| 264 |
|
---|
| 265 | node = container.openChild(OBJECTTREE,INITIALIZER,NULL)->addChild();
|
---|
| 266 | last = node;
|
---|
| 267 |
|
---|
| 268 | (*node)["position"] = p.getStreamLocation();
|
---|
| 269 |
|
---|
| 270 | p.getToken("{",NULL);
|
---|
| 271 | parseParameters(p,node,"iniatr,exinf,inirtn");
|
---|
| 272 | p.getToken("}");
|
---|
| 273 | }
|
---|
| 274 |
|
---|
| 275 | DECLARE_API(ATT_FIN, "VATT_TER")
|
---|
| 276 | {
|
---|
| 277 | Token token;
|
---|
| 278 | Directory * node;
|
---|
| 279 |
|
---|
| 280 | node = container.openChild(OBJECTTREE,TERMINATOR,NULL)->addChild();
|
---|
| 281 | last = node;
|
---|
| 282 |
|
---|
| 283 | (*node)["position"] = p.getStreamLocation();
|
---|
| 284 |
|
---|
| 285 | p.getToken("{",NULL);
|
---|
| 286 | parseParameters(p,node,"teratr,exinf,terrtn");
|
---|
| 287 | p.getToken("}");
|
---|
| 288 | }
|
---|
| 289 |
|
---|
| 290 |
|
---|