summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2003-10-02 12:40:23 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2003-10-02 12:40:23 +0000
commitff247b6862648b4582f847672df16a4b86145d46 (patch)
tree6a6e167fb59dc2a853ad81f74735ec4e72a4e41d /cpukit
parent2003-10-02 Phil Torre <ptorre@zetron.com> (diff)
downloadrtems-ff247b6862648b4582f847672df16a4b86145d46.tar.bz2
2003-10-02 Phil Torre <ptorre@zetron.com>
PR 504/rtems * include/rtems/score/coremutex.h: Add fatal error check for a task blocking on a mutex when thread dispatching is disabled.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/score/ChangeLog6
-rw-r--r--cpukit/score/include/rtems/score/coremutex.h12
2 files changed, 18 insertions, 0 deletions
diff --git a/cpukit/score/ChangeLog b/cpukit/score/ChangeLog
index a1f8857619..a46bb3ee47 100644
--- a/cpukit/score/ChangeLog
+++ b/cpukit/score/ChangeLog
@@ -1,3 +1,9 @@
+2003-10-02 Phil Torre <ptorre@zetron.com>
+
+ PR 504/rtems
+ * include/rtems/score/coremutex.h: Add fatal error check for a task
+ blocking on a mutex when thread dispatching is disabled.
+
2003-09-26 Joel Sherrill <joel@OARcorp.com>
* cpu/hppa1.1/.cvsignore, cpu/hppa1.1/ChangeLog,
diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h
index fb29a7df82..1b3a570aca 100644
--- a/cpukit/score/include/rtems/score/coremutex.h
+++ b/cpukit/score/include/rtems/score/coremutex.h
@@ -26,6 +26,8 @@ extern "C" {
#include <rtems/score/threadq.h>
#include <rtems/score/priority.h>
#include <rtems/score/watchdog.h>
+#include <rtems/score/interr.h>
+#include <rtems/score/sysstate.h>
/*
* The following type defines the callout which the API provides
@@ -152,6 +154,7 @@ void _CORE_mutex_Initialize(
* a macro that uses two support routines.
*/
+
#ifndef __RTEMS_APPLICATION__
RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock(
CORE_mutex_Control *the_mutex,
@@ -166,6 +169,15 @@ void _CORE_mutex_Seize_interrupt_blocking(
#define _CORE_mutex_Seize( \
_the_mutex, _id, _wait, _timeout, _level ) \
do { \
+ if ( _Thread_Dispatch_disable_level \
+ && (_wait) \
+ && (_System_state_Get() >= SYSTEM_STATE_BEGIN_MULTITASKING ) \
+ ) { \
+ _Internal_error_Occurred( \
+ INTERNAL_ERROR_CORE, \
+ FALSE, \
+ 18 /* called from wrong environment */); \
+ } \
if ( _CORE_mutex_Seize_interrupt_trylock( _the_mutex, &_level ) ) { \
if ( !_wait ) { \
_ISR_Enable( _level ); \