Ignore:
Timestamp:
Jul 3, 2020, 7:19:17 PM (4 years ago)
Author:
coas-nagasima
Message:

ASP3, TINET, mbed を更新

Location:
EcnlProtoTool/trunk/asp3_dcre/syssvc
Files:
7 added
19 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/histogram.h

    r321 r429  
    33 *      Toyohashi Open Platform for Embedded Real-Time Systems
    44 *
    5  *  Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory
     5 *  Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory
    66 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    77 *
     
    5454 *  実行時間分布計測の初期化
    5555 */
    56 extern void     init_hist(ID histid);
     56extern ER       init_hist(ID histid);
    5757
    5858/*
    5959 *  実行時間計測の開始
    6060 */
    61 extern void     begin_measure(ID histid);
     61extern ER       begin_measure(ID histid);
    6262
    6363/*
    6464 *  実行時間計測の終了
    6565 */
    66 extern void     end_measure(ID histid);
     66extern ER       end_measure(ID histid);
    6767
    6868/*
    6969 *  実行時間分布計測の表示
    7070 */
    71 extern void     print_hist(ID histid);
     71extern ER       print_hist(ID histid);
    7272
    7373#ifdef __cplusplus
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/serial.h

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
     
    4847#define TOPPERS_SERIAL_H
    4948
    50 #include <kernel.h>
    51 
    5249#ifdef __cplusplus
    5350extern "C" {
    5451#endif
     52
     53#include <kernel.h>
    5554
    5655/*
     
    6261} T_SERIAL_RPOR;
    6362
     63#ifdef TOPPERS_OMIT_TECS
     64/*
     65 *  シリアルインタフェースドライバの初期化ルーチン
     66 */
     67extern void             serial_initialize(intptr_t exinf) throw();
     68
     69/*
     70 *  シリアルインタフェースドライバからの未送信文字の取出し
     71 */
     72extern bool_t   serial_get_chr(ID portid, char *p_c) throw();
     73#endif
     74
    6475/*
    6576 *  シリアルインタフェースドライバのサービスコール
     
    6778extern ER               serial_opn_por(ID portid) throw();
    6879extern ER               serial_cls_por(ID portid) throw();
    69 extern ER_UINT  serial_rea_dat(ID portid, char *buf, uint_t len) throw();
     80extern ER_UINT  serial_trea_dat(ID portid, char *buf, uint_t len, TMO tmout) throw();
    7081extern ER_UINT  serial_wri_dat(ID portid, const char *buf, uint_t len) throw();
    7182extern ER               serial_ctl_por(ID portid, uint_t ioctl) throw();
    7283extern ER               serial_ref_por(ID portid, T_SERIAL_RPOR *pk_rpor) throw();
     84
     85Inline ER_UINT  serial_rea_dat(ID portid, char *buf, uint_t len)
     86{
     87        return serial_trea_dat(portid, buf, len, TMO_FEVR);
     88}
    7389
    7490/*
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/syslog.h

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
     
    5554#include <t_syslog.h>
    5655
     56#ifdef TOPPERS_OMIT_TECS
     57/*
     58 *  ログバッファのサイズ
     59 */
     60#ifndef TCNT_SYSLOG_BUFFER
     61#define TCNT_SYSLOG_BUFFER      32              /* ログバッファのサイズ */
     62#endif /* TCNT_SYSLOG_BUFFER */
     63
     64/*
     65 *  システムログ機能の初期化
     66 */
     67extern void     syslog_initialize(intptr_t exinf) throw();
     68#endif
     69
     70/*
     71 *  ログ情報の重要度のビットマップを作るためのマクロ
     72 */
     73#define LOG_MASK(prio)          (1U << (prio))
     74#define LOG_UPTO(prio)          ((1U << ((prio) + 1)) - 1)
     75
     76/*
     77 *  パケット形式の定義
     78 */
     79typedef struct t_syslog_rlog {
     80        uint_t  count;          /* ログバッファ中のログの数 */
     81        uint_t  lost;           /* 失われたログの数 */
     82        uint_t  logmask;        /* ログバッファに記録すべき重要度 */
     83        uint_t  lowmask;        /* 低レベル出力すべき重要度 */
     84} T_SYSLOG_RLOG;
     85
    5786/*
    5887 *  ログ情報の出力
     
    6897 *  出力すべきログ情報の重要度の設定
    6998 */
    70 extern ER       syslog_msk_log(uint_t logmask, uint_t lowmask) throw();
     99extern ER               syslog_msk_log(uint_t logmask, uint_t lowmask) throw();
    71100
    72101/*
    73102 *  ログバッファの状態参照
    74103 */
    75 extern ER       syslog_ref_log(T_SYSLOG_RLOG *pk_rlog) throw();
     104extern ER               syslog_ref_log(T_SYSLOG_RLOG *pk_rlog) throw();
    76105
    77106/*
    78107 *  低レベル出力によるすべてのログ情報の出力
    79108 */
    80 extern ER       syslog_fls_log(void) throw();
     109extern ER               syslog_fls_log(void) throw();
    81110
    82111#ifdef __cplusplus
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tBanner.cdl

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tBannerMain.c

    r321 r429  
    66 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
    77 *                              Toyohashi Univ. of Technology, JAPAN
    8  *  Copyright (C) 2004-2017 by Embedded and Real-Time Systems Laboratory
     8 *  Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory
    99 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    1010 *
     
    5656"Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory\n"
    5757"                            Toyohashi Univ. of Technology, JAPAN\n"
    58 "Copyright (C) 2004-2017 by Embedded and Real-Time Systems Laboratory\n"
     58"Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory\n"
    5959"            Graduate School of Information Science, Nagoya Univ., JAPAN\n"
    6060"%s";
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tHistogram.c

    r321 r429  
    33 *      Toyohashi Open Platform for Embedded Real-Time Systems
    44 *
    5  *  Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory
     5 *  Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory
    66 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    77 *
     
    4343
    4444#include "tHistogram_tecsgen.h"
    45 #define syslog_write    cSysLog_write
    4645#include <t_syslog.h>
    47 #include <log_output.h>
    4846
    4947/*
    5048 *  実行時間分布計測の初期化(受け口関数)
    5149 */
    52 void
     50ER
    5351eHistogram_initialize(CELLIDX idx)
    5452{
     
    6159        VAR_over = 0U;
    6260        VAR_under = 0U;
     61        return(E_OK);
    6362}
    6463
     
    6665 *  実行時間計測の開始(受け口関数)
    6766 */
    68 void
     67ER
    6968eHistogram_beginMeasure(CELLIDX idx)
    7069{
     
    7372        HIST_BM_HOOK();
    7473        HIST_GET_TIM(&VAR_begin_time);
     74        return(E_OK);
    7575}
    7676
     
    7878 *  実行時間計測の終了(受け口関数)
    7979 */
    80 void
     80ER
    8181eHistogram_endMeasure(CELLIDX idx)
    8282{
     
    103103                VAR_under++;
    104104        }
     105        return(E_OK);
    105106}
    106107
     
    108109 *  実行時間分布計測の表示(受け口関数)
    109110 */
    110 void
     111ER
    111112eHistogram_print(CELLIDX idx)
    112113{
     
    125126                syslog_1(LOG_NOTICE, "> INT_MAX : %d", VAR_under);
    126127        }
     128        return(E_OK);
    127129}
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tHistogram.cdl

    r321 r429  
    33 *      Toyohashi Open Platform for Embedded Real-Time Systems
    44 *
    5  *  Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory
     5 *  Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory
    66 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    77 *
     
    5151         *  実行時間分布計測の初期化
    5252         */
    53         void    initialize(void);
     53        ER      initialize(void);
    5454
    5555        /*
    5656         *  実行時間計測の開始
    5757         */
    58         void    beginMeasure(void);
     58        ER      beginMeasure(void);
    5959
    6060        /*
    6161         *  実行時間計測の終了
    6262         */
    63         void    endMeasure(void);
     63        ER      endMeasure(void);
    6464
    6565        /*
    6666         *  実行時間分布計測の表示
    6767         */
    68         void    print(void);
     68        ER      print(void);
    6969};
    7070
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tHistogramAdapter.c

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    6  *  Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory
     5 *  Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory
    76 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    87 *
     
    4847
    4948/*
     49 *  実行時間分布計測IDの範囲の判定
     50 */
     51#define VALID_HISTID(histid)    (1 <= histid && histid <= N_CP_cHistogram)
     52
     53/*
    5054 *  実行時間分布計測の初期化(サービスコール)
    5155 */
    52 void
     56ER
    5357init_hist(ID histid)
    5458{
    55         assert(1 <= histid && histid <= N_CP_cHistogram);
    56         return(cHistogram_initialize(histid - 1));
     59        ER              ercd;
     60
     61        if (!VALID_HISTID(histid)) {
     62                ercd = E_ID;
     63        }
     64        else {
     65                ercd = cHistogram_initialize(histid - 1);
     66        }
     67        return(ercd);
    5768}
    5869
     
    6071 *  実行時間計測の開始
    6172 */
    62 void
     73ER
    6374begin_measure(ID histid)
    6475{
    65         assert(1 <= histid && histid <= N_CP_cHistogram);
    66         return(cHistogram_beginMeasure(histid - 1));
     76        ER              ercd;
     77
     78        if (!VALID_HISTID(histid)) {
     79                ercd = E_ID;
     80        }
     81        else {
     82                ercd = cHistogram_beginMeasure(histid - 1);
     83        }
     84        return(ercd);
    6785}
    6886
     
    7088 *  実行時間計測の終了
    7189 */
    72 void
     90ER
    7391end_measure(ID histid)
    7492{
    75         assert(1 <= histid && histid <= N_CP_cHistogram);
    76         return(cHistogram_endMeasure(histid - 1));
     93        ER              ercd;
     94
     95        if (!VALID_HISTID(histid)) {
     96                ercd = E_ID;
     97        }
     98        else {
     99                ercd = cHistogram_endMeasure(histid - 1);
     100        }
     101        return(ercd);
    77102}
    78103
     
    80105 *  実行時間分布計測の表示
    81106 */
    82 void
     107ER
    83108print_hist(ID histid)
    84109{
    85         assert(1 <= histid && histid <= N_CP_cHistogram);
    86         return(cHistogram_print(histid - 1));
     110        ER              ercd;
     111
     112        if (!VALID_HISTID(histid)) {
     113                ercd = E_ID;
     114        }
     115        else {
     116                ercd = cHistogram_print(histid - 1);
     117        }
     118        return(ercd);
    87119}
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tLogTask.cdl

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2015 by Ushio Laboratory
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tLogTaskMain.c

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
    76 *                              Toyohashi Univ. of Technology, JAPAN
    8  *  Copyright (C) 2005-2016 by Embedded and Real-Time Systems Laboratory
     7 *  Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory
    98 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    109 *
     
    8281        }
    8382        else {
    84                 for (;;) {
     83                while (true) {
    8584                        if (cSysLog_refer(&rlog) < 0) {
    8685                                ercd = E_SYS;
     
    113112                        rercd = dly_tsk(ATTR_flushWait);
    114113                        if (rercd < 0) {
    115                                 ercd = (rercd == E_RLWAI) ? rercd : E_SYS;
     114                                ercd = (MERCD(rercd) == E_RLWAI) ? rercd : E_SYS;
    116115                                goto error_exit;
    117116                        }
     
    130129{
    131130        SYSLOG  syslog;
    132         uint_t  lost;
    133131        ER_UINT rercd;
    134132
     
    136134        syslog_0(LOG_NOTICE, "System logging task is started.");
    137135
    138         for (;;) {
    139                 lost = 0U;
     136        while (true) {
    140137                while ((rercd = cSysLog_read(&syslog)) >= 0) {
    141                         lost += (uint_t) rercd;
    142                         if (lost > 0U) {
    143                                 syslog_lostmsg(lost, logtask_putc);
    144                                 lost = 0U;
     138                        if (((uint_t) rercd) > 0U) {
     139                                syslog_lostmsg((uint_t) rercd, logtask_putc);
    145140                        }
    146141                        syslog_print(&syslog, logtask_putc);
    147                         logtask_putc('\n');
    148142                }
    149                 if (lost > 0U) {
    150                         syslog_lostmsg(lost, logtask_putc);
    151                 }
    152                 dly_tsk(ATTR_interval);
     143                (void) dly_tsk(ATTR_interval);
    153144        }
    154145}
     
    189180                        syslog_lostmsg((uint_t) rercd, target_fput_log);
    190181                }
    191                 if (syslog.logtype >= LOG_TYPE_COMMENT) {
    192                         syslog_print(&syslog, target_fput_log);
    193                         target_fput_log('\n');
    194                 }
     182                syslog_print(&syslog, target_fput_log);
    195183        }
    196184}
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tSerialAdapter.c

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
     
    8382 */
    8483ER_UINT
    85 serial_rea_dat(ID portid, char *buf, uint_t len)
     84serial_trea_dat(ID portid, char *buf, uint_t len, TMO tmout)
    8685{
    8786        if (sns_dpn()) {                                /* コンテキストのチェック */
     
    9291        }
    9392
    94         return(cSerialPort_read(portid - 1, buf, len));
     93        return(cSerialPort_read(portid - 1, buf, len, tmout));
    9594}
    9695
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tSerialPort.cdl

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2015 by Ushio Laboratory
     
    5756        ER              open(void);
    5857        ER              close(void);
    59         ER_UINT read([out,size_is(length)] char *buffer, [in] uint_t length);
     58        ER_UINT read([out,size_is(length)] char *buffer, [in] uint_t length, [in] TMO tmout);
    6059        ER_UINT write([in,size_is(length)] const char *buffer, [in] uint_t length);
    6160        ER              control([in] uint_t ioControl);
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tSerialPortMain.c

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
    76 *                              Toyohashi Univ. of Technology, JAPAN
    8  *  Copyright (C) 2006-2015 by Embedded and Real-Time Systems Laboratory
     7 *  Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory
    98 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    109 *
     
    242241
    243242/*
    244  *  シリアルポートへの文字送信
     243 *  SIOポートへの文字送信
    245244 *
    246  *  p_cellcbで指定されるSIOポートに対して,文字cを送信する.文字を送信
    247  *  レジスタにいれた場合にはtrueを返す.そうでない場合には,送信レジス
    248  *  タが空いたことを通知するコールバック関数を許可し,falseを返す.この
    249  *  関数は,CPUロック状態で呼び出される.
     245 *  p_cellcbで指定されるシリアルポートに対応するSIOポートに対して,文
     246 *  字cを送信する.文字を送信レジスタにいれた場合にはtrueを返す.そう
     247 *  でない場合には,送信レジスタが空いたことを通知するコールバック関数
     248 *  を許可し,falseを返す.この関数は,CPUロック状態で呼び出される.
    250249 */
    251250Inline bool_t
     
    268267{
    269268        bool_t  buffer_full;
    270         ER              ercd, rercd;
     269        ER_BOOL ercd;
     270        ER              rercd;
    271271
    272272        /*
     
    359359 *  シリアルポートからの1文字受信
    360360 */
    361 static bool_t
     361static ER_BOOL
    362362serialPort_readChar(CELLCB *p_cellcb, char *p_c)
    363363{
    364364        bool_t  buffer_empty;
    365         ER              ercd;
     365        ER_BOOL ercd;
    366366
    367367        SVC(loc_cpu(), gen_ercd_sys(p_cellcb));
     
    397397 */
    398398ER_UINT
    399 eSerialPort_read(CELLIDX idx, char *buffer, uint_t length)
     399eSerialPort_read(CELLIDX idx, char *buffer, uint_t length, TMO tmout)
    400400{
    401401        CELLCB  *p_cellcb;
     
    423423        while (reacnt < length) {
    424424                if (buffer_empty) {
    425                         SVC(rercd = cReceiveSemaphore_wait(),
    426                                                                                 gen_ercd_wait(rercd, p_cellcb));
     425                        rercd = cReceiveSemaphore_waitTimeout(tmout);
     426                        if (rercd == E_TMOUT)
     427                                return E_TMOUT;
     428                        if (rercd < 0) {
     429                                gen_ercd_wait(rercd, p_cellcb);
     430                                ercd = rercd;
     431                                goto error_exit;
     432                        }
    427433                }
    428434                SVC(rercd = serialPort_readChar(p_cellcb, &c), rercd);
     
    519525        if (VAR_receiveFlowControl != '\0') {
    520526                /*
    521                  *  START/STOP を送信する.
     527                 *  START/STOPを送信する.
    522528                 */
    523529                (void) cSIOPort_putChar(VAR_receiveFlowControl);
     
    569575                 */
    570576                VAR_sendStopped = false;
    571                 if (VAR_sendCount > 0U) {
     577                while (VAR_sendCount > 0U) {
    572578                        c = VAR_sendBuffer[VAR_sendReadPointer];
    573579                        if (serialPort_sendChar(p_cellcb, c)) {
     
    580586                                VAR_sendCount--;
    581587                        }
     588                        else {
     589                                break;
     590                        }
    582591                }
    583592        }
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tSysLog.c

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
    76 *                              Toyohashi Univ. of Technology, JAPAN
    8  *  Copyright (C) 2005-2016 by Embedded and Real-Time Systems Laboratory
     7 *  Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory
    98 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    109 *
     
    5049#include <t_syslog.h>
    5150#include <log_output.h>
     51
     52/*
     53 *  トレースログに関する設定
     54 */
     55#ifdef TOPPERS_ENABLE_TRACE
     56#include "arch/tracelog/trace_log.h"
     57#endif /* TOPPERS_ENABLE_TRACE */
     58
     59/*
     60 *  ターゲット依存情報の定義
     61 */
    5262#include "target_syssvc.h"
    5363
     
    126136        if ((VAR_lowMask & LOG_MASK(priority)) != 0U) {
    127137                syslog_print(p_syslog, low_putchar);
    128                 low_putchar('\n');
    129138        }
    130139
     
    212221
    213222        while ((rercd = eSysLog_read(&logbuf)) >= 0) {
    214                 if (rercd > 0) {
     223                if (((uint_t) rercd) > 0U) {
    215224                        syslog_lostmsg((uint_t) rercd, low_putchar);
    216225                }
    217                 if (logbuf.logtype >= LOG_TYPE_COMMENT) {
    218                         syslog_print(&logbuf, low_putchar);
    219                         low_putchar('\n');
    220                 }
    221         }
    222 
    223         SIL_UNL_INT();
    224         return(E_OK);
    225 }
     226                syslog_print(&logbuf, low_putchar);
     227        }
     228
     229        SIL_UNL_INT();
     230        return(E_OK);
     231}
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tSysLog.cdl

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2015 by Ushio Laboratory
     
    4645
    4746/*
    48  *  システムログ出力に関する定義
     47 *  システムログ機能に関する定義
    4948 */
    50 import_C("t_syslog.h");
     49import_C("syssvc/syslog.h");
    5150
    5251/*
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tSysLogAdapter.c

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    65 *  Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tTestService.c

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    6  *  Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory
     5 *  Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory
    76 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    87 *
     
    5251 *  テストプログラムの開始(受け口関数)
    5352 */
    54 void
     53ER
    5554eTestService_start(const char *progname)
    5655{
    5756        syslog_1(LOG_NOTICE, "Test program: %s", progname);
    5857        VAR_check_count = 0U;
    59 }
    60 
    61 /*
    62  *      自己診断関数の設定
    63  */
    64 void
    65 eTestService_setBuiltInTest(Descriptor(sBuiltInTest) desc)
    66 {
    67         cBuiltInTest_set_descriptor(desc);
     58        return(E_OK);
    6859}
    6960
     
    8778 *      チェックポイント(受け口関数)
    8879 */
    89 void
     80ER
    9081eTestService_checkPoint(uint_t count)
    9182{
     
    133124         */
    134125        SIL_UNL_INT();
     126        return(E_OK);
    135127}
    136128
     
    138130 *      完了チェックポイント(受け口関数)
    139131 */
    140 void
     132ER
    141133eTestService_finishPoint(uint_t count)
    142134{
     
    146138        }
    147139        test_finish();
     140        return(E_OK);
    148141}
    149142
     
    151144 *      条件チェックのエラー処理(受け口関数)
    152145 */
    153 void
     146ER
    154147eTestService_assertError(const char *expr, const char *file, int_t line)
    155148{
     
    157150                                                                                                expr, file, line);
    158151        test_finish();
    159 }
    160 
    161 /*
    162  *      エラーコードチェックのエラー処理(受け口関数)
    163  */
    164 void
    165 eTestService_serviceError(ER ercd, const char *file, int_t line)
    166 {
    167         syslog_3(LOG_ERROR, "## Unexpected error %s detected at %s:%u.\007",
    168                                                                                 itron_strerror(ercd), file, line);
    169         test_finish();
     152        return(E_OK);
    170153}
    171154
     
    174157 */
    175158ER
     159eTestService_serviceError(ER ercd, const char *file, int_t line)
     160{
     161        syslog_3(LOG_ERROR, "## Unexpected error %s detected at %s:%u.\007",
     162                                                                                itron_strerror(ercd), file, line);
     163        test_finish();
     164        return(E_OK);
     165}
     166
     167/*
     168 *      割込み優先度マスクの取得(受け口関数)
     169 */
     170ER
    176171eTestService_getInterruptPriorityMask(PRI *p_ipm)
    177172{
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/tTestService.cdl

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    6  *  Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory
     5 *  Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory
    76 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    87 *
     
    4645 *  自己診断サービスのシグニチャ
    4746 */
     47[callback]
    4848signature sBuiltInTest {
    4949        ER              builtInTest(void);
     
    5252/*
    5353 *  テストプログラム用サービスのシグニチャ
    54  *
    55  *  setBuiltInTestは,TECSの中では動的結合を使って実現すべきであるが,
    56  *  C言語のアプリケーションから呼び出しやすくするために,TECSの作法違
    57  *  反のコードとなっている.
    5854 *
    5955 *  getInterruptPriorityMaskは,そのままカーネルを呼び出すだけの関数で
     
    6460 */
    6561signature sTestService {
    66         void    start([in, string] const char *progname);
    67         void    setBuiltInTest([in] Descriptor(sBuiltInTest) desc);
    68         void    checkPoint([in] uint_t count);
    69         void    finishPoint([in] uint_t count);
    70         void    assertError([in, string] const char *expr,
     62        ER              start([in, string] const char *progname);
     63        ER              checkPoint([in] uint_t count);
     64        ER              finishPoint([in] uint_t count);
     65        ER              assertError([in, string] const char *expr,
    7166                                                        [in, string] const char *file, [in] int_t line);
    72         void    serviceError([in] ER ercd,
     67        ER              serviceError([in] ER ercd,
    7368                                                        [in, string] const char *file, [in] int_t line);
    7469        ER              getInterruptPriorityMask([out] PRI *p_ipm);
     
    8075[singleton, active]
    8176celltype tTestService {
    82         entry           sTestService    eTestService;
    83         [dynamic, optional] call        sBuiltInTest    cBuiltInTest;
    84         call            sSysLog                 cSysLog;
     77        entry                           sTestService    eTestService;
     78        call                            sSysLog                 cSysLog;
     79        [optional] call         sBuiltInTest    cBuiltInTest;
    8580
    8681        var {
     
    8883        };
    8984};
    90 
    91 /*
    92  *  自己診断サービスのディスクリプタを取得するシグニチャ
    93  */
    94 signature sGetBuiltInTestDescriptor {
    95         ER              getDescriptor([out] Descriptor(sBuiltInTest) *p_desc,
    96                                                                                                                 [in] int_t i);
    97 };
    98 
    99 /*
    100  *  自己診断サービスのディスクリプタを取得するセルタイプ
    101  */
    102 [singleton, active]
    103 celltype tBuiltInTestAdaptor {
    104         [ref_desc] call sBuiltInTest                            cBuiltInTest[];
    105         entry                   sGetBuiltInTestDescriptor       eGetBuiltInTestDescriptor;
    106 };
  • EcnlProtoTool/trunk/asp3_dcre/syssvc/test_svc.h

    r321 r429  
    11/*
    2  *  TOPPERS/ASP Kernel
    3  *      Toyohashi Open Platform for Embedded Real-Time Systems/
    4  *      Advanced Standard Profile Kernel
     2 *  TOPPERS Software
     3 *      Toyohashi Open Platform for Embedded Real-Time Systems
    54 *
    6  *  Copyright (C) 2005-2016 by Embedded and Real-Time Systems Laboratory
     5 *  Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory
    76 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    87 *
     
    5453
    5554/*
    56  *  TECSで記述されたテストプログラム用のサービスを直接呼び出すための定義
    57  *
    58  *  C言語で記述されたアプリケーションから,TECSで記述されたテストプログ
    59  *  ラム用のサービスを呼び出すためには,アダプタを用いるのが正当な方法
    60  *  であるが,テストプログラム用のサービスがシングルトンであることを利
    61  *  用して直接呼び出す.
     55 *  テストプログラム用サービスのサービスコール
    6256 */
    63 extern void     tTestService_eTestService_start(const char* progname);
    64 extern void     tTestService_eTestService_setBuiltInTest(void *desc);
    65 extern void     tTestService_eTestService_checkPoint(uint_t count);
    66 extern void     tTestService_eTestService_finishPoint(uint_t count);
    67 extern void     tTestService_eTestService_assertError(const char* expr,
    68                                                                                         const char* file, int_t line);
    69 extern void     tTestService_eTestService_serviceError(ER ercd,
    70                                                                                         const char* file, int_t line);
    71 extern ER       tTestService_eTestService_getInterruptPriorityMask(PRI* p_ipm);
    72 
    73 /*
    74  *  テストプログラムの開始
    75  */
    76 Inline void
    77 test_start(const char *progname)
    78 {
    79         tTestService_eTestService_start(progname);
    80 }
    81 
    82 /*
    83  *      自己診断関数の設定
    84  */
    85 Inline void
    86 set_bit_service(void *bit_service)
    87 {
    88         tTestService_eTestService_setBuiltInTest(bit_service);
    89 }
    90 
    91 /*
    92  *      チェックポイント
    93  */
    94 Inline void
    95 check_point(uint_t count)
    96 {
    97         tTestService_eTestService_checkPoint(count);
    98 }
    99 
    100 /*
    101  *      完了チェックポイント
    102  */
    103 Inline void
    104 check_finish(uint_t count)
    105 {
    106         tTestService_eTestService_finishPoint(count);
    107 }
     57extern void     test_start(const char *progname);
     58extern void     check_point(uint_t count);
     59extern void     check_finish(uint_t count);
     60extern void     check_assert_error(const char *expr, const char *file, int_t line);
     61extern void     check_ercd_error(ER ercd, const char *file, int_t line);
     62extern ER       get_interrupt_priority_mask(PRI *p_ipm);
    10863
    10964/*
    11065 *      条件チェック
    11166 */
    112 Inline void
    113 check_assert_error(const char *expr, const char *file, int_t line)
    114 {
    115         tTestService_eTestService_assertError(expr, file, line);
    116 }
    117 
    11867#define check_assert(exp) \
    11968        ((void)(!(exp) ? (check_assert_error(#exp, __FILE__, __LINE__), 0) : 0))
     
    12271 *      エラーコードチェック
    12372 */
    124 Inline void
    125 check_ercd_error(ER ercd, const char *file, int_t line)
    126 {
    127         tTestService_eTestService_serviceError(ercd, file, line);
    128 }
    129 
    13073#define check_ercd(ercd, expected_ercd) \
    13174        ((void)((ercd) != (expected_ercd) ? \
     
    14689 *      割込み優先度マスクのチェック
    14790 */
    148 #define check_ipm(ipm) do {                                                                                             \
    149         PRI             intpri;                                                                                                         \
    150         ER              ercd;                                                                                                           \
    151                                                                                                                                                 \
    152         ercd = tTestService_eTestService_getInterruptPriorityMask(&intpri);     \
    153         check_ercd(ercd, E_OK);                                                                                         \
    154         check_assert(intpri == ipm);                                                                            \
     91#define check_ipm(ipm) do {                                                     \
     92        PRI             intpri;                                                                 \
     93        ER              ercd;                                                                   \
     94                                                                                                        \
     95        ercd = get_interrupt_priority_mask(&intpri);    \
     96        check_ercd(ercd, E_OK);                                                 \
     97        check_assert(intpri == ipm);                                    \
    15598} while (false);
    15699
     
    159102#endif
    160103
    161 /*
    162  *  TECSで記述された自己診断サービスを直接呼び出すための定義
    163  *
    164  *  C言語で記述されたアプリケーションから,TECSで記述された自己診断サー
    165  *  ビスを呼び出すためには,アダプタを用いるのが正当な方法であるが,自
    166  *  己診断サービスがシングルトンであることを利用して直接呼び出す.
    167  */
    168 extern ER       tBuiltInTestAdaptor_eGetBuiltInTestDescriptor_getDescriptor
    169                                                                                                 (void **p_desc, int_t i);
    170 
    171 Inline void *
    172 get_bit_kernel(void)
    173 {
    174         void    *desc;
    175 
    176         tBuiltInTestAdaptor_eGetBuiltInTestDescriptor_getDescriptor(&desc, 0);
    177         return(desc);
    178 }
    179 
    180 Inline void *
    181 get_bit_mutex(void)
    182 {
    183         void    *desc;
    184 
    185         tBuiltInTestAdaptor_eGetBuiltInTestDescriptor_getDescriptor(&desc, 1);
    186         return(desc);
    187 }
    188 
    189104#endif /* TOPPERS_TEST_SVC_H */
Note: See TracChangeset for help on using the changeset viewer.