source: rtems/cpukit/sapi/src/interrtext.c @ b308f23

5
Last change on this file since b308f23 was a6524b9, checked in by Sebastian Huber <sebastian.huber@…>, on 03/22/15 at 13:31:59

score: Simplify debug code and use _Assert()

  • 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  "OBSOLETE_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.