summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi/src/fatalsrctext.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/fatalsrctext.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/fatalsrctext.c')
-rw-r--r--cpukit/sapi/src/fatalsrctext.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/cpukit/sapi/src/fatalsrctext.c b/cpukit/sapi/src/fatalsrctext.c
new file mode 100644
index 0000000000..902a269b59
--- /dev/null
+++ b/cpukit/sapi/src/fatalsrctext.c
@@ -0,0 +1,53 @@
+/**
+ * @file
+ *
+ * @brief Implementation of rtems_fatal_source_text()
+ *
+ * @ingroup ClassicFatal
+ */
+
+/*
+ * Copyright (c) 2013-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 fatal_source_text[] = {
+ "INTERNAL_ERROR_CORE",
+ "INTERNAL_ERROR_RTEMS_API",
+ "INTERNAL_ERROR_POSIX_API",
+ "RTEMS_FATAL_SOURCE_BDBUF",
+ "RTEMS_FATAL_SOURCE_APPLICATION",
+ "RTEMS_FATAL_SOURCE_EXIT",
+ "RTEMS_FATAL_SOURCE_BSP_GENERIC",
+ "RTEMS_FATAL_SOURCE_BSP_SPECIFIC",
+ "RTEMS_FATAL_SOURCE_ASSERT",
+ "RTEMS_FATAL_SOURCE_STACK_CHECKER",
+ "RTEMS_FATAL_SOURCE_EXCEPTION"
+};
+
+const char *rtems_fatal_source_text( rtems_fatal_source source )
+{
+ size_t i = source;
+ const char *text = "?";
+
+ if ( i < RTEMS_ARRAY_SIZE( fatal_source_text ) ) {
+ text = fatal_source_text[ i ];
+ }
+
+ return text;
+}