diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-20 11:53:41 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-20 16:16:59 +0200 |
commit | 956b8e5047e8736257df80bbb39648b9872ecdbf (patch) | |
tree | 578cd0512af40f1020ea5bc22a61ce52e0a50517 | |
parent | posix: Add const to _POSIX_Keys_Key_value_find() (diff) | |
download | rtems-956b8e5047e8736257df80bbb39648b9872ecdbf.tar.bz2 |
mpci: Simplify _Objects_MP_Is_remote()
-rw-r--r-- | cpukit/score/include/rtems/score/objectmp.h | 20 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/threadmp.h | 2 | ||||
-rw-r--r-- | cpukit/score/src/objectgetisr.c | 8 | ||||
-rw-r--r-- | cpukit/score/src/objectmp.c | 12 |
4 files changed, 20 insertions, 22 deletions
diff --git a/cpukit/score/include/rtems/score/objectmp.h b/cpukit/score/include/rtems/score/objectmp.h index 4f73012a04..5c9f4f74e3 100644 --- a/cpukit/score/include/rtems/score/objectmp.h +++ b/cpukit/score/include/rtems/score/objectmp.h @@ -144,19 +144,19 @@ Objects_Name_or_id_lookup_errors _Objects_MP_Global_name_search ( ); /** - * @brief Searches the Global Object Table managed - * by information for the object indicated by ID. + * @brief Returns true, if the object identifier is in the global object + * identifier cache of the specified object information, otherwise false. * - * @param[in] information points to the object information table for this - * object class. - * @param[in] the_id is the Id of the object being opened. + * @param id The object identifier. + * @param information The object information. * - * @retval OBJECTS_REMOTE A remote objects with this object identifier exits. - * @retval OBJECTS_ERROR Otherwise. + * @retval true A remote objects with this object identifier exits in the + * global object identifier cache of the specified information. + * @retval false Otherwise. */ -Objects_Locations _Objects_MP_Is_remote( - Objects_Information *information, - Objects_Id the_id +bool _Objects_MP_Is_remote( + Objects_Id id, + const Objects_Information *information ); /** diff --git a/cpukit/score/include/rtems/score/threadmp.h b/cpukit/score/include/rtems/score/threadmp.h index 46add28c13..9cde35b649 100644 --- a/cpukit/score/include/rtems/score/threadmp.h +++ b/cpukit/score/include/rtems/score/threadmp.h @@ -100,7 +100,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_MP_Is_remote( Objects_Id id ) return false; } - return _Objects_MP_Is_remote( information, id ) == OBJECTS_REMOTE; + return _Objects_MP_Is_remote( id, information ); } /**@}*/ diff --git a/cpukit/score/src/objectgetisr.c b/cpukit/score/src/objectgetisr.c index 3a185ce125..71f62fe482 100644 --- a/cpukit/score/src/objectgetisr.c +++ b/cpukit/score/src/objectgetisr.c @@ -43,10 +43,12 @@ Objects_Control *_Objects_Get_isr_disable( return NULL; } -#if defined(RTEMS_MULTIPROCESSING) - *location = _Objects_MP_Is_remote( information, id ); -#else *location = OBJECTS_ERROR; + +#if defined(RTEMS_MULTIPROCESSING) + if ( _Objects_MP_Is_remote( id, information ) ) { + *location = OBJECTS_REMOTE; + } #endif return NULL; diff --git a/cpukit/score/src/objectmp.c b/cpukit/score/src/objectmp.c index 0df9190beb..0628544f70 100644 --- a/cpukit/score/src/objectmp.c +++ b/cpukit/score/src/objectmp.c @@ -351,9 +351,9 @@ Objects_Name_or_id_lookup_errors _Objects_MP_Global_name_search( return status; } -Objects_Locations _Objects_MP_Is_remote( - Objects_Information *information, - Objects_Id the_id +bool _Objects_MP_Is_remote( + Objects_Id the_id, + const Objects_Information *information ) { Objects_MP_Control *the_global_object; @@ -371,11 +371,7 @@ Objects_Locations _Objects_MP_Is_remote( _Objects_MP_Global_release( &lock_context ); - if ( the_global_object != NULL ) { - return OBJECTS_REMOTE; - } else { - return OBJECTS_ERROR; - } + return the_global_object != NULL; } Objects_MP_Control *_Objects_MP_Allocate_global_object( void ) |