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/score/src/coremsgsubmit.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/score/src/coremsgsubmit.c')
-rw-r--r-- | cpukit/score/src/coremsgsubmit.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/cpukit/score/src/coremsgsubmit.c b/cpukit/score/src/coremsgsubmit.c index 02de12f6ea..f63fa39f39 100644 --- a/cpukit/score/src/coremsgsubmit.c +++ b/cpukit/score/src/coremsgsubmit.c @@ -25,21 +25,19 @@ #include <rtems/score/statesimpl.h> #include <rtems/score/wkspace.h> -CORE_message_queue_Status _CORE_message_queue_Submit( - CORE_message_queue_Control *the_message_queue, - Thread_Control *executing, - const void *buffer, - size_t size, - Objects_Id id, - #if defined(RTEMS_MULTIPROCESSING) - CORE_message_queue_API_mp_support_callout api_message_queue_mp_support, - #else - CORE_message_queue_API_mp_support_callout api_message_queue_mp_support RTEMS_UNUSED, - #endif - CORE_message_queue_Submit_types submit_type, - bool wait, - Watchdog_Interval timeout, - ISR_lock_Context *lock_context +CORE_message_queue_Status _CORE_message_queue_Do_submit( + CORE_message_queue_Control *the_message_queue, + Thread_Control *executing, + const void *buffer, + size_t size, +#if defined(RTEMS_MULTIPROCESSING) + Thread_queue_MP_callout mp_callout, + Objects_Id mp_id, +#endif + CORE_message_queue_Submit_types submit_type, + bool wait, + Watchdog_Interval timeout, + ISR_lock_Context *lock_context ) { CORE_message_queue_Buffer_control *the_message; @@ -60,16 +58,12 @@ CORE_message_queue_Status _CORE_message_queue_Submit( the_message_queue, buffer, size, + mp_callout, + mp_id, submit_type, lock_context ); if ( the_thread != NULL ) { - #if defined(RTEMS_MULTIPROCESSING) - if ( !_Objects_Is_local_id( the_thread->Object.id ) ) - (*api_message_queue_mp_support) ( the_thread, id ); - - _Thread_Dispatch_enable( _Per_CPU_Get() ); - #endif return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } @@ -139,10 +133,6 @@ CORE_message_queue_Status _CORE_message_queue_Submit( CORE_MESSAGE_QUEUE_STATUS_TIMEOUT, lock_context ); - #if defined(RTEMS_MULTIPROCESSING) - _Thread_Dispatch_enable( _Per_CPU_Get() ); - #endif - return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } |