source: rtems/cpukit/include/rtems/score/interr.h

Last change on this file was 64fbeaa, checked in by Sebastian Huber <sebastian.huber@…>, on 10/06/22 at 06:47:14

score: INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALL

Ensure that the IDLE storage allocator did allocate a suffiently large area.

Update #3835.
Update #4524.

  • Property mode set to 100644
File size: 8.9 KB
RevLine 
[7ebce359]1/* SPDX-License-Identifier: BSD-2-Clause */
2
[20f02c6]3/**
[5ad74fd6]4 * @file
[3a4ae6c]5 *
[5ad74fd6]6 * @ingroup RTEMSScoreIntErr
[319cb20]7 *
[9278f3d]8 * @brief This header file provides the interfaces of the
9 *   @ref RTEMSScoreIntErr.
[baff4da]10 */
11
12/*
[4b72da4]13 *  COPYRIGHT (c) 1989-2009.
[3a4ae6c]14 *  On-Line Applications Research Corporation (OAR).
15 *
[7ebce359]16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 *    notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 *    notice, this list of conditions and the following disclaimer in the
23 *    documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
[3a4ae6c]36 */
37
[092f142a]38#ifndef _RTEMS_SCORE_INTERR_H
39#define _RTEMS_SCORE_INTERR_H
[3a4ae6c]40
[3fe2155]41#include <rtems/score/cpu.h>
[25e02d5]42
[baff4da]43/**
[5ad74fd6]44 * @defgroup RTEMSScoreIntErr Internal Error Handler
45 *
46 * @ingroup RTEMSScore
47 *
[c81ac0e]48 * @brief This group contains the Internal Error Handler implementation.
[baff4da]49 *
[c81ac0e]50 * This handler encapsulates functionality to terminate the system.
[d8cd045c]51 *
[5ad74fd6]52 * @{
[baff4da]53 */
54
[3a4ae6c]55#ifdef __cplusplus
56extern "C" {
57#endif
58
[baff4da]59/**
[156e91e]60 *  @brief This type lists the possible sources from which an error
[3a4ae6c]61 *  can be reported.
62 */
63typedef enum {
[51acbdc]64  /**
65   * @brief Errors of the core system.
66   *
67   * @see Internal_errors_Core_list.
68   */
[f6edd880]69  INTERNAL_ERROR_CORE = 0,
[51acbdc]70
71  /**
72   * @brief Errors of the RTEMS API.
73   */
[f6edd880]74  INTERNAL_ERROR_RTEMS_API = 1,
[51acbdc]75
76  /**
77   * @brief Errors of the POSIX API.
78   */
[f6edd880]79  INTERNAL_ERROR_POSIX_API = 2,
[156e91e]80
[608940f]81  /**
82   * @brief Fatal source for the block device cache.
83   *
84   * @see rtems_bdbuf_fatal_code.
85   */
[f6edd880]86  RTEMS_FATAL_SOURCE_BDBUF = 3,
[608940f]87
[038e2f4a]88  /**
89   * @brief Fatal source for application specific errors.
90   *
91   * The fatal code is application specific.
92   */
[f6edd880]93  RTEMS_FATAL_SOURCE_APPLICATION = 4,
[038e2f4a]94
[a052181]95  /**
96   * @brief Fatal source of exit().
97   *
98   * The fatal code is the exit() status code.
99   */
[f6edd880]100  RTEMS_FATAL_SOURCE_EXIT = 5,
[a052181]101
[9d10cf90]102  /**
[33cb8bf]103   * @brief Fatal source for BSP errors.
[9d10cf90]104   *
[33cb8bf]105   * The fatal codes are defined in <bsp/fatal.h>.  Examples are interrupt and
106   * exception initialization.
[9d10cf90]107   *
[33cb8bf]108   * @see bsp_fatal_code and bsp_fatal().
[9d10cf90]109   */
[f6edd880]110  RTEMS_FATAL_SOURCE_BSP = 6,
[b9bc399]111
[a0c7aa55]112  /**
113   * @brief Fatal source of assert().
114   *
[68f36d14]115   * The fatal code is the pointer value of the assert context.
116   *
117   * @see rtems_assert_context.
[a0c7aa55]118   */
[f6edd880]119  RTEMS_FATAL_SOURCE_ASSERT = 7,
[a0c7aa55]120
[a12f7e9]121  /**
122   * @brief Fatal source of the stack checker.
123   *
124   * The fatal code is the object name of the executing task.
125   */
[f6edd880]126  RTEMS_FATAL_SOURCE_STACK_CHECKER = 8,
[a12f7e9]127
[7e32b62]128  /**
[815994f]129   * @brief Fatal source of the exceptions.
[7e32b62]130   *
131   * The fatal code is the pointer value of the exception frame pointer.
132   *
[815994f]133   * @see rtems_exception_frame and rtems_exception_frame_print().
[7e32b62]134   */
[f6edd880]135  RTEMS_FATAL_SOURCE_EXCEPTION = 9,
[7e32b62]136
[9eec2f3]137  /**
138   * @brief Fatal source of SMP domain.
139   *
140   * @see SMP_Fatal_code.
141   */
[f6edd880]142  RTEMS_FATAL_SOURCE_SMP = 10,
[9eec2f3]143
[15e19273]144  /**
145   * @brief Fatal source of rtems_panic().
146   *
147   * @see rtem
148   */
149  RTEMS_FATAL_SOURCE_PANIC = 11,
150
[de9b7d7]151  /**
152   * @brief Fatal source for invalid C program heap frees via free().
153   *
154   * The fatal code is the bad pointer.
155   */
156  RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE = 12,
157
[3859cd63]158  /**
159   * @brief Fatal source for heap errors.
160   *
161   * The fatal code is the address to a heap error context (Heap_Error_context).
162   */
163  RTEMS_FATAL_SOURCE_HEAP = 13,
164
[4969af4]165  /**
166   * @brief Fatal source for spurious interrupts.
167   *
168   * The fatal code is the interrupt vector number of the spurious interrupt.
169   */
170  RTEMS_FATAL_SOURCE_SPURIOUS_INTERRUPT = 14,
171
[156e91e]172  /**
173   * @brief The last available fatal source.
174   *
175   * This enum value ensures that the enum type needs at least 32-bits for
176   * architectures with short enums.
177   */
[c226990]178  RTEMS_FATAL_SOURCE_LAST = 0x7fffffff
[3a4ae6c]179} Internal_errors_Source;
180
[6a07436]181/**
[bee0323]182 * @brief A list of errors which are generated internally by the executive
183 * core.
184 *
[c4d89de]185 * Do not re-use numbers of obsolete error codes.  Comment no longer used
186 * error codes and do not uncomment commented or obsolete error codes.
[3a4ae6c]187 */
188typedef enum {
[bee0323]189  /* INTERNAL_ERROR_NO_CONFIGURATION_TABLE = 0, */
190  /* INTERNAL_ERROR_NO_CPU_TABLE = 1, */
191  INTERNAL_ERROR_TOO_LITTLE_WORKSPACE = 2,
[78211376]192  /* INTERNAL_ERROR_WORKSPACE_ALLOCATION = 3, */
[56e61e24]193  /* INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL = 4, */
[bee0323]194  INTERNAL_ERROR_THREAD_EXITTED = 5,
195  INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION = 6,
196  INTERNAL_ERROR_INVALID_NODE = 7,
197  INTERNAL_ERROR_NO_MPCI = 8,
198  INTERNAL_ERROR_BAD_PACKET = 9,
199  INTERNAL_ERROR_OUT_OF_PACKETS = 10,
200  INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS = 11,
201  INTERNAL_ERROR_OUT_OF_PROXIES = 12,
202  INTERNAL_ERROR_INVALID_GLOBAL_ID = 13,
[c5af8aa0]203  /* INTERNAL_ERROR_BAD_STACK_HOOK = 14, */
[bee0323]204  /* INTERNAL_ERROR_BAD_ATTRIBUTES = 15, */
205  /* INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY = 16, */
206  /* INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL = 17, */
207  /* INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_FROM_BAD_STATE = 18, */
[21275b58]208  /* INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 = 19, */
[bee0323]209  /* INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP = 20, */
[2145e0c7]210  /* INTERNAL_ERROR_GXX_KEY_ADD_FAILED = 21, */
211  /* INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED = 22, */
[bee0323]212  INTERNAL_ERROR_NO_MEMORY_FOR_HEAP = 23,
213  INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR = 24,
214  INTERNAL_ERROR_RESOURCE_IN_USE = 25,
[bc175a1]215  /* INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL = 26, */
[cd3e220]216  /* INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL = 27, */
[bee0323]217  INTERNAL_ERROR_THREAD_QUEUE_DEADLOCK = 28,
218  INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_STICKY_FROM_BAD_STATE = 29,
219  INTERNAL_ERROR_BAD_THREAD_DISPATCH_DISABLE_LEVEL = 30,
[279d5260]220  INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT = 31,
[0a81a58]221  INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED = 32,
[82529688]222  INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED = 33,
[ba74ebde]223  /* INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED = 34, */
[bc5b56a]224  /* INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED = 35, */
[e203b65e]225  INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED = 36,
[600d88d]226  INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED = 37,
[ddc339c]227  INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT = 38,
[7c19e50]228  INTERNAL_ERROR_ARC4RANDOM_GETENTROPY_FAIL = 39,
[c312f31]229  INTERNAL_ERROR_NO_MEMORY_FOR_PER_CPU_DATA = 40,
[657e30c1]230  INTERNAL_ERROR_TOO_LARGE_TLS_SIZE = 41,
231  INTERNAL_ERROR_RTEMS_INIT_TASK_CONSTRUCT_FAILED = 42,
[45ee958]232  INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED = 43,
[64fbeaa]233  INTERNAL_ERROR_NO_MEMORY_FOR_IDLE_TASK_STORAGE = 44,
234  INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALL = 45
[3a4ae6c]235} Internal_errors_Core_list;
236
[46d3c6d8]237typedef CPU_Uint32ptr Internal_errors_t;
[25e02d5]238
[4b72da4]239/**
[1906a36]240 * @brief Initiates system termination.
[3a4ae6c]241 *
[891d0d96]242 * This routine is invoked when the application or the executive itself
[1906a36]243 * determines that a fatal error has occurred or a final system state is
244 * reached (for example after exit()).
[891d0d96]245 *
[008efaf]246 * The first action of this function is to call the fatal handler of the user
[1906a36]247 * extensions.  For the initial extensions the following conditions are
248 * required
249 * - a valid stack pointer and enough stack space,
250 * - a valid code memory, and
251 * - valid read-only data.
[f8ac52f2]252 *
[1906a36]253 * For the initial extensions the read-write data (including BSS segment) is
[8a6de83]254 * not required on single processor configurations.  On SMP configurations
255 * however the read-write data must be initialized since this function must
256 * determine the state of the other processors and request them to shut-down if
257 * necessary.
[1906a36]258 *
259 * Non-initial extensions require in addition valid read-write data.  The BSP
260 * may install an initial extension that performs a system reset.  In this case
261 * the non-initial extensions will be not called.
262 *
[bf338f04]263 * Once all fatal handler executed the system state is set to
[92f50c3]264 * SYSTEM_STATE_TERMINATED.
[1906a36]265 *
266 * The final step is to call the CPU specific _CPU_Fatal_halt().
267 *
[5ad74fd6]268 * @param the_source The fatal source indicating the subsystem the fatal
[f8ac52f2]269 * condition originated in.
[5ad74fd6]270 * @param the_error The fatal error code.  This value must be interpreted
[f8ac52f2]271 * with respect to the source.
[bf54252]272 *
[b6606e8]273 * @see rtems_fatal() and _Internal_error().
[3a4ae6c]274 */
[d7a48e1]275RTEMS_NO_RETURN void _Terminate(
[3a4ae6c]276  Internal_errors_Source  the_source,
[25e02d5]277  Internal_errors_t       the_error
[d7a48e1]278);
[3a4ae6c]279
[3a659b04]280/**
281 * @brief Terminates the system with an INTERNAL_ERROR_CORE fatal source and
282 * the specified core error code.
283 *
[5ad74fd6]284 * @param core_error The core error code.
[3a659b04]285 *
286 * @see _Terminate().
287 */
[d7a48e1]288RTEMS_NO_RETURN void _Internal_error( Internal_errors_Core_list core_error );
[3a659b04]289
[3a4ae6c]290#ifdef __cplusplus
291}
292#endif
293
[5ad74fd6]294/** @} */
[baff4da]295
[3a4ae6c]296#endif
[b10825c]297/* end of include file */
Note: See TracBrowser for help on using the repository browser.