RTEMS | Remove essentially dead code from _Terminate() (#5067)
Sebastian Huber (@sebhub)
gitlab at rtems.org
Mon Jul 15 14:00:32 UTC 2024
Sebastian Huber created an issue: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5067
Assignee: Sebastian Huber
## Summary
The system termination procedure is implemented like this:
```c
void _Terminate(
Internal_errors_Source the_source,
Internal_errors_t the_error
)
{
_User_extensions_Fatal( the_source, the_error );
_System_state_Set( SYSTEM_STATE_TERMINATED );
_SMP_Request_shutdown();
_CPU_Fatal_halt( the_source, the_error );
}
```
However, the `_User_extensions_Fatal()` should not return for properly configured applications. The `_Terminate()` implementation should be simplified to ease testing and code coverage.
```c
void _Terminate(
Internal_errors_Source the_source,
Internal_errors_t the_error
)
{
_User_extensions_Fatal( the_source, the_error );
/*
* Everything after invoking the fatal extensions is essentially dead code.
* At least one fatal extension of the initial extension sets should not
* return and for example reset the system. See section "System Termination
* Procedure" in the RTEMS Classic API Guide.
*
* The following code is only executed in badly applications.
*/
_CPU_Thread_Idle_body( 0 );
}
```
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5067
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240715/64197470/attachment-0001.htm>
More information about the bugs
mailing list