[PATCH] score: Remove _Internal_errors_What_happened

Gedare Bloom gedare at rtems.org
Tue Jul 27 19:56:19 UTC 2021


Thanks, this also needs a rtems-docs/c-user/fatal-error update

On Tue, Jul 27, 2021 at 2:13 AM Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> Users have access to the fatal error source and code though the fatal error
> extension.  The user-specific fatal error handling should be done in statically
> initialized fatal error handlers.  The _Internal_errors_What_happened was
> updated after the fatal error extension. In addition, there was no API to get
> the information stored in _Internal_errors_What_happened.  Remove this object
> to save some bytes of storage.
> ---
>  cpukit/include/rtems/score/interr.h | 18 +-----------------
>  cpukit/score/src/interr.c           | 11 +----------
>  testsuites/sptests/spsize/size.c    |  2 --
>  3 files changed, 2 insertions(+), 29 deletions(-)
>
> diff --git a/cpukit/include/rtems/score/interr.h b/cpukit/include/rtems/score/interr.h
> index e5a0a62cf6..65cac29500 100644
> --- a/cpukit/include/rtems/score/interr.h
> +++ b/cpukit/include/rtems/score/interr.h
> @@ -214,21 +214,6 @@ typedef enum {
>
>  typedef CPU_Uint32ptr Internal_errors_t;
>
> -/**
> - *  This type holds the fatal error information.
> - */
> -typedef struct {
> -  /** This is the source of the error. */
> -  Internal_errors_Source  the_source;
> -  /** This is the error code. */
> -  Internal_errors_t       the_error;
> -} Internal_errors_Information;
> -
> -/**
> - *  When a fatal error occurs, the error information is stored here.
> - */
> -extern Internal_errors_Information _Internal_errors_What_happened;
> -
>  /**
>   * @brief Initiates system termination.
>   *
> @@ -253,8 +238,7 @@ extern Internal_errors_Information _Internal_errors_What_happened;
>   * may install an initial extension that performs a system reset.  In this case
>   * the non-initial extensions will be not called.
>   *
> - * Once all fatal handler executed the error information will be stored to
> - * _Internal_errors_What_happened and the system state is set to
> + * Once all fatal handler executed the system state is set to
>   * SYSTEM_STATE_TERMINATED.
>   *
>   * The final step is to call the CPU specific _CPU_Fatal_halt().
> diff --git a/cpukit/score/src/interr.c b/cpukit/score/src/interr.c
> index 3f5ec2c473..fd5a4c92b8 100644
> --- a/cpukit/score/src/interr.c
> +++ b/cpukit/score/src/interr.c
> @@ -4,8 +4,7 @@
>   * @ingroup RTEMSScoreIntErr
>   *
>   * @brief This source file contains the definition of ::_System_state_Current
> - *   and ::_Internal_errors_What_happened and implementation of _Terminate() and
> - *   _Internal_error().
> + *   and the implementation of _Terminate() and _Internal_error().
>   */
>
>  /*
> @@ -28,22 +27,14 @@
>
>  System_state_Codes _System_state_Current;
>
> -Internal_errors_Information _Internal_errors_What_happened;
> -
>  void _Terminate(
>    Internal_errors_Source the_source,
>    Internal_errors_t      the_error
>  )
>  {
>    _User_extensions_Fatal( the_source, the_error );
> -
> -  _Internal_errors_What_happened.the_source = the_source;
> -  _Internal_errors_What_happened.the_error  = the_error;
> -
>    _System_state_Set( SYSTEM_STATE_TERMINATED );
> -
>    _SMP_Request_shutdown();
> -
>    _CPU_Fatal_halt( the_source, the_error );
>
>    /* will not return from this routine */
> diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c
> index d26e34f51d..1b6881bb24 100644
> --- a/testsuites/sptests/spsize/size.c
> +++ b/testsuites/sptests/spsize/size.c
> @@ -272,8 +272,6 @@ uninitialized =
>
>  /*init.h*/      0                                         +
>
> -/*interr.h*/    (sizeof _Internal_errors_What_happened)   +
> -
>  /*intr.h*/      0                                         +
>
>  /*isr.h*/       (sizeof _ISR_Nest_level)                  +
> --
> 2.26.2
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list