RTEMS 6.1-rc1
|
This group contains the Object Handler implementation. More...
Modules | |
Object Handler Multiprocessing (MP) Support | |
This group contains the implementation to support the Object Handler in multiprocessing (MP) configurations. | |
Files | |
file | object.h |
This header file provides interfaces of the Object Handler which are used by the implementation and the Application Configuration. | |
file | objectdata.h |
This header file provides data structures used by the implementation and the Application Configuration to define instances of Objects_Information, ::_Objects_MP_Controls, and ultimately Thread_Configured_control. | |
file | objectimpl.h |
This header file provides interfaces of the Object Handler which are only used by the implementation. | |
file | objectactivecount.c |
This source file contains the implementation of _Objects_Active_count(). | |
file | objectallocate.c |
This source file contains the implementation of _Objects_Allocate(). | |
file | objectallocatenone.c |
This source file contains the implementation of _Objects_Allocate_none(). | |
file | objectallocatestatic.c |
This source file contains the implementation of _Objects_Allocate_static(). | |
file | objectallocateunlimited.c |
This source file contains the implementation of _Objects_Allocate_unlimited(). | |
file | objectapimaximumclass.c |
This source file contains the implementation of _Objects_API_maximum_class(). | |
file | objectclose.c |
This source file contains the implementation of _Objects_Close(). | |
file | objectextendinformation.c |
This source file contains the implementation of _Objects_Extend_information(). | |
file | objectfree.c |
This source file contains the implementation of _Objects_Free_unlimited(). | |
file | objectfreenothing.c |
This source file contains the implementation of _Objects_Free_nothing(). | |
file | objectfreestatic.c |
This source file contains the implementation of _Objects_Free_static(). | |
file | objectgetinfo.c |
This source file contains the implementation of _Objects_Get_information(). | |
file | objectgetinfoid.c |
This source file contains the implementation of _Objects_Get_information_id(). | |
file | objectgetlocal.c |
This source file contains the implementation of _Objects_Get(). | |
file | objectgetnameasstring.c |
This source file contains the implementation of _Objects_Name_to_string() and _Objects_Get_name_as_string(). | |
file | objectgetnext.c |
This source file contains the implementation of _Objects_Get_next(). | |
file | objectgetnoprotection.c |
This source file contains the implementation of _Objects_Get_no_protection(). | |
file | objectidtoname.c |
This source file contains the implementation of _Objects_Id_to_name(). | |
file | objectinitializeinformation.c |
This source file contains the implementation of _Objects_Initialize_information(). | |
file | objectnamespaceremove.c |
This source file contains the implementation of _Objects_Namespace_remove_string(). | |
file | objectnametoid.c |
This source file contains the implementation of _Objects_Name_to_id_u32(). | |
file | objectnametoidstring.c |
This source file contains the implementation of _Objects_Get_by_name(). | |
file | objectsetname.c |
This source file contains the implementation of _Objects_Set_name(). | |
file | objectshrinkinformation.c |
This source file contains the implementation of _Objects_Free_objects_block() and _Objects_Shrink_information(). | |
Data Structures | |
union | Objects_Name |
struct | Objects_Control |
struct | Objects_Information |
The information structure used to manage each API class of objects. More... | |
Macros | |
#define | OBJECTS_INDEX_START_BIT 0U |
#define | OBJECTS_NODE_START_BIT 16U |
#define | OBJECTS_API_START_BIT 24U |
#define | OBJECTS_CLASS_START_BIT 27U |
#define | OBJECTS_INDEX_MASK (Objects_Id)0x0000ffffU |
#define | OBJECTS_NODE_MASK (Objects_Id)0x00ff0000U |
#define | OBJECTS_API_MASK (Objects_Id)0x07000000U |
#define | OBJECTS_CLASS_MASK (Objects_Id)0xf8000000U |
#define | OBJECTS_INDEX_VALID_BITS (Objects_Id)0x0000ffffU |
#define | OBJECTS_NODE_VALID_BITS (Objects_Id)0x000000ffU |
#define | OBJECTS_API_VALID_BITS (Objects_Id)0x00000007U |
#define | OBJECTS_CLASS_VALID_BITS (Objects_Id)0x0000001fU |
#define | OBJECTS_UNLIMITED_OBJECTS 0x80000000U |
#define | OBJECTS_ID_INITIAL_INDEX (0) |
#define | OBJECTS_ID_FINAL_INDEX (0xffffU) |
#define | OBJECTS_APIS_LAST OBJECTS_POSIX_API |
#define | OBJECTS_ID_NONE 0 |
#define | OBJECTS_ID_OF_SELF ((Objects_Id) 0) |
#define | OBJECTS_SEARCH_ALL_NODES 0 |
#define | OBJECTS_SEARCH_OTHER_NODES 0x7FFFFFFE |
#define | OBJECTS_SEARCH_LOCAL_NODE 0x7FFFFFFF |
#define | OBJECTS_WHO_AM_I 0 |
#define | OBJECTS_ID_INITIAL(_api, _class, _node) _Objects_Build_id( (_api), (_class), (_node), OBJECTS_ID_INITIAL_INDEX ) |
#define | OBJECTS_ID_FINAL ((Objects_Id)~0) |
#define | _Objects_Build_name(_C1, _C2, _C3, _C4) |
#define | _Objects_Build_id(the_api, the_class, node, index) |
Builds an object ID from its components. More... | |
#define | _Objects_Is_unlimited(maximum) ( ( ( maximum ) & OBJECTS_UNLIMITED_OBJECTS ) != 0 ) |
#define | _Objects_Maximum_per_allocation(maximum) ((Objects_Maximum) ((maximum) & ~OBJECTS_UNLIMITED_OBJECTS)) |
#define | _Objects_Local_node ((uint16_t) 1) |
The local MPCI node number. | |
#define | OBJECTS_NO_STRING_NAME 0 |
Constant for the object information string name length to indicate that this object class has no string names. | |
#define | OBJECTS_INFORMATION_MP(name, extract) |
#define | OBJECTS_INFORMATION_DEFINE_ZERO(name, api, cls, nl) |
Statically initializes an objects information. More... | |
#define | OBJECTS_INFORMATION_DEFINE(name, api, cls, type, max, nl, ex) |
Statically initializes an objects information. More... | |
#define | OBJECTS_INTERNAL_CLASSES_LAST OBJECTS_INTERNAL_THREADS |
#define | OBJECTS_RTEMS_CLASSES_LAST OBJECTS_RTEMS_BARRIERS |
#define | OBJECTS_POSIX_CLASSES_LAST OBJECTS_POSIX_SHMS |
#define | _Objects_Maximum_nodes 1 |
#define | OBJECTS_INDEX_MINIMUM 1U |
Typedefs | |
typedef uint32_t | Objects_Id |
typedef uint16_t | Objects_Maximum |
typedef struct Objects_Information | Objects_Information |
typedef bool(* | Objects_Name_comparators) (void *, void *, uint16_t) |
Enumerations | |
enum | Objects_APIs { OBJECTS_NO_API = 0 , OBJECTS_INTERNAL_API = 1 , OBJECTS_CLASSIC_API = 2 , OBJECTS_POSIX_API = 3 , OBJECTS_FAKE_OBJECTS_API = 7 } |
enum | Objects_Internal_API { OBJECTS_INTERNAL_NO_CLASS = 0 , OBJECTS_INTERNAL_THREADS = 1 } |
enum | Objects_Classic_API { OBJECTS_CLASSIC_NO_CLASS = 0 , OBJECTS_RTEMS_TASKS = 1 , OBJECTS_RTEMS_TIMERS , OBJECTS_RTEMS_SEMAPHORES , OBJECTS_RTEMS_MESSAGE_QUEUES , OBJECTS_RTEMS_PARTITIONS , OBJECTS_RTEMS_REGIONS , OBJECTS_RTEMS_PORTS , OBJECTS_RTEMS_PERIODS , OBJECTS_RTEMS_EXTENSIONS , OBJECTS_RTEMS_BARRIERS } |
enum | Objects_POSIX_API { OBJECTS_POSIX_NO_CLASS = 0 , OBJECTS_POSIX_THREADS = 1 , OBJECTS_POSIX_KEYS , OBJECTS_POSIX_MESSAGE_QUEUES , OBJECTS_POSIX_SEMAPHORES , OBJECTS_POSIX_TIMERS , OBJECTS_POSIX_SHMS } |
enum | Objects_Fake_objects_API { OBJECTS_FAKE_OBJECTS_NO_CLASS = 0 , OBJECTS_FAKE_OBJECTS_SCHEDULERS = 1 } |
enum | Objects_Get_by_name_error { OBJECTS_GET_BY_NAME_INVALID_NAME , OBJECTS_GET_BY_NAME_NAME_TOO_LONG , OBJECTS_GET_BY_NAME_NO_OBJECT } |
Functions | |
Objects_Control * | _Objects_Allocate_none (Objects_Information *information) |
Always return NULL. More... | |
Objects_Control * | _Objects_Allocate_static (Objects_Information *information) |
Return an inactive object or NULL. More... | |
Objects_Control * | _Objects_Allocate_unlimited (Objects_Information *information) |
Return an inactive object or NULL. More... | |
void | _Objects_Free_static (Objects_Information *information, Objects_Control *the_object) |
Free the object. More... | |
void | _Objects_Free_unlimited (Objects_Information *information, Objects_Control *the_object) |
Free the object. More... | |
Objects_Maximum | _Objects_Extend_information (Objects_Information *information) |
Extends an object class information record. More... | |
void | _Objects_Free_objects_block (Objects_Information *information, Objects_Maximum block) |
Free the objects block with the specified index. More... | |
void | _Objects_Shrink_information (Objects_Information *information) |
Shrinks an object class information record. More... | |
void | _Objects_Initialize_information (Objects_Information *information) |
Initializes the specified objects information. More... | |
unsigned int | _Objects_API_maximum_class (uint32_t api) |
Returns highest numeric value of a valid API for the specified API. More... | |
Objects_Control * | _Objects_Allocate (Objects_Information *information) |
Allocates an object. More... | |
Status_Control | _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. More... | |
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. More... | |
Status_Control | _Objects_Id_to_name (Objects_Id id, Objects_Name *name) |
Returns the name associated with object id. More... | |
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. More... | |
Objects_Control * | _Objects_Get_no_protection (Objects_Id id, const Objects_Information *information) |
Maps object ids to object control blocks. More... | |
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. More... | |
Objects_Information * | _Objects_Get_information (Objects_APIs the_api, uint16_t the_class) |
Gets object information. More... | |
Objects_Information * | _Objects_Get_information_id (Objects_Id id) |
Gets information of an object from an ID. More... | |
char * | _Objects_Get_name_as_string (Objects_Id id, size_t length, char *name) |
Gets object name in the form of a C string. More... | |
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. More... | |
Status_Control | _Objects_Set_name (const Objects_Information *information, Objects_Control *the_object, const char *name) |
Sets objects name. More... | |
void | _Objects_Namespace_remove_string (const Objects_Information *information, Objects_Control *the_object) |
Removes object with a string name from its namespace. More... | |
void | _Objects_Close (const Objects_Information *information, Objects_Control *the_object) |
Closes object. More... | |
Objects_Maximum | _Objects_Active_count (const Objects_Information *information) |
Returns the count of active objects. More... | |
void | _Objects_Free_nothing (void *ptr) |
This function does nothing. More... | |
Variables | |
Objects_Information **const | _Objects_Information_table [OBJECTS_APIS_LAST+1] |
This group contains the Object Handler implementation.
This handler provides mechanisms which can be used to initialize and manipulate all objects which have identifiers.
#define _Objects_Build_id | ( | the_api, | |
the_class, | |||
node, | |||
index | |||
) |
Builds an object ID from its components.
the_api | The object API. |
the_class | The object API class. |
node | The object node. |
index | The object index. |
#define _Objects_Build_name | ( | _C1, | |
_C2, | |||
_C3, | |||
_C4 | |||
) |
This macro is used to build a thirty-two bit style name from four characters. The most significant byte will be the character _C1.
[in] | _C1 | is the first character of the name |
[in] | _C2 | is the second character of the name |
[in] | _C3 | is the third character of the name |
[in] | _C4 | is the fourth character of the name |
#define _Objects_Is_unlimited | ( | maximum | ) | ( ( ( maximum ) & OBJECTS_UNLIMITED_OBJECTS ) != 0 ) |
Returns if the object maximum specifies unlimited objects.
[in] | maximum | The object maximum specification. |
true | Unlimited objects are available. |
false | The object count is fixed. |
#define _Objects_Maximum_nodes 1 |
The following is referenced to the number of nodes in the system.
#define OBJECTS_API_MASK (Objects_Id)0x07000000U |
This mask is used to extract the API portion of an object Id.
#define OBJECTS_API_START_BIT 24U |
This is the bit position of the starting bit of the API portion of the object Id.
#define OBJECTS_API_VALID_BITS (Objects_Id)0x00000007U |
This mask represents the bits that is used to ensure no extra bits are set after shifting to extract the API portion of an object Id.
#define OBJECTS_APIS_LAST OBJECTS_POSIX_API |
This macro is used to generically specify the last API index.
#define OBJECTS_CLASS_MASK (Objects_Id)0xf8000000U |
This mask is used to extract the class portion of an object Id.
#define OBJECTS_CLASS_START_BIT 27U |
This is the bit position of the starting bit of the class portion of the object Id.
#define OBJECTS_CLASS_VALID_BITS (Objects_Id)0x0000001fU |
This mask represents the bits that is used to ensure no extra bits are set after shifting to extract the class portion of an object Id.
#define OBJECTS_ID_FINAL ((Objects_Id)~0) |
This macro specifies the highest object ID value
#define OBJECTS_ID_FINAL_INDEX (0xffffU) |
This is the highest value for the index portion of an object Id.
#define OBJECTS_ID_INITIAL | ( | _api, | |
_class, | |||
_node | |||
) | _Objects_Build_id( (_api), (_class), (_node), OBJECTS_ID_INITIAL_INDEX ) |
This macros calculates the lowest ID for the specified api, class, and node.
#define OBJECTS_ID_INITIAL_INDEX (0) |
This is the lowest value for the index portion of an object Id.
#define OBJECTS_ID_NONE 0 |
No object can have this ID.
#define OBJECTS_ID_OF_SELF ((Objects_Id) 0) |
The following defines the constant which may be used to manipulate the calling task.
#define OBJECTS_INDEX_MASK (Objects_Id)0x0000ffffU |
This mask is used to extract the index portion of an object Id.
#define OBJECTS_INDEX_MINIMUM 1U |
This is the minimum object ID index associated with an object.
#define OBJECTS_INDEX_START_BIT 0U |
This is the bit position of the starting bit of the index portion of the object Id.
#define OBJECTS_INDEX_VALID_BITS (Objects_Id)0x0000ffffU |
This mask represents the bits that is used to ensure no extra bits are set after shifting to extract the index portion of an object Id.
#define OBJECTS_INFORMATION_DEFINE | ( | name, | |
api, | |||
cls, | |||
type, | |||
max, | |||
nl, | |||
ex | |||
) |
Statically initializes an objects information.
The initialized objects information references a table with statically allocated objects as specified by the object maximum parameter. These objects must be registered via a call to _Objects_Information().
name | The object class C designator namespace prefix, e.g. _Semaphore. |
api | The object API number, e.g. OBJECTS_CLASSIC_API. |
cls | The object class number, e.g. OBJECTS_RTEMS_SEMAPHORES. |
type | The object class type. |
max | The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag may be set). |
nl | The object name string length, use OBJECTS_NO_STRING_NAME for objects without a string name. |
ex | The optional object extraction method. Used only if multiprocessing (RTEMS_MULTIPROCESSING) is enabled. |
#define OBJECTS_INFORMATION_DEFINE_ZERO | ( | name, | |
api, | |||
cls, | |||
nl | |||
) |
Statically initializes an objects information.
The initialized objects information contains no objects.
name | The object class C designator namespace prefix, e.g. _Semaphore. |
api | The object API number, e.g. OBJECTS_CLASSIC_API. |
cls | The object class number, e.g. OBJECTS_RTEMS_SEMAPHORES. |
nl | The object name string length, use OBJECTS_NO_STRING_NAME for objects without a string name. |
#define OBJECTS_INTERNAL_CLASSES_LAST OBJECTS_INTERNAL_THREADS |
This macro is used to generically specify the last API index.
#define OBJECTS_NODE_MASK (Objects_Id)0x00ff0000U |
This mask is used to extract the node portion of an object Id.
#define OBJECTS_NODE_START_BIT 16U |
This is the bit position of the starting bit of the node portion of the object Id.
#define OBJECTS_NODE_VALID_BITS (Objects_Id)0x000000ffU |
This mask represents the bits that is used to ensure no extra bits are set after shifting to extract the node portion of an object Id.
#define OBJECTS_POSIX_CLASSES_LAST OBJECTS_POSIX_SHMS |
This macro is used to generically specify the last API index.
#define OBJECTS_RTEMS_CLASSES_LAST OBJECTS_RTEMS_BARRIERS |
This macro is used to generically specify the last API index.
#define OBJECTS_SEARCH_ALL_NODES 0 |
The following constant is used to specify that a name to ID search should search through all nodes.
#define OBJECTS_SEARCH_LOCAL_NODE 0x7FFFFFFF |
The following constant is used to specify that a name to ID search should search only on this node.
#define OBJECTS_SEARCH_OTHER_NODES 0x7FFFFFFE |
The following constant is used to specify that a name to ID search should search through all nodes except the current node.
#define OBJECTS_UNLIMITED_OBJECTS 0x80000000U |
Mask to enable unlimited objects. This is used in the configuration table when specifying the number of configured objects.
#define OBJECTS_WHO_AM_I 0 |
The following constant is used to specify that a name to ID search is being asked for the ID of the currently executing task.
typedef uint32_t Objects_Id |
The following type defines the control block used to manage object IDs. The format is as follows (0=LSB):
Bits 0 .. 15 = index (up to 65535 objects of a type) Bits 16 .. 23 = node (up to 255 nodes) Bits 24 .. 26 = API (up to 7 API classes) Bits 27 .. 31 = class (up to 31 object types per API)
typedef uint16_t Objects_Maximum |
This type is used to store the maximum number of allowed objects of each type.
typedef bool(* Objects_Name_comparators) (void *, void *, uint16_t) |
Functions which compare names are prototyped like this.
enum Objects_APIs |
This enumerated type is used in the class field of the object ID.
enum Objects_Classic_API |
This enumerated type is used in the class field of the object ID for the RTEMS Classic API.
enum Objects_Internal_API |
This enumerated type is used in the class field of the object ID for RTEMS internal object classes.
enum Objects_POSIX_API |
This enumerated type is used in the class field of the object ID for the POSIX API.
Objects_Maximum _Objects_Active_count | ( | const Objects_Information * | information | ) |
Returns the count of active objects.
information | The object information table. |
Objects_Control * _Objects_Allocate | ( | Objects_Information * | information | ) |
Allocates an object.
This function locks the object allocator mutex via _Objects_Allocator_lock(). The caller must later unlock the object allocator mutex via _Objects_Allocator_unlock(). The caller must unlock the mutex in any case, even if the allocation failed due to resource shortage.
A typical object allocation code looks like this:
[in,out] | information | The object information block. |
object | The allocated object. |
NULL | No object available. |
Objects_Control * _Objects_Allocate_none | ( | Objects_Information * | information | ) |
Always return NULL.
information | The objects information. |
NULL | Always. |
Objects_Control * _Objects_Allocate_static | ( | Objects_Information * | information | ) |
Return an inactive object or NULL.
information | The objects information. |
NULL | No inactive object is available. |
object | An inactive object. |
Objects_Control * _Objects_Allocate_unlimited | ( | Objects_Information * | information | ) |
Return an inactive object or NULL.
Try to extend the objects information if necessary.
information | The objects information. |
NULL | No inactive object is available. |
object | An inactive object. |
unsigned int _Objects_API_maximum_class | ( | uint32_t | api | ) |
Returns highest numeric value of a valid API for the specified API.
This function returns the highest numeric value of a valid API for the specified api.
api | The API of interest. |
some_value | Positive integer on success. |
0 | The method failed. |
void _Objects_Close | ( | const Objects_Information * | information, |
Objects_Control * | the_object | ||
) |
Closes object.
This function removes the_object control pointer and object name in the Local Pointer and Local Name Tables.
information | Points to an Object Information Table. | |
[out] | the_object | A pointer to an object. |
Objects_Maximum _Objects_Extend_information | ( | Objects_Information * | information | ) |
Extends an object class information record.
information | Points to an object class information block. |
0 | The extend operation failed. |
block | The block index of the new objects block. |
void _Objects_Free_nothing | ( | void * | ptr | ) |
This function does nothing.
ptr | is not used. |
void _Objects_Free_objects_block | ( | Objects_Information * | information, |
Objects_Maximum | block | ||
) |
Free the objects block with the specified index.
information | The objects information. |
block | The block index. |
void _Objects_Free_static | ( | Objects_Information * | information, |
Objects_Control * | the_object | ||
) |
Free the object.
Append the object to the inactive chain of the objects information.
information | The objects information. |
the_object | The object to free. |
void _Objects_Free_unlimited | ( | Objects_Information * | information, |
Objects_Control * | the_object | ||
) |
Free the object.
Append the object to the inactive chain of the objects information and shrink the objects information if necessary.
information | The objects information. |
the_object | The object to free. |
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.
In this function interrupts are disabled during the object lookup. In case an associated object exists, then interrupts remain disabled, otherwise the previous interrupt state is restored.
id | The object identifier. This is the first parameter since usual callers get the object identifier as the first parameter themself. |
lock_context | The interrupt lock context. This is the second parameter since usual callers get the interrupt lock context as the second parameter themself. |
information | The object class information block. |
pointer | The pointer to the associated object control block. Interrupts are now disabled and must be restored using the specified lock context via _ISR_lock_ISR_enable() or _ISR_lock_Release_and_ISR_enable(). |
NULL | No associated object exists. |
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.
The object information must use string names.
information | The object information. Must not be NULL. | |
name | The object name. | |
[out] | name_length_p | Optional parameter to return the name length. |
[out] | error | The error indication in case of failure. Must not be NULL. |
pointer | The first object according to object index associated with this name. |
NULL | No object exists for this name or invalid parameters. |
Objects_Information * _Objects_Get_information | ( | Objects_APIs | the_api, |
uint16_t | the_class | ||
) |
Gets object information.
This function returns the information structure given an API and Class. This can be done independent of the existence of any objects created by the API.
the_api | Indicates the API for the information we want |
the_class | Indicates the Class for the information we want |
pointer | Pointer to the Object Information Table for the class of objects which corresponds to this object ID. |
NULL | An error occurred. |
Objects_Information * _Objects_Get_information_id | ( | Objects_Id | id | ) |
Gets information of an object from an ID.
This function returns the information structure given an id of an object.
id | The object ID to get the information from. |
pointer | Pointer to the Object Information Table for the class of objects which corresponds to this object ID. |
NULL | An error occurred. |
char * _Objects_Get_name_as_string | ( | Objects_Id | id, |
size_t | length, | ||
char * | name | ||
) |
Gets object name in the form of a C string.
This method gets the name of an object and returns its name in the form of a C string. It attempts to be careful about overflowing the user's string and about returning unprintable characters.
id | The object to obtain the name of. | |
length | Indicates the length of the caller's buffer. | |
[out] | name | A string which will be filled in. |
a name The operation was succeeded and the string was correctly filled in.
NULL | An error occurred. |
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.
Locks the object allocator mutex in case a next object exists.
id | 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. | |
information | Points to an object class information block. | |
[in,out] | next_id_p | The Id of the next object we will look at. |
pointer | Pointer to the located object. |
NULL | An error occurred. |
Objects_Control * _Objects_Get_no_protection | ( | Objects_Id | id, |
const Objects_Information * | information | ||
) |
Maps object ids to object control blocks.
This function maps object ids to object control blocks. If id corresponds to a local object, then it returns the_object control pointer which maps to id and location is set to OBJECTS_LOCAL. If the object class supports global objects and the object id is global and resides on a remote node, then location is set to OBJECTS_REMOTE, and the_object is undefined. Otherwise, location is set to OBJECTS_ERROR and the_object is undefined.
id | 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. |
information | Points to an object class information block. |
pointer | The local object corresponding to the given id. |
NULL | The object to the given id was not found locally. |
Status_Control _Objects_Id_to_name | ( | Objects_Id | id, |
Objects_Name * | name | ||
) |
Returns the name associated with object id.
This function implements the common portion of the object Id to name directives. This function returns the name associated with object id.
id | is the Id of the object whose name we are locating. | |
[out] | name | will contain the name of the object, if found. |
STATUS_SUCCESSFUL | The operation succeeded. name contains the name of the object. |
STATUS_INVALID_ID | The id is invalid, the operation failed. |
void _Objects_Initialize_information | ( | Objects_Information * | information | ) |
Initializes the specified objects information.
The objects information must be statically pre-initialized with the OBJECTS_INFORMATION_DEFINE() macro before this function is called.
information | The object information to be initialized. |
Status_Control _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.
This method converts an object name to an identifier. It performs a look up using the object information block for this object class.
name | is the name of the object to find. | |
node | is the set of nodes to search. | |
[out] | id | is the pointer to an object identifier variable or NULL. The object identifier will be stored in the referenced variable, if the operation was successful. |
information | is the pointer to an object class information block. |
STATUS_SUCCESSFUL | The operations was successful. |
STATUS_INVALID_ADDRESS | The id parameter was NULL. |
STATUS_INVALID_NAME | No object exists with the specified name on the specified node set. |
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.
Non-printable characters according to isprint() are converted to '*'.
name | The object name. | |
is_string | Indicates if the object name is a string or a four character array (32-bit unsigned integer). | |
[out] | buffer | The string buffer for the text representation. |
buffer_size | The buffer size in characters. |
void _Objects_Namespace_remove_string | ( | const Objects_Information * | information, |
Objects_Control * | the_object | ||
) |
Removes object with a string name from its namespace.
information | The corresponding object information table. | |
[out] | the_object | The object the object to operate upon. |
Status_Control _Objects_Set_name | ( | const Objects_Information * | information, |
Objects_Control * | the_object, | ||
const char * | name | ||
) |
Sets objects name.
This method sets the object name to either a copy of a string or up to the first four characters of the string based upon whether this object class uses strings for names.
information | points to the object information. | |
[out] | the_object | is the object to operate upon. |
name | is a pointer to the name to use. |
STATUS_SUCCESSFUL | The operation succeeded. |
STATUS_NO_MEMORY | There was no memory available to duplicate the name. |
void _Objects_Shrink_information | ( | Objects_Information * | information | ) |
Shrinks an object class information record.
This function shrinks an object class information record. The object's name and object space are released. The local_table etc block does not shrink. The InActive list needs to be scanned to find the objects are remove them.
information | Points to an object class information block. |
|
extern |
The following is the list of information blocks per API for each object class. From the ID, we can go to one of these information blocks, and obtain a pointer to the appropriate object control block.