summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-03 09:57:38 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-04 07:24:31 +0200
commit822ec589689dd5c9bf773fbddb491012965bd2e1 (patch)
tree8999c606a15546a4588bd8741bd9c993b97bf99d /cpukit/score
parentscore: Simplify _Thread_Get_objects_information() (diff)
downloadrtems-822ec589689dd5c9bf773fbddb491012965bd2e1.tar.bz2
score: Add _Thread_MP_Is_remote()
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h21
-rw-r--r--cpukit/score/include/rtems/score/threadmp.h11
-rw-r--r--cpukit/score/src/threadget.c21
3 files changed, 32 insertions, 21 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index b19a6dcae0..1fea4da6ca 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -482,6 +482,27 @@ void _Thread_Set_priority(
bool prepend_it
);
+RTEMS_INLINE_ROUTINE Objects_Information *_Thread_Get_objects_information(
+ Objects_Id id
+)
+{
+ uint32_t the_api;
+
+ the_api = _Objects_Get_API( id );
+
+ if ( !_Objects_Is_api_valid( the_api ) ) {
+ return NULL;
+ }
+
+ /*
+ * Threads are always first class :)
+ *
+ * There is no need to validate the object class of the object identifier,
+ * since this will be done by the object get methods.
+ */
+ return _Objects_Information_table[ the_api ][ 1 ];
+}
+
/**
* @brief Maps thread Id to a TCB pointer.
*
diff --git a/cpukit/score/include/rtems/score/threadmp.h b/cpukit/score/include/rtems/score/threadmp.h
index 5dc5c7ebec..46add28c13 100644
--- a/cpukit/score/include/rtems/score/threadmp.h
+++ b/cpukit/score/include/rtems/score/threadmp.h
@@ -91,6 +91,17 @@ Thread_Control *_Thread_MP_Find_proxy (
*/
void _Thread_MP_Free_proxy( Thread_Control *the_thread );
+RTEMS_INLINE_ROUTINE bool _Thread_MP_Is_remote( Objects_Id id )
+{
+ Objects_Information *information;
+
+ information = _Thread_Get_objects_information( id );
+ if ( information == NULL ) {
+ return false;
+ }
+
+ return _Objects_MP_Is_remote( information, id ) == OBJECTS_REMOTE;
+}
/**@}*/
diff --git a/cpukit/score/src/threadget.c b/cpukit/score/src/threadget.c
index 24773facbf..7e3963d287 100644
--- a/cpukit/score/src/threadget.c
+++ b/cpukit/score/src/threadget.c
@@ -21,27 +21,6 @@
#include <rtems/score/threadimpl.h>
-static Objects_Information *_Thread_Get_objects_information(
- Objects_Id id
-)
-{
- uint32_t the_api;
-
- the_api = _Objects_Get_API( id );
-
- if ( !_Objects_Is_api_valid( the_api ) ) {
- return NULL;
- }
-
- /*
- * Threads are always first class :)
- *
- * There is no need to validate the object class of the object identifier,
- * since this will be done by the object get methods.
- */
- return _Objects_Information_table[ the_api ][ 1 ];
-}
-
Thread_Control *_Thread_Get(
Objects_Id id,
Objects_Locations *location