diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-27 14:29:00 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-31 10:14:42 +0200 |
commit | b1ce11614b615065505cee398645e995e4cee39f (patch) | |
tree | 65e432f37ad0333a04a466ee05395dd78391f5c0 | |
parent | score: Delete CORE_mutex_Control::blocked_count (diff) | |
download | rtems-b1ce11614b615065505cee398645e995e4cee39f.tar.bz2 |
score: Delete CORE_mutex_Control::holder_id
We can use the holder pointer to get the identifier if necessary.
-rw-r--r-- | cpukit/libmisc/monitor/mon-sema.c | 9 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/coremutex.h | 2 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/coremuteximpl.h | 1 | ||||
-rw-r--r-- | cpukit/score/src/coremutex.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/coremutexsurrender.c | 5 |
5 files changed, 8 insertions, 11 deletions
diff --git a/cpukit/libmisc/monitor/mon-sema.c b/cpukit/libmisc/monitor/mon-sema.c index c8a2b16280..df474eafc7 100644 --- a/cpukit/libmisc/monitor/mon-sema.c +++ b/cpukit/libmisc/monitor/mon-sema.c @@ -24,8 +24,7 @@ rtems_monitor_sema_canonical( canonical_sema->priority_ceiling = rtems_sema->Core_control.mutex.Attributes.priority_ceiling; - canonical_sema->holder_id = - rtems_sema->Core_control.mutex.holder_id; + canonical_sema->holder_id = 0; if (_Attributes_Is_counting_semaphore(canonical_sema->attribute)) { /* we have a counting semaphore */ @@ -36,6 +35,12 @@ rtems_monitor_sema_canonical( rtems_sema->Core_control.semaphore.Attributes.maximum_count; } else { + Thread_Control *holder = rtems_sema->Core_control.mutex.holder; + + if (holder != NULL) { + canonical_sema->holder_id = holder->Object.id; + } + /* we have a binary semaphore (mutex) */ canonical_sema->cur_count = rtems_sema->Core_control.mutex.lock; canonical_sema->max_count = 1; /* mutex is either 0 or 1 */ diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h index be11cb6325..a29aee5ac8 100644 --- a/cpukit/score/include/rtems/score/coremutex.h +++ b/cpukit/score/include/rtems/score/coremutex.h @@ -167,8 +167,6 @@ typedef struct { * has not unlocked it. If the thread is not locked, there is no holder. */ Thread_Control *holder; - /** This element contains the object Id of the holding thread. */ - Objects_Id holder_id; #ifdef __RTEMS_STRICT_ORDER_MUTEX__ /** This field is used to manipulate the priority inheritance mutex queue*/ CORE_mutex_order_list queue; diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h index f2a7ca7813..497843850f 100644 --- a/cpukit/score/include/rtems/score/coremuteximpl.h +++ b/cpukit/score/include/rtems/score/coremuteximpl.h @@ -454,7 +454,6 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body( if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; - the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ){ diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c index 4cdc7647d1..1c6c3db302 100644 --- a/cpukit/score/src/coremutex.c +++ b/cpukit/score/src/coremutex.c @@ -42,7 +42,6 @@ CORE_mutex_Status _CORE_mutex_Initialize( if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; the_mutex->holder = executing; - the_mutex->holder_id = executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { @@ -60,7 +59,6 @@ CORE_mutex_Status _CORE_mutex_Initialize( } else { the_mutex->nest_count = 0; the_mutex->holder = NULL; - the_mutex->holder_id = 0; } _Thread_queue_Initialize( diff --git a/cpukit/score/src/coremutexsurrender.c b/cpukit/score/src/coremutexsurrender.c index 11e8cd4489..de1c744c2c 100644 --- a/cpukit/score/src/coremutexsurrender.c +++ b/cpukit/score/src/coremutexsurrender.c @@ -172,8 +172,7 @@ CORE_mutex_Status _CORE_mutex_Surrender( _Thread_Change_priority( holder, holder->real_priority, true ); } } - the_mutex->holder = NULL; - the_mutex->holder_id = 0; + the_mutex->holder = NULL; /* * Now we check if another thread was waiting for this mutex. If so, @@ -185,7 +184,6 @@ CORE_mutex_Status _CORE_mutex_Surrender( if ( !_Objects_Is_local_id( the_thread->Object.id ) ) { the_mutex->holder = NULL; - the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; ( *api_mutex_mp_support)( the_thread, id ); @@ -195,7 +193,6 @@ CORE_mutex_Status _CORE_mutex_Surrender( { the_mutex->holder = the_thread; - the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; switch ( the_mutex->Attributes.discipline ) { |