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

ASP3, TINET, mbed を更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.