summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-02-14 17:50:23 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-02-14 17:50:23 +0000
commit7ce892d633435c7f4cbe18e1100162236182f7c7 (patch)
treec016bdf0c8f24f8dd95d068839516051c10e0f96 /cpukit
parent2011-02-11 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-7ce892d633435c7f4cbe18e1100162236182f7c7.tar.bz2
2011-02-14 Joel Sherrill <joel.sherrilL@OARcorp.com>
* score/include/rtems/score/coremutex.h, score/inline/rtems/score/coremutex.inl, score/src/apimutexallocate.c: Fix direction of conditional and eliminate use of nesting is error when POSIX is disabled.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog7
-rw-r--r--cpukit/score/include/rtems/score/coremutex.h4
-rw-r--r--cpukit/score/inline/rtems/score/coremutex.inl10
-rw-r--r--cpukit/score/src/apimutexallocate.c2
4 files changed, 17 insertions, 6 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index c6c5e97d04..e335b6331b 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,10 @@
+2011-02-14 Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+ * score/include/rtems/score/coremutex.h,
+ score/inline/rtems/score/coremutex.inl, score/src/apimutexallocate.c:
+ Fix direction of conditional and eliminate use of nesting is error
+ when POSIX is disabled.
+
2011-02-11 Joel Sherrill <joel.sherrilL@OARcorp.com>
* rtems/src/semtranslatereturncode.c,
diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h
index 97c4e5c947..5a0a800b28 100644
--- a/cpukit/score/include/rtems/score/coremutex.h
+++ b/cpukit/score/include/rtems/score/coremutex.h
@@ -85,7 +85,7 @@ typedef enum {
* resource was unavailable.
*/
CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT,
-#if !defined(RTEMS_POSIX_API)
+#if defined(RTEMS_POSIX_API)
/** This status indicates that an attempt was made to relock a mutex
* for which nesting is not configured.
*/
@@ -142,6 +142,7 @@ typedef enum {
* + unlock(m)
*/
CORE_MUTEX_NESTING_ACQUIRES,
+#if defined(RTEMS_POSIX_API)
/**
* This sequence returns an error at the indicated point:
*
@@ -150,6 +151,7 @@ typedef enum {
* + unlock(m)
*/
CORE_MUTEX_NESTING_IS_ERROR,
+#endif
/**
* This sequence performs as indicated:
* + lock(m)
diff --git a/cpukit/score/inline/rtems/score/coremutex.inl b/cpukit/score/inline/rtems/score/coremutex.inl
index 9f6d749b81..f6f666159b 100644
--- a/cpukit/score/inline/rtems/score/coremutex.inl
+++ b/cpukit/score/inline/rtems/score/coremutex.inl
@@ -205,10 +205,12 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
the_mutex->nest_count++;
_ISR_Enable( *level_p );
return 0;
- case CORE_MUTEX_NESTING_IS_ERROR:
- executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
- _ISR_Enable( *level_p );
- return 0;
+ #if defined(RTEMS_POSIX_API)
+ case CORE_MUTEX_NESTING_IS_ERROR:
+ executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
+ _ISR_Enable( *level_p );
+ return 0;
+ #endif
case CORE_MUTEX_NESTING_BLOCKS:
break;
}
diff --git a/cpukit/score/src/apimutexallocate.c b/cpukit/score/src/apimutexallocate.c
index c5a24d9782..5a2a323315 100644
--- a/cpukit/score/src/apimutexallocate.c
+++ b/cpukit/score/src/apimutexallocate.c
@@ -23,7 +23,7 @@ void _API_Mutex_Allocate(
API_Mutex_Control *mutex;
CORE_mutex_Attributes attr = {
- CORE_MUTEX_NESTING_IS_ERROR,
+ CORE_MUTEX_NESTING_ACQUIRES,
false,
CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT,
0