summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-11 17:52:13 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 13:20:33 +0200
commit9276fdec2ec381e455e81f0fe3175d574579f631 (patch)
treed6efd1c75e93575a24b5125cb126140e411284e6 /cpukit/score
parentRevert "score: Avoid use of uninitialized variable" (diff)
downloadrtems-9276fdec2ec381e455e81f0fe3175d574579f631.tar.bz2
score: Fix CORE mutex initialization
The priority inheritance and ceiling CORE mutexes wrongly used the FIFO queueing discipline. Delete misleading _CORE_mutex_Is_priority(). Bug introduced by 1e1a91ed11458ddbb27b94d0001d8f0fc2ef7a97. Add test sptests/spmutex01, since no existing uni-processor test covered the thread priority queueing discipline for CORE mutexes.
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/include/rtems/score/coremuteximpl.h19
-rw-r--r--cpukit/score/src/coremutex.c6
2 files changed, 3 insertions, 22 deletions
diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h
index ef116ec7b8..34a9972c9e 100644
--- a/cpukit/score/include/rtems/score/coremuteximpl.h
+++ b/cpukit/score/include/rtems/score/coremuteximpl.h
@@ -460,25 +460,6 @@ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_fifo(
return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_FIFO;
}
-/**
- * @brief Doex core mutex use priority blocking.
- *
- * This routine returns true if the mutex's wait discipline is PRIORITY and
- * false otherwise.
- *
- * @param[in] the_attribute is the attribute set of the mutex.
- *
- * @retval true The mutex is using priority blocking order.
- * @retval false The mutex is not using priority blocking order.
- *
- */
-RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_priority(
- const CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY;
-}
-
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c
index 8fc3a406d9..ea5e759dc4 100644
--- a/cpukit/score/src/coremutex.c
+++ b/cpukit/score/src/coremutex.c
@@ -82,10 +82,10 @@ CORE_mutex_Status _CORE_mutex_Initialize(
_Thread_queue_Initialize( &the_mutex->Wait_queue );
- if ( _CORE_mutex_Is_priority( the_mutex_attributes ) ) {
- the_mutex->operations = &_Thread_queue_Operations_priority;
- } else {
+ if ( _CORE_mutex_Is_fifo( the_mutex_attributes ) ) {
the_mutex->operations = &_Thread_queue_Operations_FIFO;
+ } else {
+ the_mutex->operations = &_Thread_queue_Operations_priority;
}
return CORE_MUTEX_STATUS_SUCCESSFUL;