Rev | Line | |
---|
[30] | 1 | /*
|
---|
| 2 | * Simple な Sample
|
---|
| 3 | *
|
---|
| 4 | * +-------------+ +-------------+ +-------------+
|
---|
| 5 | * | | | | | |
|
---|
| 6 | * | tTask | sTaskBody | tSimple | sSample | tSample |
|
---|
[34] | 7 | * | Task |-----------|> Simple |==========|> Sample |
|
---|
[30] | 8 | * | |cTask eBody| |cCall eEnt| |
|
---|
| 9 | * | |Body | | | |
|
---|
| 10 | * +-------------+ +-------------+ +-------------+
|
---|
[34] | 11 | *
|
---|
| 12 | * * SimpleSample/SimpleSample.cdl を参照
|
---|
| 13 | * * この例では Trace プラグインが指定される。以下の※を参照
|
---|
| 14 | * * Trace プラグインのため tSysLog, tKernel を用いる
|
---|
[30] | 15 | */
|
---|
| 16 |
|
---|
| 17 | // cygwin 用の簡易な型定義
|
---|
| 18 | import( <cygwin_kernel.cdl> );
|
---|
[34] | 19 | // TECS 対応 TOPPERS/ASP ならば import( <kernel.cdl> ); に相当する
|
---|
[30] | 20 |
|
---|
[34] | 21 | // tSysLog の定義 (Trace の出力先)
|
---|
[30] | 22 | import( <tSysLog.cdl> );
|
---|
| 23 |
|
---|
[34] | 24 | // セル SysLog (Trace の出力先)
|
---|
[30] | 25 | cell tSysLog SysLog {
|
---|
| 26 | };
|
---|
[34] | 27 | // セル Kernel (Trace の時刻を得る)
|
---|
[30] | 28 | cell tKernel Kernel {
|
---|
| 29 | };
|
---|
| 30 |
|
---|
[34] | 31 | // シグニチャ sSample
|
---|
[30] | 32 | signature sSample {
|
---|
| 33 | ER sayHello( [in]int32_t times );
|
---|
| 34 | ER howAreYou( [out,string(len)]char_t *buf, [in]int32_t len );
|
---|
| 35 | };
|
---|
| 36 |
|
---|
[34] | 37 | // セルタイプ tSample
|
---|
[30] | 38 | celltype tSample {
|
---|
| 39 | entry sSample eEnt;
|
---|
| 40 | };
|
---|
| 41 |
|
---|
[34] | 42 | // セルタイプ tSimple
|
---|
[30] | 43 | celltype tSimple {
|
---|
| 44 | call sSample cCall;
|
---|
| 45 | entry sTaskBody eBody;
|
---|
| 46 | };
|
---|
| 47 |
|
---|
[34] | 48 | // セル Sample
|
---|
[30] | 49 | cell tSample Sample {
|
---|
| 50 | };
|
---|
| 51 |
|
---|
[34] | 52 | // セル Simple
|
---|
[30] | 53 | cell tSimple Simple {
|
---|
[34] | 54 | [through(TracePlugin,"")] // <<< ※ この行を挿入
|
---|
[30] | 55 | cCall = Sample.eEnt;
|
---|
| 56 | };
|
---|
| 57 |
|
---|
[34] | 58 | // セル Task
|
---|
[30] | 59 | cell tTask Task {
|
---|
| 60 | cBody = Simple.eBody;
|
---|
| 61 | priority = 11;
|
---|
| 62 | stackSize = 1024;
|
---|
| 63 | taskAttribute = C_EXP( "TA_ACT" );
|
---|
| 64 | };
|
---|
[34] | 65 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.