RTEMS  5.0.0
Files | Data Structures | Typedefs | Enumerations | Functions | Variables
Internal Error Handler

Files

file  interr.c
 Initiates system termination.
 

Data Structures

struct  Internal_errors_Information
 

Typedefs

typedef CPU_Uint32ptr Internal_errors_t
 

Enumerations

enum  Internal_errors_Source {
  INTERNAL_ERROR_CORE = 0, INTERNAL_ERROR_RTEMS_API = 1, INTERNAL_ERROR_POSIX_API = 2, RTEMS_FATAL_SOURCE_BDBUF = 3,
  RTEMS_FATAL_SOURCE_APPLICATION = 4, RTEMS_FATAL_SOURCE_EXIT = 5, RTEMS_FATAL_SOURCE_BSP = 6, RTEMS_FATAL_SOURCE_ASSERT = 7,
  RTEMS_FATAL_SOURCE_STACK_CHECKER = 8, RTEMS_FATAL_SOURCE_EXCEPTION = 9, RTEMS_FATAL_SOURCE_SMP = 10, RTEMS_FATAL_SOURCE_PANIC = 11,
  RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE = 12, RTEMS_FATAL_SOURCE_LAST = 0xffffffff
}
 This type lists the possible sources from which an error can be reported. More...
 
enum  Internal_errors_Core_list {
  INTERNAL_ERROR_TOO_LITTLE_WORKSPACE = 2, INTERNAL_ERROR_WORKSPACE_ALLOCATION = 3, INTERNAL_ERROR_THREAD_EXITTED = 5, INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION = 6,
  INTERNAL_ERROR_INVALID_NODE = 7, INTERNAL_ERROR_NO_MPCI = 8, INTERNAL_ERROR_BAD_PACKET = 9, INTERNAL_ERROR_OUT_OF_PACKETS = 10,
  INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS = 11, INTERNAL_ERROR_OUT_OF_PROXIES = 12, INTERNAL_ERROR_INVALID_GLOBAL_ID = 13, INTERNAL_ERROR_BAD_STACK_HOOK = 14,
  INTERNAL_ERROR_GXX_KEY_ADD_FAILED = 21, INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED = 22, INTERNAL_ERROR_NO_MEMORY_FOR_HEAP = 23, INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR = 24,
  INTERNAL_ERROR_RESOURCE_IN_USE = 25, INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL = 26, INTERNAL_ERROR_THREAD_QUEUE_DEADLOCK = 28, INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_STICKY_FROM_BAD_STATE = 29,
  INTERNAL_ERROR_BAD_THREAD_DISPATCH_DISABLE_LEVEL = 30, INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT = 31, INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED = 32, INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED = 33,
  INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED = 34, INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED = 36, INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED = 37, INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT = 38,
  INTERNAL_ERROR_ARC4RANDOM_GETENTROPY_FAIL = 39, INTERNAL_ERROR_NO_MEMORY_FOR_PER_CPU_DATA = 40
}
 A list of errors which are generated internally by the executive core. More...
 

Functions

void _Terminate (Internal_errors_Source the_source, Internal_errors_t the_error) RTEMS_NO_RETURN
 Initiates system termination. More...
 
void _Internal_error (Internal_errors_Core_list core_error) RTEMS_NO_RETURN
 Terminates the system with an INTERNAL_ERROR_CORE fatal source and the specified core error code. More...
 

Variables

Internal_errors_Information _Internal_errors_What_happened
 

Detailed Description

This handler encapsulates functionality which provides the foundation Semaphore services used in all of the APIs supported by RTEMS.

Enumeration Type Documentation

◆ Internal_errors_Core_list

A list of errors which are generated internally by the executive core.

Do not re-use numbers of obsolete error codes. Uncomment no longer used error codes.

◆ Internal_errors_Source

This type lists the possible sources from which an error can be reported.

Enumerator
INTERNAL_ERROR_CORE 

Errors of the core system.

See also
Internal_errors_Core_list.
INTERNAL_ERROR_RTEMS_API 

Errors of the RTEMS API.

INTERNAL_ERROR_POSIX_API 

Errors of the POSIX API.

RTEMS_FATAL_SOURCE_BDBUF 

Fatal source for the block device cache.

See also
rtems_bdbuf_fatal_code.
RTEMS_FATAL_SOURCE_APPLICATION 

Fatal source for application specific errors.

The fatal code is application specific.

RTEMS_FATAL_SOURCE_EXIT 

Fatal source of exit().

The fatal code is the exit() status code.

RTEMS_FATAL_SOURCE_BSP 

Fatal source for BSP errors.

The fatal codes are defined in <bsp/fatal.h>. Examples are interrupt and exception initialization.

See also
bsp_fatal_code and bsp_fatal().
RTEMS_FATAL_SOURCE_ASSERT 

Fatal source of assert().

The fatal code is the pointer value of the assert context.

See also
rtems_assert_context.
RTEMS_FATAL_SOURCE_STACK_CHECKER 

Fatal source of the stack checker.

The fatal code is the object name of the executing task.

RTEMS_FATAL_SOURCE_EXCEPTION 

Fatal source of the exceptions.

The fatal code is the pointer value of the exception frame pointer.

See also
rtems_exception_frame and rtems_exception_frame_print().
RTEMS_FATAL_SOURCE_SMP 

Fatal source of SMP domain.

See also
SMP_Fatal_code.
RTEMS_FATAL_SOURCE_PANIC 

Fatal source of rtems_panic().

See also
rtem
RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE 

Fatal source for invalid C program heap frees via free().

The fatal code is the bad pointer.

RTEMS_FATAL_SOURCE_LAST 

The last available fatal source.

This enum value ensures that the enum type needs at least 32-bits for architectures with short enums.

Function Documentation

◆ _Internal_error()

void _Internal_error ( Internal_errors_Core_list  core_error)

Terminates the system with an INTERNAL_ERROR_CORE fatal source and the specified core error code.

Parameters
[in]core_errorThe core error code.
See also
_Terminate().

◆ _Terminate()

void _Terminate ( Internal_errors_Source  the_source,
Internal_errors_t  the_error 
)

Initiates system termination.

This routine is invoked when the application or the executive itself determines that a fatal error has occurred or a final system state is reached (for example after exit()).

The first action of this function is to call the fatal handler of the user extensions. For the initial extensions the following conditions are required

  • a valid stack pointer and enough stack space,
  • a valid code memory, and
  • valid read-only data.

For the initial extensions the read-write data (including BSS segment) is not required on single processor configurations. On SMP configurations however the read-write data must be initialized since this function must determine the state of the other processors and request them to shut-down if necessary.

Non-initial extensions require in addition valid read-write data. The BSP 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 SYSTEM_STATE_TERMINATED.

The final step is to call the CPU specific _CPU_Fatal_halt().

Parameters
[in]the_sourceThe fatal source indicating the subsystem the fatal condition originated in.
[in]the_errorThe fatal error code. This value must be interpreted with respect to the source.
See also
rtems_fatal() and _Internal_error().

Variable Documentation

◆ _Internal_errors_What_happened

Internal_errors_Information _Internal_errors_What_happened

When a fatal error occurs, the error information is stored here.