summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi/src/interrtext.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-07 09:53:47 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-12 09:18:00 +0100
commitbab16de2671cc5b35e3df9b343e8645b632e3b1d (patch)
treef397b31d5a5c2f87e5c3aee69f6cfb39738f7ac2 /cpukit/sapi/src/interrtext.c
parentsparc: Save/restore only non-volatile context (diff)
downloadrtems-bab16de2671cc5b35e3df9b343e8645b632e3b1d.tar.bz2
score: Change debug helper functions
Rename rtems_internal_error_description() to rtems_internal_error_text(). Rename rtems_fatal_source_description() to rtems_fatal_source_text(). Rename rtems_status_code_description() to rtems_status_text(). Remove previous implementation of rtems_status_text().
Diffstat (limited to 'cpukit/sapi/src/interrtext.c')
-rw-r--r--cpukit/sapi/src/interrtext.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/cpukit/sapi/src/interrtext.c b/cpukit/sapi/src/interrtext.c
new file mode 100644
index 0000000000..a66add5d70
--- /dev/null
+++ b/cpukit/sapi/src/interrtext.c
@@ -0,0 +1,67 @@
+/**
+ * @file
+ *
+ * @brief Returns a text for an internal error code.
+ *
+ * @ingroup ClassicFatal
+ */
+
+/*
+ * Copyright (c) 2012-2014 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include <rtems/fatal.h>
+
+static const char *const internal_error_text[] = {
+ "INTERNAL_ERROR_NO_CONFIGURATION_TABLE",
+ "INTERNAL_ERROR_NO_CPU_TABLE",
+ "INTERNAL_ERROR_TOO_LITTLE_WORKSPACE",
+ "INTERNAL_ERROR_WORKSPACE_ALLOCATION",
+ "INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL",
+ "INTERNAL_ERROR_THREAD_EXITTED",
+ "INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION",
+ "INTERNAL_ERROR_INVALID_NODE",
+ "INTERNAL_ERROR_NO_MPCI",
+ "INTERNAL_ERROR_BAD_PACKET",
+ "INTERNAL_ERROR_OUT_OF_PACKETS",
+ "INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS",
+ "INTERNAL_ERROR_OUT_OF_PROXIES",
+ "INTERNAL_ERROR_INVALID_GLOBAL_ID",
+ "INTERNAL_ERROR_BAD_STACK_HOOK",
+ "INTERNAL_ERROR_BAD_ATTRIBUTES",
+ "INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY",
+ "INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL",
+ "INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE",
+ "INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0",
+ "INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP",
+ "INTERNAL_ERROR_GXX_KEY_ADD_FAILED",
+ "INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED",
+ "INTERNAL_ERROR_NO_MEMORY_FOR_HEAP",
+ "INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR"
+};
+
+const char *rtems_internal_error_text( rtems_fatal_code error )
+{
+ size_t i = error;
+ const char *text = "?";
+
+ if ( i < RTEMS_ARRAY_SIZE( internal_error_text ) ) {
+ text = internal_error_text[ i ];
+ }
+
+ return text;
+}