diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-21 10:47:36 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-24 09:22:36 +0100 |
commit | 0b263b0eb7dd05efe44359b9d8172926856badc7 (patch) | |
tree | 0fcb6c0924561f08c7854a5fbecc51f79bfca22a /cpukit/include/rtems/score | |
parent | build: Fix format in wscript (diff) | |
download | rtems-0b263b0eb7dd05efe44359b9d8172926856badc7.tar.bz2 |
score: Remove _Objects_Open()
Use the type safe _Objects_Open_u32() instead. Return the object
identifier to enforce a common usage pattern.
Diffstat (limited to 'cpukit/include/rtems/score')
-rw-r--r-- | cpukit/include/rtems/score/objectimpl.h | 60 | ||||
-rw-r--r-- | cpukit/include/rtems/score/threadimpl.h | 4 |
2 files changed, 23 insertions, 41 deletions
diff --git a/cpukit/include/rtems/score/objectimpl.h b/cpukit/include/rtems/score/objectimpl.h index 1a0029b3b0..8ba8189976 100644 --- a/cpukit/include/rtems/score/objectimpl.h +++ b/cpukit/include/rtems/score/objectimpl.h @@ -738,50 +738,27 @@ RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( } /** - * @brief Places the_object control pointer and object name - * in the Local Pointer and Local Name Tables, respectively. + * @brief Assigns the 32-bit unsigned integer name to the object and places the + * object in the local object table. * - * This method uses Objects_Name for the object name. + * @param information is the object information. * - * @param[in, out] information Points to an Object Information Table. - * @param the_object Pointer to an object. - * @param name The name of the object to make accessible. - */ -RTEMS_INLINE_ROUTINE void _Objects_Open( - Objects_Information *information, - Objects_Control *the_object, - Objects_Name name -) -{ - _Assert( information != NULL ); - _Assert( the_object != NULL ); - - the_object->name = name; - - _Objects_Set_local_object( - information, - _Objects_Get_index( the_object->id ), - the_object - ); -} - -/** - * @brief Places the_object control pointer and object name - * in the Local Pointer and Local Name Tables, respectively. + * @param[in, out] the_object is the object to open. * - * This method uses uint32_t for the object name. + * @param name is the name of the object to open. * - * @param[in, out] information Points to an Object Information Table. - * @param the_object Pointer to an object. - * @param name The name of the object to make accessible. + * @return Returns the identifier of the object which is now valid. */ -RTEMS_INLINE_ROUTINE void _Objects_Open_u32( +RTEMS_INLINE_ROUTINE Objects_Id _Objects_Open_u32( const Objects_Information *information, Objects_Control *the_object, uint32_t name ) { + _Assert( information != NULL ); _Assert( !_Objects_Has_string_name( information ) ); + _Assert( the_object != NULL ); + the_object->name.name_u32 = name; _Objects_Set_local_object( @@ -789,17 +766,19 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_u32( _Objects_Get_index( the_object->id ), the_object ); + + return the_object->id; } /** - * @brief Places the_object control pointer and object name - * in the Local Pointer and Local Name Tables, respectively. + * @brief Assigns the string name to the object and places the object in the + * local object table. * - * This method uses a String for the object name. + * @param information is the object information. * - * @param[in, out] information Points to an Object Information Table. - * @param the_object Pointer to an object. - * @param name The name of the object to make accessible. + * @param[in, out] the_object is the object to open. + * + * @param name is the name of the object to open. */ RTEMS_INLINE_ROUTINE void _Objects_Open_string( const Objects_Information *information, @@ -807,7 +786,10 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_string( const char *name ) { + _Assert( information != NULL ); _Assert( _Objects_Has_string_name( information ) ); + _Assert( the_object != NULL ); + the_object->name.name_p = name; _Objects_Set_local_object( diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h index e9d44526da..0c7df47f36 100644 --- a/cpukit/include/rtems/score/threadimpl.h +++ b/cpukit/include/rtems/score/threadimpl.h @@ -164,9 +164,9 @@ typedef struct { Thread_CPU_budget_algorithm_callout budget_callout; /** - * @brief Name of the object for the thread. + * @brief 32-bit unsigned integer name of the object for the thread. */ - Objects_Name name; + uint32_t name; /** * @brief The thread's initial ISR level. |