Changeset 429 for EcnlProtoTool/trunk/asp3_dcre/syssvc/test_svc.h
- Timestamp:
- Jul 3, 2020, 7:19:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.