score: Optimize _Objects_Get_no_protection()

Make the id the first parameter since usual callers get the object
identifier as the first parameter themself.
This commit is contained in:
Sebastian Huber
2016-04-21 07:29:40 +02:00
parent 36cd27c1e3
commit d7a12be9c3
6 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free(
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get( pthread_key_t key )
{
return (POSIX_Keys_Control *)
_Objects_Get_no_protection( &_POSIX_Keys_Information, (Objects_Id) key );
_Objects_Get_no_protection( (Objects_Id) key, &_POSIX_Keys_Information );
}
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_acquire(
@@ -73,7 +73,7 @@ RTEMS_INLINE_ROUTINE Region_Control *_Region_Get_and_lock( Objects_Id id )
_RTEMS_Lock_allocator();
the_region = (Region_Control *)
_Objects_Get_no_protection( &_Region_Information, id );
_Objects_Get_no_protection( id, &_Region_Information );
if ( the_region != NULL ) {
/* Keep allocator lock */
+1 -1
View File
@@ -42,7 +42,7 @@ RTEMS_INLINE_ROUTINE void _Extension_Free (
RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get( Objects_Id id )
{
return (Extension_Control *)
_Objects_Get_no_protection( &_Extension_Information, id );
_Objects_Get_no_protection( id, &_Extension_Information );
}
#ifdef __cplusplus
@@ -656,8 +656,10 @@ Objects_Control *_Objects_Get_local(
* is undefined. Otherwise, location is set to OBJECTS_ERROR
* and the_object is undefined.
*
* @param[in] information points to an object class information block.
* @param[in] id is the Id of the object whose name we are locating.
* This is the first parameter since usual callers get the object identifier
* as the first parameter themself.
* @param[in] information points to an object class information block.
*
* @retval This method returns one of the values from the
* @ref Objects_Name_or_id_lookup_errors enumeration to indicate
@@ -670,8 +672,8 @@ Objects_Control *_Objects_Get_local(
* objects.
*/
Objects_Control *_Objects_Get_no_protection(
const Objects_Information *information,
Objects_Id id
Objects_Id id,
const Objects_Information *information
);
/**
+1 -1
View File
@@ -52,7 +52,7 @@ Objects_Control *_Objects_Get_next(
}
/* try to grab one */
the_object = _Objects_Get_no_protection( information, next_id );
the_object = _Objects_Get_no_protection( next_id, information );
next_id++;
+2 -2
View File
@@ -21,8 +21,8 @@
#include <rtems/score/objectimpl.h>
Objects_Control *_Objects_Get_no_protection(
const Objects_Information *information,
Objects_Id id
Objects_Id id,
const Objects_Information *information
)
{
Objects_Control *the_object;