From 6c06288f6452da96fa630f1482aeaaba5d217531 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 29 Jan 2008 21:52:21 +0000 Subject: 2008-01-29 Joel Sherrill * itron/src/exd_tsk.c, itron/src/task.c, libmisc/capture/capture.c, libmisc/monitor/mon-config.c, libmisc/monitor/mon-driver.c, libmisc/monitor/mon-itask.c, libmisc/monitor/mon-monitor.c, libmisc/monitor/mon-mpci.c, libmisc/monitor/mon-object.c, libmisc/monitor/mon-symbols.c, posix/src/cancelrun.c, posix/src/pthreadexit.c, rtems/Makefile.am, rtems/preinstall.am, rtems/include/rtems.h, rtems/include/rtems/rtems/support.h, rtems/inline/rtems/rtems/tasks.inl, rtems/src/eventmp.c, rtems/src/msgmp.c, rtems/src/partmp.c, rtems/src/regionmp.c, rtems/src/rtemsobjectgetname.c, rtems/src/semmp.c, rtems/src/signalmp.c, rtems/src/taskdelete.c, rtems/src/taskmp.c, rtems/src/timerserver.c, score/Makefile.am, score/include/rtems/score/object.h, score/inline/rtems/score/object.inl, score/src/Unlimited.txt, score/src/objectgetnameasstring.c, score/src/threadqextractwithproxy.c: Add new Object Services collection. This changed the name of a few previously public but undocumented services and added a some new services. * rtems/include/rtems/rtems/object.h, rtems/src/rtemsbuildid.c, rtems/src/rtemsbuildname.c, rtems/src/rtemsobjectapimaximumclass.c, rtems/src/rtemsobjectapiminimumclass.c, rtems/src/rtemsobjectgetapiclassname.c, rtems/src/rtemsobjectgetapiname.c, rtems/src/rtemsobjectgetclassicname.c, rtems/src/rtemsobjectgetclassinfo.c, rtems/src/rtemsobjectidapimaximum.c, rtems/src/rtemsobjectidapiminimum.c, rtems/src/rtemsobjectidgetapi.c, rtems/src/rtemsobjectidgetclass.c, rtems/src/rtemsobjectidgetindex.c, rtems/src/rtemsobjectidgetnode.c, rtems/src/rtemsobjectsetname.c, score/src/objectapimaximumclass.c, score/src/objectgetinfo.c, score/src/objectgetinfoid.c, score/src/objectsetname.c: New files. * rtems/src/rtemsidtoname.c: Removed. --- cpukit/rtems/include/rtems.h | 44 +--- cpukit/rtems/include/rtems/rtems/object.h | 328 +++++++++++++++++++++++++++++ cpukit/rtems/include/rtems/rtems/support.h | 55 +---- 3 files changed, 331 insertions(+), 96 deletions(-) create mode 100644 cpukit/rtems/include/rtems/rtems/object.h (limited to 'cpukit/rtems/include') diff --git a/cpukit/rtems/include/rtems.h b/cpukit/rtems/include/rtems.h index c6329fe41b..249aa1cc04 100644 --- a/cpukit/rtems/include/rtems.h +++ b/cpukit/rtems/include/rtems.h @@ -8,7 +8,7 @@ * two (2) CPU dependent files to tailor its data structures for a * particular processor. * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -56,6 +56,7 @@ extern "C" { #include #include #include +#include #include #include #include @@ -119,47 +120,6 @@ extern "C" { #define RTEMS_MINIMUN_HETERO_CONVERSION MP_PACKET_MINIMUN_HETERO_CONVERSION -/* - * rtems_object_id_to_name - * - * This directive returns the name associated with the specified - * object ID. - * - * Input parameters: - * id - object id - * - * Output parameters: - * *name - user defined object name - * RTEMS_SUCCESSFUL - if successful - * error code - if unsuccessful - */ - -rtems_status_code rtems_object_id_to_name( - rtems_id id, - rtems_name *name -); - -/* - * rtems_object_get_name - * - * This directive returns the name associated with the specified - * object ID. - * - * Input parameters: - * id - object id - * - * Output parameters: - * *name - user defined object name - * name - if successful - * NULL - if unsuccessful - */ - -char *rtems_object_get_name( - rtems_id id, - size_t length, - char *name -); - #ifdef __cplusplus } #endif diff --git a/cpukit/rtems/include/rtems/rtems/object.h b/cpukit/rtems/include/rtems/rtems/object.h new file mode 100644 index 0000000000..6bcab81e8c --- /dev/null +++ b/cpukit/rtems/include/rtems/rtems/object.h @@ -0,0 +1,328 @@ +/** + * @file rtems/classinfo.h + */ + +/* + * COPYRIGHT (c) 1989-2008. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#ifndef _RTEMS_CLASSINFO_H +#define _RTEMS_CLASSINFO_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +/** + * This structure is used to return information to the application + * about the objects configured for a specific API/Class combination. + */ +typedef struct { + /** This field is the minimum valid object Id for this class. */ + rtems_id minimum_id; + /** This field is the maximum valid object Id for this class. */ + rtems_id maximum_id; + /** This field is the number of object instances configured for this class. */ + uint32_t maximum; + /** This field indicates if the class is configured for auto-extend. */ + boolean auto_extend; + /** This field is the number of currently unallocated objects. */ + uint32_t unallocated; +} rtems_object_api_class_information; + +/** + * @brief Build Object Id + * + * This function returns an object id composed of the + * specified @a api, @a class, @a node, + * and @a index. + * + * @param[in] _api indicates the api to use for the Id + * @param[in] _class indicates the class to use for the Id + * @param[in] _node indicates the node to use for the Id + * @param[in] _index indicates the index to use for the Id + * + * @return This method returns an object Id built from the + * specified values. + * + * @note A body is also provided. + */ +#define rtems_build_id( _api, _class, _node, _index ) \ + _Objects_Build_id( _api, _class, _node, _index ) + +/** + * @brief Build Thirty-Two Bit Object Name + * + * This function returns an object name composed of the four characters + * C1, C2, C3, and C4. + * + * @param[in] _C1 is the first character of the name + * @param[in] _C2 is the second character of the name + * @param[in] _C3 is the third character of the name + * @param[in] _C4 is the fourth character of the name + * + * @note This must be implemented as a macro for use in + * Configuration Tables. A body is also provided. + * + */ +#define rtems_build_name( _C1, _C2, _C3, _C4 ) \ + _Objects_Build_name( _C1, _C2, _C3, _C4 ) + +/** @brief Obtain name of object + * + * This directive returns the name associated with the specified + * object ID. + * + * @param[in] id is the Id of the object to obtain the name of. + * @param[out] name will be set to the name of the object + * + * @note The object must be have a name of the 32-bit form. + * + * @return @a *name will contain user defined object name + * @return @a{RTEMS_SUCCESSFUL - if successful + * @return error code - if unsuccessful + */ +rtems_status_code rtems_object_get_classic_name( + rtems_id id, + rtems_name *name +); + +/** + * @brief Obtain Object Name as String + * + * This directive returns the name associated with the specified + * object ID. + * + * @param[in] id is the Id of the object to obtain the name of + * @param[in] length is the length of the output name buffer + * @param[out] name will be set to the name of the object + * + * @return @a *name will contain user defined object name + * @return @a name - if successful + * @return @a NULL - if unsuccessful + */ +char *rtems_object_get_name( + rtems_id id, + size_t length, + char *name +); + +/** + * @brief Set Name of Object + * + * This method allows the caller to set the name of an + * object. This can be used to set the name of objects + * which do not have a naming scheme per their API. + * + * @param[in] id is the Id of the object to obtain the name of + * @param[out] name will be set to the name of the object + * + * @return @a *name will contain user defined object name + * @return @a RTEMS_SUCCESSFUL - if successful + * @return error code - if unsuccessful + */ +rtems_status_code rtems_object_set_name( + rtems_id id, + const char *name +); + +/** + * @brief Get API Portion of Object Id + * + * This function returns the API portion of the Id. + * + * @param[in] id is the Id of the object to obtain the API from + * + * @return This method returns the API portion of the provided + * @a _id. + * + * @note This method does NOT validate the @a _id provided. + * + * @note A body is also provided. + */ +#define rtems_object_id_get_api( _id ) \ + _Objects_Get_API( _id ) + +/** + * @brief Get Class Portion of Object Id + * + * This function returns the class portion of the ID. + * + * @param[in] id is the Id of the object to obtain the class from + * + * @return This method returns the class portion of the provided + * @a _id. + * + * @note This method does NOT validate the @a _id provided. + * + * @note A body is also provided. + */ +#define rtems_object_id_get_class( _id ) \ + _Objects_Get_class( _id ) + +/** + * @brief Get Node Portion of Object Id + * + * This function returns the node portion of the ID. + * + * @param[in] id is the Id of the object to obtain the node from + * + * @return This method returns the node portion of the provided + * @a _id. + * + * @note This method does NOT validate the @a _id provided. + * + * @note A body is also provided. + */ +#define rtems_object_id_get_node( _id ) \ + _Objects_Get_node( _id ) + +/** + * @brief Get Index Portion of Object Id + * + * This function returns the index portion of the ID. + * + * @param[in] id is the Id of the object to obtain the index from + * + * @return This method returns the index portion of the provided + * @a _id. + * + * @note This method does NOT validate the @a _id provided. + * + * @note A body is also provided. + */ +#define rtems_object_id_get_index( _id ) \ + _Objects_Get_index( _id ) + +/** + * @brief Get Lowest Valid API Index + * + * This method returns the lowest valid value for the API + * portion of an RTEMS object Id. + * + * @return This method returns the least valid value for + * the API portion of an RTEMS object Id. + * + * @note A body is also provided. + */ +#define rtems_object_id_api_minimum() \ + OBJECTS_INTERNAL_API + +/** + * @brief Get Highest Valid API Index + * + * This method returns the highest valid value for the API + * portion of an RTEMS object Id. + * + * @return This method returns the greatest valid value for + * the API portion of an RTEMS object Id. + * + * @note A body is also provided. + */ +#define rtems_object_id_api_maximum() \ + OBJECTS_ITRON_API + +/** + * @brief Get Lowest Valid Class Value + * + * This method returns the lowest valid value Class for the + * specified @a api. Each API supports a different number + * of object classes. + * + * @param[in] api is the API to obtain the maximum class of + * + * @return This method returns the least valid value for + * class number for the specified @a api. + */ +uint32_t rtems_object_id_api_minimum_class( + uint32_t api +); + +/** + * @brief Get Highest Valid Class Value + * + * This method returns the lowest valid value Class for the + * specified @a api. Each API supports a different number + * of object classes. + * + * @param[in] api is the API to obtain the maximum class of + * + * @return This method returns the least valid value for + * class number for the specified @a api. + */ +int rtems_object_id_api_maximum_class( + uint32_t api +); + +/** + * @brief Get API Name + * + * This method returns a string containing the name of the + * specified @a api. + * + * @param[in] api is the API to obtain the name of + * + * @return If successful, this method returns the name of + * the specified @a api. Otherwise, it returns + * the string "BAD API" + */ +const char *rtems_object_get_api_name( + uint32_t api +); + +/** + * @brief Get Class Name + * + * This method returns a string containing the name of the + * @a class from the specified @a api. + * + * @param[in] api is the API for the class + * @param[in] class is the class to obtain the name of + * + * @return If successful, this method returns the name of + * the specified @a class. Otherwise, it returns + * the string "BAD CLASS" + */ +const char *rtems_object_get_api_class_name( + uint32_t api, + uint32_t class +); + +/** + * @brief Get Class Name + * + * This method returns a string containing the name of the + * @a class from the specified @a api. + * + * @param[in] api is the API for the class + * @param[in] class is the class to obtain information about + * @param[in] info points to the information structure to fill in + * + * @return If successful, this method returns the name of + * RTEMS_SUCCESSFUL with @a *info filled in. Otherwise, + * a status is returned to indicate the error. + * + */ +rtems_status_code rtems_object_get_class_information( + uint32_t api, + uint32_t class, + rtems_object_api_class_information *info +); + +#ifdef __cplusplus +} +#endif + +#endif +/* end of include file */ diff --git a/cpukit/rtems/include/rtems/rtems/support.h b/cpukit/rtems/include/rtems/rtems/support.h index 1fd5b997fc..d77eb72139 100644 --- a/cpukit/rtems/include/rtems/rtems/support.h +++ b/cpukit/rtems/include/rtems/rtems/support.h @@ -6,7 +6,7 @@ * This include file contains information about support functions for * the RTEMS API. * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -25,59 +25,6 @@ extern "C" { #include -/* - * rtems_build_name - * - * DESCRIPTION: - * - * This function returns an object name composed of the four characters - * C1, C2, C3, and C4. - * - * NOTE: - * - * This must be implemented as a macro for use in Configuration Tables. - * - */ - -#define rtems_build_name( _C1, _C2, _C3, _C4 ) \ - ( (uint32_t )(_C1) << 24 | (uint32_t )(_C2) << 16 | (uint32_t )(_C3) << 8 | (uint32_t )(_C4) ) - -/* - * rtems_get_class - * - * DESCRIPTION: - * - * This function returns the class portion of the ID. - * - */ - -#define rtems_get_class( _id ) \ - _Objects_Get_class( _id ) - -/* - * rtems_get_node - * - * DESCRIPTION: - * - * This function returns the node portion of the ID. - * - */ - -#define rtems_get_node( _id ) \ - _Objects_Get_node( _id ) - -/* - * rtems_get_index - * - * DESCRIPTION: - * - * This function returns the index portion of the ID. - * - */ - -#define rtems_get_index( _id ) \ - _Objects_Get_index( _id ) - /* * Time related */ -- cgit v1.2.3