[rtems commit] score: Disable ISR in _Internal_error_Occurred()
Sebastian Huber
sebh at rtems.org
Wed Feb 19 08:52:43 UTC 2014
Module: rtems
Branch: master
Commit: 38ee75853f674977609bd078c69fb53420afdd08
Changeset: http://git.rtems.org/rtems/commit/?id=38ee75853f674977609bd078c69fb53420afdd08
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Mon Feb 17 09:58:43 2014 +0100
score: Disable ISR in _Internal_error_Occurred()
Disable interrupts as the first step in _Internal_error_Occurred() to
get a defined execution context for the fatal extensions.
Make _ISR_Disable_without_giant() available for non-SMP configurations.
---
cpukit/score/include/rtems/score/interr.h | 4 +++-
cpukit/score/include/rtems/score/isrlevel.h | 4 ++--
cpukit/score/src/interr.c | 6 ++++++
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h
index b774edc..2f5add4 100644
--- a/cpukit/score/include/rtems/score/interr.h
+++ b/cpukit/score/include/rtems/score/interr.h
@@ -176,7 +176,9 @@ extern Internal_errors_Information _Internal_errors_What_happened;
* determines that a fatal error has occurred or a final system state is
* reached (for example after exit()).
*
- * The first action of this function is to call the fatal handler of the user
+ * The first action is to disable interrupts.
+ *
+ * The second action of this function is to call the fatal handler of the user
* extensions. For the initial extensions the following conditions are
* required
* - a valid stack pointer and enough stack space,
diff --git a/cpukit/score/include/rtems/score/isrlevel.h b/cpukit/score/include/rtems/score/isrlevel.h
index 3da67fd..137103e 100644
--- a/cpukit/score/include/rtems/score/isrlevel.h
+++ b/cpukit/score/include/rtems/score/isrlevel.h
@@ -136,14 +136,14 @@ typedef uint32_t ISR_Level;
RTEMS_COMPILER_MEMORY_BARRIER(); \
} while (0)
-#if defined( RTEMS_SMP )
-
#define _ISR_Disable_without_giant( _level ) \
do { \
_CPU_ISR_Disable( _level ); \
RTEMS_COMPILER_MEMORY_BARRIER(); \
} while (0)
+#if defined( RTEMS_SMP )
+
#define _ISR_Enable_without_giant( _level ) \
do { \
RTEMS_COMPILER_MEMORY_BARRIER(); \
diff --git a/cpukit/score/src/interr.c b/cpukit/score/src/interr.c
index f3a3127..9f52ce7 100644
--- a/cpukit/score/src/interr.c
+++ b/cpukit/score/src/interr.c
@@ -19,6 +19,7 @@
#endif
#include <rtems/score/interr.h>
+#include <rtems/score/isrlevel.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/userextimpl.h>
@@ -32,6 +33,11 @@ void _Internal_error_Occurred(
Internal_errors_t the_error
)
{
+ ISR_Level level;
+
+ _ISR_Disable_without_giant( level );
+ (void) level;
+
_User_extensions_Fatal( the_source, is_internal, the_error );
_Internal_errors_What_happened.the_source = the_source;
More information about the vc
mailing list