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.
This commit is contained in:
Joel Sherrill
2011-02-14 17:50:23 +00:00
parent 2af90ff1a1
commit 7ce892d633
4 changed files with 17 additions and 6 deletions
+7
View File
@@ -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> 2011-02-11 Joel Sherrill <joel.sherrilL@OARcorp.com>
* rtems/src/semtranslatereturncode.c, * rtems/src/semtranslatereturncode.c,
+3 -1
View File
@@ -85,7 +85,7 @@ typedef enum {
* resource was unavailable. * resource was unavailable.
*/ */
CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT, 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 /** This status indicates that an attempt was made to relock a mutex
* for which nesting is not configured. * for which nesting is not configured.
*/ */
@@ -142,6 +142,7 @@ typedef enum {
* + unlock(m) * + unlock(m)
*/ */
CORE_MUTEX_NESTING_ACQUIRES, CORE_MUTEX_NESTING_ACQUIRES,
#if defined(RTEMS_POSIX_API)
/** /**
* This sequence returns an error at the indicated point: * This sequence returns an error at the indicated point:
* *
@@ -150,6 +151,7 @@ typedef enum {
* + unlock(m) * + unlock(m)
*/ */
CORE_MUTEX_NESTING_IS_ERROR, CORE_MUTEX_NESTING_IS_ERROR,
#endif
/** /**
* This sequence performs as indicated: * This sequence performs as indicated:
* + lock(m) * + lock(m)
@@ -205,10 +205,12 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
the_mutex->nest_count++; the_mutex->nest_count++;
_ISR_Enable( *level_p ); _ISR_Enable( *level_p );
return 0; return 0;
case CORE_MUTEX_NESTING_IS_ERROR: #if defined(RTEMS_POSIX_API)
executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; case CORE_MUTEX_NESTING_IS_ERROR:
_ISR_Enable( *level_p ); executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
return 0; _ISR_Enable( *level_p );
return 0;
#endif
case CORE_MUTEX_NESTING_BLOCKS: case CORE_MUTEX_NESTING_BLOCKS:
break; break;
} }
+1 -1
View File
@@ -23,7 +23,7 @@ void _API_Mutex_Allocate(
API_Mutex_Control *mutex; API_Mutex_Control *mutex;
CORE_mutex_Attributes attr = { CORE_mutex_Attributes attr = {
CORE_MUTEX_NESTING_IS_ERROR, CORE_MUTEX_NESTING_ACQUIRES,
false, false,
CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT, CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT,
0 0