summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/libcsupport/src/__assert.c2
-rw-r--r--cpukit/score/include/rtems/score/interr.h7
-rw-r--r--testsuites/sptests/spfatal10/testcase.h8
-rw-r--r--testsuites/sptests/spfatal11/testcase.h2
4 files changed, 14 insertions, 5 deletions
diff --git a/cpukit/libcsupport/src/__assert.c b/cpukit/libcsupport/src/__assert.c
index 5adefdf632..07af01bc40 100644
--- a/cpukit/libcsupport/src/__assert.c
+++ b/cpukit/libcsupport/src/__assert.c
@@ -34,7 +34,7 @@ void __assert_func(
(func) ? ", function: " : "",
(func) ? func : ""
);
- rtems_fatal_error_occurred(0);
+ rtems_fatal( RTEMS_FATAL_SOURCE_ASSERT, (rtems_fatal_code) func );
}
#endif
diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h
index b316fbfd9f..20efcb3e0b 100644
--- a/cpukit/score/include/rtems/score/interr.h
+++ b/cpukit/score/include/rtems/score/interr.h
@@ -84,6 +84,13 @@ typedef enum {
RTEMS_FATAL_SOURCE_BSP_SPECIFIC,
/**
+ * @brief Fatal source of assert().
+ *
+ * The fatal code is the pointer value of the function string.
+ */
+ RTEMS_FATAL_SOURCE_ASSERT,
+
+ /**
* @brief The last available fatal source.
*
* This enum value ensures that the enum type needs at least 32-bits for
diff --git a/testsuites/sptests/spfatal10/testcase.h b/testsuites/sptests/spfatal10/testcase.h
index 6d011ce2dd..9af96d9637 100644
--- a/testsuites/sptests/spfatal10/testcase.h
+++ b/testsuites/sptests/spfatal10/testcase.h
@@ -10,15 +10,17 @@
#include <assert.h>
+static const char func [] = "Init";
+
#define FATAL_ERROR_TEST_NAME "10"
#define FATAL_ERROR_DESCRIPTION "asserting with non-NULL strings..."
-#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
+#define FATAL_ERROR_EXPECTED_SOURCE RTEMS_FATAL_SOURCE_ASSERT
#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
-#define FATAL_ERROR_EXPECTED_ERROR 0
+#define FATAL_ERROR_EXPECTED_ERROR ((rtems_fatal_code) func)
void force_error()
{
- __assert_func( __FILE__, __LINE__, "Init", "forced" );
+ __assert_func( __FILE__, __LINE__, func, "forced" );
/* we will not run this far */
}
diff --git a/testsuites/sptests/spfatal11/testcase.h b/testsuites/sptests/spfatal11/testcase.h
index 43a4ab267d..055b95cc73 100644
--- a/testsuites/sptests/spfatal11/testcase.h
+++ b/testsuites/sptests/spfatal11/testcase.h
@@ -12,7 +12,7 @@
#define FATAL_ERROR_TEST_NAME "11"
#define FATAL_ERROR_DESCRIPTION "asserting with non-NULL strings..."
-#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
+#define FATAL_ERROR_EXPECTED_SOURCE RTEMS_FATAL_SOURCE_ASSERT
#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
#define FATAL_ERROR_EXPECTED_ERROR 0