[rtems commit] score: Objects_Thread_queue_Extract_callout

Sebastian Huber sebh at rtems.org
Wed Mar 30 06:47:08 UTC 2016


Module:    rtems
Branch:    master
Commit:    9d9b6b56d1ecf0d8918556835fa0f83289140791
Changeset: http://git.rtems.org/rtems/commit/?id=9d9b6b56d1ecf0d8918556835fa0f83289140791

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Mar 30 08:36:08 2016 +0200

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 3c2b450..f3c31f2 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 0658a78..26af64e 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 2b265f2..6768530 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 9fd6c74..9c9a1e6 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 74b240c..53077c4 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 00fc810..8e9d307 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 bd4e04f..bcdec6b 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 66b74ad..90432c1 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 3adf3a7..786910e 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 72043a0..9bbf9c6 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
 



More information about the vc mailing list