forked from Imagelibrary/rtems
rtems: Move MrsP semaphore operations
Move MrsP semaphore operations to a less prominent location. Fix field name.
This commit is contained in:
@@ -82,7 +82,7 @@ rtems_monitor_sema_canonical(
|
||||
#if defined(RTEMS_SMP)
|
||||
case SEMAPHORE_VARIANT_MRSP:
|
||||
canonical_sema->cur_count =
|
||||
rtems_sema->Core_control.mrsp.Resource.owner == NULL;
|
||||
rtems_sema->Core_control.MRSP.Resource.owner == NULL;
|
||||
canonical_sema->max_count = 1;
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -92,7 +92,7 @@ typedef struct {
|
||||
CORE_semaphore_Control semaphore;
|
||||
|
||||
#if defined(RTEMS_SMP)
|
||||
MRSP_Control mrsp;
|
||||
MRSP_Control MRSP;
|
||||
#endif
|
||||
} Core_control;
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ rtems_status_code rtems_semaphore_create(
|
||||
} else if ( _Attributes_Is_multiprocessor_resource_sharing( attribute_set ) ) {
|
||||
the_semaphore->variant = SEMAPHORE_VARIANT_MRSP;
|
||||
status = _MRSP_Initialize(
|
||||
&the_semaphore->Core_control.mrsp,
|
||||
&the_semaphore->Core_control.MRSP,
|
||||
priority_ceiling,
|
||||
executing,
|
||||
count != 1
|
||||
|
||||
@@ -66,7 +66,7 @@ rtems_status_code rtems_semaphore_delete(
|
||||
break;
|
||||
#if defined(RTEMS_SMP)
|
||||
case SEMAPHORE_VARIANT_MRSP:
|
||||
status = _MRSP_Can_destroy( &the_semaphore->Core_control.mrsp );
|
||||
status = _MRSP_Can_destroy( &the_semaphore->Core_control.MRSP );
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
@@ -92,7 +92,7 @@ rtems_status_code rtems_semaphore_delete(
|
||||
switch ( the_semaphore->variant ) {
|
||||
#if defined(RTEMS_SMP)
|
||||
case SEMAPHORE_VARIANT_MRSP:
|
||||
_MRSP_Destroy( &the_semaphore->Core_control.mrsp, &queue_context );
|
||||
_MRSP_Destroy( &the_semaphore->Core_control.MRSP, &queue_context );
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
||||
@@ -40,7 +40,7 @@ THREAD_QUEUE_OBJECT_ASSERT(
|
||||
#if defined(RTEMS_SMP)
|
||||
THREAD_QUEUE_OBJECT_ASSERT(
|
||||
Semaphore_Control,
|
||||
Core_control.mrsp.Wait_queue
|
||||
Core_control.MRSP.Wait_queue
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -70,17 +70,6 @@ rtems_status_code rtems_semaphore_obtain(
|
||||
wait = !_Options_Is_no_wait( option_set );
|
||||
|
||||
switch ( the_semaphore->variant ) {
|
||||
#if defined(RTEMS_SMP)
|
||||
case SEMAPHORE_VARIANT_MRSP:
|
||||
status = _MRSP_Seize(
|
||||
&the_semaphore->Core_control.mrsp,
|
||||
executing,
|
||||
wait,
|
||||
timeout,
|
||||
&queue_context
|
||||
);
|
||||
break;
|
||||
#endif
|
||||
case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY:
|
||||
status = _CORE_recursive_mutex_Seize(
|
||||
&the_semaphore->Core_control.Mutex.Recursive,
|
||||
@@ -112,6 +101,17 @@ rtems_status_code rtems_semaphore_obtain(
|
||||
&queue_context
|
||||
);
|
||||
break;
|
||||
#if defined(RTEMS_SMP)
|
||||
case SEMAPHORE_VARIANT_MRSP:
|
||||
status = _MRSP_Seize(
|
||||
&the_semaphore->Core_control.MRSP,
|
||||
executing,
|
||||
wait,
|
||||
timeout,
|
||||
&queue_context
|
||||
);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
_Assert(
|
||||
the_semaphore->variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
|
||||
|
||||
@@ -49,15 +49,6 @@ rtems_status_code rtems_semaphore_release( rtems_id id )
|
||||
);
|
||||
|
||||
switch ( the_semaphore->variant ) {
|
||||
#if defined(RTEMS_SMP)
|
||||
case SEMAPHORE_VARIANT_MRSP:
|
||||
status = _MRSP_Surrender(
|
||||
&the_semaphore->Core_control.mrsp,
|
||||
executing,
|
||||
&queue_context
|
||||
);
|
||||
break;
|
||||
#endif
|
||||
case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY:
|
||||
status = _CORE_recursive_mutex_Surrender(
|
||||
&the_semaphore->Core_control.Mutex.Recursive,
|
||||
@@ -93,6 +84,15 @@ rtems_status_code rtems_semaphore_release( rtems_id id )
|
||||
);
|
||||
status = STATUS_SUCCESSFUL;
|
||||
break;
|
||||
#if defined(RTEMS_SMP)
|
||||
case SEMAPHORE_VARIANT_MRSP:
|
||||
status = _MRSP_Surrender(
|
||||
&the_semaphore->Core_control.MRSP,
|
||||
executing,
|
||||
&queue_context
|
||||
);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
_Assert( the_semaphore->variant == SEMAPHORE_VARIANT_COUNTING );
|
||||
status = _CORE_semaphore_Surrender(
|
||||
|
||||
@@ -58,7 +58,7 @@ static rtems_status_code _Semaphore_Set_priority(
|
||||
break;
|
||||
#if defined(RTEMS_SMP)
|
||||
case SEMAPHORE_VARIANT_MRSP:
|
||||
mrsp = &the_semaphore->Core_control.mrsp;
|
||||
mrsp = &the_semaphore->Core_control.MRSP;
|
||||
scheduler_index = _Scheduler_Get_index_by_id( scheduler_id );
|
||||
|
||||
_MRSP_Acquire_critical( mrsp, queue_context );
|
||||
|
||||
Reference in New Issue
Block a user