void tex_task1(TEXPTN texptn, intptr_t exinf) { ER ercd; switch (texptn) { case 0x0001: check_point(12); check_state(false, false, TIPM_ENAALL, true, true, true); /* * ディスパッチ許可,割込み優先度マスク変更,タスク例外処理許可 */ check_point(13); ercd = ena_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMIN_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); check_state(false, false, TMIN_INTPRI, false, true, false); break; default: check_point(0); break; } }
void task1(intptr_t exinf) { ER ercd; if (TMAX_INTPRI == TMIN_INTPRI) { syslog_0(LOG_NOTICE, "This test program is not necessary."); ext_ker(); } check_point(1); check_state(false, false, TIPM_ENAALL, false, false, true); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); check_point(2); check_state(false, false, TMAX_INTPRI, false, true, false); RAISE_CPU_EXCEPTION; check_point(5); check_state(false, false, TMAX_INTPRI, false, true, false); check_finish(6); }
ER_UINT extsvc_routine(intptr_t par1, intptr_t par2, intptr_t par3, intptr_t par4, intptr_t par5, ID cdmid) { ER ercd; switch ((uint_t) par1) { case 1: ercd = loc_cpu(); break; case 2: ercd = unl_cpu(); break; case 3: ercd = dis_dsp(); break; case 4: ercd = ena_dsp(); break; case 5: ercd = chg_ipm((PRI) par2); break; case 6: ercd = rot_rdq((PRI) par2); break; default: ercd = E_NOSPT; break; } return(ercd); }
void task1(intptr_t exinf) { ER ercd; switch (++task1_count) { case 1: check_point(1); check_state(false, false, TIPM_ENAALL, false, false, true); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); check_point(2); check_state(false, false, TMAX_INTPRI, false, true, false); RAISE_CPU_EXCEPTION; check_point(0); break; case 2: check_point(8); check_state(false, false, TIPM_ENAALL, false, false, true); check_finish(9); break; default: check_point(0); break; } }
/** ed_dis_inter -- 割込みを禁止する。 * if_std0001.c からのみ呼び出し。 * ed_ena_inter() は tinet_sys_config.h で定義 * #define ed_ena_inter(ipm) chg_ipm(ipm) ******************************************************* */ IPM ed_dis_inter( void ) { IPM ipm; syscall(get_ipm(&ipm)); syscall(chg_ipm(if_ed_handler_intmask)); return ipm; }
Inline ER check_chg_ipm(PRI intpri) { ER ercd; ercd = chg_ipm(intpri); if (ercd == E_PAR) { syslog_0(LOG_NOTICE, "This test program is not necessary."); ext_ker(); } return(ercd); }
void task1(intptr_t exinf) { ER ercd; check_point(1); check_state(false, false, TIPM_ENAALL, false, false, true); ercd = chg_ipm(TMIN_INTPRI); check_ercd(ercd, E_OK); check_point(2); check_state(false, false, TMIN_INTPRI, false, true, true); RAISE_CPU_EXCEPTION; check_point(5); check_state(false, false, TMIN_INTPRI, false, true, true); check_finish(6); }
void task1(intptr_t exinf) { ER ercd; switch (++task1_count) { case 1: if (TMAX_INTPRI == TMIN_INTPRI) { syslog_0(LOG_NOTICE, "This test program is not necessary."); ext_ker(); } check_point(1); check_state(false, false, TIPM_ENAALL, false, false, true); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); check_point(2); check_state(false, false, TMAX_INTPRI, false, true, false); RAISE_CPU_EXCEPTION; check_point(0); break; case 2: check_point(8); check_state(false, false, TIPM_ENAALL, false, false, true); check_finish(9); break; default: check_point(0); break; } }
void tex_task1(TEXPTN texptn, intptr_t exinf) { ER_UINT ercd; switch (++tex_task1_count) { case 1: check_point(4); check_assert(texptn == 0x0001); check_state(false, false, TIPM_ENAALL, false, false, true); check_point(5); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); ercd = loc_cpu(); check_ercd(ercd, E_OK); check_state(false, true, TMAX_INTPRI, true, true, false); return; check_point(0); case 2: check_point(10); check_assert(texptn == 0x0002); check_state(false, false, TIPM_ENAALL, true, true, true); check_point(11); ercd = ras_tex(TASK1, 0x0001); check_ercd(ercd, E_OK); ercd = ras_tex(TASK1, 0x0002); check_ercd(ercd, E_OK); check_point(12); ercd = ena_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = loc_cpu(); check_ercd(ercd, E_OK); check_state(false, true, TMAX_INTPRI, false, true, true); return; check_point(0); case 3: check_point(13); check_assert(texptn == 0x0003); check_state(false, false, TIPM_ENAALL, true, true, true); check_point(14); ercd = ena_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); check_state(false, false, TMAX_INTPRI, false, true, false); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); check_point(15); ercd = ras_tex(TSK_SELF, 0x0004); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = dis_tex(); check_ercd(ercd, E_OK); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); check_point(16); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); check_point(19); check_state(false, false, TIPM_ENAALL, false, false, false); return; check_point(0); case 4: check_point(17); check_assert(texptn == 0x0004); check_state(false, false, TIPM_ENAALL, false, false, true); check_point(18); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = loc_cpu(); check_ercd(ercd, E_OK); check_state(false, true, TMAX_INTPRI, true, true, true); return; check_point(0); default: check_point(0); } check_point(0); }
void task1(intptr_t exinf) { ER_UINT ercd; T_RFLG rflg; FLGPTN flgptn; test_start(__FILE__); check_point(1); ercd = ref_flg(FLG1, &rflg); check_ercd(ercd, E_OK); check_assert(rflg.wtskid == TSK_NONE); check_assert(rflg.flgptn == 0x00); ercd = ref_flg(FLG2, &rflg); check_ercd(ercd, E_OK); check_assert(rflg.wtskid == TSK_NONE); check_assert(rflg.flgptn == 0x01); check_point(2); ercd = loc_cpu(); check_ercd(ercd, E_OK); ercd = set_flg(FLG1, 0x01); check_ercd(ercd, E_CTX); ercd = wai_flg(FLG1, 0x01, TWF_ORW, &flgptn); check_ercd(ercd, E_CTX); ercd = unl_cpu(); check_ercd(ercd, E_OK); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = wai_flg(FLG1, 0x01, TWF_ORW, &flgptn); check_ercd(ercd, E_CTX); ercd = ena_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = wai_flg(FLG1, 0x01, TWF_ORW, &flgptn); check_ercd(ercd, E_CTX); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); ercd = set_flg(0, 0x01); check_ercd(ercd, E_ID); ercd = wai_flg(0, 0x01, TWF_ORW, &flgptn); check_ercd(ercd, E_ID); ercd = set_flg(TNUM_FLGID+1, 0x01); check_ercd(ercd, E_ID); ercd = wai_flg(TNUM_FLGID+1, 0x01, TWF_ORW, &flgptn); check_ercd(ercd, E_ID); ercd = wai_flg(FLG1, 0x00, TWF_ORW, &flgptn); check_ercd(ercd, E_PAR); ercd = wai_flg(FLG1, 0x01, 0U, &flgptn); check_ercd(ercd, E_PAR); ercd = wai_flg(FLG1, 0x01, (TWF_ORW|TWF_ANDW), &flgptn); check_ercd(ercd, E_PAR); ercd = set_flg(FLG1, 0x00); check_ercd(ercd, E_OK); ercd = ref_flg(FLG1, &rflg); check_ercd(ercd, E_OK); check_assert(rflg.wtskid == TSK_NONE); check_assert(rflg.flgptn == 0x00); ercd = set_flg(FLG1, 0x01); check_ercd(ercd, E_OK); ercd = ref_flg(FLG1, &rflg); check_ercd(ercd, E_OK); check_assert(rflg.wtskid == TSK_NONE); check_assert(rflg.flgptn == 0x01); ercd = set_flg(FLG1, 0x01); check_ercd(ercd, E_OK); ercd = ref_flg(FLG1, &rflg); check_ercd(ercd, E_OK); check_assert(rflg.wtskid == TSK_NONE); check_assert(rflg.flgptn == 0x01); ercd = set_flg(FLG1, 0x02); check_ercd(ercd, E_OK); ercd = ref_flg(FLG1, &rflg); check_ercd(ercd, E_OK); check_assert(rflg.wtskid == TSK_NONE); check_assert(rflg.flgptn == 0x03); ercd = clr_flg(FLG1, ~0x01); check_ercd(ercd, E_OK); ercd = set_flg(FLG1, 0x03); check_ercd(ercd, E_OK); ercd = ref_flg(FLG1, &rflg); check_ercd(ercd, E_OK); check_assert(rflg.wtskid == TSK_NONE); check_assert(rflg.flgptn == 0x03); check_point(3); ercd = act_tsk(TASK2); check_ercd(ercd, E_OK); check_point(6); ercd = set_flg(FLG1, 0x04); check_ercd(ercd, E_OK); check_point(9); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = set_flg(FLG1, 0x08); check_ercd(ercd, E_OK); ercd = ref_flg(FLG1, &rflg); check_ercd(ercd, E_OK); check_assert(rflg.wtskid == TSK_NONE); check_assert(rflg.flgptn == 0x0f); check_point(10); ercd = ena_dsp(); check_ercd(ercd, E_OK); check_point(13); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = set_flg(FLG2, 0x04); check_ercd(ercd, E_OK); ercd = ref_flg(FLG2, &rflg); check_ercd(ercd, E_OK); check_assert(rflg.wtskid == TSK_NONE); check_assert(rflg.flgptn == 0x00); check_point(14); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); check_point(17); ercd = sus_tsk(TASK2); check_ercd(ercd, E_OK); ercd = set_flg(FLG2, 0x04); check_ercd(ercd, E_OK); ercd = ref_flg(FLG2, &rflg); check_ercd(ercd, E_OK); check_assert(rflg.wtskid == TSK_NONE); check_assert(rflg.flgptn == 0x00); check_point(18); ercd = rsm_tsk(TASK2); check_ercd(ercd, E_OK); check_point(21); ercd = wai_flg(FLG2, 0x02, TWF_ORW, &flgptn); check_ercd(ercd, E_ILUSE); ercd = set_flg(FLG2, 0x02); check_ercd(ercd, E_OK); ercd = wai_flg(FLG2, 0x02, TWF_ORW, &flgptn); check_ercd(ercd, E_ILUSE); check_point(22); ercd = set_flg(FLG2, 0x01); check_ercd(ercd, E_OK); check_point(25); ercd = wai_flg(FLG3, 0x01, TWF_ORW, &flgptn); check_ercd(ercd, E_OK); check_point(31); ercd = wai_flg(FLG4, 0x01, TWF_ORW, &flgptn); check_ercd(ercd, E_OK); check_point(37); ercd = clr_flg(FLG3, 0); check_ercd(ercd, E_OK); ercd = sta_alm(ALM1, 2 * TEST_TIME_CP); check_ercd(ercd, E_OK); check_point(38); ercd = wai_flg(FLG3, 0x01, TWF_ORW, &flgptn); check_ercd(ercd, E_OK); check_point(42); ercd = set_flg(FLG3, 0x02); check_ercd(ercd, E_OK); check_point(43); ercd = slp_tsk(); check_ercd(ercd, E_OK); check_point(0); }
void tex_task1(TEXPTN texptn, intptr_t exinf) { ER ercd; switch (texptn) { case 0x0001: check_point(4); check_state(false, false, TIPM_ENAALL, false, false, true); /* * dispatch disabled, ipm changed, task exception enabled */ check_point(5); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); ercd = loc_cpu(); check_ercd(ercd, E_OK); check_state(false, true, TMAX_INTPRI, true, true, false); break; case 0x0002: check_point(10); check_state(false, false, TIPM_ENAALL, true, true, true); /* * raise task exception request */ check_point(11); ercd = ras_tex(TSK_SELF, 0x0001); check_ercd(ercd, E_OK); ercd = ras_tex(TSK_SELF, 0x0002); check_ercd(ercd, E_OK); /* * dispatch enabled, ipm changed, cpu locked */ check_point(12); ercd = ena_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = loc_cpu(); check_ercd(ercd, E_OK); check_state(false, true, TMAX_INTPRI, false, true, true); break; case 0x0003: check_point(13); check_state(false, false, TIPM_ENAALL, true, true, true); /* * dispatch enabled, ipm changed, task exception enabled */ check_point(14); ercd = ena_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); check_state(false, false, TMAX_INTPRI, false, true, false); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); /* * raise task exception request */ check_point(15); ercd = ras_tex(TSK_SELF, 0x0004); ercd = dis_tex(); check_ercd(ercd, E_OK); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); check_point(16); ercd = chg_ipm(TIPM_ENAALL); /* task exception routine runs here */ check_ercd(ercd, E_OK); /* * check the state when task exception routine returns */ check_point(19); check_state(false, false, TIPM_ENAALL, false, false, false); break; case 0x0004: check_point(17); check_state(false, false, TIPM_ENAALL, false, false, true); /* * dispatch disabled, ipm changed, cpu locked */ check_point(18); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = loc_cpu(); check_ercd(ercd, E_OK); check_state(false, true, TMAX_INTPRI, true, true, true); break; default: check_point(0); break; } }
void task1(intptr_t exinf) { ER ercd; check_point(1); ercd = isig_sem(SEM1); check_ercd(ercd, E_CTX); check_point(2); ercd = loc_cpu(); check_ercd(ercd, E_OK); ercd = pol_sem(SEM1); check_ercd(ercd, E_CTX); ercd = twai_sem(SEM1, TMO_POL); check_ercd(ercd, E_CTX); ercd = unl_cpu(); check_ercd(ercd, E_OK); check_point(3); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = pol_sem(SEM1); check_ercd(ercd, E_OK); ercd = twai_sem(SEM1, TMO_POL); check_ercd(ercd, E_CTX); ercd = ena_dsp(); check_ercd(ercd, E_OK); check_point(4); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = pol_sem(SEM1); check_ercd(ercd, E_TMOUT); ercd = twai_sem(SEM1, TMO_POL); check_ercd(ercd, E_CTX); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); check_point(5); ercd = twai_sem(SEM1, -2); check_ercd(ercd, E_PAR); ercd = twai_sem(SEM1, TMO_POL); check_ercd(ercd, E_TMOUT); check_point(6); ercd = sta_alm(ALM1, 10); check_ercd(ercd, E_OK); check_point(7); ercd = twai_sem(SEM1, TMO_FEVR); check_ercd(ercd, E_OK); check_point(11); ercd = act_tsk(TASK3); check_ercd(ercd, E_OK); check_point(12); ercd = wai_sem(SEM1); check_ercd(ercd, E_OK); check_point(15); ercd = wai_sem(SEM1); check_ercd(ercd, E_OK); check_point(19); ercd = wai_sem(SEM1); check_ercd(ercd, E_OK); check_point(23); ercd = act_tsk(TASK2); check_ercd(ercd, E_OK); check_point(25); ercd = wai_sem(SEM1); check_ercd(ercd, E_OK); check_point(30); ercd = sta_alm(ALM1, 10); check_ercd(ercd, E_OK); check_point(31); ercd = twai_sem(SEM1, 100); check_ercd(ercd, E_RLWAI); check_point(33); ercd = sta_alm(ALM1, 100); check_ercd(ercd, E_OK); check_point(34); ercd = twai_sem(SEM1, 10); check_ercd(ercd, E_TMOUT); check_point(35); ercd = stp_alm(ALM1); check_ercd(ercd, E_OK); check_finish(36); check_point(0); }
void task1(intptr_t exinf) { ER ercd; T_RTEX rtex; /* * 初期状態のチェック */ check_point(1); check_state(false, false, TIPM_ENAALL, false, false, true); ercd = ref_tex(TSK_SELF, &rtex); check_ercd(ercd, E_OK); check_assert((rtex.texstat & TTEX_DIS) != 0); check_assert(rtex.pndptn == 0); /* * ras_texのエラー検出 */ ercd = ras_tex(TASK3, 0x0001); check_ercd(ercd, E_OBJ); ercd = ras_tex(TASK4, 0x0001); check_ercd(ercd, E_OBJ); /* * ref_texのエラー検出 */ ercd = ref_tex(TASK3, &rtex); check_ercd(ercd, E_OBJ); ercd = ref_tex(TASK4, &rtex); check_ercd(ercd, E_OBJ); /* * タスク例外処理の許可 */ check_point(2); ercd = ena_tex(); check_ercd(ercd, E_OK); check_state(false, false, TIPM_ENAALL, false, false, false); ercd = ref_tex(TSK_SELF, &rtex); check_ercd(ercd, E_OK); check_assert((rtex.texstat & TTEX_ENA) != 0); check_assert(rtex.pndptn == 0); /* * タスク例外処理を要求 */ check_point(3); ercd = ras_tex(TSK_SELF, 0x0001); /* ここでタスク例外処理ルーチンが動作する */ check_ercd(ercd, E_OK); /* * タスク例外処理からのリターンにより元の状態に戻っていることを * チェック */ check_point(6); check_state(false, false, TIPM_ENAALL, false, false, false); /* * ディスパッチ禁止,割込み優先度マスク変更,タスク例外処理禁止 */ check_point(7); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMIN_INTPRI); check_ercd(ercd, E_OK); ercd = dis_tex(); check_ercd(ercd, E_OK); check_state(false, false, TMIN_INTPRI, true, true, true); /* * タスク例外処理を要求 */ check_point(8); ercd = ras_tex(TASK1, 0x0002); check_ercd(ercd, E_OK); ercd = ref_tex(TSK_SELF, &rtex); check_ercd(ercd, E_OK); check_assert((rtex.texstat & TTEX_DIS) != 0); check_assert(rtex.pndptn == 0x0002); /* * タスク例外処理を許可 */ check_point(9); ercd = ena_tex(); /* ここでタスク例外処理ルーチンが動作する */ check_ercd(ercd, E_OK); /* * タスク例外処理からのリターンにより元の状態に戻っていることを * チェック */ check_point(19); check_state(false, false, TMIN_INTPRI, true, true, false); /* * タスク2に切り換える */ check_point(20); ercd = ena_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); ercd = rot_rdq(TPRI_SELF); /* ここで他のタスクが動作する */ check_ercd(ercd, E_OK); /* * タスク2に対してタスク例外処理を要求 */ check_point(26); ercd = ras_tex(TASK2, 0x0001); check_ercd(ercd, E_OK); ercd = ref_tex(TASK2, &rtex); check_ercd(ercd, E_OK); check_assert((rtex.texstat & TTEX_ENA) != 0); check_assert(rtex.pndptn == 0x0001); /* * タスク2に切り換える */ check_point(27); ercd = rot_rdq(TPRI_SELF); /* ここで他のタスクが動作する */ check_ercd(ercd, E_OK); /* * タスク終了 */ check_point(33); }
void tex_task1(TEXPTN texptn, intptr_t exinf) { ER ercd; switch (texptn) { case 0x0001: check_point(4); check_state(false, false, TIPM_ENAALL, false, false, true); /* * ディスパッチ禁止,割込み優先度マスク変更,タスク例外処理許可 */ check_point(5); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); ercd = loc_cpu(); check_ercd(ercd, E_OK); check_state(false, true, TMAX_INTPRI, true, true, false); break; case 0x0002: check_point(10); check_state(false, false, TMIN_INTPRI, true, true, true); /* * タスク例外処理を要求 */ check_point(11); ercd = ras_tex(TSK_SELF, 0x0001); check_ercd(ercd, E_OK); ercd = ras_tex(TSK_SELF, 0x0002); check_ercd(ercd, E_OK); /* * ディスパッチ許可,割込み優先度マスク変更,CPUロック */ check_point(12); ercd = ena_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = loc_cpu(); check_ercd(ercd, E_OK); check_state(false, true, TMAX_INTPRI, false, true, true); break; case 0x0003: check_point(13); check_state(false, false, TMIN_INTPRI, true, true, true); /* * ディスパッチ許可,割込み優先度マスク変更,タスク例外許可 */ check_point(14); ercd = ena_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); check_state(false, false, TMAX_INTPRI, false, true, false); /* * タスク例外処理を要求 */ check_point(15); ercd = ras_tex(TSK_SELF, 0x0004); /* ここでタスク例外処理ルーチンが動作する */ check_ercd(ercd, E_OK); /* * タスク例外処理からのリターンにより元の状態に戻っていること * をチェック */ check_point(18); check_state(false, false, TMAX_INTPRI, false, true, false); break; case 0x0004: check_point(16); check_state(false, false, TMAX_INTPRI, false, true, true); /* * ディスパッチ禁止,割込み優先度マスク変更,CPUロック */ check_point(17); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); ercd = loc_cpu(); check_ercd(ercd, E_OK); check_state(false, true, TIPM_ENAALL, true, true, true); break; default: check_point(0); break; } }
void task1(intptr_t exinf) { ER ercd; test_start(__FILE__); /* * 初期状態のチェック */ check_point(1); check_state(false, false, TIPM_ENAALL, false, false, true); /* * CPUロック状態のチェック */ check_point(2); ercd = loc_cpu(); check_ercd(ercd, E_OK); check_state(false, true, TIPM_ENAALL, false, true, true); /* * 割込み優先度マスク変更のチェック */ ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_CTX); check_state(false, true, TIPM_ENAALL, false, true, true); /* * CPUロック解除のチェック */ check_point(3); ercd = unl_cpu(); check_ercd(ercd, E_OK); check_state(false, false, TIPM_ENAALL, false, false, true); /* * 割込み優先度マスク変更のチェック */ check_point(4); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); check_state(false, false, TMAX_INTPRI, false, true, true); /* * ディスパッチ禁止のチェック */ check_point(5); ercd = dis_dsp(); check_ercd(ercd, E_OK); check_state(false, false, TMAX_INTPRI, true, true, true); /* * タスク例外処理許可のチェック */ check_point(6); ercd = ena_tex(); check_ercd(ercd, E_OK); check_state(false, false, TMAX_INTPRI, true, true, false); /* * 割込み優先度マスク全解除のチェック */ check_point(7); ercd = chg_ipm(TIPM_ENAALL); check_ercd(ercd, E_OK); check_state(false, false, TIPM_ENAALL, true, true, false); /* * ディスパッチ許可のチェック */ check_point(8); ercd = ena_dsp(); check_ercd(ercd, E_OK); check_state(false, false, TIPM_ENAALL, false, false, false); /* * タスク例外処理禁止のチェック */ check_point(9); ercd = dis_tex(); check_ercd(ercd, E_OK); check_state(false, false, TIPM_ENAALL, false, false, true); /* * ディスパッチ禁止,タスク例外処理許可 */ check_point(10); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = ena_tex(); check_ercd(ercd, E_OK); check_state(false, false, TIPM_ENAALL, true, true, false); /* * タスク例外処理を要求 */ check_point(11); ercd = ras_tex(TSK_SELF, 0x0001); /* ここでタスク例外処理ルーチンが動作する */ check_ercd(ercd, E_OK); /* * タスク例外処理からのリターンにより元の状態に戻っていることを * チェック */ check_point(14); check_state(false, false, TIPM_ENAALL, true, true, false); /* * CPUロック状態に */ check_point(15); ercd = loc_cpu(); check_ercd(ercd, E_OK); /* * そのままタスク終了 */ check_point(16); }
void task2(intptr_t exinf) { ER_UINT ercd; T_RTSK rtsk; switch (++task2_count) { case 1: check_point(4); ercd = loc_mtx(MTX1); check_ercd(ercd, E_OK); ercd = ext_tsk(); check_ercd(ercd, E_OK); check_point(0); case 2: check_point(6); ercd = loc_mtx(MTX1); check_ercd(ercd, E_OK); ercd = act_tsk(TASK3); check_ercd(ercd, E_OK); check_point(8); ercd = ext_tsk(); check_ercd(ercd, E_OK); check_point(0); case 3: check_point(11); ercd = ext_tsk(); check_ercd(ercd, E_OK); check_point(0); case 4: check_point(12); ercd = ref_tsk(TASK2, &rtsk); check_ercd(ercd, E_OK); check_assert(rtsk.tskstat == TTS_RUN); check_assert(rtsk.actcnt == 0U); ercd = act_tsk(TASK2); check_ercd(ercd, E_OK); ercd = chg_pri(TASK2, TASK3_PRIORITY); check_ercd(ercd, E_OK); ercd = act_tsk(TASK3); check_ercd(ercd, E_OK); check_point(13); ercd = ext_tsk(); check_ercd(ercd, E_OK); check_point(0); case 5: check_point(15); check_assert(sns_loc() == false); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = ext_tsk(); check_ercd(ercd, E_OK); check_point(0); case 6: check_point(17); ercd = chg_ipm(TMAX_INTPRI); check_ercd(ercd, E_OK); ercd = act_tsk(TASK3); check_ercd(ercd, E_OK); ercd = act_tsk(TASK4); check_ercd(ercd, E_OK); check_point(18); ercd = ext_tsk(); check_ercd(ercd, E_OK); check_point(0); case 7: check_point(22); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = ext_tsk(); check_ercd(ercd, E_OK); check_point(0); case 8: check_point(24); ercd = dis_dsp(); check_ercd(ercd, E_OK); ercd = act_tsk(TASK3); check_ercd(ercd, E_OK); ercd = act_tsk(TASK4); check_ercd(ercd, E_OK); check_point(25); ercd = ext_tsk(); check_ercd(ercd, E_OK); check_point(0); default: check_point(0); } check_point(0); }