RTEMS Logo

RTEMS 4.6.99.3 On-Line Library


Key Concepts Object IDs

PREV UP NEXT Bookshelf RTEMS C User's Guide

2.2.2: Object IDs

An object ID is a unique unsigned thirty-two bit entity composed of three parts: object class, node, and index. The data type rtems_id is used to store object IDs.

31 26 25 16 15 0
Class Node Index

The most significant six bits are the object class. The next ten bits are the number of the node on which this object was created. The node number is always one (1) in a single processor system. The least significant sixteen bits form an identifier within a particular object type. This identifier, called the object index, ranges in value from 1 to the maximum number of objects configured for this object type.

The three components of an object ID make it possible to quickly locate any object in even the most complicated multiprocessor system. Object ID's are associated with an object by RTEMS when the object is created and the corresponding ID is returned by the appropriate object create directive. The object ID is required as input to all directives involving objects, except those which create an object or obtain the ID of an object.

The object identification directives can be used to dynamically obtain a particular object's ID given its name. This mapping is accomplished by searching the name table associated with this object type. If the name is non-unique, then the ID associated with the first occurrence of the name will be returned to the application. Since object IDs are returned when the object is created, the object identification directives are not necessary in a properly designed single processor application.

In addition, services are provided to portably examine the three subcomponents of an RTEMS ID. These services are prototyped as follows:

rtems_unsigned32 rtems_get_class( rtems_id );
rtems_unsigned32 rtems_get_node( rtems_id );
rtems_unsigned32 rtems_get_index( rtems_id );

An object control block is a data structure defined by RTEMS which contains the information necessary to manage a particular object type. For efficiency reasons, the format of each object type's control block is different. However, many of the fields are similar in function. The number of each type of control block is application dependent and determined by the values specified in the user's Configuration Table. An object control block is allocated at object create time and freed when the object is deleted. With the exception of user extension routines, object control blocks are not directly manipulated by user applications.


PREV UP NEXT Bookshelf RTEMS C User's Guide

Copyright © 1988-2004 OAR Corporation