Changeset 429 for EcnlProtoTool/trunk/asp3_dcre/syssvc
- Timestamp:
- Jul 3, 2020, 7:19:17 PM (4 years ago)
- Location:
- EcnlProtoTool/trunk/asp3_dcre/syssvc
- Files:
-
- 7 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/syssvc/histogram.h
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 4 * 5 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 6 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 7 7 * … … 54 54 * 実行時間分布計測の初期化 55 55 */ 56 extern voidinit_hist(ID histid);56 extern ER init_hist(ID histid); 57 57 58 58 /* 59 59 * 実行時間計測の開始 60 60 */ 61 extern voidbegin_measure(ID histid);61 extern ER begin_measure(ID histid); 62 62 63 63 /* 64 64 * 実行時間計測の終了 65 65 */ 66 extern voidend_measure(ID histid);66 extern ER end_measure(ID histid); 67 67 68 68 /* 69 69 * 実行時間分布計測の表示 70 70 */ 71 extern voidprint_hist(ID histid);71 extern ER print_hist(ID histid); 72 72 73 73 #ifdef __cplusplus -
EcnlProtoTool/trunk/asp3_dcre/syssvc/serial.h
r321 r429 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory … … 48 47 #define TOPPERS_SERIAL_H 49 48 50 #include <kernel.h>51 52 49 #ifdef __cplusplus 53 50 extern "C" { 54 51 #endif 52 53 #include <kernel.h> 55 54 56 55 /* … … 62 61 } T_SERIAL_RPOR; 63 62 63 #ifdef TOPPERS_OMIT_TECS 64 /* 65 * シリアルインタフェースドライバの初期化ルーチン 66 */ 67 extern void serial_initialize(intptr_t exinf) throw(); 68 69 /* 70 * シリアルインタフェースドライバからの未送信文字の取出し 71 */ 72 extern bool_t serial_get_chr(ID portid, char *p_c) throw(); 73 #endif 74 64 75 /* 65 76 * シリアルインタフェースドライバのサービスコール … … 67 78 extern ER serial_opn_por(ID portid) throw(); 68 79 extern ER serial_cls_por(ID portid) throw(); 69 extern ER_UINT serial_ rea_dat(ID portid, char *buf, uint_t len) throw();80 extern ER_UINT serial_trea_dat(ID portid, char *buf, uint_t len, TMO tmout) throw(); 70 81 extern ER_UINT serial_wri_dat(ID portid, const char *buf, uint_t len) throw(); 71 82 extern ER serial_ctl_por(ID portid, uint_t ioctl) throw(); 72 83 extern ER serial_ref_por(ID portid, T_SERIAL_RPOR *pk_rpor) throw(); 84 85 Inline ER_UINT serial_rea_dat(ID portid, char *buf, uint_t len) 86 { 87 return serial_trea_dat(portid, buf, len, TMO_FEVR); 88 } 73 89 74 90 /* -
EcnlProtoTool/trunk/asp3_dcre/syssvc/syslog.h
r321 r429 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory … … 55 54 #include <t_syslog.h> 56 55 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 */ 67 extern 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 */ 79 typedef 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 57 86 /* 58 87 * ログ情報の出力 … … 68 97 * 出力すべきログ情報の重要度の設定 69 98 */ 70 extern ER syslog_msk_log(uint_t logmask, uint_t lowmask) throw();99 extern ER syslog_msk_log(uint_t logmask, uint_t lowmask) throw(); 71 100 72 101 /* 73 102 * ログバッファの状態参照 74 103 */ 75 extern ER syslog_ref_log(T_SYSLOG_RLOG *pk_rlog) throw();104 extern ER syslog_ref_log(T_SYSLOG_RLOG *pk_rlog) throw(); 76 105 77 106 /* 78 107 * 低レベル出力によるすべてのログ情報の出力 79 108 */ 80 extern ER syslog_fls_log(void) throw();109 extern ER syslog_fls_log(void) throw(); 81 110 82 111 #ifdef __cplusplus -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tBanner.cdl
r321 r429 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tBannerMain.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2004-201 7by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 56 56 "Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory\n" 57 57 " Toyohashi Univ. of Technology, JAPAN\n" 58 "Copyright (C) 2004-201 7by Embedded and Real-Time Systems Laboratory\n"58 "Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory\n" 59 59 " Graduate School of Information Science, Nagoya Univ., JAPAN\n" 60 60 "%s"; -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tHistogram.c
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 4 * 5 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 6 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 7 7 * … … 43 43 44 44 #include "tHistogram_tecsgen.h" 45 #define syslog_write cSysLog_write46 45 #include <t_syslog.h> 47 #include <log_output.h>48 46 49 47 /* 50 48 * 実行時間分布計測の初期化(受け口関数) 51 49 */ 52 void 50 ER 53 51 eHistogram_initialize(CELLIDX idx) 54 52 { … … 61 59 VAR_over = 0U; 62 60 VAR_under = 0U; 61 return(E_OK); 63 62 } 64 63 … … 66 65 * 実行時間計測の開始(受け口関数) 67 66 */ 68 void 67 ER 69 68 eHistogram_beginMeasure(CELLIDX idx) 70 69 { … … 73 72 HIST_BM_HOOK(); 74 73 HIST_GET_TIM(&VAR_begin_time); 74 return(E_OK); 75 75 } 76 76 … … 78 78 * 実行時間計測の終了(受け口関数) 79 79 */ 80 void 80 ER 81 81 eHistogram_endMeasure(CELLIDX idx) 82 82 { … … 103 103 VAR_under++; 104 104 } 105 return(E_OK); 105 106 } 106 107 … … 108 109 * 実行時間分布計測の表示(受け口関数) 109 110 */ 110 void 111 ER 111 112 eHistogram_print(CELLIDX idx) 112 113 { … … 125 126 syslog_1(LOG_NOTICE, "> INT_MAX : %d", VAR_under); 126 127 } 128 return(E_OK); 127 129 } -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tHistogram.cdl
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 4 * 5 * Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory 6 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 7 7 * … … 51 51 * 実行時間分布計測の初期化 52 52 */ 53 voidinitialize(void);53 ER initialize(void); 54 54 55 55 /* 56 56 * 実行時間計測の開始 57 57 */ 58 voidbeginMeasure(void);58 ER beginMeasure(void); 59 59 60 60 /* 61 61 * 実行時間計測の終了 62 62 */ 63 voidendMeasure(void);63 ER endMeasure(void); 64 64 65 65 /* 66 66 * 実行時間分布計測の表示 67 67 */ 68 voidprint(void);68 ER print(void); 69 69 }; 70 70 -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tHistogramAdapter.c
r321 r429 1 1 /* 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 5 4 * 6 * Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 7 * … … 48 47 49 48 /* 49 * 実行時間分布計測IDの範囲の判定 50 */ 51 #define VALID_HISTID(histid) (1 <= histid && histid <= N_CP_cHistogram) 52 53 /* 50 54 * 実行時間分布計測の初期化(サービスコール) 51 55 */ 52 void 56 ER 53 57 init_hist(ID histid) 54 58 { 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); 57 68 } 58 69 … … 60 71 * 実行時間計測の開始 61 72 */ 62 void 73 ER 63 74 begin_measure(ID histid) 64 75 { 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); 67 85 } 68 86 … … 70 88 * 実行時間計測の終了 71 89 */ 72 void 90 ER 73 91 end_measure(ID histid) 74 92 { 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); 77 102 } 78 103 … … 80 105 * 実行時間分布計測の表示 81 106 */ 82 void 107 ER 83 108 print_hist(ID histid) 84 109 { 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); 87 119 } -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tLogTask.cdl
r321 r429 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2015 by Ushio Laboratory -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tLogTaskMain.c
r321 r429 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 6 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 9 * … … 82 81 } 83 82 else { 84 for (;;) {83 while (true) { 85 84 if (cSysLog_refer(&rlog) < 0) { 86 85 ercd = E_SYS; … … 113 112 rercd = dly_tsk(ATTR_flushWait); 114 113 if (rercd < 0) { 115 ercd = ( rercd== E_RLWAI) ? rercd : E_SYS;114 ercd = (MERCD(rercd) == E_RLWAI) ? rercd : E_SYS; 116 115 goto error_exit; 117 116 } … … 130 129 { 131 130 SYSLOG syslog; 132 uint_t lost;133 131 ER_UINT rercd; 134 132 … … 136 134 syslog_0(LOG_NOTICE, "System logging task is started."); 137 135 138 for (;;) { 139 lost = 0U; 136 while (true) { 140 137 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); 145 140 } 146 141 syslog_print(&syslog, logtask_putc); 147 logtask_putc('\n');148 142 } 149 if (lost > 0U) { 150 syslog_lostmsg(lost, logtask_putc); 151 } 152 dly_tsk(ATTR_interval); 143 (void) dly_tsk(ATTR_interval); 153 144 } 154 145 } … … 189 180 syslog_lostmsg((uint_t) rercd, target_fput_log); 190 181 } 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); 195 183 } 196 184 } -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSerialAdapter.c
r321 r429 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory … … 83 82 */ 84 83 ER_UINT 85 serial_ rea_dat(ID portid, char *buf, uint_t len)84 serial_trea_dat(ID portid, char *buf, uint_t len, TMO tmout) 86 85 { 87 86 if (sns_dpn()) { /* コンテキストのチェック */ … … 92 91 } 93 92 94 return(cSerialPort_read(portid - 1, buf, len ));93 return(cSerialPort_read(portid - 1, buf, len, tmout)); 95 94 } 96 95 -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSerialPort.cdl
r321 r429 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2015 by Ushio Laboratory … … 57 56 ER open(void); 58 57 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); 60 59 ER_UINT write([in,size_is(length)] const char *buffer, [in] uint_t length); 61 60 ER control([in] uint_t ioControl); -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSerialPortMain.c
r321 r429 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 6 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2006-201 5by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 9 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 9 * … … 242 241 243 242 /* 244 * シリアルポートへの文字送信243 * SIOポートへの文字送信 245 244 * 246 * p_cellcbで指定される SIOポートに対して,文字cを送信する.文字を送信247 * レジスタにいれた場合にはtrueを返す.そうでない場合には,送信レジス248 * タが空いたことを通知するコールバック関数を許可し,falseを返す.この249 * 関数は,CPUロック状態で呼び出される.245 * p_cellcbで指定されるシリアルポートに対応するSIOポートに対して,文 246 * 字cを送信する.文字を送信レジスタにいれた場合にはtrueを返す.そう 247 * でない場合には,送信レジスタが空いたことを通知するコールバック関数 248 * を許可し,falseを返す.この関数は,CPUロック状態で呼び出される. 250 249 */ 251 250 Inline bool_t … … 268 267 { 269 268 bool_t buffer_full; 270 ER ercd, rercd; 269 ER_BOOL ercd; 270 ER rercd; 271 271 272 272 /* … … 359 359 * シリアルポートからの1文字受信 360 360 */ 361 static bool_t361 static ER_BOOL 362 362 serialPort_readChar(CELLCB *p_cellcb, char *p_c) 363 363 { 364 364 bool_t buffer_empty; 365 ER 365 ER_BOOL ercd; 366 366 367 367 SVC(loc_cpu(), gen_ercd_sys(p_cellcb)); … … 397 397 */ 398 398 ER_UINT 399 eSerialPort_read(CELLIDX idx, char *buffer, uint_t length )399 eSerialPort_read(CELLIDX idx, char *buffer, uint_t length, TMO tmout) 400 400 { 401 401 CELLCB *p_cellcb; … … 423 423 while (reacnt < length) { 424 424 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 } 427 433 } 428 434 SVC(rercd = serialPort_readChar(p_cellcb, &c), rercd); … … 519 525 if (VAR_receiveFlowControl != '\0') { 520 526 /* 521 * START/STOP 527 * START/STOPを送信する. 522 528 */ 523 529 (void) cSIOPort_putChar(VAR_receiveFlowControl); … … 569 575 */ 570 576 VAR_sendStopped = false; 571 if(VAR_sendCount > 0U) {577 while (VAR_sendCount > 0U) { 572 578 c = VAR_sendBuffer[VAR_sendReadPointer]; 573 579 if (serialPort_sendChar(p_cellcb, c)) { … … 580 586 VAR_sendCount--; 581 587 } 588 else { 589 break; 590 } 582 591 } 583 592 } -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSysLog.c
r321 r429 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 6 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 9 * … … 50 49 #include <t_syslog.h> 51 50 #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 */ 52 62 #include "target_syssvc.h" 53 63 … … 126 136 if ((VAR_lowMask & LOG_MASK(priority)) != 0U) { 127 137 syslog_print(p_syslog, low_putchar); 128 low_putchar('\n');129 138 } 130 139 … … 212 221 213 222 while ((rercd = eSysLog_read(&logbuf)) >= 0) { 214 if ( rercd > 0) {223 if (((uint_t) rercd) > 0U) { 215 224 syslog_lostmsg((uint_t) rercd, low_putchar); 216 225 } 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 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2015 by Ushio Laboratory … … 46 45 47 46 /* 48 * システムログ 出力に関する定義47 * システムログ機能に関する定義 49 48 */ 50 import_C(" t_syslog.h");49 import_C("syssvc/syslog.h"); 51 50 52 51 /* -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSysLogAdapter.c
r321 r429 1 1 /* 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 5 4 * 6 5 * Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tTestService.c
r321 r429 1 1 /* 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 5 4 * 6 * Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 7 * … … 52 51 * テストプログラムの開始(受け口関数) 53 52 */ 54 void 53 ER 55 54 eTestService_start(const char *progname) 56 55 { 57 56 syslog_1(LOG_NOTICE, "Test program: %s", progname); 58 57 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); 68 59 } 69 60 … … 87 78 * チェックポイント(受け口関数) 88 79 */ 89 void 80 ER 90 81 eTestService_checkPoint(uint_t count) 91 82 { … … 133 124 */ 134 125 SIL_UNL_INT(); 126 return(E_OK); 135 127 } 136 128 … … 138 130 * 完了チェックポイント(受け口関数) 139 131 */ 140 void 132 ER 141 133 eTestService_finishPoint(uint_t count) 142 134 { … … 146 138 } 147 139 test_finish(); 140 return(E_OK); 148 141 } 149 142 … … 151 144 * 条件チェックのエラー処理(受け口関数) 152 145 */ 153 void 146 ER 154 147 eTestService_assertError(const char *expr, const char *file, int_t line) 155 148 { … … 157 150 expr, file, line); 158 151 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); 170 153 } 171 154 … … 174 157 */ 175 158 ER 159 eTestService_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 */ 170 ER 176 171 eTestService_getInterruptPriorityMask(PRI *p_ipm) 177 172 { -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tTestService.cdl
r321 r429 1 1 /* 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 5 4 * 6 * Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 7 * … … 46 45 * 自己診断サービスのシグニチャ 47 46 */ 47 [callback] 48 48 signature sBuiltInTest { 49 49 ER builtInTest(void); … … 52 52 /* 53 53 * テストプログラム用サービスのシグニチャ 54 *55 * setBuiltInTestは,TECSの中では動的結合を使って実現すべきであるが,56 * C言語のアプリケーションから呼び出しやすくするために,TECSの作法違57 * 反のコードとなっている.58 54 * 59 55 * getInterruptPriorityMaskは,そのままカーネルを呼び出すだけの関数で … … 64 60 */ 65 61 signature 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, 71 66 [in, string] const char *file, [in] int_t line); 72 voidserviceError([in] ER ercd,67 ER serviceError([in] ER ercd, 73 68 [in, string] const char *file, [in] int_t line); 74 69 ER getInterruptPriorityMask([out] PRI *p_ipm); … … 80 75 [singleton, active] 81 76 celltype 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; 85 80 86 81 var { … … 88 83 }; 89 84 }; 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 1 1 /* 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 5 4 * 6 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 7 * … … 54 53 55 54 /* 56 * TECSで記述されたテストプログラム用のサービスを直接呼び出すための定義 57 * 58 * C言語で記述されたアプリケーションから,TECSで記述されたテストプログ 59 * ラム用のサービスを呼び出すためには,アダプタを用いるのが正当な方法 60 * であるが,テストプログラム用のサービスがシングルトンであることを利 61 * 用して直接呼び出す. 55 * テストプログラム用サービスのサービスコール 62 56 */ 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 } 57 extern void test_start(const char *progname); 58 extern void check_point(uint_t count); 59 extern void check_finish(uint_t count); 60 extern void check_assert_error(const char *expr, const char *file, int_t line); 61 extern void check_ercd_error(ER ercd, const char *file, int_t line); 62 extern ER get_interrupt_priority_mask(PRI *p_ipm); 108 63 109 64 /* 110 65 * 条件チェック 111 66 */ 112 Inline void113 check_assert_error(const char *expr, const char *file, int_t line)114 {115 tTestService_eTestService_assertError(expr, file, line);116 }117 118 67 #define check_assert(exp) \ 119 68 ((void)(!(exp) ? (check_assert_error(#exp, __FILE__, __LINE__), 0) : 0)) … … 122 71 * エラーコードチェック 123 72 */ 124 Inline void125 check_ercd_error(ER ercd, const char *file, int_t line)126 {127 tTestService_eTestService_serviceError(ercd, file, line);128 }129 130 73 #define check_ercd(ercd, expected_ercd) \ 131 74 ((void)((ercd) != (expected_ercd) ? \ … … 146 89 * 割込み優先度マスクのチェック 147 90 */ 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); \ 155 98 } while (false); 156 99 … … 159 102 #endif 160 103 161 /*162 * TECSで記述された自己診断サービスを直接呼び出すための定義163 *164 * C言語で記述されたアプリケーションから,TECSで記述された自己診断サー165 * ビスを呼び出すためには,アダプタを用いるのが正当な方法であるが,自166 * 己診断サービスがシングルトンであることを利用して直接呼び出す.167 */168 extern ER tBuiltInTestAdaptor_eGetBuiltInTestDescriptor_getDescriptor169 (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 189 104 #endif /* TOPPERS_TEST_SVC_H */
Note:
See TracChangeset
for help on using the changeset viewer.