summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cpukit/libnetworking/rtems/rtems_glue.c4
-rw-r--r--cpukit/posix/include/rtems/posix/barrierimpl.h2
-rw-r--r--cpukit/posix/include/rtems/posix/mqueueimpl.h2
-rw-r--r--cpukit/posix/include/rtems/posix/semaphoreimpl.h2
-rw-r--r--cpukit/rtems/include/rtems/rtems/barrierimpl.h2
-rw-r--r--cpukit/rtems/include/rtems/rtems/messageimpl.h20
-rw-r--r--cpukit/rtems/include/rtems/rtems/semimpl.h20
-rw-r--r--cpukit/rtems/src/msgqbroadcast.c10
-rw-r--r--cpukit/rtems/src/msgqdelete.c10
-rw-r--r--cpukit/rtems/src/msgqflush.c2
-rw-r--r--cpukit/rtems/src/msgqgetnumberpending.c2
-rw-r--r--cpukit/rtems/src/msgqreceive.c2
-rw-r--r--cpukit/rtems/src/msgqsend.c10
-rw-r--r--cpukit/rtems/src/msgqurgent.c10
-rw-r--r--cpukit/rtems/src/semdelete.c6
-rw-r--r--cpukit/rtems/src/semflush.c11
-rw-r--r--cpukit/rtems/src/semobtain.c2
-rw-r--r--cpukit/rtems/src/semrelease.c11
-rw-r--r--cpukit/rtems/src/semsetpriority.c2
-rw-r--r--cpukit/score/include/rtems/score/mrspimpl.h2
-rw-r--r--cpukit/score/include/rtems/score/threadq.h15
-rw-r--r--cpukit/score/include/rtems/score/threadqimpl.h47
-rw-r--r--cpukit/score/src/apimutexlock.c2
-rw-r--r--cpukit/score/src/apimutexunlock.c2
-rw-r--r--cpukit/score/src/condition.c2
-rw-r--r--cpukit/score/src/mpci.c2
-rw-r--r--cpukit/score/src/mutex.c4
-rw-r--r--cpukit/score/src/semaphore.c2
-rw-r--r--cpukit/score/src/threadqenqueue.c12
-rw-r--r--cpukit/score/src/threadrestart.c2
-rw-r--r--testsuites/sptests/spintrcritical22/init.c2
-rw-r--r--testsuites/tmtests/tm26/task1.c2
32 files changed, 107 insertions, 119 deletions
diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c
index f517c22054..9b6338c5e3 100644
--- a/cpukit/libnetworking/rtems/rtems_glue.c
+++ b/cpukit/libnetworking/rtems/rtems_glue.c
@@ -375,7 +375,7 @@ rtems_bsdnet_semaphore_obtain (void)
Status_Control status;
if (!the_networkSemaphore)
rtems_panic ("rtems-net: network sema obtain: network not initialised\n");
- _Thread_queue_Context_initialize(&queue_context, NULL);
+ _Thread_queue_Context_initialize(&queue_context);
_ISR_lock_ISR_disable(&queue_context.Lock_context);
status = _CORE_mutex_Seize (
&the_networkSemaphore->Core_control.mutex,
@@ -408,7 +408,7 @@ rtems_bsdnet_semaphore_release (void)
if (!the_networkSemaphore)
rtems_panic ("rtems-net: network sema obtain: network not initialised\n");
- _Thread_queue_Context_initialize(&queue_context, NULL);
+ _Thread_queue_Context_initialize(&queue_context);
_ISR_lock_ISR_disable(&queue_context.Lock_context);
status = _CORE_mutex_Surrender (
&the_networkSemaphore->Core_control.mutex,
diff --git a/cpukit/posix/include/rtems/posix/barrierimpl.h b/cpukit/posix/include/rtems/posix/barrierimpl.h
index 984868e7e1..2fbc2f9172 100644
--- a/cpukit/posix/include/rtems/posix/barrierimpl.h
+++ b/cpukit/posix/include/rtems/posix/barrierimpl.h
@@ -68,7 +68,7 @@ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Get(
Thread_queue_Context *queue_context
)
{
- _Thread_queue_Context_initialize( queue_context, NULL );
+ _Thread_queue_Context_initialize( queue_context );
return (POSIX_Barrier_Control *) _Objects_Get(
(Objects_Id) *barrier,
&queue_context->Lock_context,
diff --git a/cpukit/posix/include/rtems/posix/mqueueimpl.h b/cpukit/posix/include/rtems/posix/mqueueimpl.h
index 480584b823..62ddbef8f8 100644
--- a/cpukit/posix/include/rtems/posix/mqueueimpl.h
+++ b/cpukit/posix/include/rtems/posix/mqueueimpl.h
@@ -111,7 +111,7 @@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get(
Thread_queue_Context *queue_context
)
{
- _Thread_queue_Context_initialize( queue_context, NULL );
+ _Thread_queue_Context_initialize( queue_context );
return (POSIX_Message_queue_Control *) _Objects_Get(
id,
&queue_context->Lock_context,
diff --git a/cpukit/posix/include/rtems/posix/semaphoreimpl.h b/cpukit/posix/include/rtems/posix/semaphoreimpl.h
index 90019d7ed0..1521eade85 100644
--- a/cpukit/posix/include/rtems/posix/semaphoreimpl.h
+++ b/cpukit/posix/include/rtems/posix/semaphoreimpl.h
@@ -59,7 +59,7 @@ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get(
Thread_queue_Context *queue_context
)
{
- _Thread_queue_Context_initialize( queue_context, NULL );
+ _Thread_queue_Context_initialize( queue_context );
return (POSIX_Semaphore_Control *) _Objects_Get(
(Objects_Id) *id,
&queue_context->Lock_context,
diff --git a/cpukit/rtems/include/rtems/rtems/barrierimpl.h b/cpukit/rtems/include/rtems/rtems/barrierimpl.h
index 6a98917012..91834b8362 100644
--- a/cpukit/rtems/include/rtems/rtems/barrierimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/barrierimpl.h
@@ -74,7 +74,7 @@ RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get(
Thread_queue_Context *queue_context
)
{
- _Thread_queue_Context_initialize( queue_context, NULL );
+ _Thread_queue_Context_initialize( queue_context );
return (Barrier_Control *)
_Objects_Get( id, &queue_context->Lock_context, &_Barrier_Information );
}
diff --git a/cpukit/rtems/include/rtems/rtems/messageimpl.h b/cpukit/rtems/include/rtems/rtems/messageimpl.h
index c561ff9a4b..9c1da39975 100644
--- a/cpukit/rtems/include/rtems/rtems/messageimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/messageimpl.h
@@ -87,16 +87,12 @@ RTEMS_INLINE_ROUTINE void _Message_queue_Free (
_Objects_Free( &_Message_queue_Information, &the_message_queue->Object );
}
-RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Do_get(
- Objects_Id id,
- Thread_queue_Context *queue_context
-#if defined(RTEMS_MULTIPROCESSING)
- ,
- Thread_queue_MP_callout mp_callout
-#endif
+RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get(
+ Objects_Id id,
+ Thread_queue_Context *queue_context
)
{
- _Thread_queue_Context_initialize( queue_context, mp_callout );
+ _Thread_queue_Context_initialize( queue_context );
return (Message_queue_Control *) _Objects_Get(
id,
&queue_context->Lock_context,
@@ -104,14 +100,6 @@ RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Do_get(
);
}
-#if defined(RTEMS_MULTIPROCESSING)
- #define _Message_queue_Get( id, queue_context, mp_callout ) \
- _Message_queue_Do_get( id, queue_context, mp_callout )
-#else
- #define _Message_queue_Get( id, queue_context, mp_callout ) \
- _Message_queue_Do_get( id, queue_context )
-#endif
-
RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Allocate( void )
{
return (Message_queue_Control *)
diff --git a/cpukit/rtems/include/rtems/rtems/semimpl.h b/cpukit/rtems/include/rtems/rtems/semimpl.h
index 21e16e99d0..a498927691 100644
--- a/cpukit/rtems/include/rtems/rtems/semimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/semimpl.h
@@ -58,16 +58,12 @@ RTEMS_INLINE_ROUTINE void _Semaphore_Free (
_Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
}
-RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Do_get(
- Objects_Id id,
- Thread_queue_Context *queue_context
-#if defined(RTEMS_MULTIPROCESSING)
- ,
- Thread_queue_MP_callout mp_callout
-#endif
+RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get(
+ Objects_Id id,
+ Thread_queue_Context *queue_context
)
{
- _Thread_queue_Context_initialize( queue_context, mp_callout );
+ _Thread_queue_Context_initialize( queue_context );
return (Semaphore_Control *) _Objects_Get(
id,
&queue_context->Lock_context,
@@ -75,14 +71,6 @@ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Do_get(
);
}
-#if defined(RTEMS_MULTIPROCESSING)
- #define _Semaphore_Get( id, queue_context, mp_callout ) \
- _Semaphore_Do_get( id, queue_context, mp_callout )
-#else
- #define _Semaphore_Get( id, queue_context, mp_callout ) \
- _Semaphore_Do_get( id, queue_context )
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/rtems/src/msgqbroadcast.c b/cpukit/rtems/src/msgqbroadcast.c
index cc38be96f8..4c4e04e097 100644
--- a/cpukit/rtems/src/msgqbroadcast.c
+++ b/cpukit/rtems/src/msgqbroadcast.c
@@ -40,11 +40,7 @@ rtems_status_code rtems_message_queue_broadcast(
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get(
- id,
- &queue_context,
- _Message_queue_Core_message_queue_mp_support
- );
+ the_message_queue = _Message_queue_Get( id, &queue_context );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -54,6 +50,10 @@ rtems_status_code rtems_message_queue_broadcast(
#endif
}
+ _Thread_queue_Context_set_MP_callout(
+ &queue_context,
+ _Message_queue_Core_message_queue_mp_support
+ );
status = _CORE_message_queue_Broadcast(
&the_message_queue->message_queue,
buffer,
diff --git a/cpukit/rtems/src/msgqdelete.c b/cpukit/rtems/src/msgqdelete.c
index 94175e6993..7a3e40a4b5 100644
--- a/cpukit/rtems/src/msgqdelete.c
+++ b/cpukit/rtems/src/msgqdelete.c
@@ -29,11 +29,7 @@ rtems_status_code rtems_message_queue_delete(
Thread_queue_Context queue_context;
_Objects_Allocator_lock();
- the_message_queue = _Message_queue_Get(
- id,
- &queue_context,
- _Message_queue_MP_Send_object_was_deleted
- );
+ the_message_queue = _Message_queue_Get( id, &queue_context );
if ( the_message_queue == NULL ) {
_Objects_Allocator_unlock();
@@ -54,6 +50,10 @@ rtems_status_code rtems_message_queue_delete(
_Objects_Close( &_Message_queue_Information, &the_message_queue->Object );
+ _Thread_queue_Context_set_MP_callout(
+ &queue_context,
+ _Message_queue_MP_Send_object_was_deleted
+ );
_CORE_message_queue_Close(
&the_message_queue->message_queue,
&queue_context
diff --git a/cpukit/rtems/src/msgqflush.c b/cpukit/rtems/src/msgqflush.c
index b4419d173d..16f743234f 100644
--- a/cpukit/rtems/src/msgqflush.c
+++ b/cpukit/rtems/src/msgqflush.c
@@ -32,7 +32,7 @@ rtems_status_code rtems_message_queue_flush(
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get( id, &queue_context, NULL );
+ the_message_queue = _Message_queue_Get( id, &queue_context );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
diff --git a/cpukit/rtems/src/msgqgetnumberpending.c b/cpukit/rtems/src/msgqgetnumberpending.c
index d2f7820553..2a49711e87 100644
--- a/cpukit/rtems/src/msgqgetnumberpending.c
+++ b/cpukit/rtems/src/msgqgetnumberpending.c
@@ -32,7 +32,7 @@ rtems_status_code rtems_message_queue_get_number_pending(
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get( id, &queue_context, NULL );
+ the_message_queue = _Message_queue_Get( id, &queue_context );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
diff --git a/cpukit/rtems/src/msgqreceive.c b/cpukit/rtems/src/msgqreceive.c
index 66e38f7cae..75c15beb6a 100644
--- a/cpukit/rtems/src/msgqreceive.c
+++ b/cpukit/rtems/src/msgqreceive.c
@@ -45,7 +45,7 @@ rtems_status_code rtems_message_queue_receive(
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get( id, &queue_context, NULL );
+ the_message_queue = _Message_queue_Get( id, &queue_context );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
diff --git a/cpukit/rtems/src/msgqsend.c b/cpukit/rtems/src/msgqsend.c
index 9489081a79..7968281d59 100644
--- a/cpukit/rtems/src/msgqsend.c
+++ b/cpukit/rtems/src/msgqsend.c
@@ -35,11 +35,7 @@ rtems_status_code rtems_message_queue_send(
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get(
- id,
- &queue_context,
- _Message_queue_Core_message_queue_mp_support
- );
+ the_message_queue = _Message_queue_Get( id, &queue_context );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -53,6 +49,10 @@ rtems_status_code rtems_message_queue_send(
&the_message_queue->message_queue,
&queue_context
);
+ _Thread_queue_Context_set_MP_callout(
+ &queue_context,
+ _Message_queue_Core_message_queue_mp_support
+ );
status = _CORE_message_queue_Send(
&the_message_queue->message_queue,
buffer,
diff --git a/cpukit/rtems/src/msgqurgent.c b/cpukit/rtems/src/msgqurgent.c
index 6522d8fb1a..6c6379d7d8 100644
--- a/cpukit/rtems/src/msgqurgent.c
+++ b/cpukit/rtems/src/msgqurgent.c
@@ -35,11 +35,7 @@ rtems_status_code rtems_message_queue_urgent(
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get(
- id,
- &queue_context,
- _Message_queue_Core_message_queue_mp_support
- );
+ the_message_queue = _Message_queue_Get( id, &queue_context );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -53,6 +49,10 @@ rtems_status_code rtems_message_queue_urgent(
&the_message_queue->message_queue,
&queue_context
);
+ _Thread_queue_Context_set_MP_callout(
+ &queue_context,
+ _Message_queue_Core_message_queue_mp_support
+ );
status = _CORE_message_queue_Urgent(
&the_message_queue->message_queue,
buffer,
diff --git a/cpukit/rtems/src/semdelete.c b/cpukit/rtems/src/semdelete.c
index 405c8055c3..13f2bf0268 100644
--- a/cpukit/rtems/src/semdelete.c
+++ b/cpukit/rtems/src/semdelete.c
@@ -31,11 +31,7 @@ rtems_status_code rtems_semaphore_delete(
rtems_attribute attribute_set;
_Objects_Allocator_lock();
- the_semaphore = _Semaphore_Get(
- id,
- &queue_context,
- _Semaphore_MP_Send_object_was_deleted
- );
+ the_semaphore = _Semaphore_Get( id, &queue_context );
if ( the_semaphore == NULL ) {
_Objects_Allocator_unlock();
diff --git a/cpukit/rtems/src/semflush.c b/cpukit/rtems/src/semflush.c
index 73305354ec..07d4aa98b4 100644
--- a/cpukit/rtems/src/semflush.c
+++ b/cpukit/rtems/src/semflush.c
@@ -27,11 +27,7 @@ rtems_status_code rtems_semaphore_flush( rtems_id id )
Thread_queue_Context queue_context;
rtems_attribute attribute_set;
- the_semaphore = _Semaphore_Get(
- id,
- &queue_context,
- _Semaphore_MP_Send_object_was_deleted
- );
+ the_semaphore = _Semaphore_Get( id, &queue_context );
if ( the_semaphore == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -45,6 +41,11 @@ rtems_status_code rtems_semaphore_flush( rtems_id id )
attribute_set = the_semaphore->attribute_set;
+ _Thread_queue_Context_set_MP_callout(
+ &queue_context,
+ _Semaphore_MP_Send_object_was_deleted
+ );
+
#if defined(RTEMS_SMP)
if ( _Attributes_Is_multiprocessor_resource_sharing( attribute_set ) ) {
_ISR_lock_ISR_enable( &queue_context.Lock_context );
diff --git a/cpukit/rtems/src/semobtain.c b/cpukit/rtems/src/semobtain.c
index 527f7ea03f..06c2e1009e 100644
--- a/cpukit/rtems/src/semobtain.c
+++ b/cpukit/rtems/src/semobtain.c
@@ -46,7 +46,7 @@ rtems_status_code rtems_semaphore_obtain(
bool wait;
Status_Control status;
- the_semaphore = _Semaphore_Get( id, &queue_context, NULL );
+ the_semaphore = _Semaphore_Get( id, &queue_context );
if ( the_semaphore == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
diff --git a/cpukit/rtems/src/semrelease.c b/cpukit/rtems/src/semrelease.c
index 007914c09a..10fe743480 100644
--- a/cpukit/rtems/src/semrelease.c
+++ b/cpukit/rtems/src/semrelease.c
@@ -32,11 +32,7 @@ rtems_status_code rtems_semaphore_release( rtems_id id )
rtems_attribute attribute_set;
Status_Control status;
- the_semaphore = _Semaphore_Get(
- id,
- &queue_context,
- _Semaphore_Core_mutex_mp_support
- );
+ the_semaphore = _Semaphore_Get( id, &queue_context );
if ( the_semaphore == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -46,6 +42,11 @@ rtems_status_code rtems_semaphore_release( rtems_id id )
#endif
}
+ _Thread_queue_Context_set_MP_callout(
+ &queue_context,
+ _Semaphore_Core_mutex_mp_support
+ );
+
attribute_set = the_semaphore->attribute_set;
#if defined(RTEMS_SMP)
if ( _Attributes_Is_multiprocessor_resource_sharing( attribute_set ) ) {
diff --git a/cpukit/rtems/src/semsetpriority.c b/cpukit/rtems/src/semsetpriority.c
index 4deee3d189..ee6614af0f 100644
--- a/cpukit/rtems/src/semsetpriority.c
+++ b/cpukit/rtems/src/semsetpriority.c
@@ -103,7 +103,7 @@ rtems_status_code rtems_semaphore_set_priority(
return RTEMS_INVALID_ID;
}
- the_semaphore = _Semaphore_Get( semaphore_id, &queue_context, NULL );
+ the_semaphore = _Semaphore_Get( semaphore_id, &queue_context );
if ( the_semaphore == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
diff --git a/cpukit/score/include/rtems/score/mrspimpl.h b/cpukit/score/include/rtems/score/mrspimpl.h
index ffdc802f6f..5a1fcda54d 100644
--- a/cpukit/score/include/rtems/score/mrspimpl.h
+++ b/cpukit/score/include/rtems/score/mrspimpl.h
@@ -189,7 +189,7 @@ RTEMS_INLINE_ROUTINE void _MRSP_Timeout( Watchdog_Control *watchdog )
Thread_Control *thread = rival->thread;
Thread_queue_Context queue_context;
- _Thread_queue_Context_initialize( &queue_context, NULL );
+ _Thread_queue_Context_initialize( &queue_context );
_ISR_lock_ISR_disable( &queue_context.Lock_context );
_MRSP_Acquire_critical( mrsp, &queue_context );
diff --git a/cpukit/score/include/rtems/score/threadq.h b/cpukit/score/include/rtems/score/threadq.h
index 467462d2b8..5f2ffe49a9 100644
--- a/cpukit/score/include/rtems/score/threadq.h
+++ b/cpukit/score/include/rtems/score/threadq.h
@@ -63,7 +63,22 @@ typedef void ( *Thread_queue_MP_callout )(
* @see _Thread_queue_Context_initialize().
*/
typedef struct {
+ /**
+ * @brief The lock context for the thread queue acquire and release
+ * operations.
+ */
ISR_lock_Context Lock_context;
+
+ /**
+ * @brief Callout to unblock the thread in case it is actually a thread
+ * proxy.
+ *
+ * This field is only used on multiprocessing configurations. Used by
+ * thread queue extract and unblock methods for objects with multiprocessing
+ * (MP) support.
+ *
+ * @see _Thread_queue_Context_set_MP_callout().
+ */
#if defined(RTEMS_MULTIPROCESSING)
Thread_queue_MP_callout mp_callout;
#endif
diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h
index a8f404f299..4f5b48b6eb 100644
--- a/cpukit/score/include/rtems/score/threadqimpl.h
+++ b/cpukit/score/include/rtems/score/threadqimpl.h
@@ -53,47 +53,44 @@ typedef struct {
Thread_queue_Queue Queue;
} Thread_queue_Syslock_queue;
-RTEMS_INLINE_ROUTINE void _Thread_queue_Do_context_initialize(
- Thread_queue_Context *queue_context
-#if defined(RTEMS_MULTIPROCESSING)
- ,
- Thread_queue_MP_callout mp_callout
-#endif
+/**
+ * @brief Initializes a thread queue context.
+ *
+ * @param queue_context The thread queue context to initialize.
+ */
+RTEMS_INLINE_ROUTINE void _Thread_queue_Context_initialize(
+ Thread_queue_Context *queue_context
)
{
-#if defined(RTEMS_MULTIPROCESSING)
- queue_context->mp_callout = mp_callout;
+#if defined(RTEMS_MULTIPROCESSING) && defined(RTEMS_DEBUG)
+ queue_context->mp_callout = NULL;
#else
(void) queue_context;
#endif
}
/**
- * @brief Initializes a thread queue context.
+ * @brief Sets the MP callout in the thread queue context.
*
- * @param queue_context The thread queue context to initialize.
+ * @param queue_context The thread queue context.
* @param mp_callout Callout to unblock the thread in case it is actually a
* thread proxy. This parameter is only used on multiprocessing
* configurations. Used by thread queue extract and unblock methods for
* objects with multiprocessing (MP) support.
*/
#if defined(RTEMS_MULTIPROCESSING)
- #define _Thread_queue_Context_initialize( \
- queue_context, \
- mp_callout \
- ) \
- _Thread_queue_Do_context_initialize( \
- queue_context, \
- mp_callout \
- )
+RTEMS_INLINE_ROUTINE void _Thread_queue_Context_set_MP_callout(
+ Thread_queue_Context *queue_context,
+ Thread_queue_MP_callout mp_callout
+)
+{
+ queue_context->mp_callout = mp_callout;
+}
#else
- #define _Thread_queue_Context_initialize( \
- queue_context, \
- mp_callout \
- ) \
- _Thread_queue_Do_context_initialize( \
- queue_context \
- )
+#define _Thread_queue_Context_set_MP_callout( queue_context, mp_callout ) \
+ do { \
+ (void) queue_context; \
+ } while ( 0 )
#endif
RTEMS_INLINE_ROUTINE void _Thread_queue_Heads_initialize(
diff --git a/cpukit/score/src/apimutexlock.c b/cpukit/score/src/apimutexlock.c
index 11d12c5a7e..7a7f911f84 100644
--- a/cpukit/score/src/apimutexlock.c
+++ b/cpukit/score/src/apimutexlock.c
@@ -31,7 +31,7 @@ void _API_Mutex_Lock( API_Mutex_Control *the_mutex )
previous_thread_life_state =
_Thread_Set_life_protection( THREAD_LIFE_PROTECTED );
- _Thread_queue_Context_initialize( &queue_context, NULL );
+ _Thread_queue_Context_initialize( &queue_context );
_ISR_lock_ISR_disable( &queue_context.Lock_context );
_CORE_mutex_Seize(
diff --git a/cpukit/score/src/apimutexunlock.c b/cpukit/score/src/apimutexunlock.c
index f0f114e0bf..486301fa82 100644
--- a/cpukit/score/src/apimutexunlock.c
+++ b/cpukit/score/src/apimutexunlock.c
@@ -31,7 +31,7 @@ void _API_Mutex_Unlock( API_Mutex_Control *the_mutex )
previous_thread_life_state = the_mutex->previous_thread_life_state;
restore_thread_life_protection = the_mutex->Mutex.nest_count == 1;
- _Thread_queue_Context_initialize( &queue_context, NULL );
+ _Thread_queue_Context_initialize( &queue_context );
_ISR_lock_ISR_disable( &queue_context.Lock_context );
_CORE_mutex_Surrender( &the_mutex->Mutex, &queue_context );
diff --git a/cpukit/score/src/condition.c b/cpukit/score/src/condition.c
index 39924e8c92..fae150a7cd 100644
--- a/cpukit/score/src/condition.c
+++ b/cpukit/score/src/condition.c
@@ -247,7 +247,7 @@ static void _Condition_Wake( struct _Condition_Control *_condition, int count )
Condition_Context context;
condition = _Condition_Get( _condition );
- _Thread_queue_Context_initialize( &context.Base, NULL );
+ _Thread_queue_Context_initialize( &context.Base );
_ISR_lock_ISR_disable( &context.Base.Lock_context );
_Condition_Queue_acquire_critical( condition, &context.Base.Lock_context );
diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c
index 78d8e657fa..1e26b1f3ce 100644
--- a/cpukit/score/src/mpci.c
+++ b/cpukit/score/src/mpci.c
@@ -325,7 +325,7 @@ void _MPCI_Receive_server(
Thread_queue_Context queue_context;
executing = _Thread_Get_executing();
- _Thread_queue_Context_initialize( &queue_context, NULL );
+ _Thread_queue_Context_initialize( &queue_context );
for ( ; ; ) {
diff --git a/cpukit/score/src/mutex.c b/cpukit/score/src/mutex.c
index eea15a05dc..6a85850a89 100644
--- a/cpukit/score/src/mutex.c
+++ b/cpukit/score/src/mutex.c
@@ -293,7 +293,7 @@ void _Mutex_Release( struct _Mutex_Control *_mutex )
Thread_Control *executing;
mutex = _Mutex_Get( _mutex );
- _Thread_queue_Context_initialize( &queue_context, NULL );
+ _Thread_queue_Context_initialize( &queue_context );
executing = _Mutex_Queue_acquire( mutex, &queue_context.Lock_context );
_Assert( mutex->Queue.Queue.owner == executing );
@@ -422,7 +422,7 @@ void _Mutex_recursive_Release( struct _Mutex_recursive_Control *_mutex )
unsigned int nest_level;
mutex = _Mutex_recursive_Get( _mutex );
- _Thread_queue_Context_initialize( &queue_context, NULL );
+ _Thread_queue_Context_initialize( &queue_context );
executing = _Mutex_Queue_acquire(
&mutex->Mutex,
&queue_context.Lock_context
diff --git a/cpukit/score/src/semaphore.c b/cpukit/score/src/semaphore.c
index ea0835d7b5..72abd9e12a 100644
--- a/cpukit/score/src/semaphore.c
+++ b/cpukit/score/src/semaphore.c
@@ -114,7 +114,7 @@ void _Semaphore_Post( struct _Semaphore_Control *_sem )
Thread_queue_Heads *heads;
sem = _Semaphore_Get( _sem );
- _Thread_queue_Context_initialize( &queue_context, NULL );
+ _Thread_queue_Context_initialize( &queue_context );
_Semaphore_Queue_acquire( sem, &queue_context.Lock_context );
heads = sem->Queue.Queue.heads;
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index 948275b74c..4eaafa9036 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -195,10 +195,7 @@ void _Thread_queue_Extract( Thread_Control *the_thread )
void *lock;
Thread_queue_Queue *queue;
- _Thread_queue_Context_initialize(
- &queue_context,
- _Thread_queue_MP_callout_do_nothing
- );
+ _Thread_queue_Context_initialize( &queue_context );
lock = _Thread_Lock_acquire( the_thread, &queue_context.Lock_context );
queue = the_thread->Wait.queue;
@@ -206,6 +203,10 @@ void _Thread_queue_Extract( Thread_Control *the_thread )
if ( queue != NULL ) {
_SMP_Assert( lock == &queue->Lock );
+ _Thread_queue_Context_set_MP_callout(
+ &queue_context,
+ _Thread_queue_MP_callout_do_nothing
+ );
_Thread_queue_Extract_critical(
queue,
the_thread->Wait.operations,
@@ -229,7 +230,8 @@ Thread_Control *_Thread_queue_Do_dequeue(
Thread_queue_Context queue_context;
Thread_Control *the_thread;
- _Thread_queue_Context_initialize( &queue_context, mp_callout );
+ _Thread_queue_Context_initialize( &queue_context );
+ _Thread_queue_Context_set_MP_callout( &queue_context, mp_callout );
_Thread_queue_Acquire( the_thread_queue, &queue_context.Lock_context );
the_thread = _Thread_queue_First_locked( the_thread_queue, operations );
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index f9636e61c7..3bddac458d 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -118,7 +118,7 @@ static void _Thread_Wake_up_joining_threads( Thread_Control *the_thread )
join_context.exit_value = the_thread->Life.exit_value;
#endif
- _Thread_queue_Context_initialize( &join_context.Base, NULL );
+ _Thread_queue_Context_initialize( &join_context.Base );
_Thread_queue_Acquire(
&the_thread->Join_queue,
&join_context.Base.Lock_context
diff --git a/testsuites/sptests/spintrcritical22/init.c b/testsuites/sptests/spintrcritical22/init.c
index 3670d1ae8d..9b5c5e13be 100644
--- a/testsuites/sptests/spintrcritical22/init.c
+++ b/testsuites/sptests/spintrcritical22/init.c
@@ -36,7 +36,7 @@ static Semaphore_Control *get_semaphore_control(rtems_id id)
Thread_queue_Context queue_context;
Semaphore_Control *sem;
- sem = _Semaphore_Get(id, &queue_context, NULL);
+ sem = _Semaphore_Get(id, &queue_context);
rtems_test_assert(sem != NULL);
_ISR_lock_ISR_enable(&queue_context.Lock_context);
diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c
index 68cb246cd0..38fb0ea0b1 100644
--- a/testsuites/tmtests/tm26/task1.c
+++ b/testsuites/tmtests/tm26/task1.c
@@ -514,7 +514,7 @@ void complete_test( void )
benchmark_timer_initialize();
for ( index=1 ; index <= OPERATION_COUNT ; index++ ) {
- (void) _Semaphore_Get( Semaphore_id, &queue_context, NULL );
+ (void) _Semaphore_Get( Semaphore_id, &queue_context );
_ISR_lock_ISR_enable( &queue_context.Lock_context );
}
semaphore_get_time = benchmark_timer_read();