forked from Imagelibrary/rtems
2003-08-14 Joel Sherrill <joel@OARcorp.com>
* Makefile.am, include/rtems.h, include/rtems/rtems/status.h, src/dpmemident.c, src/msgqident.c, src/partident.c, src/ratemonident.c, src/regionident.c, src/semident.c, src/taskident.c, src/timerident.c: Added ID to name lookup service and changed name of id/name translation status code. This propagated to multiple functions. The user API service added was rtems_object_id_to_name() * src/rtemsidtoname.c: New file.
This commit is contained in:
@@ -1,3 +1,14 @@
|
|||||||
|
2003-08-14 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* Makefile.am, include/rtems.h, include/rtems/rtems/status.h,
|
||||||
|
src/dpmemident.c, src/msgqident.c, src/partident.c,
|
||||||
|
src/ratemonident.c, src/regionident.c, src/semident.c,
|
||||||
|
src/taskident.c, src/timerident.c: Added ID to name lookup service
|
||||||
|
and changed name of id/name translation status code. This propagated
|
||||||
|
to multiple functions. The user API service added was
|
||||||
|
rtems_object_id_to_name()
|
||||||
|
* src/rtemsidtoname.c: New file.
|
||||||
|
|
||||||
2003-06-12 Joel Sherrill <joel@OARcorp.com>
|
2003-06-12 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
* include/rtems/rtems/msgmp.h, include/rtems/rtems/partmp.h,
|
* include/rtems/rtems/msgmp.h, include/rtems/rtems/partmp.h,
|
||||||
|
|||||||
@@ -126,7 +126,8 @@ PARTITION_C_FILES = src/part.c src/partcreate.c src/partdelete.c src/partgetbuff
|
|||||||
DPMEM_C_FILES = src/dpmem.c src/dpmemcreate.c src/dpmemdelete.c src/dpmemexternal2internal.c \
|
DPMEM_C_FILES = src/dpmem.c src/dpmemcreate.c src/dpmemdelete.c src/dpmemexternal2internal.c \
|
||||||
src/dpmemident.c src/dpmeminternal2external.c
|
src/dpmemident.c src/dpmeminternal2external.c
|
||||||
|
|
||||||
STD_C_FILES = src/attr.c $(TASK_C_FILES) $(RATEMON_C_FILES) $(INTR_C_FILES) \
|
STD_C_FILES = src/attr.c src/rtemsidtoname.c \
|
||||||
|
$(TASK_C_FILES) $(RATEMON_C_FILES) $(INTR_C_FILES) \
|
||||||
$(CLOCK_C_FILES) $(TIMER_C_FILES) $(SEMAPHORE_C_FILES) \
|
$(CLOCK_C_FILES) $(TIMER_C_FILES) $(SEMAPHORE_C_FILES) \
|
||||||
$(MESSAGE_QUEUE_C_FILES) $(EVENT_C_FILES) $(SIGNAL_C_FILES) \
|
$(MESSAGE_QUEUE_C_FILES) $(EVENT_C_FILES) $(SIGNAL_C_FILES) \
|
||||||
$(PARTITION_C_FILES) $(REGION_C_FILES) $(DPMEM_C_FILES)
|
$(PARTITION_C_FILES) $(REGION_C_FILES) $(DPMEM_C_FILES)
|
||||||
|
|||||||
@@ -115,6 +115,26 @@ extern "C" {
|
|||||||
|
|
||||||
#define RTEMS_MINIMUN_HETERO_CONVERSION MP_PACKET_MINIMUN_HETERO_CONVERSION
|
#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 - message queue 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
|
||||||
|
);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -63,8 +63,9 @@ extern rtems_status_code _Status_Object_name_errors_to_status[];
|
|||||||
|
|
||||||
#ifdef RTEMS_API_INIT
|
#ifdef RTEMS_API_INIT
|
||||||
rtems_status_code _Status_Object_name_errors_to_status[] = {
|
rtems_status_code _Status_Object_name_errors_to_status[] = {
|
||||||
RTEMS_SUCCESSFUL, /* OBJECTS_SUCCESSFUL */
|
RTEMS_SUCCESSFUL, /* OBJECTS_ID_NAME_OR_ID_LOOKUP_SUCCESSFUL */
|
||||||
RTEMS_INVALID_NAME, /* OBJECTS_INVALID_NAME */
|
RTEMS_INVALID_NAME, /* OBJECTS_INVALID_NAME */
|
||||||
|
RTEMS_INVALID_ID, /* OBJECTS_INVALID_ID */
|
||||||
RTEMS_INVALID_NODE /* OBJECTS_INVALID_NODE */
|
RTEMS_INVALID_NODE /* OBJECTS_INVALID_NODE */
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ rtems_status_code rtems_port_ident(
|
|||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Objects_Name_to_id_errors status;
|
Objects_Name_or_id_lookup_errors status;
|
||||||
|
|
||||||
status = _Objects_Name_to_id(
|
status = _Objects_Name_to_id(
|
||||||
&_Dual_ported_memory_Information,
|
&_Dual_ported_memory_Information,
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ rtems_status_code rtems_message_queue_ident(
|
|||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Objects_Name_to_id_errors status;
|
Objects_Name_or_id_lookup_errors status;
|
||||||
|
|
||||||
status = _Objects_Name_to_id(
|
status = _Objects_Name_to_id(
|
||||||
&_Message_queue_Information,
|
&_Message_queue_Information,
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ rtems_status_code rtems_partition_ident(
|
|||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Objects_Name_to_id_errors status;
|
Objects_Name_or_id_lookup_errors status;
|
||||||
|
|
||||||
status = _Objects_Name_to_id(
|
status = _Objects_Name_to_id(
|
||||||
&_Partition_Information,
|
&_Partition_Information,
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ rtems_status_code rtems_rate_monotonic_ident(
|
|||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Objects_Name_to_id_errors status;
|
Objects_Name_or_id_lookup_errors status;
|
||||||
|
|
||||||
status = _Objects_Name_to_id(
|
status = _Objects_Name_to_id(
|
||||||
&_Rate_monotonic_Information,
|
&_Rate_monotonic_Information,
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ rtems_status_code rtems_region_ident(
|
|||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Objects_Name_to_id_errors status;
|
Objects_Name_or_id_lookup_errors status;
|
||||||
|
|
||||||
status = _Objects_Name_to_id(
|
status = _Objects_Name_to_id(
|
||||||
&_Region_Information,
|
&_Region_Information,
|
||||||
|
|||||||
46
cpukit/rtems/src/rtemsidtoname.c
Normal file
46
cpukit/rtems/src/rtemsidtoname.c
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* RTEMS ID To Name Lookup
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-2003.
|
||||||
|
* 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.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <rtems/system.h>
|
||||||
|
#include <rtems/score/object.h>
|
||||||
|
#include <rtems/rtems/status.h>
|
||||||
|
#include <rtems/rtems/types.h>
|
||||||
|
|
||||||
|
/*PAGE
|
||||||
|
*
|
||||||
|
* rtems_object_id_to_name
|
||||||
|
*
|
||||||
|
* This directive returns the name associated with the specified
|
||||||
|
* object ID.
|
||||||
|
*
|
||||||
|
* Input parameters:
|
||||||
|
* id - message queue 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
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Objects_Name_or_id_lookup_errors status;
|
||||||
|
|
||||||
|
status = _Objects_Id_to_name( id, (Objects_Name *) name );
|
||||||
|
|
||||||
|
return _Status_Object_name_errors_to_status[ status ];
|
||||||
|
}
|
||||||
@@ -69,7 +69,7 @@ rtems_status_code rtems_semaphore_ident(
|
|||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Objects_Name_to_id_errors status;
|
Objects_Name_or_id_lookup_errors status;
|
||||||
|
|
||||||
status = _Objects_Name_to_id(
|
status = _Objects_Name_to_id(
|
||||||
&_Semaphore_Information,
|
&_Semaphore_Information,
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ rtems_status_code rtems_task_ident(
|
|||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Objects_Name_to_id_errors status;
|
Objects_Name_or_id_lookup_errors status;
|
||||||
|
|
||||||
if ( name == OBJECTS_ID_OF_SELF ) {
|
if ( name == OBJECTS_ID_OF_SELF ) {
|
||||||
*id = _Thread_Executing->Object.id;
|
*id = _Thread_Executing->Object.id;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ rtems_status_code rtems_timer_ident(
|
|||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Objects_Name_to_id_errors status;
|
Objects_Name_or_id_lookup_errors status;
|
||||||
|
|
||||||
status = _Objects_Name_to_id(
|
status = _Objects_Name_to_id(
|
||||||
&_Timer_Information,
|
&_Timer_Information,
|
||||||
|
|||||||
Reference in New Issue
Block a user