summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-01-29 21:52:21 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-01-29 21:52:21 +0000
commit6c06288f6452da96fa630f1482aeaaba5d217531 (patch)
treeb12309ae199663c23f0ba74a71fdba4f32fb1036 /cpukit/rtems/src
parent2008-01-29 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-6c06288f6452da96fa630f1482aeaaba5d217531.tar.bz2
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.
Diffstat (limited to 'cpukit/rtems/src')
-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
25 files changed, 589 insertions, 37 deletions
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 */