summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-19 14:14:10 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-21 07:29:40 +0200
commitd7a12be9c3f1034947210d4bafa3d39fe1e74571 (patch)
treeb6371a8816cb82265149fb5aa861e49ebf1598b9
parentscore: Simplify _Objects_Get_next() (diff)
downloadrtems-d7a12be9c3f1034947210d4bafa3d39fe1e74571.tar.bz2
score: Optimize _Objects_Get_no_protection()
Make the id the first parameter since usual callers get the object identifier as the first parameter themself.
-rw-r--r--cpukit/posix/include/rtems/posix/keyimpl.h2
-rw-r--r--cpukit/rtems/include/rtems/rtems/regionimpl.h2
-rw-r--r--cpukit/sapi/include/rtems/extensionimpl.h2
-rw-r--r--cpukit/score/include/rtems/score/objectimpl.h8
-rw-r--r--cpukit/score/src/objectgetnext.c2
-rw-r--r--cpukit/score/src/objectgetnoprotection.c4
6 files changed, 11 insertions, 9 deletions
diff --git a/cpukit/posix/include/rtems/posix/keyimpl.h b/cpukit/posix/include/rtems/posix/keyimpl.h
index 1f8747052d..833e652eb1 100644
--- a/cpukit/posix/include/rtems/posix/keyimpl.h
+++ b/cpukit/posix/include/rtems/posix/keyimpl.h
@@ -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(
diff --git a/cpukit/rtems/include/rtems/rtems/regionimpl.h b/cpukit/rtems/include/rtems/rtems/regionimpl.h
index 4db65997a7..e4dcff06fe 100644
--- a/cpukit/rtems/include/rtems/rtems/regionimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/regionimpl.h
@@ -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 */
diff --git a/cpukit/sapi/include/rtems/extensionimpl.h b/cpukit/sapi/include/rtems/extensionimpl.h
index 64ac600520..fb4eeaff7c 100644
--- a/cpukit/sapi/include/rtems/extensionimpl.h
+++ b/cpukit/sapi/include/rtems/extensionimpl.h
@@ -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
diff --git a/cpukit/score/include/rtems/score/objectimpl.h b/cpukit/score/include/rtems/score/objectimpl.h
index 6877b8e9fe..fb45977c1d 100644
--- a/cpukit/score/include/rtems/score/objectimpl.h
+++ b/cpukit/score/include/rtems/score/objectimpl.h
@@ -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
);
/**
diff --git a/cpukit/score/src/objectgetnext.c b/cpukit/score/src/objectgetnext.c
index 2d4f252b97..a46c02f2c2 100644
--- a/cpukit/score/src/objectgetnext.c
+++ b/cpukit/score/src/objectgetnext.c
@@ -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++;
diff --git a/cpukit/score/src/objectgetnoprotection.c b/cpukit/score/src/objectgetnoprotection.c
index eaa172c83b..85692234fa 100644
--- a/cpukit/score/src/objectgetnoprotection.c
+++ b/cpukit/score/src/objectgetnoprotection.c
@@ -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;