source: rtems/cpukit/sapi/src/interrtext.c @ 6e93c836

4.115
Last change on this file since 6e93c836 was 3f5f2ce, checked in by Sebastian Huber <sebastian.huber@…>, on 03/28/14 at 12:44:18

score: PR788: Add INTERNAL_ERROR_RESOURCE_IN_USE

Issue a fatal error in case a thread is deleted which still owns
resources (e.g. a binary semaphore with priority inheritance or ceiling
protocol). The resource count must be checked quite late since RTEMS
task variable destructors, POSIX key destructors, POSIX cleanup handler,
the Newlib thread termination extension or other thread termination
extensions may release resources. In this context it would be quite
difficult to return an error status to the caller.

An alternative would be to place threads with a non-zero resource count
not on the zombie chain. Thus we have a resource leak instead of a
fatal error. The terminator thread can see this error if we return an
RTEMS_RESOURCE_IN_USE status for the rtems_task_delete() for example.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 * @file
3 *
4 * @brief Returns a text for an internal error code.
5 *
6 * @ingroup ClassicFatal
7 */
8
9/*
10 * Copyright (c) 2012-2014 embedded brains GmbH.  All rights reserved.
11 *
12 *  embedded brains GmbH
13 *  Dornierstr. 4
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.org/license/LICENSE.
21 */
22
23#if HAVE_CONFIG_H
24  #include "config.h"
25#endif
26
27#include <rtems/fatal.h>
28
29static const char *const internal_error_text[] = {
30  "INTERNAL_ERROR_NO_CONFIGURATION_TABLE",
31  "INTERNAL_ERROR_NO_CPU_TABLE",
32  "INTERNAL_ERROR_TOO_LITTLE_WORKSPACE",
33  "INTERNAL_ERROR_WORKSPACE_ALLOCATION",
34  "INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL",
35  "INTERNAL_ERROR_THREAD_EXITTED",
36  "INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION",
37  "INTERNAL_ERROR_INVALID_NODE",
38  "INTERNAL_ERROR_NO_MPCI",
39  "INTERNAL_ERROR_BAD_PACKET",
40  "INTERNAL_ERROR_OUT_OF_PACKETS",
41  "INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS",
42  "INTERNAL_ERROR_OUT_OF_PROXIES",
43  "INTERNAL_ERROR_INVALID_GLOBAL_ID",
44  "INTERNAL_ERROR_BAD_STACK_HOOK",
45  "INTERNAL_ERROR_BAD_ATTRIBUTES",
46  "INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY",
47  "INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL",
48  "INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE",
49  "INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0",
50  "OBSOLETE_INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP",
51  "INTERNAL_ERROR_GXX_KEY_ADD_FAILED",
52  "INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED",
53  "INTERNAL_ERROR_NO_MEMORY_FOR_HEAP",
54  "INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR",
55  "INTERNAL_ERROR_RESOURCE_IN_USE"
56};
57
58const char *rtems_internal_error_text( rtems_fatal_code error )
59{
60  size_t i = error;
61  const char *text = "?";
62
63  if ( i < RTEMS_ARRAY_SIZE( internal_error_text ) ) {
64    text = internal_error_text[ i ];
65  }
66
67  return text;
68}
Note: See TracBrowser for help on using the repository browser.