summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-23 11:40:18 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-25 12:43:54 +0200
commit631b3c8967a329cdd53e54365e4e4c0aa93a4251 (patch)
tree3a750b145a90c90aa86222c26ee68aeb8c87a417 /cpukit/rtems
parentscore: Get rid of mp_id parameter (diff)
downloadrtems-631b3c8967a329cdd53e54365e4e4c0aa93a4251.tar.bz2
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.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/include/rtems/rtems/barrierimpl.h7
-rw-r--r--cpukit/rtems/include/rtems/rtems/messageimpl.h21
-rw-r--r--cpukit/rtems/include/rtems/rtems/semimpl.h21
-rw-r--r--cpukit/rtems/src/barrierdelete.c10
-rw-r--r--cpukit/rtems/src/barrierrelease.c11
-rw-r--r--cpukit/rtems/src/barrierwait.c11
-rw-r--r--cpukit/rtems/src/msgmp.c12
-rw-r--r--cpukit/rtems/src/msgqbroadcast.c11
-rw-r--r--cpukit/rtems/src/msgqdelete.c13
-rw-r--r--cpukit/rtems/src/msgqflush.c6
-rw-r--r--cpukit/rtems/src/msgqgetnumberpending.c8
-rw-r--r--cpukit/rtems/src/msgqreceive.c8
-rw-r--r--cpukit/rtems/src/msgqsend.c13
-rw-r--r--cpukit/rtems/src/msgqurgent.c13
-rw-r--r--cpukit/rtems/src/semdelete.c30
-rw-r--r--cpukit/rtems/src/semflush.c24
-rw-r--r--cpukit/rtems/src/semobtain.c18
-rw-r--r--cpukit/rtems/src/semrelease.c16
-rw-r--r--cpukit/rtems/src/semsetpriority.c28
19 files changed, 157 insertions, 124 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/barrierimpl.h b/cpukit/rtems/include/rtems/rtems/barrierimpl.h
index 39632fcd00..0eaadfc046 100644
--- a/cpukit/rtems/include/rtems/rtems/barrierimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/barrierimpl.h
@@ -70,12 +70,13 @@ RTEMS_INLINE_ROUTINE void _Barrier_Free (
}
RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get(
- Objects_Id id,
- ISR_lock_Context *lock_context
+ Objects_Id id,
+ Thread_queue_Context *queue_context
)
{
+ _Thread_queue_Context_initialize( queue_context, NULL );
return (Barrier_Control *)
- _Objects_Get( id, lock_context, &_Barrier_Information );
+ _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 199af1cacb..d6217f171e 100644
--- a/cpukit/rtems/include/rtems/rtems/messageimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/messageimpl.h
@@ -101,18 +101,31 @@ RTEMS_INLINE_ROUTINE void _Message_queue_Free (
_Objects_Free( &_Message_queue_Information, &the_message_queue->Object );
}
-RTEMS_INLINE_ROUTINE Message_queue_Control * _Message_queue_Get(
- Objects_Id id,
- ISR_lock_Context *lock_context
+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
)
{
+ _Thread_queue_Context_initialize( queue_context, mp_callout );
return (Message_queue_Control *) _Objects_Get(
id,
- lock_context,
+ &queue_context->Lock_context,
&_Message_queue_Information
);
}
+#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 ac55bc7354..c23bef905a 100644
--- a/cpukit/rtems/include/rtems/rtems/semimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/semimpl.h
@@ -134,18 +134,31 @@ RTEMS_INLINE_ROUTINE void _Semaphore_Free (
_Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
}
-RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get(
- Objects_Id id,
- ISR_lock_Context *lock_context
+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
)
{
+ _Thread_queue_Context_initialize( queue_context, mp_callout );
return (Semaphore_Control *) _Objects_Get(
id,
- lock_context,
+ &queue_context->Lock_context,
&_Semaphore_Information
);
}
+#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/barrierdelete.c b/cpukit/rtems/src/barrierdelete.c
index 05d6a3f7d0..3d57908326 100644
--- a/cpukit/rtems/src/barrierdelete.c
+++ b/cpukit/rtems/src/barrierdelete.c
@@ -24,20 +24,20 @@ rtems_status_code rtems_barrier_delete(
rtems_id id
)
{
- Barrier_Control *the_barrier;
- ISR_lock_Context lock_context;
+ Barrier_Control *the_barrier;
+ Thread_queue_Context queue_context;
_Objects_Allocator_lock();
- the_barrier = _Barrier_Get( id, &lock_context );
+ the_barrier = _Barrier_Get( id, &queue_context );
if ( the_barrier == NULL ) {
_Objects_Allocator_unlock();
return RTEMS_INVALID_ID;
}
- _CORE_barrier_Acquire_critical( &the_barrier->Barrier, &lock_context );
+ _CORE_barrier_Acquire_critical( &the_barrier->Barrier, &queue_context );
_Objects_Close( &_Barrier_Information, &the_barrier->Object );
- _CORE_barrier_Flush( &the_barrier->Barrier, NULL, &lock_context );
+ _CORE_barrier_Flush( &the_barrier->Barrier, &queue_context );
_Barrier_Free( the_barrier );
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
diff --git a/cpukit/rtems/src/barrierrelease.c b/cpukit/rtems/src/barrierrelease.c
index 2c7d222c0d..2c7f72d303 100644
--- a/cpukit/rtems/src/barrierrelease.c
+++ b/cpukit/rtems/src/barrierrelease.c
@@ -25,24 +25,23 @@ rtems_status_code rtems_barrier_release(
uint32_t *released
)
{
- Barrier_Control *the_barrier;
- ISR_lock_Context lock_context;
+ Barrier_Control *the_barrier;
+ Thread_queue_Context queue_context;
if ( released == NULL ) {
return RTEMS_INVALID_ADDRESS;
}
- the_barrier = _Barrier_Get( id, &lock_context );
+ the_barrier = _Barrier_Get( id, &queue_context );
if ( the_barrier == NULL ) {
return RTEMS_INVALID_ID;
}
- _CORE_barrier_Acquire_critical( &the_barrier->Barrier, &lock_context );
+ _CORE_barrier_Acquire_critical( &the_barrier->Barrier, &queue_context );
*released = _CORE_barrier_Surrender(
&the_barrier->Barrier,
- NULL,
- &lock_context
+ &queue_context
);
return RTEMS_SUCCESSFUL;
}
diff --git a/cpukit/rtems/src/barrierwait.c b/cpukit/rtems/src/barrierwait.c
index 7f463aa217..6e133751aa 100644
--- a/cpukit/rtems/src/barrierwait.c
+++ b/cpukit/rtems/src/barrierwait.c
@@ -27,11 +27,11 @@ rtems_status_code rtems_barrier_wait(
rtems_interval timeout
)
{
- Barrier_Control *the_barrier;
- ISR_lock_Context lock_context;
- Thread_Control *executing;
+ Barrier_Control *the_barrier;
+ Thread_queue_Context queue_context;
+ Thread_Control *executing;
- the_barrier = _Barrier_Get( id, &lock_context );
+ the_barrier = _Barrier_Get( id, &queue_context );
if ( the_barrier == NULL ) {
return RTEMS_INVALID_ID;
@@ -43,8 +43,7 @@ rtems_status_code rtems_barrier_wait(
executing,
true,
timeout,
- NULL,
- &lock_context
+ &queue_context
);
return _Barrier_Translate_core_barrier_return_code(
executing->Wait.return_code
diff --git a/cpukit/rtems/src/msgmp.c b/cpukit/rtems/src/msgmp.c
index c336ba48c1..d8077a71ec 100644
--- a/cpukit/rtems/src/msgmp.c
+++ b/cpukit/rtems/src/msgmp.c
@@ -576,17 +576,7 @@ void _Message_queue_MP_Send_extract_proxy (
);
}
-/*
- * _Message_queue_Core_message_queue_mp_support
- *
- * Input parameters:
- * the_thread - the remote thread the message was submitted to
- * id - id of the message queue
- *
- * Output parameters: NONE
- */
-
-void _Message_queue_Core_message_queue_mp_support (
+void _Message_queue_Core_message_queue_mp_support(
Thread_Control *the_thread,
Objects_Id id
)
diff --git a/cpukit/rtems/src/msgqbroadcast.c b/cpukit/rtems/src/msgqbroadcast.c
index 45d9097326..75f9d60e1b 100644
--- a/cpukit/rtems/src/msgqbroadcast.c
+++ b/cpukit/rtems/src/msgqbroadcast.c
@@ -28,7 +28,7 @@ rtems_status_code rtems_message_queue_broadcast(
)
{
Message_queue_Control *the_message_queue;
- ISR_lock_Context lock_context;
+ Thread_queue_Context queue_context;
CORE_message_queue_Status status;
if ( buffer == NULL ) {
@@ -39,7 +39,11 @@ rtems_status_code rtems_message_queue_broadcast(
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get( id, &lock_context );
+ the_message_queue = _Message_queue_Get(
+ id,
+ &queue_context,
+ _Message_queue_Core_message_queue_mp_support
+ );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -53,9 +57,8 @@ rtems_status_code rtems_message_queue_broadcast(
&the_message_queue->message_queue,
buffer,
size,
- _Message_queue_Core_message_queue_mp_support,
count,
- &lock_context
+ &queue_context
);
return _Message_queue_Translate_core_message_queue_return_code( status );
}
diff --git a/cpukit/rtems/src/msgqdelete.c b/cpukit/rtems/src/msgqdelete.c
index c39cfea5a7..94175e6993 100644
--- a/cpukit/rtems/src/msgqdelete.c
+++ b/cpukit/rtems/src/msgqdelete.c
@@ -26,10 +26,14 @@ rtems_status_code rtems_message_queue_delete(
)
{
Message_queue_Control *the_message_queue;
- ISR_lock_Context lock_context;
+ Thread_queue_Context queue_context;
_Objects_Allocator_lock();
- the_message_queue = _Message_queue_Get( id, &lock_context );
+ the_message_queue = _Message_queue_Get(
+ id,
+ &queue_context,
+ _Message_queue_MP_Send_object_was_deleted
+ );
if ( the_message_queue == NULL ) {
_Objects_Allocator_unlock();
@@ -45,15 +49,14 @@ rtems_status_code rtems_message_queue_delete(
_CORE_message_queue_Acquire_critical(
&the_message_queue->message_queue,
- &lock_context
+ &queue_context
);
_Objects_Close( &_Message_queue_Information, &the_message_queue->Object );
_CORE_message_queue_Close(
&the_message_queue->message_queue,
- _Message_queue_MP_Send_object_was_deleted,
- &lock_context
+ &queue_context
);
#if defined(RTEMS_MULTIPROCESSING)
diff --git a/cpukit/rtems/src/msgqflush.c b/cpukit/rtems/src/msgqflush.c
index baca1767f6..b4419d173d 100644
--- a/cpukit/rtems/src/msgqflush.c
+++ b/cpukit/rtems/src/msgqflush.c
@@ -26,13 +26,13 @@ rtems_status_code rtems_message_queue_flush(
)
{
Message_queue_Control *the_message_queue;
- ISR_lock_Context lock_context;
+ Thread_queue_Context queue_context;
if ( count == NULL ) {
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get( id, &lock_context );
+ the_message_queue = _Message_queue_Get( id, &queue_context, NULL );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -44,7 +44,7 @@ rtems_status_code rtems_message_queue_flush(
*count = _CORE_message_queue_Flush(
&the_message_queue->message_queue,
- &lock_context
+ &queue_context
);
return RTEMS_SUCCESSFUL;
}
diff --git a/cpukit/rtems/src/msgqgetnumberpending.c b/cpukit/rtems/src/msgqgetnumberpending.c
index f655c0bba4..d2f7820553 100644
--- a/cpukit/rtems/src/msgqgetnumberpending.c
+++ b/cpukit/rtems/src/msgqgetnumberpending.c
@@ -26,13 +26,13 @@ rtems_status_code rtems_message_queue_get_number_pending(
)
{
Message_queue_Control *the_message_queue;
- ISR_lock_Context lock_context;
+ Thread_queue_Context queue_context;
if ( count == NULL ) {
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get( id, &lock_context );
+ the_message_queue = _Message_queue_Get( id, &queue_context, NULL );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -44,12 +44,12 @@ rtems_status_code rtems_message_queue_get_number_pending(
_CORE_message_queue_Acquire_critical(
&the_message_queue->message_queue,
- &lock_context
+ &queue_context
);
*count = the_message_queue->message_queue.number_of_pending_messages;
_CORE_message_queue_Release(
&the_message_queue->message_queue,
- &lock_context
+ &queue_context
);
return RTEMS_SUCCESSFUL;
}
diff --git a/cpukit/rtems/src/msgqreceive.c b/cpukit/rtems/src/msgqreceive.c
index dada8dff81..6ed3d25674 100644
--- a/cpukit/rtems/src/msgqreceive.c
+++ b/cpukit/rtems/src/msgqreceive.c
@@ -32,7 +32,7 @@ rtems_status_code rtems_message_queue_receive(
)
{
Message_queue_Control *the_message_queue;
- ISR_lock_Context lock_context;
+ Thread_queue_Context queue_context;
Thread_Control *executing;
if ( buffer == NULL ) {
@@ -43,7 +43,7 @@ rtems_status_code rtems_message_queue_receive(
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get( id, &lock_context );
+ the_message_queue = _Message_queue_Get( id, &queue_context, NULL );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -55,7 +55,7 @@ rtems_status_code rtems_message_queue_receive(
_CORE_message_queue_Acquire_critical(
&the_message_queue->message_queue,
- &lock_context
+ &queue_context
);
executing = _Thread_Executing;
@@ -66,7 +66,7 @@ rtems_status_code rtems_message_queue_receive(
size,
!_Options_Is_no_wait( option_set ),
timeout,
- &lock_context
+ &queue_context
);
return _Message_queue_Translate_core_message_queue_return_code(
executing->Wait.return_code
diff --git a/cpukit/rtems/src/msgqsend.c b/cpukit/rtems/src/msgqsend.c
index c306deb18b..c5bde9d348 100644
--- a/cpukit/rtems/src/msgqsend.c
+++ b/cpukit/rtems/src/msgqsend.c
@@ -27,14 +27,18 @@ rtems_status_code rtems_message_queue_send(
)
{
Message_queue_Control *the_message_queue;
- ISR_lock_Context lock_context;
+ Thread_queue_Context queue_context;
CORE_message_queue_Status status;
if ( buffer == NULL ) {
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get( id, &lock_context );
+ the_message_queue = _Message_queue_Get(
+ id,
+ &queue_context,
+ _Message_queue_Core_message_queue_mp_support
+ );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -46,16 +50,15 @@ rtems_status_code rtems_message_queue_send(
_CORE_message_queue_Acquire_critical(
&the_message_queue->message_queue,
- &lock_context
+ &queue_context
);
status = _CORE_message_queue_Send(
&the_message_queue->message_queue,
buffer,
size,
- _Message_queue_Core_message_queue_mp_support,
false, /* sender does not block */
0, /* no timeout */
- &lock_context
+ &queue_context
);
/*
diff --git a/cpukit/rtems/src/msgqurgent.c b/cpukit/rtems/src/msgqurgent.c
index 56522a1c10..add5f09bb2 100644
--- a/cpukit/rtems/src/msgqurgent.c
+++ b/cpukit/rtems/src/msgqurgent.c
@@ -27,14 +27,18 @@ rtems_status_code rtems_message_queue_urgent(
)
{
Message_queue_Control *the_message_queue;
- ISR_lock_Context lock_context;
+ Thread_queue_Context queue_context;
CORE_message_queue_Status status;
if ( buffer == NULL ) {
return RTEMS_INVALID_ADDRESS;
}
- the_message_queue = _Message_queue_Get( id, &lock_context );
+ the_message_queue = _Message_queue_Get(
+ id,
+ &queue_context,
+ _Message_queue_Core_message_queue_mp_support
+ );
if ( the_message_queue == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -46,16 +50,15 @@ rtems_status_code rtems_message_queue_urgent(
_CORE_message_queue_Acquire_critical(
&the_message_queue->message_queue,
- &lock_context
+ &queue_context
);
status = _CORE_message_queue_Urgent(
&the_message_queue->message_queue,
buffer,
size,
- _Message_queue_Core_message_queue_mp_support,
false, /* sender does not block */
0, /* no timeout */
- &lock_context
+ &queue_context
);
/*
diff --git a/cpukit/rtems/src/semdelete.c b/cpukit/rtems/src/semdelete.c
index cf2283830c..023a57cf23 100644
--- a/cpukit/rtems/src/semdelete.c
+++ b/cpukit/rtems/src/semdelete.c
@@ -25,12 +25,16 @@ rtems_status_code rtems_semaphore_delete(
rtems_id id
)
{
- Semaphore_Control *the_semaphore;
- ISR_lock_Context lock_context;
- rtems_attribute attribute_set;
+ Semaphore_Control *the_semaphore;
+ Thread_queue_Context queue_context;
+ rtems_attribute attribute_set;
_Objects_Allocator_lock();
- the_semaphore = _Semaphore_Get( id, &lock_context );
+ the_semaphore = _Semaphore_Get(
+ id,
+ &queue_context,
+ _Semaphore_MP_Send_object_was_deleted
+ );
if ( the_semaphore == NULL ) {
_Objects_Allocator_unlock();
@@ -52,13 +56,13 @@ rtems_status_code rtems_semaphore_delete(
_MRSP_Acquire_critical(
&the_semaphore->Core_control.mrsp,
- &lock_context
+ &queue_context
);
mrsp_status = _MRSP_Can_destroy( &the_semaphore->Core_control.mrsp );
if ( mrsp_status != MRSP_SUCCESSFUL ) {
_MRSP_Release(
&the_semaphore->Core_control.mrsp,
- &lock_context
+ &queue_context
);
_Objects_Allocator_unlock();
return _Semaphore_Translate_MRSP_status_code( mrsp_status );
@@ -68,7 +72,7 @@ rtems_status_code rtems_semaphore_delete(
if ( !_Attributes_Is_counting_semaphore( attribute_set ) ) {
_CORE_mutex_Acquire_critical(
&the_semaphore->Core_control.mutex,
- &lock_context
+ &queue_context
);
if (
@@ -77,7 +81,7 @@ rtems_status_code rtems_semaphore_delete(
) {
_CORE_mutex_Release(
&the_semaphore->Core_control.mutex,
- &lock_context
+ &queue_context
);
_Objects_Allocator_unlock();
return RTEMS_RESOURCE_IN_USE;
@@ -85,7 +89,7 @@ rtems_status_code rtems_semaphore_delete(
} else {
_CORE_semaphore_Acquire_critical(
&the_semaphore->Core_control.semaphore,
- &lock_context
+ &queue_context
);
}
@@ -93,22 +97,20 @@ rtems_status_code rtems_semaphore_delete(
#if defined(RTEMS_SMP)
if ( _Attributes_Is_multiprocessor_resource_sharing( attribute_set ) ) {
- _MRSP_Destroy( &the_semaphore->Core_control.mrsp, &lock_context );
+ _MRSP_Destroy( &the_semaphore->Core_control.mrsp, &queue_context );
} else
#endif
if ( !_Attributes_Is_counting_semaphore( attribute_set ) ) {
_CORE_mutex_Flush(
&the_semaphore->Core_control.mutex,
_CORE_mutex_Was_deleted,
- _Semaphore_MP_Send_object_was_deleted,
- &lock_context
+ &queue_context
);
_CORE_mutex_Destroy( &the_semaphore->Core_control.mutex );
} else {
_CORE_semaphore_Destroy(
&the_semaphore->Core_control.semaphore,
- _Semaphore_MP_Send_object_was_deleted,
- &lock_context
+ &queue_context
);
}
diff --git a/cpukit/rtems/src/semflush.c b/cpukit/rtems/src/semflush.c
index 73e9ad06cb..b18de6d4a7 100644
--- a/cpukit/rtems/src/semflush.c
+++ b/cpukit/rtems/src/semflush.c
@@ -23,11 +23,15 @@
rtems_status_code rtems_semaphore_flush( rtems_id id )
{
- Semaphore_Control *the_semaphore;
- ISR_lock_Context lock_context;
- rtems_attribute attribute_set;
+ Semaphore_Control *the_semaphore;
+ Thread_queue_Context queue_context;
+ rtems_attribute attribute_set;
- the_semaphore = _Semaphore_Get( id, &lock_context );
+ the_semaphore = _Semaphore_Get(
+ id,
+ &queue_context,
+ _Semaphore_MP_Send_object_was_deleted
+ );
if ( the_semaphore == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -43,30 +47,28 @@ rtems_status_code rtems_semaphore_flush( rtems_id id )
#if defined(RTEMS_SMP)
if ( _Attributes_Is_multiprocessor_resource_sharing( attribute_set ) ) {
- _ISR_lock_ISR_enable( &lock_context );
+ _ISR_lock_ISR_enable( &queue_context.Lock_context );
return RTEMS_NOT_DEFINED;
} else
#endif
if ( !_Attributes_Is_counting_semaphore( attribute_set ) ) {
_CORE_mutex_Acquire_critical(
&the_semaphore->Core_control.mutex,
- &lock_context
+ &queue_context
);
_CORE_mutex_Flush(
&the_semaphore->Core_control.mutex,
_CORE_mutex_Unsatisfied_nowait,
- _Semaphore_MP_Send_object_was_deleted,
- &lock_context
+ &queue_context
);
} else {
_CORE_semaphore_Acquire_critical(
&the_semaphore->Core_control.semaphore,
- &lock_context
+ &queue_context
);
_CORE_semaphore_Flush(
&the_semaphore->Core_control.semaphore,
- _Semaphore_MP_Send_object_was_deleted,
- &lock_context
+ &queue_context
);
}
return RTEMS_SUCCESSFUL;
diff --git a/cpukit/rtems/src/semobtain.c b/cpukit/rtems/src/semobtain.c
index 3cf780aa28..6d994f4707 100644
--- a/cpukit/rtems/src/semobtain.c
+++ b/cpukit/rtems/src/semobtain.c
@@ -38,13 +38,13 @@ rtems_status_code rtems_semaphore_obtain(
rtems_interval timeout
)
{
- Semaphore_Control *the_semaphore;
- ISR_lock_Context lock_context;
- Thread_Control *executing;
- rtems_attribute attribute_set;
- bool wait;
+ Semaphore_Control *the_semaphore;
+ Thread_queue_Context queue_context;
+ Thread_Control *executing;
+ rtems_attribute attribute_set;
+ bool wait;
- the_semaphore = _Semaphore_Get( id, &lock_context );
+ the_semaphore = _Semaphore_Get( id, &queue_context, NULL );
if ( the_semaphore == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -66,7 +66,7 @@ rtems_status_code rtems_semaphore_obtain(
executing,
wait,
timeout,
- &lock_context
+ &queue_context
);
return _Semaphore_Translate_MRSP_status_code( mrsp_status );
} else
@@ -77,7 +77,7 @@ rtems_status_code rtems_semaphore_obtain(
executing,
wait,
timeout,
- &lock_context
+ &queue_context
);
return _Semaphore_Translate_core_mutex_return_code(
executing->Wait.return_code
@@ -90,7 +90,7 @@ rtems_status_code rtems_semaphore_obtain(
executing,
wait,
timeout,
- &lock_context
+ &queue_context
);
return _Semaphore_Translate_core_semaphore_return_code(
executing->Wait.return_code
diff --git a/cpukit/rtems/src/semrelease.c b/cpukit/rtems/src/semrelease.c
index c39455c167..197e4d81b0 100644
--- a/cpukit/rtems/src/semrelease.c
+++ b/cpukit/rtems/src/semrelease.c
@@ -30,9 +30,13 @@ rtems_status_code rtems_semaphore_release( rtems_id id )
CORE_mutex_Status mutex_status;
CORE_semaphore_Status semaphore_status;
rtems_attribute attribute_set;
- ISR_lock_Context lock_context;
+ Thread_queue_Context queue_context;
- the_semaphore = _Semaphore_Get( id, &lock_context );
+ the_semaphore = _Semaphore_Get(
+ id,
+ &queue_context,
+ _Semaphore_Core_mutex_mp_support
+ );
if ( the_semaphore == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -50,7 +54,7 @@ rtems_status_code rtems_semaphore_release( rtems_id id )
mrsp_status = _MRSP_Surrender(
&the_semaphore->Core_control.mrsp,
_Thread_Executing,
- &lock_context
+ &queue_context
);
return _Semaphore_Translate_MRSP_status_code( mrsp_status );
} else
@@ -58,15 +62,13 @@ rtems_status_code rtems_semaphore_release( rtems_id id )
if ( !_Attributes_Is_counting_semaphore( attribute_set ) ) {
mutex_status = _CORE_mutex_Surrender(
&the_semaphore->Core_control.mutex,
- _Semaphore_Core_mutex_mp_support,
- &lock_context
+ &queue_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,
- &lock_context
+ &queue_context
);
return _Semaphore_Translate_core_semaphore_return_code( semaphore_status );
}
diff --git a/cpukit/rtems/src/semsetpriority.c b/cpukit/rtems/src/semsetpriority.c
index 18fb66ab7f..4deee3d189 100644
--- a/cpukit/rtems/src/semsetpriority.c
+++ b/cpukit/rtems/src/semsetpriority.c
@@ -22,11 +22,11 @@
#include <rtems/score/schedulerimpl.h>
static rtems_status_code _Semaphore_Set_priority(
- Semaphore_Control *the_semaphore,
- rtems_id scheduler_id,
- rtems_task_priority new_priority,
- rtems_task_priority *old_priority_p,
- ISR_lock_Context *lock_context
+ Semaphore_Control *the_semaphore,
+ rtems_id scheduler_id,
+ rtems_task_priority new_priority,
+ rtems_task_priority *old_priority_p,
+ Thread_queue_Context *queue_context
)
{
rtems_status_code sc;
@@ -40,7 +40,7 @@ static rtems_status_code _Semaphore_Set_priority(
MRSP_Control *mrsp = &the_semaphore->Core_control.mrsp;
uint32_t scheduler_index = _Scheduler_Get_index_by_id( scheduler_id );
- _MRSP_Acquire_critical( mrsp, lock_context );
+ _MRSP_Acquire_critical( mrsp, queue_context );
old_priority = _MRSP_Get_ceiling_priority( mrsp, scheduler_index );
@@ -48,7 +48,7 @@ static rtems_status_code _Semaphore_Set_priority(
_MRSP_Set_ceiling_priority( mrsp, scheduler_index, new_priority );
}
- _MRSP_Release( mrsp, lock_context );
+ _MRSP_Release( mrsp, queue_context );
sc = RTEMS_SUCCESSFUL;
} else
@@ -56,7 +56,7 @@ static rtems_status_code _Semaphore_Set_priority(
if ( _Attributes_Is_priority_ceiling( attribute_set ) ) {
CORE_mutex_Control *mutex = &the_semaphore->Core_control.mutex;
- _CORE_mutex_Acquire_critical( mutex, lock_context );
+ _CORE_mutex_Acquire_critical( mutex, queue_context );
old_priority = mutex->Attributes.priority_ceiling;
@@ -64,11 +64,11 @@ static rtems_status_code _Semaphore_Set_priority(
mutex->Attributes.priority_ceiling = new_priority;
}
- _CORE_mutex_Release( mutex, lock_context );
+ _CORE_mutex_Release( mutex, queue_context );
sc = RTEMS_SUCCESSFUL;
} else {
- _ISR_lock_ISR_enable( lock_context );
+ _ISR_lock_ISR_enable( &queue_context->Lock_context );
old_priority = 0;
@@ -87,8 +87,8 @@ rtems_status_code rtems_semaphore_set_priority(
rtems_task_priority *old_priority
)
{
- Semaphore_Control *the_semaphore;
- ISR_lock_Context lock_context;
+ Semaphore_Control *the_semaphore;
+ Thread_queue_Context queue_context;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
!_RTEMS_tasks_Priority_is_valid( new_priority ) ) {
@@ -103,7 +103,7 @@ rtems_status_code rtems_semaphore_set_priority(
return RTEMS_INVALID_ID;
}
- the_semaphore = _Semaphore_Get( semaphore_id, &lock_context );
+ the_semaphore = _Semaphore_Get( semaphore_id, &queue_context, NULL );
if ( the_semaphore == NULL ) {
#if defined(RTEMS_MULTIPROCESSING)
@@ -120,6 +120,6 @@ rtems_status_code rtems_semaphore_set_priority(
scheduler_id,
new_priority,
old_priority,
- &lock_context
+ &queue_context
);
}