21 #ifndef _RTEMS_SCORE_OBJECTIMPL_H 22 #define _RTEMS_SCORE_OBJECTIMPL_H 51 #define OBJECTS_INTERNAL_CLASSES_LAST OBJECTS_INTERNAL_THREADS 54 #define OBJECTS_RTEMS_CLASSES_LAST OBJECTS_RTEMS_BARRIERS 57 #define OBJECTS_POSIX_CLASSES_LAST OBJECTS_POSIX_SHMS 64 OBJECTS_FAKE_OBJECTS_NO_CLASS = 0,
65 OBJECTS_FAKE_OBJECTS_SCHEDULERS = 1
66 } Objects_Fake_objects_API;
71 #if defined(RTEMS_MULTIPROCESSING) 74 #define _Objects_Maximum_nodes 1 80 #define OBJECTS_INDEX_MINIMUM 1U 204 OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL,
205 OBJECTS_INVALID_NAME,
206 OBJECTS_INVALID_ADDRESS,
215 #define OBJECTS_NAME_ERRORS_FIRST OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL 221 #define OBJECTS_NAME_ERRORS_LAST OBJECTS_INVALID_NODE 250 OBJECTS_GET_BY_NAME_INVALID_NAME,
251 OBJECTS_GET_BY_NAME_NAME_TOO_LONG,
252 OBJECTS_GET_BY_NAME_NO_OBJECT
253 } Objects_Get_by_name_error;
272 size_t *name_length_p,
273 Objects_Get_by_name_error *error
588 #
if defined(RTEMS_MULTIPROCESSING)
595 #if defined(RTEMS_MULTIPROCESSING) 616 return ( left == right );
730 _Assert( information != NULL );
756 _Assert( information != NULL );
759 the_object->
name = name;
836 _RTEMS_Lock_allocator();
848 _RTEMS_Unlock_allocator();
859 return _RTEMS_Allocator_is_owner();
886 return ( *information->
allocate )( information );
940 ( *information->
deallocate )( information, the_object );
965 if ( block > objects_per_block ) {
966 block /= objects_per_block;
993 if ( the_object == NULL ) {
994 ( *extend )( information );
998 if ( the_object != NULL ) {
1011 #if defined(RTEMS_MULTIPROCESSING) 1012 #include <rtems/score/objectmp.h> static __inline__ Objects_Control * _Objects_Allocate_with_extend(Objects_Information *information, void(*extend)(Objects_Information *))
Allocate an object and extend the objects information on demand.
static __inline__ void _Objects_Allocator_unlock(void)
Unlocks the object allocator mutex.
void _Objects_Shrink_information(Objects_Information *information)
Shrinks an object class information record.
#define OBJECTS_APIS_LAST
void _Objects_Free_objects_block(Objects_Information *information, Objects_Maximum block)
Free the objects block with the specified index.
static __inline__ bool _Objects_Is_local_id(Objects_Id id RTEMS_UNUSED)
Checks if the id is of a local object.
static __inline__ Objects_Maximum _Objects_Get_maximum_index(const Objects_Information *information)
Returns the maximum index of the specified object class.
#define _Objects_Maximum_nodes
static __inline__ bool _Objects_Is_local_node(uint32_t node)
Checks if the node is of the local object.
#define OBJECTS_INDEX_START_BIT
static __inline__ void _Objects_Activate_unlimited(Objects_Information *information, Objects_Control *the_object)
Activate the object.
Objects_Name_or_id_lookup_errors _Objects_Name_to_id_u32(uint32_t name, uint32_t node, Objects_Id *id, const Objects_Information *information)
Searches an object of the specified class with the specified name on the specified set of nodes...
Objects_Information * _Objects_Get_information(Objects_APIs the_api, uint16_t the_class)
Gets object information.
static __inline__ Objects_Control * _Objects_Allocate_unprotected(Objects_Information *information)
Allocates an object without locking the allocator mutex.
static __inline__ bool _System_state_Is_up(System_state_Codes state)
Checks if the state is up.
Objects_Information **const _Objects_Information_table[OBJECTS_APIS_LAST+1]
void _Objects_Initialize_information(Objects_Information *information)
Initializes the specified objects information.
Objects_Name_or_id_lookup_errors
#define OBJECTS_INDEX_MINIMUM
Constants and Structures Related with Thread Dispatch.
Objects_Information * _Objects_Get_information_id(Objects_Id id)
Gets information of an object from an ID.
static __inline__ void _Objects_Open_u32(const Objects_Information *information, Objects_Control *the_object, uint32_t name)
Places the_object control pointer and object name in the Local Pointer and Local Name Tables...
size_t _Objects_Name_to_string(Objects_Name name, bool is_string, char *buffer, size_t buffer_size)
Converts the specified object name to a text representation.
static __inline__ Objects_Maximum _Objects_Get_index(Objects_Id id)
Returns the index portion of the ID.
char * _Objects_Get_name_as_string(Objects_Id id, size_t length, char *name)
Gets object name in the form of a C string.
static __inline__ Objects_Control * _Objects_Get_inactive(Objects_Information *information)
Get an inactive object or NULL.
bool(* Objects_Name_comparators)(void *, void *, uint16_t)
Objects_Maximum _Objects_Extend_information(Objects_Information *information)
Extends an object class information record.
static __inline__ void _Objects_Allocator_lock(void)
Locks the object allocator mutex.
Objects_Control * _Objects_Allocate(Objects_Information *information)
Allocates an object.
Object Handler Data Structures.
Information for the Assert Handler.
Objects_Control * _Objects_Get_by_name(const Objects_Information *information, const char *name, size_t *name_length_p, Objects_Get_by_name_error *error)
Gets an object control block identified by its name.
static __inline__ uint32_t _Objects_Get_node(Objects_Id id)
Returns the node portion of the ID.
static __inline__ bool _Objects_Has_string_name(const Objects_Information *information)
Returns if the object has a string name.
static __inline__ void _Objects_Open(Objects_Information *information, Objects_Control *the_object, Objects_Name name)
Places the_object control pointer and object name in the Local Pointer and Local Name Tables...
Objects_Maximum _Objects_Active_count(const Objects_Information *information)
Returns the count of active objects.
static __inline__ void _Objects_Namespace_remove_u32(const Objects_Information *information, Objects_Control *the_object)
Removes object with a 32-bit integer name from its namespace.
static __inline__ bool _Objects_Allocator_is_owner(void)
Checks if the allocator is the owner of the object allocator mutex.
static __inline__ void _Objects_Open_string(const Objects_Information *information, Objects_Control *the_object, const char *name)
Places the_object control pointer and object name in the Local Pointer and Local Name Tables...
static __inline__ void _Objects_Set_local_object(const Objects_Information *information, uint32_t index, Objects_Control *the_object)
Sets the pointer to the local_table object referenced by the index.
bool _Objects_Set_name(const Objects_Information *information, Objects_Control *the_object, const char *name)
Sets objects name.
Objects_Control * _Objects_Get_next(Objects_Id id, const Objects_Information *information, Objects_Id *next_id_p)
Gets the next open object after the specified object identifier.
#define RTEMS_UNUSED
Tells the compiler that a specific variable or function is deliberately unused.
static __inline__ Objects_Maximum _Objects_Extend_size(const Objects_Information *information)
Returns the object's objects per block.
static __inline__ System_state_Codes _System_state_Get(void)
Gets the current system state.
#define _Objects_Local_node
The local MPCI node number.
#define OBJECTS_INDEX_MASK
System State Handler API.
void _Objects_Namespace_remove_string(const Objects_Information *information, Objects_Control *the_object)
Removes object with a string name from its namespace.
Objects_Control * _Objects_Get(Objects_Id id, ISR_lock_Context *lock_context, const Objects_Information *information)
Maps the specified object identifier to the associated local object control block.
Local ISR lock context for acquire and release pairs.
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
static __inline__ bool _Objects_Is_api_valid(uint32_t the_api)
Checks if the api is valid.
static __inline__ Objects_Id _Objects_Get_minimum_id(Objects_Id id)
Returns the identifier with the minimum index for the specified identifier.
void _Objects_Close(const Objects_Information *information, Objects_Control *the_object)
Closes object.
Objects_Control * _Objects_Get_no_protection(Objects_Id id, const Objects_Information *information)
Maps object ids to object control blocks.
unsigned int _Objects_API_maximum_class(uint32_t api)
Returns highest numeric value of a valid API for the specified API.
static __inline__ void _Objects_Invalidate_Id(const Objects_Information *information, Objects_Control *the_object)
Invalidates an object Id.
static __inline__ Objects_Maximum _Objects_Is_auto_extend(const Objects_Information *information)
Checks if the automatic object extension (unlimited objects) is enabled.
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.
static __inline__ Chain_Node * _Chain_Get_unprotected(Chain_Control *the_chain)
Gets the first node (unprotected).
static __inline__ bool _Objects_Are_ids_equal(Objects_Id left, Objects_Id right)
Checks if two object IDs are equal.
static __inline__ void _Objects_Free(Objects_Information *information, Objects_Control *the_object)
Frees an object.
Objects_Name_or_id_lookup_errors _Objects_Id_to_name(Objects_Id id, Objects_Name *name)
Returns the name associated with object id.