summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cpukit/ChangeLog35
-rw-r--r--cpukit/itron/src/exd_tsk.c4
-rw-r--r--cpukit/itron/src/task.c4
-rw-r--r--cpukit/libmisc/capture/capture.c4
-rw-r--r--cpukit/libmisc/monitor/mon-config.c2
-rw-r--r--cpukit/libmisc/monitor/mon-driver.c2
-rw-r--r--cpukit/libmisc/monitor/mon-itask.c2
-rw-r--r--cpukit/libmisc/monitor/mon-monitor.c2
-rw-r--r--cpukit/libmisc/monitor/mon-mpci.c2
-rw-r--r--cpukit/libmisc/monitor/mon-object.c23
-rw-r--r--cpukit/libmisc/monitor/mon-symbols.c2
-rw-r--r--cpukit/posix/src/cancelrun.c4
-rw-r--r--cpukit/posix/src/pthreadexit.c4
-rw-r--r--cpukit/rtems/Makefile.am21
-rw-r--r--cpukit/rtems/include/rtems.h44
-rw-r--r--cpukit/rtems/include/rtems/rtems/object.h328
-rw-r--r--cpukit/rtems/include/rtems/rtems/support.h55
-rw-r--r--cpukit/rtems/inline/rtems/rtems/tasks.inl4
-rw-r--r--cpukit/rtems/preinstall.am4
-rw-r--r--cpukit/rtems/src/eventmp.c6
-rw-r--r--cpukit/rtems/src/msgmp.c10
-rw-r--r--cpukit/rtems/src/partmp.c8
-rw-r--r--cpukit/rtems/src/regionmp.c8
-rw-r--r--cpukit/rtems/src/rtemsbuildid.c31
-rw-r--r--cpukit/rtems/src/rtemsbuildname.c31
-rw-r--r--cpukit/rtems/src/rtemsobjectapimaximumclass.c27
-rw-r--r--cpukit/rtems/src/rtemsobjectapiminimumclass.c29
-rw-r--r--cpukit/rtems/src/rtemsobjectgetapiclassname.c100
-rw-r--r--cpukit/rtems/src/rtemsobjectgetapiname.c43
-rw-r--r--cpukit/rtems/src/rtemsobjectgetclassicname.c (renamed from cpukit/rtems/src/rtemsidtoname.c)13
-rw-r--r--cpukit/rtems/src/rtemsobjectgetclassinfo.c62
-rw-r--r--cpukit/rtems/src/rtemsobjectgetname.c5
-rw-r--r--cpukit/rtems/src/rtemsobjectidapimaximum.c26
-rw-r--r--cpukit/rtems/src/rtemsobjectidapiminimum.c26
-rw-r--r--cpukit/rtems/src/rtemsobjectidgetapi.c28
-rw-r--r--cpukit/rtems/src/rtemsobjectidgetclass.c28
-rw-r--r--cpukit/rtems/src/rtemsobjectidgetindex.c28
-rw-r--r--cpukit/rtems/src/rtemsobjectidgetnode.c28
-rw-r--r--cpukit/rtems/src/rtemsobjectsetname.c61
-rw-r--r--cpukit/rtems/src/semmp.c8
-rw-r--r--cpukit/rtems/src/signalmp.c6
-rw-r--r--cpukit/rtems/src/taskdelete.c4
-rw-r--r--cpukit/rtems/src/taskmp.c6
-rw-r--r--cpukit/rtems/src/timerserver.c4
-rw-r--r--cpukit/score/Makefile.am3
-rw-r--r--cpukit/score/include/rtems/score/object.h81
-rw-r--r--cpukit/score/inline/rtems/score/object.inl29
-rw-r--r--cpukit/score/src/Unlimited.txt23
-rw-r--r--cpukit/score/src/objectapimaximumclass.c38
-rw-r--r--cpukit/score/src/objectgetinfo.c43
-rw-r--r--cpukit/score/src/objectgetinfoid.c27
-rw-r--r--cpukit/score/src/objectgetnameasstring.c4
-rw-r--r--cpukit/score/src/objectsetname.c73
-rw-r--r--cpukit/score/src/threadqextractwithproxy.c2
54 files changed, 1270 insertions, 225 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index cb6d002875..04882afc30 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,38 @@
+2008-01-29 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * 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.
+
2008-01-29 Jennifer Averett <jennifer.averett@OARcorp.com>
* score/src/corerwlockrelease.c, score/src/coresemseize.c: Changed
diff --git a/cpukit/itron/src/exd_tsk.c b/cpukit/itron/src/exd_tsk.c
index c99282f4d8..1cae344a53 100644
--- a/cpukit/itron/src/exd_tsk.c
+++ b/cpukit/itron/src/exd_tsk.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -34,7 +34,7 @@ void exd_tsk( void )
_Thread_Disable_dispatch();
- the_information = _Objects_Get_information( _Thread_Executing->Object.id );
+ the_information = _Objects_Get_information_id( _Thread_Executing->Object.id );
/* This should never happen if _Thread_Get() works right */
assert( the_information );
diff --git a/cpukit/itron/src/task.c b/cpukit/itron/src/task.c
index 863bb214d0..eba7450b94 100644
--- a/cpukit/itron/src/task.c
+++ b/cpukit/itron/src/task.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -95,7 +95,7 @@ ER _ITRON_Delete_task(
{
Objects_Information *the_information;
- the_information = _Objects_Get_information( the_thread->Object.id );
+ the_information = _Objects_Get_information_id( the_thread->Object.id );
if ( !the_information ) {
return E_OBJ; /* XXX - should never happen */
}
diff --git a/cpukit/libmisc/capture/capture.c b/cpukit/libmisc/capture/capture.c
index 45bae26d95..24af08c5e0 100644
--- a/cpukit/libmisc/capture/capture.c
+++ b/cpukit/libmisc/capture/capture.c
@@ -7,7 +7,7 @@
All rights reserved Objective Design Systems Pty Ltd, 2002
Chris Johns (ccj@acm.org)
- COPYRIGHT (c) 1989-1998.
+ COPYRIGHT (c) 1989-2008.
On-Line Applications Research Corporation (OAR).
The license and distribution terms for this file may be
@@ -1055,7 +1055,7 @@ rtems_capture_open (uint32_t size, rtems_capture_timestamp timestamp)
}
else
{
- capture_extension_index = rtems_get_index (capture_id);;
+ capture_extension_index = rtems_object_id_get_index (capture_id);;
}
/*
diff --git a/cpukit/libmisc/monitor/mon-config.c b/cpukit/libmisc/monitor/mon-config.c
index 0a1780c0eb..754312fa54 100644
--- a/cpukit/libmisc/monitor/mon-config.c
+++ b/cpukit/libmisc/monitor/mon-config.c
@@ -64,7 +64,7 @@ rtems_monitor_config_next(
)
{
rtems_configuration_table *c = _Configuration_Table;
- int n = rtems_get_index(*next_id);
+ int n = rtems_object_id_get_index(*next_id);
if (n >= 1)
goto failed;
diff --git a/cpukit/libmisc/monitor/mon-driver.c b/cpukit/libmisc/monitor/mon-driver.c
index 48827173e5..7e63860b4c 100644
--- a/cpukit/libmisc/monitor/mon-driver.c
+++ b/cpukit/libmisc/monitor/mon-driver.c
@@ -68,7 +68,7 @@ rtems_monitor_driver_next(
)
{
rtems_configuration_table *c = _Configuration_Table;
- uint32_t n = rtems_get_index(*next_id);
+ uint32_t n = rtems_object_id_get_index(*next_id);
if (n >= c->number_of_device_drivers)
goto failed;
diff --git a/cpukit/libmisc/monitor/mon-itask.c b/cpukit/libmisc/monitor/mon-itask.c
index 81b54e52a3..d48025857e 100644
--- a/cpukit/libmisc/monitor/mon-itask.c
+++ b/cpukit/libmisc/monitor/mon-itask.c
@@ -45,7 +45,7 @@ rtems_monitor_init_task_next(
{
rtems_configuration_table *c = _Configuration_Table;
rtems_initialization_tasks_table *itask;
- uint32_t n = rtems_get_index(*next_id);
+ uint32_t n = rtems_object_id_get_index(*next_id);
if (n >= c->RTEMS_api_configuration->number_of_initialization_tasks)
goto failed;
diff --git a/cpukit/libmisc/monitor/mon-monitor.c b/cpukit/libmisc/monitor/mon-monitor.c
index 3007fd7ed4..19b51e37c0 100644
--- a/cpukit/libmisc/monitor/mon-monitor.c
+++ b/cpukit/libmisc/monitor/mon-monitor.c
@@ -604,7 +604,7 @@ rtems_monitor_init(
return;
}
- rtems_monitor_node = rtems_get_node(rtems_monitor_task_id);
+ rtems_monitor_node = rtems_object_id_get_node(rtems_monitor_task_id);
rtems_monitor_default_node = rtems_monitor_node;
rtems_monitor_server_init(monitor_flags);
diff --git a/cpukit/libmisc/monitor/mon-mpci.c b/cpukit/libmisc/monitor/mon-mpci.c
index 1853297230..733852ac4d 100644
--- a/cpukit/libmisc/monitor/mon-mpci.c
+++ b/cpukit/libmisc/monitor/mon-mpci.c
@@ -74,7 +74,7 @@ rtems_monitor_mpci_next(
)
{
rtems_configuration_table *c = _Configuration_Table;
- int n = rtems_get_index(*next_id);
+ int n = rtems_object_id_get_index(*next_id);
if (n >= 1)
goto failed;
diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c
index 05c0d30afd..3087b4abb2 100644
--- a/cpukit/libmisc/monitor/mon-object.c
+++ b/cpukit/libmisc/monitor/mon-object.c
@@ -140,14 +140,18 @@ rtems_monitor_id_fixup(
{
uint32_t node;
- node = rtems_get_node(id);
+ node = rtems_object_id_get_node(id);
if (node == 0)
{
- if (rtems_get_class(id) != OBJECTS_CLASSIC_NO_CLASS)
- type = rtems_get_class(id);
-
- id = _Objects_Build_id(
- OBJECTS_CLASSIC_API, type, default_node, rtems_get_index(id));
+ if (rtems_object_id_get_class(id) != OBJECTS_CLASSIC_NO_CLASS)
+ type = rtems_object_id_get_class(id);
+
+ id = rtems_build_id(
+ OBJECTS_CLASSIC_API,
+ type,
+ default_node,
+ rtems_object_id_get_index(id)
+ );
}
return id;
}
@@ -189,7 +193,8 @@ rtems_monitor_object_canonical_next_remote(
request.argument0 = (uint32_t ) type;
request.argument1 = (uint32_t ) id;
- status = rtems_monitor_server_request(rtems_get_node(id), &request, &response);
+ status = rtems_monitor_server_request(
+ rtems_object_id_get_node(id), &request, &response);
if (status != RTEMS_SUCCESSFUL)
goto failed;
@@ -370,7 +375,7 @@ rtems_monitor_object_cmd(
{
id = (rtems_id) strtoul(argv[arg], 0, 16);
id = rtems_monitor_id_fixup(id, default_node, type);
- type = (rtems_monitor_object_type_t) rtems_get_class(id);
+ type = (rtems_monitor_object_type_t) rtems_object_id_get_class(id);
/*
* Allow the item type to change in the middle
@@ -395,7 +400,7 @@ not_found: fprintf(stdout,"Invalid or unsupported type %d\n", type);
rtems_monitor_object_dump_1(info, id, verbose);
- default_node = rtems_get_node(id);
+ default_node = rtems_object_id_get_node(id);
last_type = type;
}
diff --git a/cpukit/libmisc/monitor/mon-symbols.c b/cpukit/libmisc/monitor/mon-symbols.c
index 7ecae3b0e1..776c4d4bf8 100644
--- a/cpukit/libmisc/monitor/mon-symbols.c
+++ b/cpukit/libmisc/monitor/mon-symbols.c
@@ -304,7 +304,7 @@ rtems_monitor_symbol_next(
)
{
rtems_symbol_table_t *table;
- uint32_t n = rtems_get_index(*next_id);
+ uint32_t n = rtems_object_id_get_index(*next_id);
table = *(rtems_symbol_table_t **) object_info;
if (table == 0)
diff --git a/cpukit/posix/src/cancelrun.c b/cpukit/posix/src/cancelrun.c
index 3c289ca1a9..fff75ac1e4 100644
--- a/cpukit/posix/src/cancelrun.c
+++ b/cpukit/posix/src/cancelrun.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -62,7 +62,7 @@ void _POSIX_Threads_cancel_run(
the_thread->Wait.return_argument = PTHREAD_CANCELED;
_Thread_Close(
- _Objects_Get_information( the_thread->Object.id ),
+ _Objects_Get_information_id( the_thread->Object.id ),
the_thread
);
_POSIX_Threads_Free( the_thread );
diff --git a/cpukit/posix/src/pthreadexit.c b/cpukit/posix/src/pthreadexit.c
index ef3b3302bd..a8781f5c58 100644
--- a/cpukit/posix/src/pthreadexit.c
+++ b/cpukit/posix/src/pthreadexit.c
@@ -3,7 +3,7 @@
*
* NOTE: Key destructors are executed in the POSIX api delete extension.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -31,7 +31,7 @@ void pthread_exit(
{
Objects_Information *the_information;
- the_information = _Objects_Get_information( _Thread_Executing->Object.id );
+ the_information = _Objects_Get_information_id( _Thread_Executing->Object.id );
/*
* the_information has to be non-NULL. Otherwise, we couldn't be
diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am
index 44e9a153e7..890e9f8734 100644
--- a/cpukit/rtems/Makefile.am
+++ b/cpukit/rtems/Makefile.am
@@ -19,11 +19,11 @@ include_rtems_rtemsdir = $(includedir)/rtems/rtems
include_rtems_rtems_HEADERS = include/rtems/rtems/asr.h \
include/rtems/rtems/attr.h include/rtems/rtems/barrier.h \
- include/rtems/rtems/cache.h \
- include/rtems/rtems/clock.h include/rtems/rtems/config.h \
- include/rtems/rtems/dpmem.h include/rtems/rtems/event.h \
- include/rtems/rtems/eventset.h include/rtems/rtems/intr.h \
- include/rtems/rtems/message.h include/rtems/rtems/modes.h \
+ include/rtems/rtems/cache.h include/rtems/rtems/clock.h \
+ include/rtems/rtems/config.h include/rtems/rtems/dpmem.h \
+ include/rtems/rtems/event.h include/rtems/rtems/eventset.h \
+ include/rtems/rtems/intr.h include/rtems/rtems/message.h \
+ include/rtems/rtems/modes.h include/rtems/rtems/object.h \
include/rtems/rtems/options.h include/rtems/rtems/part.h \
include/rtems/rtems/ratemon.h include/rtems/rtems/region.h \
include/rtems/rtems/rtemsapi.h include/rtems/rtems/sem.h \
@@ -52,7 +52,14 @@ include_rtems_rtems_HEADERS += inline/rtems/rtems/asr.inl \
inline/rtems/rtems/timer.inl
## src
-librtems_a_SOURCES = src/rtemsobjectgetname.c
+librtems_a_SOURCES = src/rtemsbuildid.c src/rtemsbuildname.c \
+ src/rtemsobjectgetname.c src/rtemsobjectsetname.c \
+ src/rtemsobjectidapimaximum.c src/rtemsobjectidapiminimum.c \
+ src/rtemsobjectidgetapi.c src/rtemsobjectidgetclass.c \
+ src/rtemsobjectidgetindex.c src/rtemsobjectidgetnode.c \
+ src/rtemsobjectapiminimumclass.c src/rtemsobjectapimaximumclass.c \
+ src/rtemsobjectgetapiname.c src/rtemsobjectgetapiclassname.c \
+ src/rtemsobjectgetclassinfo.c src/rtemsobjectgetclassicname.c
## TASK_C_FILES
librtems_a_SOURCES += src/tasks.c src/taskcreate.c src/taskdelete.c \
@@ -124,7 +131,7 @@ librtems_a_SOURCES += src/dpmem.c src/dpmemcreate.c src/dpmemdelete.c \
src/dpmemexternal2internal.c src/dpmemident.c \
src/dpmeminternal2external.c src/dpmemdata.c
-librtems_a_SOURCES += src/attr.c src/rtemsidtoname.c
+librtems_a_SOURCES += src/attr.c
if HAS_MP
# We only build multiprocessing related files if HAS_MP was defined
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 <rtems/rtems/event.h>
#include <rtems/rtems/signal.h>
#include <rtems/rtems/event.h>
+#include <rtems/rtems/object.h>
#include <rtems/rtems/part.h>
#include <rtems/rtems/region.h>
#include <rtems/rtems/dpmem.h>
@@ -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 <rtems/score/object.h>
+#include <rtems/rtems/status.h>
+#include <rtems/rtems/types.h>
+
+/**
+ * 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
@@ -26,59 +26,6 @@ extern "C" {
#include <rtems/rtems/types.h>
/*
- * 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
*/
diff --git a/cpukit/rtems/inline/rtems/rtems/tasks.inl b/cpukit/rtems/inline/rtems/rtems/tasks.inl
index 1926ade36b..143662c609 100644
--- a/cpukit/rtems/inline/rtems/rtems/tasks.inl
+++ b/cpukit/rtems/inline/rtems/rtems/tasks.inl
@@ -6,7 +6,7 @@
* This file contains the static inline implementation of all inlined
* routines in the with RTEMS Tasks Manager.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -49,7 +49,7 @@ RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free (
)
{
_Objects_Free(
- _Objects_Get_information( the_task->Object.id ),
+ _Objects_Get_information_id( the_task->Object.id ),
&the_task->Object
);
}
diff --git a/cpukit/rtems/preinstall.am b/cpukit/rtems/preinstall.am
index 8d00fe9ad3..0d87743601 100644
--- a/cpukit/rtems/preinstall.am
+++ b/cpukit/rtems/preinstall.am
@@ -75,6 +75,10 @@ $(PROJECT_INCLUDE)/rtems/rtems/modes.h: include/rtems/rtems/modes.h $(PROJECT_IN
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/modes.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/modes.h
+$(PROJECT_INCLUDE)/rtems/rtems/object.h: include/rtems/rtems/object.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/object.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/object.h
+
$(PROJECT_INCLUDE)/rtems/rtems/options.h: include/rtems/rtems/options.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/options.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/options.h
diff --git a/cpukit/rtems/src/eventmp.c b/cpukit/rtems/src/eventmp.c
index 2b19571e52..552d283994 100644
--- a/cpukit/rtems/src/eventmp.c
+++ b/cpukit/rtems/src/eventmp.c
@@ -1,7 +1,7 @@
/*
* Multiprocessing Support for the Event Manager
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -63,7 +63,7 @@ rtems_status_code _Event_MP_Send_request_packet (
return (rtems_status_code)
_MPCI_Send_request_packet(
- rtems_get_node( event_id ),
+ _Objects_Get_node( event_id ),
&the_packet->Prefix,
STATES_READY
);
@@ -108,7 +108,7 @@ void _Event_MP_Send_response_packet (
the_packet->Prefix.id = the_packet->Prefix.source_tid;
_MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
+ _Objects_Get_node( the_packet->Prefix.source_tid ),
&the_packet->Prefix
);
break;
diff --git a/cpukit/rtems/src/msgmp.c b/cpukit/rtems/src/msgmp.c
index f3882a733b..471296b2a7 100644
--- a/cpukit/rtems/src/msgmp.c
+++ b/cpukit/rtems/src/msgmp.c
@@ -2,7 +2,7 @@
* Multiprocessing Support for the Message Queue Manager
*
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -59,7 +59,7 @@ void _Message_queue_MP_Send_process_packet (
the_packet->proxy_id = proxy_id;
if ( operation == MESSAGE_QUEUE_MP_EXTRACT_PROXY )
- node = rtems_get_node( message_queue_id );
+ node = _Objects_Get_node( message_queue_id );
else
node = MPCI_ALL_NODES;
@@ -147,7 +147,7 @@ rtems_status_code _Message_queue_MP_Send_request_packet (
}
return (rtems_status_code) _MPCI_Send_request_packet(
- rtems_get_node(message_queue_id),
+ _Objects_Get_node(message_queue_id),
&the_packet->Prefix,
STATES_WAITING_FOR_MESSAGE
);
@@ -172,7 +172,7 @@ rtems_status_code _Message_queue_MP_Send_request_packet (
_Thread_Executing->Wait.return_argument_1 = size_p;
return (rtems_status_code) _MPCI_Send_request_packet(
- rtems_get_node(message_queue_id),
+ _Objects_Get_node(message_queue_id),
&the_packet->Prefix,
STATES_WAITING_FOR_MESSAGE
);
@@ -232,7 +232,7 @@ void _Message_queue_MP_Send_response_packet (
the_packet->Prefix.length += the_packet->size;
_MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
+ _Objects_Get_node( the_packet->Prefix.source_tid ),
&the_packet->Prefix
);
break;
diff --git a/cpukit/rtems/src/partmp.c b/cpukit/rtems/src/partmp.c
index c69272dd81..f1b6a7bcfd 100644
--- a/cpukit/rtems/src/partmp.c
+++ b/cpukit/rtems/src/partmp.c
@@ -2,7 +2,7 @@
* Multiprocessing Support for the Partition Manager
*
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -58,7 +58,7 @@ void _Partition_MP_Send_process_packet (
the_packet->proxy_id = proxy_id;
if ( operation == PARTITION_MP_EXTRACT_PROXY )
- node = rtems_get_node( partition_id );
+ node = _Objects_Get_node( partition_id );
else
node = MPCI_ALL_NODES;
@@ -102,7 +102,7 @@ rtems_status_code _Partition_MP_Send_request_packet (
return
_MPCI_Send_request_packet(
- rtems_get_node( partition_id ),
+ _Objects_Get_node( partition_id ),
&the_packet->Prefix,
STATES_READY /* Not used */
);
@@ -153,7 +153,7 @@ void _Partition_MP_Send_response_packet (
the_packet->Prefix.id = the_packet->Prefix.source_tid;
_MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
+ _Objects_Get_node( the_packet->Prefix.source_tid ),
&the_packet->Prefix
);
break;
diff --git a/cpukit/rtems/src/regionmp.c b/cpukit/rtems/src/regionmp.c
index 6971b05c10..5780c6be58 100644
--- a/cpukit/rtems/src/regionmp.c
+++ b/cpukit/rtems/src/regionmp.c
@@ -2,7 +2,7 @@
* Multiprocessing Support for the Region Manager
*
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -58,7 +58,7 @@ void _Region_MP_Send_process_packet (
the_packet->proxy_id = proxy_id;
if ( operation == REGION_MP_EXTRACT_PROXY )
- node = rtems_get_node( region_id );
+ node = _Object_Get_node( region_id );
else
node = MPCI_ALL_NODES;
@@ -109,7 +109,7 @@ rtems_status_code _Region_MP_Send_request_packet (
the_packet->option_set = option_set;
return (rtems_status_code) _MPCI_Send_request_packet(
- rtems_get_node( region_id ),
+ _Object_Get_node( region_id ),
&the_packet->Prefix,
STATES_READY /* Not used */
);
@@ -159,7 +159,7 @@ void _Region_MP_Send_response_packet (
the_packet->Prefix.id = the_packet->Prefix.source_tid;
_MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
+ _Object_Get_node( the_packet->Prefix.source_tid ),
&the_packet->Prefix
);
break;
diff --git a/cpukit/rtems/src/rtemsbuildid.c b/cpukit/rtems/src/rtemsbuildid.c
new file mode 100644
index 0000000000..9212ee32dd
--- /dev/null
+++ b/cpukit/rtems/src/rtemsbuildid.c
@@ -0,0 +1,31 @@
+/*
+ * RTEMS Object Helper -- Build an Object Id
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/types.h>
+
+#undef rtems_build_id
+rtems_id rtems_build_id(
+ uint32_t api,
+ uint32_t class,
+ uint32_t node,
+ uint32_t index
+)
+{
+ return _Objects_Build_id( api, class, node, index );
+}
diff --git a/cpukit/rtems/src/rtemsbuildname.c b/cpukit/rtems/src/rtemsbuildname.c
new file mode 100644
index 0000000000..7f299863fa
--- /dev/null
+++ b/cpukit/rtems/src/rtemsbuildname.c
@@ -0,0 +1,31 @@
+/*
+ * RTEMS Object Helper -- Build an Object Name
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/types.h>
+
+#undef rtems_build_name
+rtems_name rtems_build_name(
+ char C1,
+ char C2,
+ char C3,
+ char C4
+)
+{
+ return _Objects_Build_name( C1, C2, C3, C4 );
+}
diff --git a/cpukit/rtems/src/rtemsobjectapimaximumclass.c b/cpukit/rtems/src/rtemsobjectapimaximumclass.c
new file mode 100644
index 0000000000..1eb1a3bad6
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectapimaximumclass.c
@@ -0,0 +1,27 @@
+/*
+ * RTEMS Object Helper -- Get Greatest Valid Class for an API
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/types.h>
+
+int rtems_object_api_maximum_class(
+ uint32_t api
+)
+{
+ return _Objects_API_maximum_class(api);
+}
diff --git a/cpukit/rtems/src/rtemsobjectapiminimumclass.c b/cpukit/rtems/src/rtemsobjectapiminimumclass.c
new file mode 100644
index 0000000000..a3995eb32a
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectapiminimumclass.c
@@ -0,0 +1,29 @@
+/*
+ * RTEMS Object Helper -- Get Least Valid Class for an API
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/types.h>
+
+uint32_t rtems_object_api_minimum_class(
+ uint32_t api
+)
+{
+ if ( _Objects_Is_api_valid( api ) )
+ return 1;
+ return -1;
+}
diff --git a/cpukit/rtems/src/rtemsobjectgetapiclassname.c b/cpukit/rtems/src/rtemsobjectgetapiclassname.c
new file mode 100644
index 0000000000..00277f1c23
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectgetapiclassname.c
@@ -0,0 +1,100 @@
+/*
+ * RTEMS Object Helper -- Obtain Name of API
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/object.h>
+
+#include <rtems/assoc.h>
+
+rtems_assoc_t rtems_object_api_internal_assoc[] = {
+ { "Thread", OBJECTS_INTERNAL_THREADS},
+ { "Mutex", OBJECTS_INTERNAL_MUTEXES},
+};
+
+rtems_assoc_t rtems_object_api_classic_assoc[] = {
+ { "Task", OBJECTS_RTEMS_TASKS},
+ { "Timer", OBJECTS_RTEMS_TIMERS},
+ { "Semaphore", OBJECTS_RTEMS_SEMAPHORES},
+ { "Message Queue", OBJECTS_RTEMS_MESSAGE_QUEUES},
+ { "Partition", OBJECTS_RTEMS_PARTITIONS},
+ { "Region", OBJECTS_RTEMS_REGIONS},
+ { "Port", OBJECTS_RTEMS_PORTS},
+ { "Period", OBJECTS_RTEMS_PERIODS},
+ { "Extension", OBJECTS_RTEMS_EXTENSIONS},
+ { "Barrier", OBJECTS_RTEMS_BARRIERS},
+};
+
+#ifdef RTEMS_POSIX_API
+rtems_assoc_t rtems_object_api_posix_assoc[] = {
+ { "Thread", OBJECTS_POSIX_THREADS},
+ { "Key", OBJECTS_POSIX_KEYS},
+ { "Interrupt", OBJECTS_POSIX_INTERRUPTS},
+ { "Queued fd", OBJECTS_POSIX_MESSAGE_QUEUE_FDS},
+ { "Message Queue", OBJECTS_POSIX_MESSAGE_QUEUES},
+ { "Mutex", OBJECTS_POSIX_MUTEXES},
+ { "Semaphore", OBJECTS_POSIX_SEMAPHORES},
+ { "Condition Variable", OBJECTS_POSIX_CONDITION_VARIABLES},
+ { "Timer", OBJECTS_POSIX_TIMERS},
+ { "Barrier", OBJECTS_POSIX_BARRIERS},
+ { "Spinlock", OBJECTS_POSIX_SPINLOCKS},
+ { "RWLock", OBJECTS_POSIX_RWLOCKS},
+};
+#endif
+
+#ifdef RTEMS_ITRON_API
+rtems_assoc_t rtems_object_api_itron_assoc[] = {
+ { "Task", OBJECTS_ITRON_TASKS},
+ { "Event Flag", OBJECTS_ITRON_EVENTFLAGS},
+ { "Mailbox", OBJECTS_ITRON_MAILBOXES},
+ { "Message Buffer", OBJECTS_ITRON_MESSAGE_BUFFERS},
+ { "Port", OBJECTS_ITRON_PORTS},
+ { "Semaphore", OBJECTS_ITRON_SEMAPHORES},
+ { "Variable Memory Pool", OBJECTS_ITRON_VARIABLE_MEMORY_POOLS},
+ { "Fixed Memory Pool", OBJECTS_ITRON_FIXED_MEMORY_POOLS},
+};
+#endif
+
+const char *rtems_object_get_api_class_name(
+ uint32_t api,
+ uint32_t class
+)
+{
+ const rtems_assoc_t *api_assoc;
+ const rtems_assoc_t *class_assoc;
+
+ switch (api) {
+ case OBJECTS_INTERNAL_API:
+ api_assoc = rtems_object_api_internal_assoc;
+ break;
+ case OBJECTS_CLASSIC_API:
+ api_assoc = rtems_object_api_classic_assoc;
+ break;
+ case OBJECTS_POSIX_API:
+ api_assoc = rtems_object_api_posix_assoc;
+ break;
+ case OBJECTS_ITRON_API:
+ api_assoc = rtems_object_api_itron_assoc;
+ break;
+ default:
+ return "BAD API";
+ }
+ class_assoc = rtems_assoc_ptr_by_local( api_assoc, class );
+ if ( class_assoc )
+ return class_assoc->name;
+ return "BAD CLASS";
+}
diff --git a/cpukit/rtems/src/rtemsobjectgetapiname.c b/cpukit/rtems/src/rtemsobjectgetapiname.c
new file mode 100644
index 0000000000..92aaba1173
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectgetapiname.c
@@ -0,0 +1,43 @@
+/*
+ * RTEMS Object Helper -- Obtain Name of API
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/object.h>
+
+#include <rtems/assoc.h>
+
+rtems_assoc_t rtems_objects_api_assoc[] = {
+ { "Internal", OBJECTS_INTERNAL_API},
+ { "Classic", OBJECTS_CLASSIC_API},
+ { "POSIX", OBJECTS_POSIX_API},
+ { "ITRON", OBJECTS_ITRON_API},
+ { 0, 0, 0 }
+};
+
+const char *rtems_object_get_api_name(
+ uint32_t api
+)
+{
+ const rtems_assoc_t *api_assoc;
+
+ api_assoc = rtems_assoc_ptr_by_local( rtems_objects_api_assoc, api );
+ if ( api_assoc )
+ return api_assoc->name;
+ return "BAD CLASS";
+}
+
diff --git a/cpukit/rtems/src/rtemsidtoname.c b/cpukit/rtems/src/rtemsobjectgetclassicname.c
index 6503d9f136..7a78d59e7e 100644
--- a/cpukit/rtems/src/rtemsidtoname.c
+++ b/cpukit/rtems/src/rtemsobjectgetclassicname.c
@@ -2,7 +2,7 @@
* RTEMS ID To Name Lookup
*
*
- * COPYRIGHT (c) 1989-2003.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -23,7 +23,7 @@
/*PAGE
*
- * rtems_object_id_to_name
+ * rtems_object_get_classic_name
*
* This directive returns the name associated with the specified
* object ID.
@@ -37,14 +37,19 @@
* error code - if unsuccessful
*/
-rtems_status_code rtems_object_id_to_name(
+rtems_status_code rtems_object_get_classic_name(
rtems_id id,
rtems_name *name
)
{
Objects_Name_or_id_lookup_errors status;
+ Objects_Name name_u;
- status = _Objects_Id_to_name( id, (Objects_Name *) name );
+ if ( !name )
+ return RTEMS_INVALID_ADDRESS;
+ status = _Objects_Id_to_name( id, &name_u );
+
+ *name = name_u.name_u32;
return _Status_Object_name_errors_to_status[ status ];
}
diff --git a/cpukit/rtems/src/rtemsobjectgetclassinfo.c b/cpukit/rtems/src/rtemsobjectgetclassinfo.c
new file mode 100644
index 0000000000..ec111c0181
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectgetclassinfo.c
@@ -0,0 +1,62 @@
+/*
+ * RTEMS Object Helper -- Get Information on Class
+ *
+ * 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$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+#include <rtems/system.h>
+#include <rtems/rtems/status.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/object.h>
+
+rtems_status_code rtems_object_get_class_information(
+ uint32_t api,
+ uint32_t class,
+ rtems_object_api_class_information *info
+)
+{
+ Objects_Information *obj_info;
+ uint32_t unallocated;
+ uint32_t i;
+
+ /*
+ * Validate parameters and look up information structure.
+ */
+ if ( !info )
+ return RTEMS_INVALID_ADDRESS;
+
+ obj_info = _Objects_Get_information( api, class );
+ if ( !obj_info )
+ return RTEMS_INVALID_NUMBER;
+
+ /*
+ * Return information about this object class to the user.
+ */
+ info->minimum_id = obj_info->minimum_id;
+ info->maximum_id = obj_info->maximum_id;
+ info->auto_extend = obj_info->auto_extend;
+ info->maximum = obj_info->maximum;
+
+ for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )
+ if ( !obj_info->local_table[i] )
+ unallocated++;
+
+ info->unallocated = unallocated;
+
+ return RTEMS_SUCCESSFUL;
+}
+
diff --git a/cpukit/rtems/src/rtemsobjectgetname.c b/cpukit/rtems/src/rtemsobjectgetname.c
index 2fbf39425d..0f03924348 100644
--- a/cpukit/rtems/src/rtemsobjectgetname.c
+++ b/cpukit/rtems/src/rtemsobjectgetname.c
@@ -1,7 +1,7 @@
/*
* RTEMS Object Helper -- Obtain Name of Object as String
*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -19,11 +19,10 @@
#include <rtems/score/object.h>
/*
- * This method objects the name of an object and returns its name
+ * This method obtain 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.
*/
-
char *rtems_object_get_name(
Objects_Id id,
size_t length,
diff --git a/cpukit/rtems/src/rtemsobjectidapimaximum.c b/cpukit/rtems/src/rtemsobjectidapimaximum.c
new file mode 100644
index 0000000000..340f631eca
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectidapimaximum.c
@@ -0,0 +1,26 @@
+/*
+ * RTEMS Object Helper -- Get Greatest Valid API Number
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/types.h>
+
+#undef rtems_object_id_api_maximum
+uint32_t rtems_object_id_api_maximum(void)
+{
+ return OBJECTS_ITRON_API;
+}
diff --git a/cpukit/rtems/src/rtemsobjectidapiminimum.c b/cpukit/rtems/src/rtemsobjectidapiminimum.c
new file mode 100644
index 0000000000..c35678672a
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectidapiminimum.c
@@ -0,0 +1,26 @@
+/*
+ * RTEMS Object Helper -- Get Least Valid API Number
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/types.h>
+
+#undef rtems_object_id_api_minimum
+uint32_t rtems_object_id_api_minimum(void)
+{
+ return OBJECTS_INTERNAL_API;
+}
diff --git a/cpukit/rtems/src/rtemsobjectidgetapi.c b/cpukit/rtems/src/rtemsobjectidgetapi.c
new file mode 100644
index 0000000000..9fd64eb959
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectidgetapi.c
@@ -0,0 +1,28 @@
+/*
+ * RTEMS Object Helper -- Extract API From Id
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/types.h>
+
+#undef rtems_object_id_get_api
+uint32_t rtems_object_id_get_api(
+ rtems_id id
+)
+{
+ return _Objects_Get_API( id );
+}
diff --git a/cpukit/rtems/src/rtemsobjectidgetclass.c b/cpukit/rtems/src/rtemsobjectidgetclass.c
new file mode 100644
index 0000000000..88a5a8b3fb
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectidgetclass.c
@@ -0,0 +1,28 @@
+/*
+ * RTEMS Object Helper -- Extract Class From Id
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/types.h>
+
+#undef rtems_object_id_get_class
+uint32_t rtems_object_id_get_class(
+ rtems_id id
+)
+{
+ return _Objects_Get_class( id );
+}
diff --git a/cpukit/rtems/src/rtemsobjectidgetindex.c b/cpukit/rtems/src/rtemsobjectidgetindex.c
new file mode 100644
index 0000000000..1ffef83db6
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectidgetindex.c
@@ -0,0 +1,28 @@
+/*
+ * RTEMS Object Helper -- Extract Index From Id
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/types.h>
+
+#undef rtems_object_id_get_index
+uint32_t rtems_object_id_get_index(
+ rtems_id id
+)
+{
+ return _Objects_Get_index( id );
+}
diff --git a/cpukit/rtems/src/rtemsobjectidgetnode.c b/cpukit/rtems/src/rtemsobjectidgetnode.c
new file mode 100644
index 0000000000..693a450659
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectidgetnode.c
@@ -0,0 +1,28 @@
+/*
+ * RTEMS Object Helper -- Extract Node From Id
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/rtems/types.h>
+
+#undef rtems_object_id_get_node
+uint32_t rtems_object_id_get_node(
+ rtems_id id
+)
+{
+ return _Objects_Get_node( id );
+}
diff --git a/cpukit/rtems/src/rtemsobjectsetname.c b/cpukit/rtems/src/rtemsobjectsetname.c
new file mode 100644
index 0000000000..ccfd8a7b59
--- /dev/null
+++ b/cpukit/rtems/src/rtemsobjectsetname.c
@@ -0,0 +1,61 @@
+/*
+ * RTEMS Object Helper -- Set Name of Object as String
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/score/thread.h>
+#include <rtems/rtems/status.h>
+#include <rtems/rtems/types.h>
+
+/*
+ * This method will set the object name based upon the user string.
+ * If the object class uses 32-bit names, then only the first 4 bytes
+ * of the string will be used.
+ */
+rtems_status_code rtems_object_set_name(
+ rtems_id id,
+ const char *name
+)
+{
+ Objects_Information *information;
+ Objects_Locations location;
+ Objects_Control *the_object;
+
+ if ( !name )
+ return RTEMS_INVALID_ADDRESS;
+
+ information = _Objects_Get_information_id( id );
+ if ( !information )
+ return RTEMS_INVALID_ID;
+
+ the_object = _Objects_Get( information, id, &location );
+ switch ( location ) {
+
+ case OBJECTS_LOCAL:
+ _Objects_Set_name( information, the_object, name );
+ _Thread_Enable_dispatch();
+ return RTEMS_SUCCESSFUL;
+
+#if defined(RTEMS_MULTIPROCESSING)
+ case OBJECTS_REMOTE:
+#endif
+ case OBJECTS_ERROR:
+ break;
+ }
+
+ return RTEMS_INVALID_ID;
+}
diff --git a/cpukit/rtems/src/semmp.c b/cpukit/rtems/src/semmp.c
index 3cade9a50c..570288d4a2 100644
--- a/cpukit/rtems/src/semmp.c
+++ b/cpukit/rtems/src/semmp.c
@@ -2,7 +2,7 @@
* Multiprocessing Support for the Semaphore Manager
*
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -59,7 +59,7 @@ void _Semaphore_MP_Send_process_packet (
the_packet->proxy_id = proxy_id;
if ( operation == SEMAPHORE_MP_EXTRACT_PROXY )
- node = rtems_get_node( semaphore_id );
+ node = _Objects_Get_node( semaphore_id );
else
node = MPCI_ALL_NODES;
@@ -106,7 +106,7 @@ rtems_status_code _Semaphore_MP_Send_request_packet (
the_packet->option_set = option_set;
return _MPCI_Send_request_packet(
- rtems_get_node( semaphore_id ),
+ _Objects_Get_node( semaphore_id ),
&the_packet->Prefix,
STATES_WAITING_FOR_SEMAPHORE
);
@@ -156,7 +156,7 @@ void _Semaphore_MP_Send_response_packet (
the_packet->Prefix.id = the_packet->Prefix.source_tid;
_MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
+ _Objects_Get_node( the_packet->Prefix.source_tid ),
&the_packet->Prefix
);
break;
diff --git a/cpukit/rtems/src/signalmp.c b/cpukit/rtems/src/signalmp.c
index 7a7f771b19..f49a0a5862 100644
--- a/cpukit/rtems/src/signalmp.c
+++ b/cpukit/rtems/src/signalmp.c
@@ -2,7 +2,7 @@
* Multiprocessing Support for the Signal Manager
*
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -64,7 +64,7 @@ rtems_status_code _Signal_MP_Send_request_packet (
the_packet->signal_in = signal_in;
return _MPCI_Send_request_packet(
- rtems_get_node( task_id ),
+ _Objects_Get_node( task_id ),
&the_packet->Prefix,
STATES_READY /* Not used */
);
@@ -108,7 +108,7 @@ void _Signal_MP_Send_response_packet (
the_packet->Prefix.id = the_packet->Prefix.source_tid;
_MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
+ _Objects_Get_node( the_packet->Prefix.source_tid ),
&the_packet->Prefix
);
break;
diff --git a/cpukit/rtems/src/taskdelete.c b/cpukit/rtems/src/taskdelete.c
index 7e5e7cbf97..890596866b 100644
--- a/cpukit/rtems/src/taskdelete.c
+++ b/cpukit/rtems/src/taskdelete.c
@@ -2,7 +2,7 @@
* RTEMS Task Manager
*
*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -62,7 +62,7 @@ rtems_status_code rtems_task_delete(
switch ( location ) {
case OBJECTS_LOCAL:
- the_information = _Objects_Get_information( the_thread->Object.id );
+ the_information = _Objects_Get_information_id( the_thread->Object.id );
#if defined(RTEMS_DEBUG)
if ( !the_information ) {
diff --git a/cpukit/rtems/src/taskmp.c b/cpukit/rtems/src/taskmp.c
index d1b2ff815c..dec5986017 100644
--- a/cpukit/rtems/src/taskmp.c
+++ b/cpukit/rtems/src/taskmp.c
@@ -2,7 +2,7 @@
* Multiprocessing Support for the RTEMS Task Manager
*
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -106,7 +106,7 @@ rtems_status_code _RTEMS_tasks_MP_Send_request_packet (
the_packet->note = note;
return _MPCI_Send_request_packet(
- rtems_get_node( task_id ),
+ _Objects_Get_node( task_id ),
&the_packet->Prefix,
STATES_READY /* Not used */
);
@@ -160,7 +160,7 @@ void _RTEMS_tasks_MP_Send_response_packet (
the_packet->Prefix.id = the_packet->Prefix.source_tid;
_MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
+ _Objects_Get_node( the_packet->Prefix.source_tid ),
&the_packet->Prefix
);
break;
diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c
index 01bb597f1c..ff1fc97099 100644
--- a/cpukit/rtems/src/timerserver.c
+++ b/cpukit/rtems/src/timerserver.c
@@ -2,7 +2,7 @@
* Timer Manager - rtems_timer_initiate_server directive along with
* the Timer Server Body and support routines
*
- * COPYRIGHT (c) 1989-2002.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -188,7 +188,7 @@ rtems_status_code rtems_timer_initiate_server(
*/
status = rtems_task_create(
- rtems_build_name('T','I','M','E'), /* "TIME" */
+ _Objects_Build_name('T','I','M','E'), /* "TIME" */
_priority, /* create with priority 1 since 0 is illegal */
stack_size, /* let user specify stack size */
RTEMS_NO_PREEMPT, /* no preempt is like an interrupt */
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index f5aae2d610..bb3c7bfcd6 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -117,7 +117,8 @@ libscore_a_SOURCES += src/object.c src/objectallocate.c \
src/objectgetisr.c src/objectgetnext.c src/objectinitializeinformation.c \
src/objectnametoid.c src/objectnametoidstring.c \
src/objectshrinkinformation.c src/objectgetnoprotection.c \
- src/objectidtoname.c src/objectgetnameasstring.c
+ src/objectidtoname.c src/objectgetnameasstring.c src/objectsetname.c \
+ src/objectgetinfo.c src/objectgetinfoid.c src/objectapimaximumclass.c
## OBJECT_C_FILES only used by ITRON API
if LIBITRON
diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h
index c1a9c040db..ffc34a46a0 100644
--- a/cpukit/score/include/rtems/score/object.h
+++ b/cpukit/score/include/rtems/score/object.h
@@ -9,7 +9,7 @@
*/
/*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -498,6 +498,18 @@ void _Objects_Initialize_information (
);
/**
+ * This function returns the highest numeric value of a valid
+ * API for the specified @code{api}.
+ *
+ * @param[in] api is the API of interest
+ *
+ * @return A positive integer on success and -1 otherwise.
+ */
+int _Objects_API_maximum_class(
+ uint32_t api
+);
+
+/**
* This function allocates a object control block from
* the inactive chain of free object control blocks.
*
@@ -536,6 +548,22 @@ void _Objects_Free(
);
/**
+ * This macro is used to build a thirty-two bit style name from
+ * four characters. The most significant byte will be the
+ * character @code{_C1}.
+ *
+ * @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
+ */
+#define _Objects_Build_name( _C1, _C2, _C3, _C4 ) \
+ ( (uint32_t)(_C1) << 24 | \
+ (uint32_t)(_C2) << 16 | \
+ (uint32_t)(_C3) << 8 | \
+ (uint32_t)(_C4) )
+
+/**
* This function implements the common portion of the object
* identification directives. This directive returns the object
* id associated with name. If more than one object of this class
@@ -677,7 +705,7 @@ Objects_Control *_Objects_Get (
*
* @note _Objects_Get returns with dispatching disabled for
* local and remote objects. _Objects_Get_isr_disable returns with
- * dispatching disabled for remote objects and interrupts for local
+ * dispatchng disabled for remote objects and interrupts for local
* objects.
*/
Objects_Control *_Objects_Get_isr_disable(
@@ -764,6 +792,37 @@ Objects_Control *_Objects_Get_next(
);
/**
+ * This function return the information structure given
+ * an the API and Class. This can be done independent of
+ * the existence of any objects created by the API.
+ *
+ * @param[in] api indicates the API for the information we want
+ * @param[in] api indicates the Class for the information we want
+ *
+ *
+ * @return This method returns a pointer to the Object Information Table
+ * for the class of objects which corresponds to this object ID.
+ */
+Objects_Information *_Objects_Get_information(
+ Objects_APIs api,
+ uint32_t class
+);
+
+/**
+ * This function return the information structure given
+ * an id of an object.
+ *
+ * @param[in] id is an object ID
+ *
+ *
+ * @return This method returns a pointer to the Object Information Table
+ * for the class of objects which corresponds to this object ID.
+ */
+Objects_Information *_Objects_Get_information_id(
+ Objects_Id id
+);
+
+/**
* This method objects 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.
@@ -774,13 +833,29 @@ Objects_Control *_Objects_Get_next(
*
* @return This method returns @a name or NULL on error.
*/
-
char *_Objects_Get_name_as_string(
Objects_Id id,
size_t length,
char *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.
+ *
+ * @param[in] information points to the object information structure
+ * @param[in] the_object is the object to operate upon
+ * @param[in] name is a pointer to the name to use
+ *
+ * @return If successful, TRUE is returned. Otherwise FALSE is returned.
+ */
+boolean _Objects_Set_name(
+ Objects_Information *information,
+ Objects_Control *the_object,
+ const char *name
+);
+
/*
* Pieces of object.inl are promoted out to the user
*/
diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl
index f541220270..e5f30d5c5e 100644
--- a/cpukit/score/inline/rtems/score/object.inl
+++ b/cpukit/score/inline/rtems/score/object.inl
@@ -7,7 +7,7 @@
* This include file contains the static inline implementation of all
* of the inlined routines in the Object Handler.
*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -244,33 +244,6 @@ RTEMS_INLINE_ROUTINE void _Objects_Set_local_object(
}
/**
- * This function return the information structure given
- * an id of an object.
- *
- * @param[in] id is an object ID
- *
- *
- * @return This method returns a pointer to the Object Information Table
- * for the class of objects which corresponds to this object ID.
- */
-RTEMS_INLINE_ROUTINE Objects_Information *_Objects_Get_information(
- Objects_Id id
-)
-{
- Objects_APIs the_api;
- uint16_t the_class;
-
-
- the_class = _Objects_Get_class( id );
-
- if ( !_Objects_Is_class_valid( the_class ) )
- return NULL;
-
- the_api = _Objects_Get_API( id );
- return _Objects_Information_table[ the_api ][ the_class ];
-}
-
-/**
* This function places the_object control pointer and object name
* in the Local Pointer and Local Name Tables, respectively.
*
diff --git a/cpukit/score/src/Unlimited.txt b/cpukit/score/src/Unlimited.txt
index be777d338a..47309c361c 100644
--- a/cpukit/score/src/Unlimited.txt
+++ b/cpukit/score/src/Unlimited.txt
@@ -231,29 +231,6 @@ o Changes to Existing Object Functions
The last were inlined, how-ever now they are not as they are too
complex to implement as macros now.
-o Object Inline and Macro Changes
-
- The functions :
-
- _Object_Allocate, and
- _Object_Free
-
- are now not inlined. The function :
-
- _Objects_Get_local_object, and
- _Objects_Set_local_object
-
- have been added. There was no provided interface to allow an API to
- get/set an objects local pointer given an index. The POSIX code
- should be updated to use this interface.
-
- The function :
-
- _Objects_Get_information
-
- has been moved to be an inline function. It is used in the get
- object call which the API uses for every object reference.
-
o Object Initialisation
The function _Objects_Initialize_information has been changed to
diff --git a/cpukit/score/src/objectapimaximumclass.c b/cpukit/score/src/objectapimaximumclass.c
new file mode 100644
index 0000000000..f156f8c7dd
--- /dev/null
+++ b/cpukit/score/src/objectapimaximumclass.c
@@ -0,0 +1,38 @@
+/*
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+
+int _Objects_API_maximum_class(
+ uint32_t api
+)
+{
+ switch (api) {
+ case OBJECTS_INTERNAL_API:
+ return OBJECTS_INTERNAL_CLASSES_LAST;
+ case OBJECTS_CLASSIC_API:
+ return OBJECTS_RTEMS_CLASSES_LAST;
+ case OBJECTS_POSIX_API:
+ return OBJECTS_POSIX_CLASSES_LAST;
+ case OBJECTS_ITRON_API:
+ return OBJECTS_ITRON_CLASSES_LAST;
+ case OBJECTS_NO_API:
+ default:
+ break;
+ }
+ return -1;
+}
+
diff --git a/cpukit/score/src/objectgetinfo.c b/cpukit/score/src/objectgetinfo.c
new file mode 100644
index 0000000000..4deb7b995e
--- /dev/null
+++ b/cpukit/score/src/objectgetinfo.c
@@ -0,0 +1,43 @@
+/*
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/wkspace.h>
+
+Objects_Information *_Objects_Get_information(
+ Objects_APIs api,
+ uint32_t class
+)
+{
+ Objects_Information *info;
+
+ if ( !_Objects_Is_api_valid( api ) )
+ return NULL;
+
+ if ( !class || class > _Objects_API_maximum_class(api) )
+ return NULL;
+
+ info = _Objects_Information_table[ api ][ class ];
+ if ( !info )
+ return NULL;
+
+ if ( info->maximum == 0 )
+ return NULL;
+
+ return info;
+}
+
diff --git a/cpukit/score/src/objectgetinfoid.c b/cpukit/score/src/objectgetinfoid.c
new file mode 100644
index 0000000000..7211066d1a
--- /dev/null
+++ b/cpukit/score/src/objectgetinfoid.c
@@ -0,0 +1,27 @@
+/*
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+
+Objects_Information *_Objects_Get_information_id(
+ Objects_Id id
+)
+{
+ return _Objects_Get_information(
+ _Objects_Get_API( id ),
+ _Objects_Get_class( id )
+ );
+}
diff --git a/cpukit/score/src/objectgetnameasstring.c b/cpukit/score/src/objectgetnameasstring.c
index e19059ffd8..71c10370f0 100644
--- a/cpukit/score/src/objectgetnameasstring.c
+++ b/cpukit/score/src/objectgetnameasstring.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -48,7 +48,7 @@ char *_Objects_Get_name_as_string(
if ( name == NULL )
return NULL;
- information = _Objects_Get_information( id );
+ information = _Objects_Get_information_id( id );
if ( !information )
return NULL;
diff --git a/cpukit/score/src/objectsetname.c b/cpukit/score/src/objectsetname.c
new file mode 100644
index 0000000000..455b4b51c3
--- /dev/null
+++ b/cpukit/score/src/objectsetname.c
@@ -0,0 +1,73 @@
+/*
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/wkspace.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <inttypes.h>
+#include <string.h>
+
+
+/*
+ * This method sets the name of an object based upon a C string.
+ */
+
+boolean _Objects_Set_name(
+ Objects_Information *information,
+ Objects_Control *the_object,
+ const char *name
+)
+{
+ size_t length;
+ const char *s;
+
+ s = name;
+ length = strnlen( name, information->name_length ) + 1;
+
+ if ( information->is_string ) {
+ char *d;
+
+ d = _Workspace_Allocate( length );
+ if ( !d )
+ return FALSE;
+
+ if ( the_object->name.name_p )
+ _Workspace_Free( (void *)the_object->name.name_p );
+
+ the_object->name.name_p = NULL;
+
+ strncpy( d, name, length );
+ the_object->name.name_p = d;
+ } else {
+ uint32_t name_u32 = 0;
+ char lname[5] = " ";
+ int i;
+
+ for ( i=0 ; i<4 && i<length ; i++ )
+ lname[ i ] = s[ i ];
+
+ name_u32 |= ((uint32_t)lname[ 0 ] << 24);
+ name_u32 |= ((uint32_t)lname[ 1 ] << 16);
+ name_u32 |= ((uint32_t)lname[ 2 ] << 8);
+ name_u32 |= (uint32_t)lname[ 3 ];
+ the_object->name.name_u32 = name_u32;
+ }
+
+ return TRUE;
+}
diff --git a/cpukit/score/src/threadqextractwithproxy.c b/cpukit/score/src/threadqextractwithproxy.c
index 5c24431ab5..16461a2dec 100644
--- a/cpukit/score/src/threadqextractwithproxy.c
+++ b/cpukit/score/src/threadqextractwithproxy.c
@@ -51,7 +51,7 @@ boolean _Thread_queue_Extract_with_proxy(
Objects_Information *the_information;
Objects_Thread_queue_Extract_callout proxy_extract_callout;
- the_information = _Objects_Get_information( the_thread->Wait.id );
+ the_information = _Objects_Get_information_id( the_thread->Wait.id );
proxy_extract_callout =
(Objects_Thread_queue_Extract_callout) the_information->extract;