EXTERN_C void ShutdownOS(void) { EcuM_ShutdownHook_App(); ShutdownHook(); }
/********************************************************************** * Stop the kernel and task activation after an error occurs. * The function returns to the adress of the main function stored by * the StartOS service. * * @param error IN Last error number detected * @return void **********************************************************************/ void ShutdownOS(StatusType Error) { kernelState = STOP; #ifdef SHUTDOWNHOOK ShutdownHook(Error); #endif return; }
/********************************************************************** * Stop the kernel and task activation after an error occurs. * The function returns to the adress of the main function stored by * the StartOS service. * * @param error IN Last error number detected * @return void **********************************************************************/ void ShutdownOS(StatusType Error) { #ifdef SHUTDOWNHOOK ShutdownHook(Error); #endif FSR1L = FSR1L_MAIN; FSR1H = FSR1H_MAIN; _restore_now(); }
/* |------------------+------------------------------------------------------------------| */ EXPORT void ShutdownOS( StatusType Error ) { DISABLE_INTERRUPT(); #if (cfgOS_SHUTDOWNHOOK == 1) ShutdownHook(Error); #endif /* @req OS425: If ShutdownOS() is called and ShutdownHook() returns then the operating system shall disable all interrupts and enter an endless loop. */ for ( ; ; ) { /* Dead lopp here */ } }
/* * OS�̏I�� */ void ShutdownOS(StatusType ercd) { volatile FP shutdownhook_adr; LOG_STUTOS_ENTER(ercd); /* * ���ׂĂ̊����݂��֎~���� */ IntGlobalDisable(); /* * ShutdownHook �̌Ăяo�� * * C�����̋K�i�ł͊��̃A�h���X��0�ɂȂ��Ȃ��Ƃ����O��, * �R���p�C���̍œK���ɂ���ShutdownHook�̃A�h���X���蕪���� * �폜�����Ă��܂��ꍇ�����邽��, volatile�w�肵�����[�J���ϐ��� * �A�h���X���������Ă��画�肵�Ă����D */ shutdownhook_adr = (FP)ShutdownHook; if (shutdownhook_adr != NULL) { /* * ShutdownHook �̒��ŁCSuspendAllInterrupts ���Ă� * �Ă������v�Ȃ悤�ɁCsus_all_cnt �����[���ɂ��Ă����D */ callevel = TCL_SHUTDOWN; sus_all_cnt++; ShutdownHook(ercd); sus_all_cnt--; } LOG_STUTOS_LEAVE(); /* * �^�[�Q�b�g�ˑ��̏I������ */ cpu_terminate(); sys_exit(); }
/* * OSの終了 */ void ShutdownOS(StatusType ercd) { volatile FP shutdownhook_adr; LOG_STUTOS_ENTER(ercd); /* * すべての割込みを禁止する */ disable_int(); /* * ShutdownHook の呼び出し * * C言語の規格では関数のアドレスは0にならないという前提から, * コンパイラの最適化によりShutdownHookのアドレス判定分岐が * 削除されてしまう場合があるため, volatile指定したローカル変数に * アドレスを代入してから判定している. */ shutdownhook_adr = (FP)ShutdownHook; if (shutdownhook_adr != NULL) { /* * ShutdownHook の中で,SuspendAllInterrupts が呼ばれ * ても大丈夫なように,sus_all_cnt を非ゼロにしておく. */ callevel = TCL_SHUTDOWN; sus_all_cnt++; ShutdownHook(ercd); sus_all_cnt--; } LOG_STUTOS_LEAVE(); /* * ターゲット依存の終了処理 */ cpu_terminate(); sys_exit(); }
/*==================[external functions definition]==========================*/ void ShutdownOS ( StatusType Error ) { /* \req OSEK_SYS_3.26 The system service void * ShutdownOS ( StatusType Error ) shall be defined */ /* achitecture dependent shutdown service */ ShutdownOs_Arch(); #if (HOOK_SHUTDOWNHOOK == OSEK_ENABLE) /* \req OSEK_ERR_1.2 The ShutdownHook hook routine shall be called when a * system shutdown is requested by the application or by the operating * system in case of a severe error */ ShutdownHook(); #endif /* this function shall never return */ while(1); }