From 631b3c8967a329cdd53e54365e4e4c0aa93a4251 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 May 2016 11:40:18 +0200 Subject: score: Move thread queue MP callout to context Drop the multiprocessing (MP) dependent callout parameter from the thread queue extract, dequeue, flush and unblock methods. Merge this parameter with the lock context into new structure Thread_queue_Context. This helps to gets rid of the conditionally compiled method call helpers. --- cpukit/score/src/coremsgsubmit.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'cpukit/score/src/coremsgsubmit.c') diff --git a/cpukit/score/src/coremsgsubmit.c b/cpukit/score/src/coremsgsubmit.c index 68067cccb6..a86774175f 100644 --- a/cpukit/score/src/coremsgsubmit.c +++ b/cpukit/score/src/coremsgsubmit.c @@ -25,25 +25,22 @@ #include #include -CORE_message_queue_Status _CORE_message_queue_Do_submit( +CORE_message_queue_Status _CORE_message_queue_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, -#endif CORE_message_queue_Submit_types submit_type, bool wait, Watchdog_Interval timeout, - ISR_lock_Context *lock_context + Thread_queue_Context *queue_context ) { CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { - _CORE_message_queue_Release( the_message_queue, lock_context ); + _CORE_message_queue_Release( the_message_queue, queue_context ); return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE; } @@ -55,9 +52,8 @@ CORE_message_queue_Status _CORE_message_queue_Do_submit( the_message_queue, buffer, size, - mp_callout, submit_type, - lock_context + queue_context ); if ( the_thread != NULL ) { return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; @@ -90,20 +86,20 @@ CORE_message_queue_Status _CORE_message_queue_Do_submit( ) { ( *the_message_queue->notify_handler )( the_message_queue, - lock_context + queue_context ); } else { - _CORE_message_queue_Release( the_message_queue, lock_context ); + _CORE_message_queue_Release( the_message_queue, queue_context ); } #else - _CORE_message_queue_Release( the_message_queue, lock_context ); + _CORE_message_queue_Release( the_message_queue, queue_context ); #endif return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } #if !defined(RTEMS_SCORE_COREMSG_ENABLE_BLOCKING_SEND) - _CORE_message_queue_Release( the_message_queue, lock_context ); + _CORE_message_queue_Release( the_message_queue, queue_context ); return CORE_MESSAGE_QUEUE_STATUS_TOO_MANY; #else /* @@ -112,7 +108,7 @@ CORE_message_queue_Status _CORE_message_queue_Do_submit( * on the queue. */ if ( !wait ) { - _CORE_message_queue_Release( the_message_queue, lock_context ); + _CORE_message_queue_Release( the_message_queue, queue_context ); return CORE_MESSAGE_QUEUE_STATUS_TOO_MANY; } @@ -121,7 +117,7 @@ CORE_message_queue_Status _CORE_message_queue_Do_submit( * deadly to block in an ISR. */ if ( _ISR_Is_in_progress() ) { - _CORE_message_queue_Release( the_message_queue, lock_context ); + _CORE_message_queue_Release( the_message_queue, queue_context ); return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED; } @@ -143,7 +139,7 @@ CORE_message_queue_Status _CORE_message_queue_Do_submit( STATES_WAITING_FOR_MESSAGE, timeout, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT, - lock_context + &queue_context->Lock_context ); return executing->Wait.return_code; #endif -- cgit v1.2.3