diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-01 11:38:47 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-06 09:08:21 +0200 |
commit | 8f9658187a46f3c3ee3d7c7b68491fab5175a8fd (patch) | |
tree | c1887c2441887909201698b8d16b8cb2e8598188 /cpukit/rtems/src/semrelease.c | |
parent | score: Simplify _Thread_queue_Do_flush() (diff) | |
download | rtems-8f9658187a46f3c3ee3d7c7b68491fab5175a8fd.tar.bz2 |
score: Rework MP thread queue callout support
The thread queue implementation was heavily reworked to support SMP.
This broke the multiprocessing support of the thread queues. This is
fixed by this patch.
A thread proxy is unblocked due to three reasons
1) timeout,
2) request satisfaction, and
3) extraction.
In case 1) no MPCI message must be sent. This is ensured via the
_Thread_queue_MP_callout_do_nothing() callout set during
_Thread_MP_Allocate_proxy().
In case 2) and 3) an MPCI message must be sent. In case we interrupt
the blocking operation during _Thread_queue_Enqueue_critical(), then
this message must be sent by the blocking thread. For this the new
fields Thread_Proxy_control::thread_queue_callout and
Thread_Proxy_control::thread_queue_id are used.
Delete the individual API MP callout types and use
Thread_queue_MP_callout throughout. This type is only defined in
multiprocessing configurations. Prefix the multiprocessing parameters
with mp_ to ease code review. Multiprocessing specific parameters are
optional due to use of a similar macro pattern. There is no overhead
for non-multiprocessing configurations.
Diffstat (limited to 'cpukit/rtems/src/semrelease.c')
-rw-r--r-- | cpukit/rtems/src/semrelease.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/cpukit/rtems/src/semrelease.c b/cpukit/rtems/src/semrelease.c index 5d41b6cfae..4a6ccb2817 100644 --- a/cpukit/rtems/src/semrelease.c +++ b/cpukit/rtems/src/semrelease.c @@ -31,28 +31,8 @@ #include <rtems/score/coremuteximpl.h> #include <rtems/score/coresemimpl.h> #include <rtems/score/thread.h> - #include <rtems/score/interr.h> -/* - * rtems_semaphore_release - * - * This directive allows a thread to release a semaphore. - * - * Input parameters: - * id - semaphore id - * - * Output parameters: - * RTEMS_SUCCESSFUL - if successful - * error code - if unsuccessful - */ - -#if defined(RTEMS_MULTIPROCESSING) -#define MUTEX_MP_SUPPORT _Semaphore_Core_mutex_mp_support -#else -#define MUTEX_MP_SUPPORT NULL -#endif - rtems_status_code rtems_semaphore_release( rtems_id id ) @@ -88,16 +68,16 @@ rtems_status_code rtems_semaphore_release( if ( !_Attributes_Is_counting_semaphore( attribute_set ) ) { mutex_status = _CORE_mutex_Surrender( &the_semaphore->Core_control.mutex, + _Semaphore_Core_mutex_mp_support, id, - MUTEX_MP_SUPPORT, &lock_context ); return _Semaphore_Translate_core_mutex_return_code( mutex_status ); } else { semaphore_status = _CORE_semaphore_Surrender( &the_semaphore->Core_control.semaphore, + _Semaphore_Core_mutex_mp_support, id, - MUTEX_MP_SUPPORT, &lock_context ); return |