From 9d9b6b56d1ecf0d8918556835fa0f83289140791 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 30 Mar 2016 08:36:08 +0200 Subject: score: Objects_Thread_queue_Extract_callout Change parameters of the objects thread queue extract callout to avoid a cast and explicit use of the thread wait information. --- cpukit/rtems/include/rtems/rtems/msgmp.h | 3 ++- cpukit/rtems/include/rtems/rtems/partmp.h | 3 ++- cpukit/rtems/include/rtems/rtems/regionmp.h | 3 ++- cpukit/rtems/include/rtems/rtems/semmp.h | 3 ++- cpukit/rtems/src/msgmp.c | 7 +++---- cpukit/rtems/src/partmp.c | 7 +++---- cpukit/rtems/src/regionmp.c | 7 +++---- cpukit/rtems/src/semmp.c | 7 +++---- cpukit/score/include/rtems/score/objectimpl.h | 5 ++++- cpukit/score/src/threadqextractwithproxy.c | 6 ++++-- 10 files changed, 28 insertions(+), 23 deletions(-) diff --git a/cpukit/rtems/include/rtems/rtems/msgmp.h b/cpukit/rtems/include/rtems/rtems/msgmp.h index 3c2b450f34..f3c31f23fb 100644 --- a/cpukit/rtems/include/rtems/rtems/msgmp.h +++ b/cpukit/rtems/include/rtems/rtems/msgmp.h @@ -163,7 +163,8 @@ void _Message_queue_MP_Send_object_was_deleted ( * the remote node must be informed of this. */ void _Message_queue_MP_Send_extract_proxy ( - void *argument + Thread_Control *the_thread, + Objects_Id id ); /** diff --git a/cpukit/rtems/include/rtems/rtems/partmp.h b/cpukit/rtems/include/rtems/rtems/partmp.h index 0658a78b65..26af64e974 100644 --- a/cpukit/rtems/include/rtems/rtems/partmp.h +++ b/cpukit/rtems/include/rtems/rtems/partmp.h @@ -133,7 +133,8 @@ void _Partition_MP_Process_packet ( * the remote node must be informed of this. */ void _Partition_MP_Send_extract_proxy ( - void *argument + Thread_Control *the_thread, + Objects_Id id ); /** diff --git a/cpukit/rtems/include/rtems/rtems/regionmp.h b/cpukit/rtems/include/rtems/rtems/regionmp.h index 2b265f2a5f..67685305ad 100644 --- a/cpukit/rtems/include/rtems/rtems/regionmp.h +++ b/cpukit/rtems/include/rtems/rtems/regionmp.h @@ -138,7 +138,8 @@ void _Region_MP_Process_packet ( * the remote node must be informed of this. */ void _Region_MP_Send_extract_proxy ( - void *argument + Thread_Control *the_thread, + Objects_Id id ); /** diff --git a/cpukit/rtems/include/rtems/rtems/semmp.h b/cpukit/rtems/include/rtems/rtems/semmp.h index 9fd6c74a5a..9c9a1e653d 100644 --- a/cpukit/rtems/include/rtems/rtems/semmp.h +++ b/cpukit/rtems/include/rtems/rtems/semmp.h @@ -132,7 +132,8 @@ void _Semaphore_MP_Send_object_was_deleted ( * the remote node must be informed of this. */ void _Semaphore_MP_Send_extract_proxy ( - void *argument + Thread_Control *the_thread, + Objects_Id id ); /** diff --git a/cpukit/rtems/src/msgmp.c b/cpukit/rtems/src/msgmp.c index 74b240cb21..53077c4863 100644 --- a/cpukit/rtems/src/msgmp.c +++ b/cpukit/rtems/src/msgmp.c @@ -453,14 +453,13 @@ void _Message_queue_MP_Send_object_was_deleted ( */ void _Message_queue_MP_Send_extract_proxy ( - void *argument + Thread_Control *the_thread, + Objects_Id id ) { - Thread_Control *the_thread = (Thread_Control *)argument; - _Message_queue_MP_Send_process_packet( MESSAGE_QUEUE_MP_EXTRACT_PROXY, - the_thread->Wait.id, + id, (rtems_name) 0, the_thread->Object.id ); diff --git a/cpukit/rtems/src/partmp.c b/cpukit/rtems/src/partmp.c index 00fc8101fb..8e9d307825 100644 --- a/cpukit/rtems/src/partmp.c +++ b/cpukit/rtems/src/partmp.c @@ -275,14 +275,13 @@ void _Partition_MP_Process_packet ( */ void _Partition_MP_Send_extract_proxy ( - void *argument + Thread_Control *the_thread, + Objects_Id id ) { - Thread_Control *the_thread = (Thread_Control *)argument; - _Partition_MP_Send_process_packet( PARTITION_MP_EXTRACT_PROXY, - the_thread->Wait.id, + id, (rtems_name) 0, the_thread->Object.id ); diff --git a/cpukit/rtems/src/regionmp.c b/cpukit/rtems/src/regionmp.c index bd4e04fcf6..bcdec6bef7 100644 --- a/cpukit/rtems/src/regionmp.c +++ b/cpukit/rtems/src/regionmp.c @@ -259,14 +259,13 @@ void _Region_MP_Process_packet ( */ void _Region_MP_Send_extract_proxy ( - void *argument + Thread_Control *the_thread, + Objects_Id id ) { - Thread_Control *the_thread = (Thread_Control *)argument; - _Region_MP_Send_process_packet( REGION_MP_EXTRACT_PROXY, - the_thread->Wait.id, + id, (rtems_name) 0, the_thread->Object.id ); diff --git a/cpukit/rtems/src/semmp.c b/cpukit/rtems/src/semmp.c index 66b74ad57b..90432c1738 100644 --- a/cpukit/rtems/src/semmp.c +++ b/cpukit/rtems/src/semmp.c @@ -247,14 +247,13 @@ void _Semaphore_MP_Send_object_was_deleted ( } void _Semaphore_MP_Send_extract_proxy ( - void *argument + Thread_Control *the_thread, + Objects_Id id ) { - Thread_Control *the_thread = (Thread_Control *)argument; - _Semaphore_MP_Send_process_packet( SEMAPHORE_MP_EXTRACT_PROXY, - the_thread->Wait.id, + id, (rtems_name) 0, the_thread->Object.id ); diff --git a/cpukit/score/include/rtems/score/objectimpl.h b/cpukit/score/include/rtems/score/objectimpl.h index 3adf3a795f..786910e2e6 100644 --- a/cpukit/score/include/rtems/score/objectimpl.h +++ b/cpukit/score/include/rtems/score/objectimpl.h @@ -127,7 +127,10 @@ typedef enum { * is extracted from a remote thread queue (i.e. it's proxy must * extracted from the remote queue). */ -typedef void ( *Objects_Thread_queue_Extract_callout )( void * ); +typedef void ( *Objects_Thread_queue_Extract_callout )( + Thread_Control *, + Objects_Id +); /** * The following defines the structure for the information used to diff --git a/cpukit/score/src/threadqextractwithproxy.c b/cpukit/score/src/threadqextractwithproxy.c index 72043a094d..9bbf9c6f64 100644 --- a/cpukit/score/src/threadqextractwithproxy.c +++ b/cpukit/score/src/threadqextractwithproxy.c @@ -37,14 +37,16 @@ void _Thread_queue_Extract_with_proxy( state = the_thread->current_state; if ( _States_Is_waiting_for_rpc_reply( state ) && _States_Is_locally_blocked( state ) ) { + Objects_Id id; Objects_Information *the_information; Objects_Thread_queue_Extract_callout proxy_extract_callout; - the_information = _Objects_Get_information_id( the_thread->Wait.id ); + id = the_thread->Wait.id; + the_information = _Objects_Get_information_id( id ); proxy_extract_callout = the_information->extract; if ( proxy_extract_callout != NULL ) - (*proxy_extract_callout)( the_thread ); + (*proxy_extract_callout)( the_thread, id ); } #endif -- cgit v1.2.3