summaryrefslogtreecommitdiffstats
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
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().
-rw-r--r--c/src/lib/libbsp/powerpc/shared/startup/panic.c2
-rw-r--r--cpukit/libcsupport/include/rtems/error.h2
-rw-r--r--cpukit/libcsupport/src/error.c42
-rw-r--r--cpukit/rtems/Makefile.am2
-rw-r--r--cpukit/rtems/include/rtems/rtems/status.h10
-rw-r--r--cpukit/rtems/src/statustext.c (renamed from cpukit/rtems/src/statusdesc.c)12
-rw-r--r--cpukit/sapi/Makefile.am4
-rw-r--r--cpukit/sapi/include/rtems/fatal.h20
-rw-r--r--cpukit/sapi/src/fatalsrctext.c (renamed from cpukit/sapi/src/fatalsrcdesc.c)18
-rw-r--r--cpukit/sapi/src/interrtext.c (renamed from cpukit/sapi/src/interrdesc.c)18
-rw-r--r--doc/ada_user/example.texi2
-rw-r--r--doc/user/Makefile.am2
-rw-r--r--doc/user/dirstat.t13
-rw-r--r--doc/user/example.texi2
-rw-r--r--doc/user/fatal.t22
-rw-r--r--testsuites/psxtests/psxfatal_support/init.c4
-rw-r--r--testsuites/sptests/spfatal_support/init.c4
-rw-r--r--testsuites/sptests/spinternalerror02/init.c48
18 files changed, 95 insertions, 132 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/panic.c b/c/src/lib/libbsp/powerpc/shared/startup/panic.c
index 4553f77119..f832054220 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/panic.c
+++ b/c/src/lib/libbsp/powerpc/shared/startup/panic.c
@@ -39,7 +39,7 @@ void _BSP_Fatal_error(unsigned int v)
switch (THESRC) {
case INTERNAL_ERROR_CORE:
printk(" RTEMS Core\n");
- err = rtems_internal_error_description(THEERR);
+ err = rtems_internal_error_text(THEERR);
break;
case INTERNAL_ERROR_RTEMS_API:
diff --git a/cpukit/libcsupport/include/rtems/error.h b/cpukit/libcsupport/include/rtems/error.h
index 95567631c0..cbcfa98614 100644
--- a/cpukit/libcsupport/include/rtems/error.h
+++ b/cpukit/libcsupport/include/rtems/error.h
@@ -84,8 +84,6 @@ typedef Internal_errors_t rtems_error_code_t;
#define RTEMS_ERROR_MASK \
(RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | RTEMS_ERROR_PANIC) /* all */
-const char *rtems_status_text(rtems_status_code sc);
-
/**
* @brief Report an Error
*
diff --git a/cpukit/libcsupport/src/error.c b/cpukit/libcsupport/src/error.c
index 0e63fa4022..81ddae251a 100644
--- a/cpukit/libcsupport/src/error.c
+++ b/cpukit/libcsupport/src/error.c
@@ -24,48 +24,6 @@
int rtems_panic_in_progress;
-const rtems_assoc_t rtems_status_assoc[] = {
- { "successful completion", RTEMS_SUCCESSFUL, 0 },
- { "returned from a thread", RTEMS_TASK_EXITTED, 0 },
- { "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, 0 },
- { "invalid object name", RTEMS_INVALID_NAME, 0 },
- { "invalid object id", RTEMS_INVALID_ID, 0 },
- { "too many", RTEMS_TOO_MANY, 0 },
- { "timed out waiting", RTEMS_TIMEOUT, 0 },
- { "object deleted while waiting", RTEMS_OBJECT_WAS_DELETED, 0 },
- { "specified size was invalid", RTEMS_INVALID_SIZE, 0 },
- { "address specified is invalid", RTEMS_INVALID_ADDRESS, 0 },
- { "number was invalid", RTEMS_INVALID_NUMBER, 0 },
- { "item has not been initialized", RTEMS_NOT_DEFINED, 0 },
- { "resources still outstanding", RTEMS_RESOURCE_IN_USE, 0 },
- { "request not satisfied", RTEMS_UNSATISFIED, 0 },
- { "thread is in wrong state", RTEMS_INCORRECT_STATE, 0 },
- { "thread already in state", RTEMS_ALREADY_SUSPENDED, 0 },
- { "illegal on calling thread", RTEMS_ILLEGAL_ON_SELF, 0 },
- { "illegal for remote object", RTEMS_ILLEGAL_ON_REMOTE_OBJECT, 0 },
- { "called from wrong environment", RTEMS_CALLED_FROM_ISR, 0 },
- { "invalid thread priority", RTEMS_INVALID_PRIORITY, 0 },
- { "invalid date/time", RTEMS_INVALID_CLOCK, 0 },
- { "invalid node id", RTEMS_INVALID_NODE, 0 },
- { "directive not configured", RTEMS_NOT_CONFIGURED, 0 },
- { "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , 0 },
- { "directive not implemented", RTEMS_NOT_IMPLEMENTED, 0 },
- { "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, 0 },
- { "could not get enough memory", RTEMS_NO_MEMORY, 0 },
- { "driver IO error", RTEMS_IO_ERROR, 0 },
- { "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, 0 },
- { 0, 0, 0 },
-};
-
-
-const char *rtems_status_text(
- rtems_status_code status
-)
-{
- return rtems_assoc_name_by_local(rtems_status_assoc, status);
-}
-
-
int rtems_verror(
rtems_error_code_t error_flag,
const char *printf_format,
diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am
index f219db8d7b..6688317061 100644
--- a/cpukit/rtems/Makefile.am
+++ b/cpukit/rtems/Makefile.am
@@ -255,7 +255,7 @@ librtems_a_SOURCES += src/workspacegreedy.c
librtems_a_SOURCES += src/modes.c
librtems_a_SOURCES += src/status.c
-librtems_a_SOURCES += src/statusdesc.c
+librtems_a_SOURCES += src/statustext.c
if HAS_MP
# We only build multiprocessing related files if HAS_MP was defined
diff --git a/cpukit/rtems/include/rtems/rtems/status.h b/cpukit/rtems/include/rtems/rtems/status.h
index 19df500497..f82b1f477c 100644
--- a/cpukit/rtems/include/rtems/rtems/status.h
+++ b/cpukit/rtems/include/rtems/rtems/status.h
@@ -242,14 +242,16 @@ RTEMS_INLINE_ROUTINE bool rtems_are_statuses_equal(
int rtems_status_code_to_errno(rtems_status_code sc);
/**
- * @brief Returns a description for a status code.
+ * @brief Returns a text for a status code.
+ *
+ * The text for each status code is the enumerator constant.
*
* @param[in] code The status code.
*
- * @retval description The status code description.
- * @retval ? The passed status code is invalid.
+ * @retval text The status code text.
+ * @retval "?" The passed status code is invalid.
*/
-const char *rtems_status_code_description( rtems_status_code code );
+const char *rtems_status_text( rtems_status_code code );
/**@}*/
diff --git a/cpukit/rtems/src/statusdesc.c b/cpukit/rtems/src/statustext.c
index 4cc426d0a9..bdb91bbb5c 100644
--- a/cpukit/rtems/src/statusdesc.c
+++ b/cpukit/rtems/src/statustext.c
@@ -24,7 +24,7 @@
#include <rtems.h>
-static const char *const status_code_desc[] = {
+static const char *const status_code_text[] = {
"RTEMS_SUCCESSFUL",
"RTEMS_TASK_EXITTED",
"RTEMS_MP_NOT_CONFIGURED",
@@ -56,14 +56,14 @@ static const char *const status_code_desc[] = {
"RTEMS_PROXY_BLOCKING"
};
-const char *rtems_status_code_description( rtems_status_code code )
+const char *rtems_status_text( rtems_status_code code )
{
size_t i = code;
- const char *desc = "?";
+ const char *text = "?";
- if ( i < RTEMS_ARRAY_SIZE( status_code_desc ) ) {
- desc = status_code_desc [i];
+ if ( i < RTEMS_ARRAY_SIZE( status_code_text ) ) {
+ text = status_code_text [i];
}
- return desc;
+ return text;
}
diff --git a/cpukit/sapi/Makefile.am b/cpukit/sapi/Makefile.am
index 2a88aa3242..65acfc7a01 100644
--- a/cpukit/sapi/Makefile.am
+++ b/cpukit/sapi/Makefile.am
@@ -29,8 +29,8 @@ libsapi_a_SOURCES = src/debug.c src/extension.c src/extensioncreate.c \
src/iounregisterdriver.c src/iowrite.c src/posixapi.c \
src/rtemsapi.c src/extensiondata.c src/getversionstring.c \
src/chainappendnotify.c src/chaingetnotify.c src/chaingetwait.c \
- src/chainprependnotify.c src/rbheap.c src/interrdesc.c \
- src/fatal2.c src/fatalsrcdesc.c
+ src/chainprependnotify.c src/rbheap.c src/interrtext.c \
+ src/fatal2.c src/fatalsrctext.c
libsapi_a_SOURCES += src/chainsmp.c
libsapi_a_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/cpukit/sapi/include/rtems/fatal.h b/cpukit/sapi/include/rtems/fatal.h
index 47bf74f279..1230182f2e 100644
--- a/cpukit/sapi/include/rtems/fatal.h
+++ b/cpukit/sapi/include/rtems/fatal.h
@@ -86,24 +86,28 @@ void rtems_fatal(
) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
/**
- * @brief Returns a description for a fatal source.
+ * @brief Returns a text for a fatal source.
+ *
+ * The text for each fatal source is the enumerator constant.
*
* @param[in] source is the fatal source.
*
- * @retval description The fatal source description.
- * @retval ? The passed fatal source is invalid.
+ * @retval text The fatal source text.
+ * @retval "?" The passed fatal source is invalid.
*/
-const char *rtems_fatal_source_description( rtems_fatal_source source );
+const char *rtems_fatal_source_text( rtems_fatal_source source );
/**
- * @brief Returns a description for an internal error code.
+ * @brief Returns a text for an internal error code.
+ *
+ * The text for each internal error code is the enumerator constant.
*
* @param[in] error is the error code.
*
- * @retval description The error code description.
- * @retval ? The passed error code is invalid.
+ * @retval text The error code text.
+ * @retval "?" The passed error code is invalid.
*/
-const char *rtems_internal_error_description( rtems_fatal_code error );
+const char *rtems_internal_error_text( rtems_fatal_code error );
/** @} */
diff --git a/cpukit/sapi/src/fatalsrcdesc.c b/cpukit/sapi/src/fatalsrctext.c
index fbe8485853..902a269b59 100644
--- a/cpukit/sapi/src/fatalsrcdesc.c
+++ b/cpukit/sapi/src/fatalsrctext.c
@@ -1,16 +1,16 @@
/**
* @file
*
- * @brief Implementation of rtems_fatal_source_description()
+ * @brief Implementation of rtems_fatal_source_text()
*
* @ingroup ClassicFatal
*/
/*
- * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2013-2014 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
@@ -26,7 +26,7 @@
#include <rtems/fatal.h>
-static const char *const fatal_source_desc [] = {
+static const char *const fatal_source_text[] = {
"INTERNAL_ERROR_CORE",
"INTERNAL_ERROR_RTEMS_API",
"INTERNAL_ERROR_POSIX_API",
@@ -40,14 +40,14 @@ static const char *const fatal_source_desc [] = {
"RTEMS_FATAL_SOURCE_EXCEPTION"
};
-const char *rtems_fatal_source_description( rtems_fatal_source source )
+const char *rtems_fatal_source_text( rtems_fatal_source source )
{
size_t i = source;
- const char *desc = "?";
+ const char *text = "?";
- if ( i < RTEMS_ARRAY_SIZE( fatal_source_desc ) ) {
- desc = fatal_source_desc [i];
+ if ( i < RTEMS_ARRAY_SIZE( fatal_source_text ) ) {
+ text = fatal_source_text[ i ];
}
- return desc;
+ return text;
}
diff --git a/cpukit/sapi/src/interrdesc.c b/cpukit/sapi/src/interrtext.c
index 5301475657..a66add5d70 100644
--- a/cpukit/sapi/src/interrdesc.c
+++ b/cpukit/sapi/src/interrtext.c
@@ -1,16 +1,16 @@
/**
* @file
*
- * @brief Returns a description for an internal error code.
+ * @brief Returns a text for an internal error code.
*
* @ingroup ClassicFatal
*/
/*
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2012-2014 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
@@ -26,7 +26,7 @@
#include <rtems/fatal.h>
-static const char *const internal_error_desc [] = {
+static const char *const internal_error_text[] = {
"INTERNAL_ERROR_NO_CONFIGURATION_TABLE",
"INTERNAL_ERROR_NO_CPU_TABLE",
"INTERNAL_ERROR_TOO_LITTLE_WORKSPACE",
@@ -54,14 +54,14 @@ static const char *const internal_error_desc [] = {
"INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR"
};
-const char *rtems_internal_error_description( rtems_fatal_code error )
+const char *rtems_internal_error_text( rtems_fatal_code error )
{
size_t i = error;
- const char *desc = "?";
+ const char *text = "?";
- if ( i < RTEMS_ARRAY_SIZE( internal_error_desc ) ) {
- desc = internal_error_desc [i];
+ if ( i < RTEMS_ARRAY_SIZE( internal_error_text ) ) {
+ text = internal_error_text[ i ];
}
- return desc;
+ return text;
}
diff --git a/doc/ada_user/example.texi b/doc/ada_user/example.texi
index 90b1b12f72..697d1e0153 100644
--- a/doc/ada_user/example.texi
+++ b/doc/ada_user/example.texi
@@ -3,7 +3,7 @@
@c On-Line Applications Research Corporation (OAR).
@c All rights reserved.
-@node Example Application, Glossary, Directive Status Codes, Top
+@node Example Application, Glossary, Directive Status Codes STATUS_TEXT - Returns a text for a status code, Top
@chapter Example Application
@example
diff --git a/doc/user/Makefile.am b/doc/user/Makefile.am
index 1b6ddcb7e4..eec627a882 100644
--- a/doc/user/Makefile.am
+++ b/doc/user/Makefile.am
@@ -144,7 +144,7 @@ fatal.texi: fatal.t
-n "Board Support Packages" < $< > $@
bsp.texi: bsp.t
- $(BMENU2) -p "Fatal Error Manager INTERNAL_ERROR_DESCRIPTION - Returns a description for an internal error code" \
+ $(BMENU2) -p "Fatal Error Manager INTERNAL_ERROR_TEXT - Returns a text for an internal error code" \
-u "Top" \
-n "User Extensions Manager" < $< > $@
diff --git a/doc/user/dirstat.t b/doc/user/dirstat.t
index adb675d613..4d51e2e5e6 100644
--- a/doc/user/dirstat.t
+++ b/doc/user/dirstat.t
@@ -40,16 +40,14 @@
@section Directives
@page
-@subsection STATUS_CODE_DESCRIPTION - Returns a description for a status code
-
-@cindex fatal error
+@subsection STATUS_TEXT - Returns a text for a status code
@subheading CALLING SEQUENCE:
@ifset is-C
-@findex rtems_status_code_description
+@findex rtems_status_text
@example
-const char *rtems_status_code_description(
+const char *rtems_status_text(
rtems_status_code code
);
@end example
@@ -57,8 +55,9 @@ const char *rtems_status_code_description(
@subheading DIRECTIVE STATUS CODES
-The status code description or "?" in case the passed status code is invalid.
+The status code text or "?" in case the passed status code is invalid.
@subheading DESCRIPTION:
-Returns a description for a status code.
+Returns a text for a status code. The text for each status code is the
+enumerator constant.
diff --git a/doc/user/example.texi b/doc/user/example.texi
index 71a71ab015..00923c014b 100644
--- a/doc/user/example.texi
+++ b/doc/user/example.texi
@@ -3,7 +3,7 @@
@c On-Line Applications Research Corporation (OAR).
@c All rights reserved.
-@node Example Application, Glossary, Directive Status Codes STATUS_CODE_DESCRIPTION - Returns a description for a status code, Top
+@node Example Application, Glossary, Directive Status Codes STATUS_TEXT - Returns a text for a status code, Top
@chapter Example Application
@example
diff --git a/doc/user/fatal.t b/doc/user/fatal.t
index 20faa642ba..61e5261c9b 100644
--- a/doc/user/fatal.t
+++ b/doc/user/fatal.t
@@ -230,16 +230,16 @@ Prints the exception frame via printk().
@c
@c
@page
-@subsection FATAL_SOURCE_DESCRIPTION - Returns a description for a fatal source
+@subsection FATAL_SOURCE_TEXT - Returns a text for a fatal source
@cindex fatal error
@subheading CALLING SEQUENCE:
@ifset is-C
-@findex rtems_fatal_source_description
+@findex rtems_fatal_source_text
@example
-const char *rtems_fatal_source_description(
+const char *rtems_fatal_source_text(
rtems_fatal_source source
);
@end example
@@ -247,26 +247,27 @@ const char *rtems_fatal_source_description(
@subheading DIRECTIVE STATUS CODES
-The fatal source description or "?" in case the passed fatal source is invalid.
+The fatal source text or "?" in case the passed fatal source is invalid.
@subheading DESCRIPTION:
-Returns a description for a fatal source.
+Returns a text for a fatal source. The text for fatal source is the enumerator
+constant.
@c
@c
@c
@page
-@subsection INTERNAL_ERROR_DESCRIPTION - Returns a description for an internal error code
+@subsection INTERNAL_ERROR_TEXT - Returns a text for an internal error code
@cindex fatal error
@subheading CALLING SEQUENCE:
@ifset is-C
-@findex rtems_internal_error_description
+@findex rtems_internal_error_text
@example
-const char *rtems_internal_error_description(
+const char *rtems_internal_error_text(
rtems_fatal_code error
);
@end example
@@ -274,8 +275,9 @@ const char *rtems_internal_error_description(
@subheading DIRECTIVE STATUS CODES
-The error code description or "?" in case the passed error code is invalid.
+The error code text or "?" in case the passed error code is invalid.
@subheading DESCRIPTION:
-Returns a description for an internal error code.
+Returns a text for an internal error code. The text for each internal error
+code is the enumerator constant.
diff --git a/testsuites/psxtests/psxfatal_support/init.c b/testsuites/psxtests/psxfatal_support/init.c
index 93645e61ca..ce8302784b 100644
--- a/testsuites/psxtests/psxfatal_support/init.c
+++ b/testsuites/psxtests/psxfatal_support/init.c
@@ -65,7 +65,7 @@ char *Errors_Rtems[] = {
void Put_Error( uint32_t source, uint32_t error )
{
if ( source == INTERNAL_ERROR_CORE ) {
- printk( rtems_internal_error_description( error ) );
+ printk( rtems_internal_error_text( error ) );
}
else if (source == INTERNAL_ERROR_RTEMS_API ){
if (error > RTEMS_NOT_IMPLEMENTED )
@@ -80,7 +80,7 @@ void Put_Error( uint32_t source, uint32_t error )
void Put_Source( rtems_fatal_source source )
{
- printk( "%s", rtems_fatal_source_description( source ) );
+ printk( "%s", rtems_fatal_source_text( source ) );
}
void Fatal_extension(
diff --git a/testsuites/sptests/spfatal_support/init.c b/testsuites/sptests/spfatal_support/init.c
index 216c766b91..dfea48858c 100644
--- a/testsuites/sptests/spfatal_support/init.c
+++ b/testsuites/sptests/spfatal_support/init.c
@@ -65,7 +65,7 @@ char *Errors_Rtems[] = {
void Put_Error( uint32_t source, uint32_t error )
{
if ( source == INTERNAL_ERROR_CORE ) {
- printk( rtems_internal_error_description( error ) );
+ printk( rtems_internal_error_text( error ) );
}
else if (source == INTERNAL_ERROR_RTEMS_API ){
if (error > RTEMS_NOT_IMPLEMENTED )
@@ -77,7 +77,7 @@ void Put_Error( uint32_t source, uint32_t error )
void Put_Source( rtems_fatal_source source )
{
- printk( "%s", rtems_fatal_source_description( source ) );
+ printk( "%s", rtems_fatal_source_text( source ) );
}
static bool is_expected_error( rtems_fatal_code error )
diff --git a/testsuites/sptests/spinternalerror02/init.c b/testsuites/sptests/spinternalerror02/init.c
index b08a7d4e5b..0d07fabe79 100644
--- a/testsuites/sptests/spinternalerror02/init.c
+++ b/testsuites/sptests/spinternalerror02/init.c
@@ -20,50 +20,50 @@
#include <rtems.h>
-static void test_internal_error_description(void)
+static void test_internal_error_text(void)
{
rtems_fatal_code error = 0;
- const char *desc = NULL;
- const char *desc_last;
+ const char *text = NULL;
+ const char *text_last;
do {
- desc_last = desc;
- desc = rtems_internal_error_description( error );
+ text_last = text;
+ text = rtems_internal_error_text( error );
++error;
- puts( desc );
- } while ( desc != desc_last );
+ puts( text );
+ } while ( text != text_last );
rtems_test_assert( error - 3 == INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR );
}
-static void test_fatal_source_description(void)
+static void test_fatal_source_text(void)
{
rtems_fatal_source source = 0;
- const char *desc = NULL;
- const char *desc_last;
+ const char *text = NULL;
+ const char *text_last;
do {
- desc_last = desc;
- desc = rtems_fatal_source_description( source );
+ text_last = text;
+ text = rtems_fatal_source_text( source );
++source;
- puts( desc );
- } while ( desc != desc_last );
+ puts( text );
+ } while ( text != text_last );
rtems_test_assert( source - 3 == RTEMS_FATAL_SOURCE_EXCEPTION );
}
-static void test_status_code_description(void)
+static void test_status_text(void)
{
rtems_status_code code = 0;
- const char *desc = NULL;
- const char *desc_last;
+ const char *text = NULL;
+ const char *text_last;
do {
- desc_last = desc;
- desc = rtems_status_code_description( code );
+ text_last = text;
+ text = rtems_status_text( code );
++code;
- puts( desc );
- } while ( desc != desc_last );
+ puts( text );
+ } while ( text != text_last );
rtems_test_assert( code - 3 == RTEMS_PROXY_BLOCKING );
}
@@ -72,9 +72,9 @@ static void Init(rtems_task_argument arg)
{
puts("\n\n*** TEST SPINTERNALERROR 2 ***");
- test_internal_error_description();
- test_fatal_source_description();
- test_status_code_description();
+ test_internal_error_text();
+ test_fatal_source_text();
+ test_status_text();
puts("*** END OF TEST SPINTERNALERROR 2 ***");