source: azure_iot_hub/trunk/asp3_dcre/tecs_kernel/kernel.cdl@ 388

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

Azure IoT Hub Device C SDK を使ったサンプルの追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/plain
File size: 21.1 KB
Line 
1/*
2 * TOPPERS/ASP Kernel
3 * Toyohashi Open Platform for Embedded Real-Time Systems/
4 * Advanced Standard Profile Kernel
5 *
6 * Copyright (C) 2015,2016 by Ushio Laboratory
7 * Graduate School of Engineering Science, Osaka Univ., JAPAN
8 * Copyright (C) 2015-2017 by Embedded and Real-Time Systems Laboratory
9 * Graduate School of Information Science, Nagoya Univ., JAPAN
10 *
11 * 上記著作権者
12は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
13 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
14 * 変・再é…
15å¸ƒï¼ˆä»¥ä¸‹ï¼Œåˆ©ç”¨ã¨å‘¼ã¶ï¼‰ã™ã‚‹ã“とを無償で許諾する.
16 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
17 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
18 * スコード中に含まれていること.
19 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
20 * 用できる形で再é…
21å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œå†é…
22å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨
23 * 者
24マニュアルなど)に,上記の著作権表示,この利用条件および下記
25 * の無保証規定を掲載すること.
26 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
27 * 用できない形で再é…
28å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œæ¬¡ã®ã„ずれかの条件を満たすこ
29 * と.
30 * (a) 再é…
31å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨è€…
32マニュアルなど)に,上記の著
33 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
34 * (b) 再é…
35å¸ƒã®å½¢æ…
36‹ã‚’,別に定める方法によって,TOPPERSプロジェクトに
37 * 報告すること.
38 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
39 * 害からも,上記著作権者
40およびTOPPERSプロジェクトをå…
41è²¬ã™ã‚‹ã“と.
42 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
43 * 由に基づく請求からも,上記著作権者
44およびTOPPERSプロジェクトを
45 * å…
46è²¬ã™ã‚‹ã“と.
47 *
48 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者
49お
50 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
51 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
52 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
53 * の責任を負わない.
54 *
55 * $Id: kernel.cdl 388 2019-05-22 11:25:18Z coas-nagasima $
56 */
57
58/*
59 * TOPPERS/ASPカーネルオブジェクト コンポーネント記述ファイル
60 */
61
62/*
63 * カーネルオブジェクトのコンポーネント化のためのヘッダファイル
64 */
65import_C("tecs_kernel.h");
66
67/*
68 * カーネル操作のシグニチャ(タスクコンテキスト用)
69 */
70signature sKernel {
71 ER getExtendedInformation([out] intptr_t *p_exinf);
72
73 ER sleep(void);
74 ER sleepTimeout([in] TMO timeout);
75 ER delay([in] RELTIM delayTime);
76
77 ER exit(void);
78 ER disableTerminate(void);
79 ER enableTerminate(void);
80 bool_t senseTerminate(void);
81
82 ER setTime([in] SYSTIM systemTime);
83 ER getTime([out] SYSTIM *p_systemTime);
84 ER adjustTime([in] int32_t adjustTime);
85 HRTCNT fetchHighResolutionTimer(void);
86
87 ER rotateReadyQueue([in] PRI taskPriority);
88 ER getTaskId([out] ID *p_taskId);
89 ER getLoad([in] PRI taskPriority, [out] uint_t *p_load);
90 ER getNthTask([in] PRI taskPriority, [in] uint_t nth,
91 [out] ID *p_taskID);
92 ER lockCpu(void);
93 ER unlockCpu(void);
94 ER disableDispatch(void);
95 ER enableDispatch(void);
96 bool_t senseContext(void);
97 bool_t senseLock(void);
98 bool_t senseDispatch(void);
99 bool_t senseDispatchPendingState(void);
100 bool_t senseKernel(void);
101 ER exitKernel(void);
102
103 ER changeInterruptPriorityMask([in] PRI interruptPriority);
104 ER getInterruptPriorityMask([out] PRI *p_interruptPriority);
105};
106
107/*
108 * カーネル操作のシグニチャ(非タスクコンテキスト用)
109 */
110[context("non-task")]
111signature siKernel {
112 HRTCNT fetchHighResolutionTimer(void);
113
114 ER rotateReadyQueue([in] PRI taskPriority);
115 ER getTaskId([out]ID *p_taskId);
116 ER lockCpu(void);
117 ER unlockCpu(void);
118 bool_t senseContext(void);
119 bool_t senseLock(void);
120 bool_t senseDispatch(void);
121 bool_t senseDispatchPendingState(void);
122 bool_t senseKernel(void);
123 ER exitKernel(void);
124
125 /* CPU例外ハンドラ中で使用する */
126 bool_t exceptionSenseDispatchPendingState
127 ([in] const void *p_exceptionInformation);
128};
129
130/*
131 * カーネルのセルタイプ
132 */
133[singleton]
134celltype tKernel {
135 [inline] entry sKernel eKernel;
136 [inline] entry siKernel eiKernel;
137};
138
139/*
140 * タイムイベント通知を受け取るためのシグネチャ
141 */
142[context("non-task")]
143signature siNotificationHandler {
144};
145
146/*
147 * タスク本体のシグニチャ
148 */
149signature sTaskBody {
150 void main(void);
151};
152
153/*
154 * タスク操作のシグニチャ(タスクコンテキスト用)
155 */
156signature sTask {
157 ER activate(void);
158 ER_UINT cancelActivate(void);
159 ER getTaskState([out] STAT *p_tskstat);
160 ER changePriority([in] PRI priority);
161 ER getPriority([out] PRI *p_priority);
162 ER refer([out] T_RTSK *pk_taskStatus);
163
164 ER wakeup(void);
165 ER_UINT cancelWakeup(void);
166 ER releaseWait(void);
167 ER suspend(void);
168 ER resume(void);
169
170 ER raiseTerminate(void);
171 ER terminate(void);
172};
173
174/*
175 * タスク操作のシグニチャ(非タスクコンテキスト用)
176 */
177[context("non-task")]
178signature siTask {
179 ER activate(void);
180 ER wakeup(void);
181 ER releaseWait(void);
182};
183
184/*
185 * タスクのセルタイプ
186 */
187[active]
188celltype tTask {
189 [inline] entry sTask eTask;
190 [inline] entry siTask eiTask;
191 call sTaskBody cTaskBody;
192
193 [inline] entry siNotificationHandler eiActivateNotificationHandler;
194 [inline] entry siNotificationHandler eiWakeUpNotificationHandler;
195
196 attr {
197 ID id = C_EXP("TSKID_$id$");
198 [omit] ATR attribute = C_EXP("TA_NULL");
199 [omit] PRI priority;
200 [omit] size_t stackSize;
201 };
202
203 factory {
204 write("tecsgen.cfg",
205 "CRE_TSK(%s, { %s, $cbp$, tTask_start, %s, %s, NULL });",
206 id, attribute, priority, stackSize);
207 };
208 FACTORY {
209 write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\"");
210 write("$ct$_factory.h", "#include \"kernel_cfg.h\"");
211 };
212};
213
214/*
215 * セマフォ操作のシグニチャ(タスクコンテキスト用)
216 */
217signature sSemaphore {
218 ER signal(void);
219 ER wait(void);
220 ER waitPolling(void);
221 ER waitTimeout([in] TMO timeout);
222 ER initialize(void);
223 ER refer([out] T_RSEM *pk_semaphoreStatus);
224};
225
226/*
227 * セマフォ操作のシグニチャ(非タスクコンテキスト用)
228 */
229[context("non-task")]
230signature siSemaphore {
231 ER signal(void);
232};
233
234/*
235 * セマフォのセルタイプ
236 */
237celltype tSemaphore {
238 [inline] entry sSemaphore eSemaphore;
239 [inline] entry siSemaphore eiSemaphore;
240
241 [inline] entry siNotificationHandler eiNotificationHandler;
242
243 attr {
244 ID id = C_EXP("SEMID_$id$");
245 [omit] ATR attribute = C_EXP("TA_NULL");
246 [omit] uint_t initialCount;
247 [omit] uint_t maxCount = 1;
248 };
249
250 factory {
251 write("tecsgen.cfg", "CRE_SEM(%s, { %s, %s, %s });",
252 id, attribute, initialCount, maxCount);
253 };
254 FACTORY {
255 write("$ct$_factory.h", "#include \"kernel_cfg.h\"");
256 };
257};
258
259/*
260 * イベントフラグ操作のシグニチャ(タスクコンテキスト用)
261 */
262signature sEventflag {
263 ER set([in] FLGPTN setPattern);
264 ER clear([in] FLGPTN clearPattern);
265 ER wait([in] FLGPTN waitPattern, [in] MODE waitMode,
266 [out] FLGPTN *p_flagPattern);
267 ER waitPolling([in] FLGPTN waitPattern, [in] MODE waitMode,
268 [out] FLGPTN *p_flagPattern);
269 ER waitTimeout([in] FLGPTN waitPattern, [in] MODE waitMode,
270 [out] FLGPTN *p_flagPattern, [in] TMO timeout);
271 ER initialize(void);
272 ER refer([out] T_RFLG *pk_eventflagStatus);
273};
274
275/*
276 * イベントフラグ操作のシグニチャ(非タスクコンテキスト用)
277 */
278[context("non-task")]
279signature siEventflag {
280 ER set([in] FLGPTN setPattern);
281};
282
283/*
284 * イベントフラグのセルタイプ
285 */
286celltype tEventflag {
287 [inline] entry sEventflag eEventflag;
288 [inline] entry siEventflag eiEventflag;
289
290 [inline] entry siNotificationHandler eiNotificationHandler;
291
292 attr {
293 ID id = C_EXP("FLGID_$id$");
294 [omit] ATR attribute = C_EXP("TA_NULL");
295 [omit] FLGPTN flagPattern;
296 };
297
298 factory {
299 write("tecsgen.cfg", "CRE_FLG(%s, { %s, %s });",
300 id, attribute, flagPattern);
301 };
302 FACTORY {
303 write("$ct$_factory.h", "#include \"kernel_cfg.h\"");
304 };
305};
306
307/*
308 * データキュー操作のシグニチャ(タスクコンテキスト用)
309 */
310signature sDataqueue {
311 ER send([in] intptr_t data);
312 ER sendPolling([in] intptr_t data);
313 ER sendTimeout([in] intptr_t data, [in] TMO timeout);
314 ER sendForce([in] intptr_t data);
315 ER receive([out] intptr_t *p_data);
316 ER receivePolling([out] intptr_t *p_Data);
317 ER receiveTimeout([out] intptr_t *p_data, [in] TMO timeout);
318 ER initialize(void);
319 ER refer([out] T_RDTQ *pk_dataqueueStatus);
320};
321
322/*
323 * データキュー操作のシグニチャ(非タスクコンテキスト用)
324 */
325[context("non-task")]
326signature siDataqueue {
327 ER sendPolling([in] intptr_t data);
328 ER sendForce([in] intptr_t data);
329};
330
331/*
332 * データキューのセルタイプ
333 */
334celltype tDataqueue {
335 [inline] entry sDataqueue eDataqueue;
336 [inline] entry siDataqueue eiDataqueue;
337
338 [inline] entry siNotificationHandler eiNotificationHandler;
339
340 attr {
341 ID id = C_EXP("DTQID_$id$");
342 [omit] ATR attribute = C_EXP("TA_NULL");
343 [omit] uint_t dataCount = 1;
344 [omit] void *dataqueueManagementBuffer = C_EXP("NULL");
345 };
346
347 factory {
348 write("tecsgen.cfg", "CRE_DTQ(%s, { %s, %s, %s });",
349 id, attribute, dataCount, dataqueueManagementBuffer);
350 };
351 FACTORY {
352 write("$ct$_factory.h", "#include \"kernel_cfg.h\"");
353 };
354};
355
356/*
357 * 優å…
358ˆåº¦ãƒ‡ãƒ¼ã‚¿ã‚­ãƒ¥ãƒ¼æ“ä½œã®ã‚·ã‚°ãƒ‹ãƒãƒ£ï¼ˆã‚¿ã‚¹ã‚¯ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆç”¨ï¼‰
359 */
360signature sPriorityDataqueue {
361 ER send([in] intptr_t data, [in] PRI dataPriority);
362 ER sendPolling([in] intptr_t data, [in] PRI dataPriority);
363 ER sendTimeout([in] intptr_t data, [in] PRI dataPriority,
364 [in] TMO timeout);
365 ER receive([out] intptr_t *p_data, [out] PRI *p_dataPriority);
366 ER receivePolling([out] intptr_t *p_data, [out] PRI *p_dataPriority);
367 ER receiveTimeout([out] intptr_t *p_data, [out] PRI *p_dataPriority,
368 [in] TMO timeout);
369 ER initialize(void);
370 ER refer([out] T_RPDQ *pk_priorityDataqueueStatus);
371};
372
373/*
374 * 優å…
375ˆåº¦ãƒ‡ãƒ¼ã‚¿ã‚­ãƒ¥ãƒ¼æ“ä½œã®ã‚·ã‚°ãƒ‹ãƒãƒ£ï¼ˆéžã‚¿ã‚¹ã‚¯ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆç”¨ï¼‰
376 */
377[context("non-task")]
378signature siPriorityDataqueue {
379 ER sendPolling([in] intptr_t data, [in] PRI dataPriority);
380};
381
382/*
383 * 優å…
384ˆåº¦ãƒ‡ãƒ¼ã‚¿ã‚­ãƒ¥ãƒ¼ã®ã‚»ãƒ«ã‚¿ã‚¤ãƒ—
385 */
386celltype tPriorityDataqueue {
387 [inline] entry sPriorityDataqueue ePriorityDataqueue;
388 [inline] entry siPriorityDataqueue eiPriorityDataqueue;
389
390 attr {
391 ID id = C_EXP("PDTQID_$id$");
392 [omit] ATR attribute = C_EXP("TA_NULL");
393 [omit] uint_t dataCount = 1;
394 [omit] PRI maxDataPriority;
395 [omit] void *priorityDataqueueManagementBuffer = C_EXP("NULL");
396 };
397
398 factory {
399 write("tecsgen.cfg", "CRE_PDQ(%s, { %s, %s, %s, %s});",
400 id, attribute, dataCount, maxDataPriority,
401 priorityDataqueueManagementBuffer);
402 };
403 FACTORY {
404 write("$ct$_factory.h", "#include \"kernel_cfg.h\"");
405 };
406};
407
408/*
409 * ミューテックス操作のシグニチャ(タスクコンテキスト用)
410 */
411signature sMutex {
412 ER lock(void);
413 ER lockPolling(void);
414 ER lockTimeout([in] TMO timeout);
415 ER unlock(void);
416 ER initialize(void);
417 ER refer([out] T_RSEM *pk_mutexStatus);
418};
419
420/*
421 * ミューテックスのセルタイプ
422 */
423celltype tMutex {
424 [inline] entry sMutex eMutex;
425
426 attr {
427 ID id = C_EXP("MTXID_$id$");
428 [omit] ATR attribute = C_EXP("TA_NULL");
429 [omit] PRI ceilingPriority;
430 };
431
432 factory {
433 write("tecsgen.cfg", "CRE_MTX(%s, { %s, %s });",
434 id, attribute, ceilingPriority);
435 };
436 FACTORY {
437 write("$ct$_factory.h", "#include \"kernel_cfg.h\"");
438 };
439};
440
441/*
442 * 固定長メモリメモリプール操作のシグニチャ(タスクコンテキスト用)
443 */
444[deviate]
445signature sFixedSizeMemoryPool {
446 ER get([out] void **p_block);
447 ER getPolling([out] void **p_block);
448 ER getTimeout([out] void **p_block, [in] TMO timeout);
449 ER release([in] const void *block);
450 ER initialize(void);
451 ER refer([out] T_RMPF *pk_fixedSizeMemoryPoolStatus);
452};
453
454/*
455 * 固定長メモリプールのセルタイプ
456 */
457celltype tFixedSizeMemoryPool {
458 [inline] entry sFixedSizeMemoryPool eFixedSizeMemoryPool;
459
460 attr {
461 ID id = C_EXP("MPFID_$id$");
462 [omit] ATR attribute = C_EXP("TA_NULL");
463 [omit] uint_t blockCount;
464 [omit] uint_t blockSize;
465 [omit] MPF_T *memoryPool = C_EXP("NULL");
466 [omit] void *memoryPoolManagementBuffer = C_EXP("NULL");
467 };
468
469 factory {
470 write("tecsgen.cfg", "CRE_MPF(%s, {%s, %s, %s, %s, %s});",
471 id, attribute, blockCount, blockSize,
472 memoryPool, memoryPoolManagementBuffer);
473 };
474 FACTORY {
475 write("$ct$_factory.h", "#include \"kernel_cfg.h\"");
476 };
477};
478
479/*
480 * ハンドラ本体のシグニチャ
481 */
482[context("non-task")]
483signature siHandlerBody {
484 void main(void);
485};
486
487/*
488 * タイムイベントハンドラを指定するためのセルタイプ
489 */
490celltype tTimeEventHandler {
491 entry siNotificationHandler eiNotificationHandler;
492 [omit] call siHandlerBody ciHandlerBody;
493
494 FACTORY {
495 write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\"");
496 };
497};
498
499/*
500 * 周期通知を操作するためのシグニチャ(タスクコンテキスト用)
501 */
502signature sCyclic {
503 ER start(void);
504 ER stop(void);
505 ER refer([out]T_RCYC *pk_cyclicHandlerStatus);
506};
507
508/*
509 * 周期通知のセルタイプ
510 */
511[active, generate(NotifierPlugin,
512 "factory=\"CRE_CYC({{id}}, { {{attribute}}, { {{_handler_params_}} }, "
513 "{{cycleTime}}, {{cyclePhase}} });\", output_file=tecsgen.cfg")]
514celltype tCyclicNotifier {
515 [inline] entry sCyclic eCyclic;
516
517 call siNotificationHandler ciNotificationHandler;
518 [optional] call siNotificationHandler ciErrorNotificationHandler;
519
520 attr {
521 ID id = C_EXP("ALMID_$id$");
522 [omit] ATR attribute = C_EXP("TA_NULL");
523 [omit] bool_t ignoreErrors = false;
524 [omit] RELTIM cycleTime;
525 [omit] RELTIM cyclePhase = 0;
526
527 /* 変数の設定による通知(TNFY_SETVAR)*/
528 [omit] intptr_t *setVariableAddress = 0;
529 [omit] intptr_t setVariableValue = 0;
530
531 /* 変数のインクリメントによる通知(TNFY_INCVAR)*/
532 [omit] intptr_t *incrementedVariableAddress = 0;
533
534 /* イベントフラグのセットによる通知(TNFY_SETFLG)*/
535 [omit] FLGPTN flagPattern = 0;
536
537 /* データキューへの送信による通知(TNFY_SNDDTQ)*/
538 [omit] intptr_t dataqueueSentValue = 0;
539
540 /* 変数の設定によるエラー通知(TENFY_SETVAR)*/
541 [omit] intptr_t *setVariableAddressForError = 0;
542
543 /* 変数のインクリメントによるエラー通知(TENFY_INCVAR)*/
544 [omit] intptr_t *incrementedVariableAddressForError = 0;
545
546 /* イベントフラグのセットによるエラー通知(TENFY_SETFLG)*/
547 [omit] FLGPTN flagPatternForError = 0;
548 };
549
550 FACTORY {
551 write("$ct$_factory.h", "#include \"kernel_cfg.h\"");
552 };
553};
554
555/*
556 * 周期通知にユーザーハンドラを指定するための複合セルタイプ
557 */
558[active]
559composite tCyclicHandler {
560 entry sCyclic eCyclic;
561 [omit] call siHandlerBody ciHandlerBody;
562
563 attr {
564 ID id = C_EXP("ALMID_$id$");
565 [omit] ATR attribute = C_EXP("TA_NULL");
566 [omit] RELTIM cycleTime;
567 [omit] RELTIM cyclePhase = 0;
568 };
569
570 cell tCyclicNotifier CyclicNotifier {
571 id = composite.id;
572 attribute = composite.attribute;
573 ciNotificationHandler = TimeEventHandler.eiNotificationHandler;
574 cycleTime = composite.cycleTime;
575 cyclePhase = composite.cyclePhase;
576 };
577
578 cell tTimeEventHandler TimeEventHandler {
579 ciHandlerBody => composite.ciHandlerBody;
580 };
581
582 eCyclic => CyclicNotifier.eCyclic;
583};
584
585/*
586 * アラーム通知を操作するためのシグニチャ(タスクコンテキスト用)
587 */
588signature sAlarm {
589 ER start([in] RELTIM alarmTime);
590 ER stop(void);
591 ER refer([out]T_RALM *pk_alarmStatus);
592};
593
594/*
595 * アラーム通知を操作するためのシグニチャ(非タスクコンテキスト用)
596 */
597[context("non-task")]
598signature siAlarm {
599 ER start([in] RELTIM alarmTime);
600 ER stop(void);
601};
602
603/*
604 * アラーム通知のセルタイプ
605 */
606[active, generate(NotifierPlugin,
607 "factory=\"CRE_ALM({{id}}, { {{attribute}}, {{{_handler_params_}}} });\", "
608 "output_file=tecsgen.cfg")]
609celltype tAlarmNotifier {
610 [inline] entry sAlarm eAlarm;
611 [inline] entry siAlarm eiAlarm;
612
613 call siNotificationHandler ciNotificationHandler;
614 [optional] call siNotificationHandler ciErrorNotificationHandler;
615
616 attr {
617 ID id = C_EXP("ALMID_$id$");
618 [omit] ATR attribute = C_EXP("TA_NULL");
619 [omit] bool_t ignoreErrors = false;
620
621 /* 変数の設定による通知(TNFY_SETVAR)*/
622 [omit] intptr_t *setVariableAddress = 0;
623 [omit] intptr_t setVariableValue = 0;
624
625 /* 変数のインクリメントによる通知(TNFY_INCVAR)*/
626 [omit] intptr_t *incrementedVariableAddress = 0;
627
628 /* イベントフラグのセットによる通知(TNFY_SETFLG)*/
629 [omit] FLGPTN flagPattern = 0;
630
631 /* データキューへの送信による通知(TNFY_SNDDTQ)*/
632 [omit] intptr_t dataqueueSentValue = 0;
633
634 /* 変数の設定によるエラー通知(TENFY_SETVAR)*/
635 [omit] intptr_t *setVariableAddressForError = 0;
636
637 /* 変数のインクリメントによるエラー通知(TENFY_INCVAR)*/
638 [omit] intptr_t *incrementedVariableAddressForError = 0;
639
640 /* イベントフラグのセットによるエラー通知(TENFY_SETFLG)*/
641 [omit] FLGPTN flagPatternForError = 0;
642 };
643
644 FACTORY {
645 write("$ct$_factory.h", "#include \"kernel_cfg.h\"");
646 };
647};
648
649/*
650 * アラーム通知にユーザーハンドラを指定するための複合セルタイプ
651 */
652[active]
653composite tAlarmHandler {
654 entry sAlarm eAlarm;
655 entry siAlarm eiAlarm;
656 [omit] call siHandlerBody ciHandlerBody;
657
658 attr {
659 ID id = C_EXP("ALMID_$id$");
660 [omit] ATR attribute = C_EXP("TA_NULL");
661 };
662
663 cell tAlarmNotifier AlarmNotifier {
664 id = composite.id;
665 attribute = composite.attribute;
666 ciNotificationHandler = TimeEventHandler.eiNotificationHandler;
667 };
668
669 cell tTimeEventHandler TimeEventHandler {
670 ciHandlerBody => composite.ciHandlerBody;
671 };
672
673 eAlarm => AlarmNotifier.eAlarm;
674 eiAlarm => AlarmNotifier.eiAlarm;
675};
676
677/*
678 * 割込み要求ライン操作のシグニチャ(タスクコンテキスト用)
679 */
680signature sInterruptRequest {
681 ER disable(void);
682 ER enable(void);
683 ER clear(void);
684 ER raise(void);
685 ER_BOOL probe(void);
686};
687
688/*
689 * 割込み要求ラインのセルタイプ
690 */
691celltype tInterruptRequest {
692 [inline] entry sInterruptRequest eInterruptRequest;
693
694 attr {
695 INTNO interruptNumber;
696 [omit] ATR attribute = C_EXP("TA_NULL");
697 [omit] PRI interruptPriority;
698 };
699
700 factory {
701 write("tecsgen.cfg", "CFG_INT(%s, { %s, %s });",
702 interruptNumber, attribute, interruptPriority);
703 };
704};
705
706/*
707 * 割込みサービスルーチンのセルタイプ
708 */
709[active]
710celltype tISR {
711 call siHandlerBody ciISRBody;
712
713 attr {
714 ID id = C_EXP("ISRID_$id$");
715 [omit] ATR attribute = C_EXP("TA_NULL");
716 [omit] INTNO interruptNumber;
717 [omit] PRI isrPriority = 1;
718 };
719
720 factory {
721 write("tecsgen.cfg", "CRE_ISR(%s, { %s, $cbp$, %s, tISR_start, %s });",
722 id, attribute, interruptNumber, isrPriority);
723 };
724 FACTORY {
725 write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\"");
726 write("$ct$_factory.h", "#include \"kernel_cfg.h\"");
727 };
728};
729
730/*
731 * 割込みハンドラのセルタイプ
732 */
733[active]
734celltype tInterruptHandler {
735 call siHandlerBody ciInterruptHandlerBody;
736
737 attr {
738 INHNO interruptHandlerNumber;
739 [omit] ATR attribute = C_EXP("TA_NULL");
740 };
741
742 factory {
743 write("tecsgen.cfg",
744 "DEF_INH(%s, { %s, tInterruptHandler_start });", attribute);
745 };
746 FACTORY {
747 write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\"");
748 };
749};
750
751/*
752 * CPU例外ハンドラのセルタイプ
753 */
754[active]
755celltype tCpuExceptionHandler {
756 call siHandlerBody ciCpuExceptionHandlerBody;
757
758 attr {
759 EXCNO cpuExceptionHandlerNumber;
760 [omit] ATR attribute = C_EXP("TA_NULL");
761 };
762
763 factory {
764 write("tecsgen.cfg",
765 "DEF_EXC(%s, { %s, tCpuExceptionHandler_start });", attribute);
766 };
767 FACTORY {
768 write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\"");
769 };
770};
771
772/*
773 * 初期化/終了処理ルーチン本体のシグニチャ
774 */
775signature sRoutineBody {
776 void main(void);
777};
778
779/*
780 * 初期化ルーチンのセルタイプ
781 */
782[active]
783celltype tInitializeRoutine {
784 call sRoutineBody cInitializeRoutineBody;
785
786 attr {
787 [omit] ATR attribute = C_EXP("TA_NULL");
788 };
789
790 factory {
791 write("tecsgen.cfg",
792 "ATT_INI({ %s, $cbp$, tInitializeRoutine_start });",
793 attribute);
794 };
795 FACTORY {
796 write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\"");
797 };
798};
799
800/*
801 * 終了処理ルーチンのセルタイプ
802 */
803[active]
804celltype tTerminateRoutine {
805 call sRoutineBody cTerminateRoutineBody;
806
807 attr {
808 [omit] ATR attribute = C_EXP("TA_NULL");
809 };
810
811 factory {
812 write("tecsgen.cfg",
813 "ATT_TER({ %s, $cbp$, tTerminateRoutine_start });", attribute);
814 };
815 FACTORY {
816 write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\"");
817 };
818};
Note: See TracBrowser for help on using the repository browser.