summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-23 19:30:23 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-23 19:30:23 +0000
commit3235ad9a2cd717df901853ad5220a4aaffae84a9 (patch)
treef73a01d8c3065188a3ab283cf545b3ce7bc4f696 /cpukit
parentAdded file .. fixed RCS Id (diff)
downloadrtems-3235ad9a2cd717df901853ad5220a4aaffae84a9.tar.bz2
Support for variable length names added to Object Handler. This supports
both fixed length "raw" names and strings from the API's point of view. Both inline and macro implementations were tested.
Diffstat (limited to '')
-rw-r--r--cpukit/libcsupport/src/__brk.c2
-rw-r--r--cpukit/libcsupport/src/__gettod.c2
-rw-r--r--cpukit/libcsupport/src/newlibc.c2
-rw-r--r--cpukit/libmisc/stackchk/check.c4
-rw-r--r--cpukit/rtems/include/rtems.h28
-rw-r--r--cpukit/rtems/include/rtems/rtems/dpmem.h5
-rw-r--r--cpukit/rtems/include/rtems/rtems/eventmp.h6
-rw-r--r--cpukit/rtems/include/rtems/rtems/message.h5
-rw-r--r--cpukit/rtems/include/rtems/rtems/msgmp.h4
-rw-r--r--cpukit/rtems/include/rtems/rtems/part.h5
-rw-r--r--cpukit/rtems/include/rtems/rtems/partmp.h6
-rw-r--r--cpukit/rtems/include/rtems/rtems/ratemon.h5
-rw-r--r--cpukit/rtems/include/rtems/rtems/region.h5
-rw-r--r--cpukit/rtems/include/rtems/rtems/regionmp.h8
-rw-r--r--cpukit/rtems/include/rtems/rtems/sem.h5
-rw-r--r--cpukit/rtems/include/rtems/rtems/semmp.h12
-rw-r--r--cpukit/rtems/include/rtems/rtems/signalmp.h6
-rw-r--r--cpukit/rtems/include/rtems/rtems/support.h80
-rw-r--r--cpukit/rtems/include/rtems/rtems/taskmp.h14
-rw-r--r--cpukit/rtems/include/rtems/rtems/tasks.h5
-rw-r--r--cpukit/rtems/include/rtems/rtems/timer.h5
-rw-r--r--cpukit/rtems/include/rtems/rtems/types.h56
-rw-r--r--cpukit/rtems/inline/rtems/rtems/support.inl54
-rw-r--r--cpukit/rtems/inline/rtems/rtems/tasks.inl5
-rw-r--r--cpukit/rtems/macros/rtems/rtems/support.inl44
-rw-r--r--cpukit/rtems/macros/rtems/rtems/tasks.inl5
-rw-r--r--cpukit/rtems/src/dpmem.c29
-rw-r--r--cpukit/rtems/src/msg.c26
-rw-r--r--cpukit/rtems/src/msgmp.c4
-rw-r--r--cpukit/rtems/src/part.c15
-rw-r--r--cpukit/rtems/src/partmp.c4
-rw-r--r--cpukit/rtems/src/ratemon.c23
-rw-r--r--cpukit/rtems/src/region.c25
-rw-r--r--cpukit/rtems/src/regionmp.c4
-rw-r--r--cpukit/rtems/src/rtemstimer.c23
-rw-r--r--cpukit/rtems/src/sem.c17
-rw-r--r--cpukit/rtems/src/semmp.c4
-rw-r--r--cpukit/rtems/src/taskmp.c2
-rw-r--r--cpukit/rtems/src/tasks.c11
-rw-r--r--cpukit/sapi/include/rtems/config.h3
-rw-r--r--cpukit/sapi/include/rtems/extension.h5
-rw-r--r--cpukit/sapi/include/rtems/init.h1
-rw-r--r--cpukit/sapi/src/extension.c23
-rw-r--r--cpukit/score/include/rtems/score/object.h142
-rw-r--r--cpukit/score/include/rtems/score/objectmp.h5
-rw-r--r--cpukit/score/include/rtems/system.h6
-rw-r--r--cpukit/score/inline/rtems/score/object.inl45
-rw-r--r--cpukit/score/macros/rtems/score/object.inl33
-rw-r--r--cpukit/score/src/object.c216
-rw-r--r--cpukit/score/src/objectmp.c7
-rw-r--r--cpukit/score/src/thread.c12
51 files changed, 746 insertions, 317 deletions
diff --git a/cpukit/libcsupport/src/__brk.c b/cpukit/libcsupport/src/__brk.c
index 7c43ffa32b..5f256cb072 100644
--- a/cpukit/libcsupport/src/__brk.c
+++ b/cpukit/libcsupport/src/__brk.c
@@ -14,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * __brk.c,v 1.2 1995/05/09 20:24:28 joel Exp
+ * $Id$
*/
#include <rtems.h>
diff --git a/cpukit/libcsupport/src/__gettod.c b/cpukit/libcsupport/src/__gettod.c
index 6f8df8a65f..d01a85b4a4 100644
--- a/cpukit/libcsupport/src/__gettod.c
+++ b/cpukit/libcsupport/src/__gettod.c
@@ -11,7 +11,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * __gettod.c,v 1.2 1995/05/09 20:24:31 joel Exp
+ * $Id$
*/
#include <rtems.h>
diff --git a/cpukit/libcsupport/src/newlibc.c b/cpukit/libcsupport/src/newlibc.c
index c3e886266d..4493b473da 100644
--- a/cpukit/libcsupport/src/newlibc.c
+++ b/cpukit/libcsupport/src/newlibc.c
@@ -35,7 +35,7 @@
*
* NOTE:
*
- * newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
+ * $Id$
*
*/
diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c
index d843c07b2d..f5e64efd33 100644
--- a/cpukit/libmisc/stackchk/check.c
+++ b/cpukit/libmisc/stackchk/check.c
@@ -250,7 +250,7 @@ void Stack_check_report_blown_task(void)
"BLOWN STACK!!! Offending task(%p): id=0x%08x; name=0x%08x",
running,
running->Object.id,
- *running->Object.name
+ *(unsigned32 *)running->Object.name
);
fflush(stderr);
@@ -387,7 +387,7 @@ void Stack_check_Dump_threads_usage(
printf( "0x%08x 0x%08x 0x%08x 0x%08x %8d %8d\n",
the_thread ? the_thread->Object.id : ~0,
- the_thread ? *the_thread->Object.name :
+ the_thread ? *(unsigned32 *)the_thread->Object.name :
rtems_build_name('I', 'N', 'T', 'R'),
(unsigned32) stack->area,
(unsigned32) stack->area + (unsigned32) stack->size - 1,
diff --git a/cpukit/rtems/include/rtems.h b/cpukit/rtems/include/rtems.h
index d0ab705f57..d1e1e6b406 100644
--- a/cpukit/rtems/include/rtems.h
+++ b/cpukit/rtems/include/rtems.h
@@ -24,6 +24,8 @@ extern "C" {
#endif
#include <rtems/system.h>
+#include <rtems/types.h>
+
#include <rtems/init.h>
#include <rtems/tasks.h>
#include <rtems/intr.h>
@@ -43,31 +45,7 @@ extern "C" {
#include <rtems/ratemon.h>
#include <rtems/mp.h>
-/*
- * RTEMS basic type definitions
- */
-
-typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
-typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
-typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
-typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
-
-typedef signed8 rtems_signed8; /* signed 8-bit value */
-typedef signed16 rtems_signed16; /* signed 16-bit value */
-typedef signed32 rtems_signed32; /* signed 32-bit value */
-typedef signed64 rtems_signed64; /* signed 64-bit value */
-
-typedef single_precision rtems_single; /* single precision float */
-typedef double_precision rtems_double; /* double precision float */
-
-typedef boolean rtems_boolean;
-
-typedef Objects_Name rtems_name;
-typedef Objects_Id rtems_id;
-
-typedef Context_Control rtems_context;
-typedef Context_Control_fp rtems_context_fp;
-typedef CPU_Interrupt_frame rtems_interrupt_frame;
+#include <rtems/support.h>
#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
diff --git a/cpukit/rtems/include/rtems/rtems/dpmem.h b/cpukit/rtems/include/rtems/rtems/dpmem.h
index 669eb394d8..2b6016a842 100644
--- a/cpukit/rtems/include/rtems/rtems/dpmem.h
+++ b/cpukit/rtems/include/rtems/rtems/dpmem.h
@@ -32,6 +32,7 @@
extern "C" {
#endif
+#include <rtems.h>
#include <rtems/object.h>
/*
@@ -78,7 +79,7 @@ void _Dual_ported_memory_Manager_initialization(
*/
rtems_status_code rtems_port_create(
- Objects_Name name,
+ rtems_name name,
void *internal_start,
void *external_start,
unsigned32 length,
@@ -96,7 +97,7 @@ rtems_status_code rtems_port_create(
*/
rtems_status_code rtems_port_ident(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
);
diff --git a/cpukit/rtems/include/rtems/rtems/eventmp.h b/cpukit/rtems/include/rtems/rtems/eventmp.h
index f192ea7f77..4b42cf791e 100644
--- a/cpukit/rtems/include/rtems/rtems/eventmp.h
+++ b/cpukit/rtems/include/rtems/rtems/eventmp.h
@@ -43,9 +43,9 @@ typedef enum {
*/
typedef struct {
- rtems_packet_prefix Prefix;
- Event_MP_Remote_operations operation;
- rtems_event_set event_in;
+ rtems_packet_prefix Prefix;
+ Event_MP_Remote_operations operation;
+ rtems_event_set event_in;
} Event_MP_Packet;
/*
diff --git a/cpukit/rtems/include/rtems/rtems/message.h b/cpukit/rtems/include/rtems/rtems/message.h
index 04aa6dfb16..25188044be 100644
--- a/cpukit/rtems/include/rtems/rtems/message.h
+++ b/cpukit/rtems/include/rtems/rtems/message.h
@@ -34,6 +34,7 @@
extern "C" {
#endif
+#include <rtems/types.h>
#include <rtems/chain.h>
#include <rtems/object.h>
#include <rtems/threadq.h>
@@ -129,7 +130,7 @@ void _Message_queue_Manager_initialization(
*/
rtems_status_code rtems_message_queue_create(
- Objects_Name name,
+ rtems_name name,
unsigned32 count,
unsigned32 max_message_size,
rtems_attribute attribute_set,
@@ -151,7 +152,7 @@ rtems_status_code rtems_message_queue_create(
*/
rtems_status_code rtems_message_queue_ident(
- Objects_Name name,
+ rtems_name name,
unsigned32 node,
Objects_Id *id
);
diff --git a/cpukit/rtems/include/rtems/rtems/msgmp.h b/cpukit/rtems/include/rtems/rtems/msgmp.h
index d3e40fe123..ff84e83ed3 100644
--- a/cpukit/rtems/include/rtems/rtems/msgmp.h
+++ b/cpukit/rtems/include/rtems/rtems/msgmp.h
@@ -57,7 +57,7 @@ typedef enum {
typedef struct {
rtems_packet_prefix Prefix;
Message_queue_MP_Remote_operations operation;
- Objects_Name name;
+ rtems_name name;
rtems_option option_set;
Objects_Id proxy_id;
unsigned32 count;
@@ -78,7 +78,7 @@ typedef struct {
void _Message_queue_MP_Send_process_packet (
Message_queue_MP_Remote_operations operation,
Objects_Id message_queue_id,
- Objects_Name name,
+ rtems_name name,
Objects_Id proxy_id
);
diff --git a/cpukit/rtems/include/rtems/rtems/part.h b/cpukit/rtems/include/rtems/rtems/part.h
index e639029dc8..230cf029f7 100644
--- a/cpukit/rtems/include/rtems/rtems/part.h
+++ b/cpukit/rtems/include/rtems/rtems/part.h
@@ -31,6 +31,7 @@
extern "C" {
#endif
+#include <rtems.h>
#include <rtems/address.h>
#include <rtems/attr.h>
#include <rtems/object.h>
@@ -83,7 +84,7 @@ void _Partition_Manager_initialization(
*/
rtems_status_code rtems_partition_create(
- Objects_Name name,
+ rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 buffer_size,
@@ -106,7 +107,7 @@ rtems_status_code rtems_partition_create(
*/
rtems_status_code rtems_partition_ident(
- Objects_Name name,
+ rtems_name name,
unsigned32 node,
Objects_Id *id
);
diff --git a/cpukit/rtems/include/rtems/rtems/partmp.h b/cpukit/rtems/include/rtems/rtems/partmp.h
index 9c551bd890..4b3bf876ff 100644
--- a/cpukit/rtems/include/rtems/rtems/partmp.h
+++ b/cpukit/rtems/include/rtems/rtems/partmp.h
@@ -48,9 +48,9 @@ typedef enum {
*/
typedef struct {
- rtems_packet_prefix Prefix;
+ rtems_packet_prefix Prefix;
Partition_MP_Remote_operations operation;
- Objects_Name name;
+ rtems_name name;
void *buffer;
Objects_Id proxy_id;
} Partition_MP_Packet;
@@ -67,7 +67,7 @@ typedef struct {
void _Partition_MP_Send_process_packet (
Partition_MP_Remote_operations operation,
Objects_Id partition_id,
- Objects_Name name,
+ rtems_name name,
Objects_Id proxy_id
);
diff --git a/cpukit/rtems/include/rtems/rtems/ratemon.h b/cpukit/rtems/include/rtems/rtems/ratemon.h
index 86acfb9a38..75a9963888 100644
--- a/cpukit/rtems/include/rtems/rtems/ratemon.h
+++ b/cpukit/rtems/include/rtems/rtems/ratemon.h
@@ -29,6 +29,7 @@
extern "C" {
#endif
+#include <rtems.h>
#include <rtems/object.h>
#include <rtems/thread.h>
#include <rtems/watchdog.h>
@@ -88,7 +89,7 @@ void _Rate_monotonic_Manager_initialization(
*/
rtems_status_code rtems_rate_monotonic_create(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
);
@@ -104,7 +105,7 @@ rtems_status_code rtems_rate_monotonic_create(
*/
rtems_status_code rtems_rate_monotonic_ident(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
);
diff --git a/cpukit/rtems/include/rtems/rtems/region.h b/cpukit/rtems/include/rtems/rtems/region.h
index c31e193c33..a5f6aa761c 100644
--- a/cpukit/rtems/include/rtems/rtems/region.h
+++ b/cpukit/rtems/include/rtems/rtems/region.h
@@ -30,6 +30,7 @@
extern "C" {
#endif
+#include <rtems.h>
#include <rtems/object.h>
#include <rtems/threadq.h>
#include <rtems/heap.h>
@@ -86,7 +87,7 @@ void _Region_Manager_initialization(
*/
rtems_status_code rtems_region_create(
- Objects_Name name,
+ rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 page_size,
@@ -123,7 +124,7 @@ rtems_status_code rtems_region_extend(
*/
rtems_status_code rtems_region_ident(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
);
diff --git a/cpukit/rtems/include/rtems/rtems/regionmp.h b/cpukit/rtems/include/rtems/rtems/regionmp.h
index f414925e1f..9756103a60 100644
--- a/cpukit/rtems/include/rtems/rtems/regionmp.h
+++ b/cpukit/rtems/include/rtems/rtems/regionmp.h
@@ -48,10 +48,10 @@ typedef enum {
*/
typedef struct {
- rtems_packet_prefix Prefix;
+ rtems_packet_prefix Prefix;
Region_MP_Remote_operations operation;
- Objects_Name name;
- rtems_option option_set;
+ rtems_name name;
+ rtems_option option_set;
unsigned32 size;
Objects_Id proxy_id;
void *segment;
@@ -69,7 +69,7 @@ typedef struct {
void _Region_MP_Send_process_packet (
Region_MP_Remote_operations operation,
Objects_Id region_id,
- Objects_Name name,
+ rtems_name name,
Objects_Id proxy_id
);
diff --git a/cpukit/rtems/include/rtems/rtems/sem.h b/cpukit/rtems/include/rtems/rtems/sem.h
index 66f5ab82b8..e70253dcb1 100644
--- a/cpukit/rtems/include/rtems/rtems/sem.h
+++ b/cpukit/rtems/include/rtems/rtems/sem.h
@@ -31,6 +31,7 @@
extern "C" {
#endif
+#include <rtems.h>
#include <rtems/attr.h>
#include <rtems/object.h>
#include <rtems/threadq.h>
@@ -81,7 +82,7 @@ void _Semaphore_Manager_initialization(
*/
rtems_status_code rtems_semaphore_create(
- Objects_Name name,
+ rtems_name name,
unsigned32 count,
rtems_attribute attribute_set,
Objects_Id *id
@@ -102,7 +103,7 @@ rtems_status_code rtems_semaphore_create(
*/
rtems_status_code rtems_semaphore_ident(
- Objects_Name name,
+ rtems_name name,
unsigned32 node,
Objects_Id *id
);
diff --git a/cpukit/rtems/include/rtems/rtems/semmp.h b/cpukit/rtems/include/rtems/rtems/semmp.h
index 882812a457..915e18164c 100644
--- a/cpukit/rtems/include/rtems/rtems/semmp.h
+++ b/cpukit/rtems/include/rtems/rtems/semmp.h
@@ -49,11 +49,11 @@ typedef enum {
*/
typedef struct {
- rtems_packet_prefix Prefix;
- Semaphore_MP_Remote_operations operation;
- Objects_Name name;
- rtems_option option_set;
- Objects_Id proxy_id;
+ rtems_packet_prefix Prefix;
+ Semaphore_MP_Remote_operations operation;
+ rtems_name name;
+ rtems_option option_set;
+ Objects_Id proxy_id;
} Semaphore_MP_Packet;
/*
@@ -68,7 +68,7 @@ typedef struct {
void _Semaphore_MP_Send_process_packet (
Semaphore_MP_Remote_operations operation,
Objects_Id semaphore_id,
- Objects_Name name,
+ rtems_name name,
Objects_Id proxy_id
);
diff --git a/cpukit/rtems/include/rtems/rtems/signalmp.h b/cpukit/rtems/include/rtems/rtems/signalmp.h
index 80aa3b7d60..b72f476bee 100644
--- a/cpukit/rtems/include/rtems/rtems/signalmp.h
+++ b/cpukit/rtems/include/rtems/rtems/signalmp.h
@@ -43,9 +43,9 @@ typedef enum {
*/
typedef struct {
- rtems_packet_prefix Prefix;
- Signal_MP_Remote_operations operation;
- rtems_signal_set signal_in;
+ rtems_packet_prefix Prefix;
+ Signal_MP_Remote_operations operation;
+ rtems_signal_set signal_in;
} Signal_MP_Packet;
/*
diff --git a/cpukit/rtems/include/rtems/rtems/support.h b/cpukit/rtems/include/rtems/rtems/support.h
new file mode 100644
index 0000000000..c6452e0847
--- /dev/null
+++ b/cpukit/rtems/include/rtems/rtems/support.h
@@ -0,0 +1,80 @@
+/* support.h
+ *
+ * This include file contains information about support functions for
+ * the RTEMS API.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#ifndef __RTEMS_RTEMS_SUPPORT_h
+#define __RTEMS_RTEMS_SUPPORT_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rtems/types.h>
+
+/*
+ * rtems_is_name_valid
+ *
+ * DESCRIPTION:
+ *
+ * This function returns TRUE if the name is valid, and FALSE otherwise.
+ */
+
+STATIC INLINE rtems_boolean rtems_is_name_valid (
+ rtems_name name
+);
+
+/*
+ * 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 ) \
+ ( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
+
+/*
+ * rtems_name_to_characters
+ *
+ * DESCRIPTION:
+ *
+ * This function breaks the object name into the four component
+ * characters C1, C2, C3, and C4.
+ *
+ */
+
+STATIC INLINE void rtems_name_to_characters(
+ rtems_name name,
+ char *c1,
+ char *c2,
+ char *c3,
+ char *c4
+);
+
+#include <rtems/support.inl>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/taskmp.h b/cpukit/rtems/include/rtems/rtems/taskmp.h
index a83723bd9f..d05277a69c 100644
--- a/cpukit/rtems/include/rtems/rtems/taskmp.h
+++ b/cpukit/rtems/include/rtems/rtems/taskmp.h
@@ -54,12 +54,12 @@ typedef enum {
*/
typedef struct {
- rtems_packet_prefix Prefix;
- RTEMS_tasks_MP_Remote_operations operation;
- Objects_Name name;
- rtems_task_priority the_priority;
- unsigned32 notepad;
- unsigned32 note;
+ rtems_packet_prefix Prefix;
+ RTEMS_tasks_MP_Remote_operations operation;
+ rtems_name name;
+ rtems_task_priority the_priority;
+ unsigned32 notepad;
+ unsigned32 note;
} RTEMS_tasks_MP_Packet;
/*
@@ -74,7 +74,7 @@ typedef struct {
void _RTEMS_tasks_MP_Send_process_packet (
RTEMS_tasks_MP_Remote_operations operation,
Objects_Id task_id,
- Objects_Name name
+ rtems_name name
);
/*
diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h
index d92913548e..88bf8e0e65 100644
--- a/cpukit/rtems/include/rtems/rtems/tasks.h
+++ b/cpukit/rtems/include/rtems/rtems/tasks.h
@@ -38,6 +38,7 @@
extern "C" {
#endif
+#include <rtems.h>
#include <rtems/message.h>
#include <rtems/object.h>
#include <rtems/part.h>
@@ -74,7 +75,7 @@ extern "C" {
*/
rtems_status_code rtems_task_create(
- Objects_Name name,
+ rtems_name name,
rtems_task_priority initial_priority,
unsigned32 stack_size,
rtems_mode initial_modes,
@@ -97,7 +98,7 @@ rtems_status_code rtems_task_create(
*/
rtems_status_code rtems_task_ident(
- Objects_Name name,
+ rtems_name name,
unsigned32 node,
Objects_Id *id
);
diff --git a/cpukit/rtems/include/rtems/rtems/timer.h b/cpukit/rtems/include/rtems/rtems/timer.h
index f6ccb5f4a1..bab05378c7 100644
--- a/cpukit/rtems/include/rtems/rtems/timer.h
+++ b/cpukit/rtems/include/rtems/rtems/timer.h
@@ -33,6 +33,7 @@
extern "C" {
#endif
+#include <rtems.h>
#include <rtems/object.h>
#include <rtems/tod.h>
#include <rtems/watchdog.h>
@@ -95,7 +96,7 @@ void _Timer_Manager_initialization(
*/
rtems_status_code rtems_timer_create(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
);
@@ -111,7 +112,7 @@ rtems_status_code rtems_timer_create(
*/
rtems_status_code rtems_timer_ident(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
);
diff --git a/cpukit/rtems/include/rtems/rtems/types.h b/cpukit/rtems/include/rtems/rtems/types.h
new file mode 100644
index 0000000000..2a5cb6f4fd
--- /dev/null
+++ b/cpukit/rtems/include/rtems/rtems/types.h
@@ -0,0 +1,56 @@
+/* types.h
+ *
+ * This include file defines the types used by the RTEMS API.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#ifndef __RTEMS_RTEMS_TYPES_h
+#define __RTEMS_RTEMS_TYPES_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rtems/object.h>
+
+/*
+ * RTEMS basic type definitions
+ */
+
+typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
+typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
+typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
+typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
+
+typedef signed8 rtems_signed8; /* signed 8-bit value */
+typedef signed16 rtems_signed16; /* signed 16-bit value */
+typedef signed32 rtems_signed32; /* signed 32-bit value */
+typedef signed64 rtems_signed64; /* signed 64-bit value */
+
+typedef single_precision rtems_single; /* single precision float */
+typedef double_precision rtems_double; /* double precision float */
+
+typedef boolean rtems_boolean;
+
+typedef unsigned32 rtems_name;
+typedef Objects_Id rtems_id;
+
+typedef Context_Control rtems_context;
+typedef Context_Control_fp rtems_context_fp;
+typedef CPU_Interrupt_frame rtems_interrupt_frame;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/support.inl b/cpukit/rtems/inline/rtems/rtems/support.inl
new file mode 100644
index 0000000000..2f98a98ad0
--- /dev/null
+++ b/cpukit/rtems/inline/rtems/rtems/support.inl
@@ -0,0 +1,54 @@
+/* support.inl
+ *
+ * This include file contains the static inline implementation of all
+ * of the inlined routines specific to the RTEMS API.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#ifndef __RTEMS_SUPPORT_inl
+#define __RTEMS_SUPPORT_inl
+
+/*PAGE
+ *
+ * rtems_is_name_valid
+ *
+ */
+
+STATIC INLINE rtems_boolean rtems_is_name_valid (
+ rtems_name name
+)
+{
+ return ( name != 0 );
+}
+
+/*PAGE
+ *
+ * rtems_name_to_characters
+ *
+ */
+
+STATIC INLINE void rtems_name_to_characters(
+ rtems_name name,
+ char *c1,
+ char *c2,
+ char *c3,
+ char *c4
+)
+{
+ *c1 = (name >> 24) & 0xff;
+ *c2 = (name >> 16) & 0xff;
+ *c3 = (name >> 8) & 0xff;
+ *c4 = name & 0xff;
+}
+
+#endif
+/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/tasks.inl b/cpukit/rtems/inline/rtems/rtems/tasks.inl
index d5df18831a..10d3e3c197 100644
--- a/cpukit/rtems/inline/rtems/rtems/tasks.inl
+++ b/cpukit/rtems/inline/rtems/rtems/tasks.inl
@@ -17,6 +17,11 @@
#ifndef __RTEMS_TASKS_inl
#define __RTEMS_TASKS_inl
+#include <rtems/msgmp.h>
+#include <rtems/partmp.h>
+#include <rtems/regionmp.h>
+#include <rtems/semmp.h>
+
/*PAGE
*
* _RTEMS_tasks_Allocate
diff --git a/cpukit/rtems/macros/rtems/rtems/support.inl b/cpukit/rtems/macros/rtems/rtems/support.inl
new file mode 100644
index 0000000000..a25b445aff
--- /dev/null
+++ b/cpukit/rtems/macros/rtems/rtems/support.inl
@@ -0,0 +1,44 @@
+/* support.inl
+ *
+ * This include file contains the macros implementation of all
+ * of the inlined routines specific to the RTEMS API.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#ifndef __RTEMS_SUPPORT_inl
+#define __RTEMS_SUPPORT_inl
+
+/*PAGE
+ *
+ * rtems_is_name_valid
+ *
+ */
+
+#define rtems_is_name_valid( _name ) \
+ ( (_name) != 0 )
+
+/*PAGE
+ *
+ * rtems_name_to_characters
+ *
+ */
+
+#define rtems_name_to_characters( _name, _c1, _c2, _c3, _c4 ) \
+ { \
+ (*(_c1) = ((_name) >> 24) & 0xff; \
+ (*(_c2) = ((_name) >> 16) & 0xff; \
+ (*(_c3) = ((_name) >> 8) & 0xff; \
+ (*(_c4) = ((_name)) & 0xff; \
+ }
+
+#endif
+/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/tasks.inl b/cpukit/rtems/macros/rtems/rtems/tasks.inl
index 7b40cbf7fd..8fec704ea4 100644
--- a/cpukit/rtems/macros/rtems/rtems/tasks.inl
+++ b/cpukit/rtems/macros/rtems/rtems/tasks.inl
@@ -17,6 +17,11 @@
#ifndef __RTEMS_TASKS_inl
#define __RTEMS_TASKS_inl
+#include <rtems/msgmp.h>
+#include <rtems/partmp.h>
+#include <rtems/regionmp.h>
+#include <rtems/semmp.h>
+
/*PAGE
*
* _RTEMS_tasks_Allocate
diff --git a/cpukit/rtems/src/dpmem.c b/cpukit/rtems/src/dpmem.c
index b594ecd00e..ea2469f4c5 100644
--- a/cpukit/rtems/src/dpmem.c
+++ b/cpukit/rtems/src/dpmem.c
@@ -13,6 +13,7 @@
*/
#include <rtems/system.h>
+#include <rtems/support.h>
#include <rtems/address.h>
#include <rtems/dpmem.h>
#include <rtems/object.h>
@@ -36,11 +37,13 @@ void _Dual_ported_memory_Manager_initialization(
)
{
_Objects_Initialize_information(
- &_Dual_ported_memory_Information,
- OBJECTS_RTEMS_PORTS,
- FALSE,
- maximum_ports,
- sizeof( Dual_ported_memory_Control )
+ &_Dual_ported_memory_Information,
+ OBJECTS_RTEMS_PORTS,
+ FALSE,
+ maximum_ports,
+ sizeof( Dual_ported_memory_Control ),
+ FALSE,
+ RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -64,7 +67,7 @@ void _Dual_ported_memory_Manager_initialization(
*/
rtems_status_code rtems_port_create(
- Objects_Name name,
+ rtems_name name,
void *internal_start,
void *external_start,
unsigned32 length,
@@ -73,7 +76,7 @@ rtems_status_code rtems_port_create(
{
register Dual_ported_memory_Control *the_port;
- if ( !_Objects_Is_name_valid( name) )
+ if ( !rtems_is_name_valid( name) )
return ( RTEMS_INVALID_NAME );
if ( !_Addresses_Is_aligned( internal_start ) ||
@@ -93,8 +96,12 @@ rtems_status_code rtems_port_create(
the_port->external_base = external_start;
the_port->length = length - 1;
- _Objects_Open( &_Dual_ported_memory_Information,
- &the_port->Object, name );
+ _Objects_Open(
+ &_Dual_ported_memory_Information,
+ &the_port->Object,
+ &name
+ );
+
*id = the_port->Object.id;
_Thread_Enable_dispatch();
return( RTEMS_SUCCESSFUL );
@@ -118,14 +125,14 @@ rtems_status_code rtems_port_create(
*/
rtems_status_code rtems_port_ident(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
)
{
return(
_Objects_Name_to_id(
&_Dual_ported_memory_Information,
- name,
+ &name,
RTEMS_SEARCH_ALL_NODES,
id
)
diff --git a/cpukit/rtems/src/msg.c b/cpukit/rtems/src/msg.c
index 49d7d0b3f3..d7c456f90a 100644
--- a/cpukit/rtems/src/msg.c
+++ b/cpukit/rtems/src/msg.c
@@ -22,6 +22,7 @@
#include <rtems/object.h>
#include <rtems/options.h>
#include <rtems/states.h>
+#include <rtems/support.h>
#include <rtems/thread.h>
#include <rtems/wkspace.h>
#include <rtems/mpci.h>
@@ -48,7 +49,9 @@ void _Message_queue_Manager_initialization(
OBJECTS_RTEMS_MESSAGE_QUEUES,
TRUE,
maximum_message_queues,
- sizeof( Message_queue_Control )
+ sizeof( Message_queue_Control ),
+ FALSE,
+ RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -130,7 +133,7 @@ failed:
*/
rtems_status_code rtems_message_queue_create(
- Objects_Name name,
+ rtems_name name,
unsigned32 count,
unsigned32 max_message_size,
rtems_attribute attribute_set,
@@ -139,7 +142,7 @@ rtems_status_code rtems_message_queue_create(
{
register Message_queue_Control *the_message_queue;
- if ( !_Objects_Is_name_valid( name ) )
+ if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
if ( _Attributes_Is_global( attribute_set ) &&
@@ -194,8 +197,11 @@ rtems_status_code rtems_message_queue_create(
_Thread_queue_Initialize( &the_message_queue->Wait_queue, attribute_set,
STATES_WAITING_FOR_MESSAGE );
- _Objects_Open( &_Message_queue_Information,
- &the_message_queue->Object, name );
+ _Objects_Open(
+ &_Message_queue_Information,
+ &the_message_queue->Object,
+ &name
+ );
*id = the_message_queue->Object.id;
@@ -230,13 +236,17 @@ rtems_status_code rtems_message_queue_create(
*/
rtems_status_code rtems_message_queue_ident(
- Objects_Name name,
+ rtems_name name,
unsigned32 node,
Objects_Id *id
)
{
- return( _Objects_Name_to_id( &_Message_queue_Information, name,
- node, id ) );
+ return _Objects_Name_to_id(
+ &_Message_queue_Information,
+ &name,
+ node,
+ id
+ );
}
/*PAGE
diff --git a/cpukit/rtems/src/msgmp.c b/cpukit/rtems/src/msgmp.c
index 75e83b5bf8..37ce2c9453 100644
--- a/cpukit/rtems/src/msgmp.c
+++ b/cpukit/rtems/src/msgmp.c
@@ -32,7 +32,7 @@
void _Message_queue_MP_Send_process_packet (
Message_queue_MP_Remote_operations operation,
Objects_Id message_queue_id,
- Objects_Name name,
+ rtems_name name,
Objects_Id proxy_id
)
{
@@ -434,7 +434,7 @@ void _Message_queue_MP_Send_extract_proxy (
_Message_queue_MP_Send_process_packet(
MESSAGE_QUEUE_MP_EXTRACT_PROXY,
the_thread->Wait.id,
- (Objects_Name) 0,
+ (rtems_name) 0,
the_thread->Object.id
);
}
diff --git a/cpukit/rtems/src/part.c b/cpukit/rtems/src/part.c
index 7cf0fe691c..b1e284c669 100644
--- a/cpukit/rtems/src/part.c
+++ b/cpukit/rtems/src/part.c
@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
+#include <rtems/support.h>
#include <rtems/address.h>
#include <rtems/config.h>
#include <rtems/object.h>
@@ -42,7 +43,9 @@ void _Partition_Manager_initialization(
OBJECTS_RTEMS_PARTITIONS,
TRUE,
maximum_partitions,
- sizeof( Partition_Control )
+ sizeof( Partition_Control ),
+ FALSE,
+ RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -69,7 +72,7 @@ void _Partition_Manager_initialization(
*/
rtems_status_code rtems_partition_create(
- Objects_Name name,
+ rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 buffer_size,
@@ -79,7 +82,7 @@ rtems_status_code rtems_partition_create(
{
register Partition_Control *the_partition;
- if ( !_Objects_Is_name_valid( name ) )
+ if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
@@ -118,7 +121,7 @@ rtems_status_code rtems_partition_create(
_Chain_Initialize( &the_partition->Memory, starting_address,
length / buffer_size, buffer_size );
- _Objects_Open( &_Partition_Information, &the_partition->Object, name );
+ _Objects_Open( &_Partition_Information, &the_partition->Object, &name );
*id = the_partition->Object.id;
if ( _Attributes_Is_global( attribute_set ) )
@@ -152,12 +155,12 @@ rtems_status_code rtems_partition_create(
*/
rtems_status_code rtems_partition_ident(
- Objects_Name name,
+ rtems_name name,
unsigned32 node,
Objects_Id *id
)
{
- return( _Objects_Name_to_id( &_Partition_Information, name, node, id ) );
+ return _Objects_Name_to_id( &_Partition_Information, &name, node, id );
}
/*PAGE
diff --git a/cpukit/rtems/src/partmp.c b/cpukit/rtems/src/partmp.c
index 9cc1723106..074165777b 100644
--- a/cpukit/rtems/src/partmp.c
+++ b/cpukit/rtems/src/partmp.c
@@ -30,7 +30,7 @@
void _Partition_MP_Send_process_packet (
Partition_MP_Remote_operations operation,
Objects_Id partition_id,
- Objects_Name name,
+ rtems_name name,
Objects_Id proxy_id
)
{
@@ -280,7 +280,7 @@ void _Partition_MP_Send_extract_proxy (
_Partition_MP_Send_process_packet(
PARTITION_MP_EXTRACT_PROXY,
the_thread->Wait.id,
- (Objects_Name) 0,
+ (rtems_name) 0,
the_thread->Object.id
);
diff --git a/cpukit/rtems/src/ratemon.c b/cpukit/rtems/src/ratemon.c
index 86f1534d98..6e84c56fb3 100644
--- a/cpukit/rtems/src/ratemon.c
+++ b/cpukit/rtems/src/ratemon.c
@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
+#include <rtems/support.h>
#include <rtems/isr.h>
#include <rtems/object.h>
#include <rtems/ratemon.h>
@@ -40,11 +41,13 @@ void _Rate_monotonic_Manager_initialization(
)
{
_Objects_Initialize_information(
- &_Rate_monotonic_Information,
- OBJECTS_RTEMS_PERIODS,
- FALSE,
- maximum_periods,
- sizeof( Rate_monotonic_Control )
+ &_Rate_monotonic_Information,
+ OBJECTS_RTEMS_PERIODS,
+ FALSE,
+ maximum_periods,
+ sizeof( Rate_monotonic_Control ),
+ FALSE,
+ RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -66,13 +69,13 @@ void _Rate_monotonic_Manager_initialization(
*/
rtems_status_code rtems_rate_monotonic_create(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
)
{
Rate_monotonic_Control *the_period;
- if ( !_Objects_Is_name_valid( name ) )
+ if ( !rtems_is_name_valid( name ) )
return( RTEMS_INVALID_NAME );
_Thread_Disable_dispatch(); /* to prevent deletion */
@@ -87,7 +90,7 @@ rtems_status_code rtems_rate_monotonic_create(
the_period->owner = _Thread_Executing;
the_period->state = RATE_MONOTONIC_INACTIVE;
- _Objects_Open( &_Rate_monotonic_Information, &the_period->Object, name );
+ _Objects_Open( &_Rate_monotonic_Information, &the_period->Object, &name );
*id = the_period->Object.id;
_Thread_Enable_dispatch();
@@ -112,13 +115,13 @@ rtems_status_code rtems_rate_monotonic_create(
*/
rtems_status_code rtems_rate_monotonic_ident(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
)
{
return _Objects_Name_to_id(
&_Rate_monotonic_Information,
- name,
+ &name,
RTEMS_SEARCH_LOCAL_NODE,
id
);
diff --git a/cpukit/rtems/src/region.c b/cpukit/rtems/src/region.c
index 40bd7ffa26..90916dcc3a 100644
--- a/cpukit/rtems/src/region.c
+++ b/cpukit/rtems/src/region.c
@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
+#include <rtems/support.h>
#include <rtems/config.h>
#include <rtems/object.h>
#include <rtems/options.h>
@@ -38,12 +39,14 @@ void _Region_Manager_initialization(
)
{
_Objects_Initialize_information(
- &_Region_Information,
- OBJECTS_RTEMS_REGIONS,
- FALSE,
- maximum_regions,
- sizeof( Region_Control )
- );
+ &_Region_Information,
+ OBJECTS_RTEMS_REGIONS,
+ FALSE,
+ maximum_regions,
+ sizeof( Region_Control ),
+ FALSE,
+ RTEMS_MAXIMUM_NAME_LENGTH
+ );
}
/*PAGE
@@ -68,7 +71,7 @@ void _Region_Manager_initialization(
*/
rtems_status_code rtems_region_create(
- Objects_Name name,
+ rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 page_size,
@@ -78,7 +81,7 @@ rtems_status_code rtems_region_create(
{
Region_Control *the_region;
- if ( !_Objects_Is_name_valid( name ) )
+ if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
if ( !_Addresses_Is_aligned( starting_address ) )
@@ -111,7 +114,7 @@ rtems_status_code rtems_region_create(
_Thread_queue_Initialize(
&the_region->Wait_queue, attribute_set, STATES_WAITING_FOR_SEGMENT );
- _Objects_Open( &_Region_Information, &the_region->Object, name );
+ _Objects_Open( &_Region_Information, &the_region->Object, &name );
*id = the_region->Object.id;
_Thread_Enable_dispatch();
@@ -136,13 +139,13 @@ rtems_status_code rtems_region_create(
*/
rtems_status_code rtems_region_ident(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
)
{
return _Objects_Name_to_id(
&_Region_Information,
- name,
+ &name,
RTEMS_SEARCH_LOCAL_NODE,
id
);
diff --git a/cpukit/rtems/src/regionmp.c b/cpukit/rtems/src/regionmp.c
index 558ae1639a..07de556acc 100644
--- a/cpukit/rtems/src/regionmp.c
+++ b/cpukit/rtems/src/regionmp.c
@@ -30,7 +30,7 @@
void _Region_MP_Send_process_packet (
Region_MP_Remote_operations operation,
Objects_Id region_id,
- Objects_Name name,
+ rtems_name name,
Objects_Id proxy_id
)
{
@@ -289,7 +289,7 @@ void _Region_MP_Send_extract_proxy (
_Region_MP_Send_process_packet(
REGION_MP_EXTRACT_PROXY,
the_thread->Wait.id,
- (Objects_Name) 0,
+ (rtems_name) 0,
the_thread->Object.id
);
}
diff --git a/cpukit/rtems/src/rtemstimer.c b/cpukit/rtems/src/rtemstimer.c
index ec55c3eaf9..2aad758269 100644
--- a/cpukit/rtems/src/rtemstimer.c
+++ b/cpukit/rtems/src/rtemstimer.c
@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
+#include <rtems/support.h>
#include <rtems/object.h>
#include <rtems/thread.h>
#include <rtems/timer.h>
@@ -37,11 +38,13 @@ void _Timer_Manager_initialization(
)
{
_Objects_Initialize_information(
- &_Timer_Information,
- OBJECTS_RTEMS_TIMERS,
- FALSE,
- maximum_timers,
- sizeof( Timer_Control )
+ &_Timer_Information,
+ OBJECTS_RTEMS_TIMERS,
+ FALSE,
+ maximum_timers,
+ sizeof( Timer_Control ),
+ FALSE,
+ RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -62,13 +65,13 @@ void _Timer_Manager_initialization(
*/
rtems_status_code rtems_timer_create(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
)
{
Timer_Control *the_timer;
- if ( !_Objects_Is_name_valid( name ) )
+ if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
_Thread_Disable_dispatch(); /* to prevent deletion */
@@ -82,7 +85,7 @@ rtems_status_code rtems_timer_create(
the_timer->the_class = TIMER_DORMANT;
- _Objects_Open( &_Timer_Information, &the_timer->Object, name );
+ _Objects_Open( &_Timer_Information, &the_timer->Object, &name );
*id = the_timer->Object.id;
_Thread_Enable_dispatch();
@@ -107,13 +110,13 @@ rtems_status_code rtems_timer_create(
*/
rtems_status_code rtems_timer_ident(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
)
{
return _Objects_Name_to_id(
&_Timer_Information,
- name,
+ &name,
RTEMS_SEARCH_LOCAL_NODE,
id
);
diff --git a/cpukit/rtems/src/sem.c b/cpukit/rtems/src/sem.c
index 340a4fa947..46dff9cdd7 100644
--- a/cpukit/rtems/src/sem.c
+++ b/cpukit/rtems/src/sem.c
@@ -27,6 +27,7 @@
*/
#include <rtems/system.h>
+#include <rtems/support.h>
#include <rtems/attr.h>
#include <rtems/config.h>
#include <rtems/isr.h>
@@ -56,10 +57,12 @@ void _Semaphore_Manager_initialization(
{
_Objects_Initialize_information(
&_Semaphore_Information,
- OBJECTS_RTEMS_SEMAPHORES,
+ OBJECTS_RTEMS_SEMAPHORES,
TRUE,
maximum_semaphores,
- sizeof( Semaphore_Control )
+ sizeof( Semaphore_Control ),
+ FALSE,
+ RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -83,7 +86,7 @@ void _Semaphore_Manager_initialization(
*/
rtems_status_code rtems_semaphore_create(
- Objects_Name name,
+ rtems_name name,
unsigned32 count,
rtems_attribute attribute_set,
Objects_Id *id
@@ -91,7 +94,7 @@ rtems_status_code rtems_semaphore_create(
{
register Semaphore_Control *the_semaphore;
- if ( !_Objects_Is_name_valid( name ) )
+ if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
if ( _Attributes_Is_global( attribute_set ) ) {
@@ -147,7 +150,7 @@ rtems_status_code rtems_semaphore_create(
_Thread_queue_Initialize( &the_semaphore->Wait_queue,
attribute_set, STATES_WAITING_FOR_SEMAPHORE );
- _Objects_Open( &_Semaphore_Information, &the_semaphore->Object, name );
+ _Objects_Open( &_Semaphore_Information, &the_semaphore->Object, &name );
*id = the_semaphore->Object.id;
@@ -181,12 +184,12 @@ rtems_status_code rtems_semaphore_create(
*/
rtems_status_code rtems_semaphore_ident(
- Objects_Name name,
+ rtems_name name,
unsigned32 node,
Objects_Id *id
)
{
- return( _Objects_Name_to_id( &_Semaphore_Information, name, node, id ) );
+ return( _Objects_Name_to_id( &_Semaphore_Information, &name, node, id ) );
}
/*PAGE
diff --git a/cpukit/rtems/src/semmp.c b/cpukit/rtems/src/semmp.c
index d131d48150..3be9fafb5f 100644
--- a/cpukit/rtems/src/semmp.c
+++ b/cpukit/rtems/src/semmp.c
@@ -31,7 +31,7 @@
void _Semaphore_MP_Send_process_packet (
Semaphore_MP_Remote_operations operation,
Objects_Id semaphore_id,
- Objects_Name name,
+ rtems_name name,
Objects_Id proxy_id
)
{
@@ -286,7 +286,7 @@ void _Semaphore_MP_Send_extract_proxy (
_Semaphore_MP_Send_process_packet(
SEMAPHORE_MP_EXTRACT_PROXY,
the_thread->Wait.id,
- (Objects_Name) 0,
+ (rtems_name) 0,
the_thread->Object.id
);
diff --git a/cpukit/rtems/src/taskmp.c b/cpukit/rtems/src/taskmp.c
index b938c60c53..17b08011ef 100644
--- a/cpukit/rtems/src/taskmp.c
+++ b/cpukit/rtems/src/taskmp.c
@@ -31,7 +31,7 @@
void _RTEMS_tasks_MP_Send_process_packet (
RTEMS_tasks_MP_Remote_operations operation,
Objects_Id task_id,
- Objects_Name name
+ rtems_name name
)
{
RTEMS_tasks_MP_Packet *the_packet;
diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c
index e900df0ab8..9cabbc50e9 100644
--- a/cpukit/rtems/src/tasks.c
+++ b/cpukit/rtems/src/tasks.c
@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
+#include <rtems/support.h>
#include <rtems/modes.h>
#include <rtems/object.h>
#include <rtems/stack.h>
@@ -48,7 +49,7 @@
*/
rtems_status_code rtems_task_create(
- Objects_Name name,
+ rtems_name name,
rtems_task_priority initial_priority,
unsigned32 stack_size,
rtems_mode initial_modes,
@@ -62,7 +63,7 @@ rtems_status_code rtems_task_create(
void *memory;
rtems_attribute the_attribute_set;
- if ( !_Objects_Is_name_valid( name ) )
+ if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
#if 0
@@ -156,7 +157,7 @@ rtems_status_code rtems_task_create(
_ASR_Initialize( &the_thread->Signal );
- _Objects_Open( &_Thread_Information, &the_thread->Object, name );
+ _Objects_Open( &_Thread_Information, &the_thread->Object, &name );
*id = the_thread->Object.id;
@@ -192,13 +193,13 @@ rtems_status_code rtems_task_create(
*/
rtems_status_code rtems_task_ident(
- Objects_Name name,
+ rtems_name name,
unsigned32 node,
Objects_Id *id
)
{
if ( name != OBJECTS_ID_OF_SELF )
- return( _Objects_Name_to_id( &_Thread_Information, name, node, id ) );
+ return( _Objects_Name_to_id( &_Thread_Information, &name, node, id ) );
*id = _Thread_Executing->Object.id;
return( RTEMS_SUCCESSFUL );
diff --git a/cpukit/sapi/include/rtems/config.h b/cpukit/sapi/include/rtems/config.h
index c2001c8074..766ea4a4a8 100644
--- a/cpukit/sapi/include/rtems/config.h
+++ b/cpukit/sapi/include/rtems/config.h
@@ -21,6 +21,7 @@
extern "C" {
#endif
+#include <rtems/types.h>
#include <rtems/object.h>
#include <rtems/thread.h>
@@ -32,7 +33,7 @@ extern "C" {
*/
typedef struct {
- Objects_Name name; /* task name */
+ rtems_name name; /* task name */
unsigned32 stack_size; /* task stack size */
rtems_task_priority initial_priority; /* task priority */
rtems_attribute attribute_set; /* task attributes */
diff --git a/cpukit/sapi/include/rtems/extension.h b/cpukit/sapi/include/rtems/extension.h
index 1e20fe6470..b447cc43fe 100644
--- a/cpukit/sapi/include/rtems/extension.h
+++ b/cpukit/sapi/include/rtems/extension.h
@@ -28,6 +28,7 @@
extern "C" {
#endif
+#include <rtems.h>
#include <rtems/object.h>
#include <rtems/userext.h>
@@ -72,7 +73,7 @@ void _Extension_Manager_initialization(
*/
rtems_status_code rtems_extension_create(
- Objects_Name name,
+ rtems_name name,
rtems_extensions_table *extension_table,
Objects_Id *id
);
@@ -89,7 +90,7 @@ rtems_status_code rtems_extension_create(
*/
rtems_status_code rtems_extension_ident(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
);
diff --git a/cpukit/sapi/include/rtems/init.h b/cpukit/sapi/include/rtems/init.h
index a5ed1688b7..8c6e34d2c3 100644
--- a/cpukit/sapi/include/rtems/init.h
+++ b/cpukit/sapi/include/rtems/init.h
@@ -30,6 +30,7 @@
extern "C" {
#endif
+#include <rtems/types.h>
#include <rtems/config.h>
#include <rtems/intr.h>
diff --git a/cpukit/sapi/src/extension.c b/cpukit/sapi/src/extension.c
index 4cae903a34..8f5f5d998a 100644
--- a/cpukit/sapi/src/extension.c
+++ b/cpukit/sapi/src/extension.c
@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
+#include <rtems/support.h>
#include <rtems/object.h>
#include <rtems/thread.h>
#include <rtems/extension.h>
@@ -35,11 +36,13 @@ void _Extension_Manager_initialization(
)
{
_Objects_Initialize_information(
- &_Extension_Information,
- OBJECTS_RTEMS_EXTENSIONS,
- FALSE,
- maximum_extensions,
- sizeof( Extension_Control )
+ &_Extension_Information,
+ OBJECTS_RTEMS_EXTENSIONS,
+ FALSE,
+ maximum_extensions,
+ sizeof( Extension_Control ),
+ FALSE,
+ RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -61,14 +64,14 @@ void _Extension_Manager_initialization(
*/
rtems_status_code rtems_extension_create(
- Objects_Name name,
+ rtems_name name,
rtems_extensions_table *extension_table,
Objects_Id *id
)
{
Extension_Control *the_extension;
- if ( !_Objects_Is_name_valid( name ) )
+ if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
_Thread_Disable_dispatch(); /* to prevent deletion */
@@ -82,7 +85,7 @@ rtems_status_code rtems_extension_create(
_User_extensions_Add_set( &the_extension->Extension, extension_table );
- _Objects_Open( &_Extension_Information, &the_extension->Object, name );
+ _Objects_Open( &_Extension_Information, &the_extension->Object, &name );
*id = the_extension->Object.id;
_Thread_Enable_dispatch();
@@ -107,13 +110,13 @@ rtems_status_code rtems_extension_create(
*/
rtems_status_code rtems_extension_ident(
- Objects_Name name,
+ rtems_name name,
Objects_Id *id
)
{
return _Objects_Name_to_id(
&_Extension_Information,
- name,
+ &name,
RTEMS_SEARCH_LOCAL_NODE,
id
);
diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h
index 7f4c01c53d..c5226302d6 100644
--- a/cpukit/score/include/rtems/score/object.h
+++ b/cpukit/score/include/rtems/score/object.h
@@ -29,7 +29,25 @@ extern "C" {
* object names.
*/
-typedef unsigned32 Objects_Name;
+typedef void * Objects_Name;
+
+/*
+ * Space for object names is allocated in multiples of this.
+ *
+ * NOTE: Must be a power of 2. Matches the name manipulation routines.
+ */
+
+#define OBJECTS_NAME_ALIGNMENT 4
+
+/*
+ * Functions which compare names are prototyped like this.
+ */
+
+typedef boolean (*Objects_Name_comparators)(
+ void * /* name_1 */,
+ void * /* name_2 */,
+ unsigned32 /* length */
+);
/*
* The following type defines the control block used to manage
@@ -91,7 +109,7 @@ typedef enum {
typedef struct {
Chain_Node Node;
Objects_Id id;
- Objects_Name *name;
+ Objects_Name name;
} Objects_Control;
/*
@@ -108,6 +126,8 @@ typedef struct {
Objects_Name *name_table; /* table of local object names */
Chain_Control *global_table; /* pointer to global table */
Chain_Control Inactive; /* chain of inactive ctl blocks */
+ boolean is_string; /* TRUE if names are strings */
+ unsigned32 name_length; /* maximum length of names */
} Objects_Information;
/*
@@ -179,10 +199,79 @@ void _Objects_Initialize_information (
Objects_Classes the_class,
boolean supports_global,
unsigned32 maximum,
- unsigned32 size
+ unsigned32 size,
+ boolean is_string,
+ unsigned32 maximum_name_length
+);
+
+/*
+ * _Objects_Clear_name
+ *
+ * DESCRIPTION:
+ *
+ * XXX
+ */
+
+void _Objects_Clear_name(
+ void *name,
+ unsigned32 length
+);
+
+/*
+ * _Objects_Copy_name_string
+ *
+ * DESCRIPTION:
+ *
+ * XXX
+ */
+
+void _Objects_Copy_name_string(
+ void *source,
+ void *destination
+);
+
+/*
+ * _Objects_Copy_name_raw
+ *
+ * DESCRIPTION:
+ *
+ * XXX
+ */
+
+void _Objects_Copy_name_raw(
+ void *source,
+ void *destination,
+ unsigned32 length
+);
+
+/*
+ * _Objects_Compare_name_string
+ *
+ * DESCRIPTION:
+ *
+ * XXX
+ */
+
+boolean _Objects_Compare_name_string(
+ void *name_1,
+ void *name_2,
+ unsigned32 length
);
/*
+ * _Objects_Compare_name_raw
+ *
+ * DESCRIPTION:
+ *
+ * XXX
+ */
+
+boolean _Objects_Compare_name_raw(
+ void *name_1,
+ void *name_2,
+ unsigned32 length
+);
+/*
* _Objects_Name_to_id
*
* DESCRIPTION:
@@ -244,53 +333,6 @@ Objects_Control *_Objects_Get_next(
);
/*
- * _Objects_Is_name_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the name is valid, and FALSE otherwise.
- */
-
-STATIC INLINE boolean _Objects_Is_name_valid (
- Objects_Name name
-);
-
-/*
- * 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 ) \
- ( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
-
-/*
- * rtems_name_to_characters
- *
- * DESCRIPTION:
- *
- * This function breaks the object name into the four component
- * characters C1, C2, C3, and C4.
- *
- */
-
-STATIC INLINE void rtems_name_to_characters(
- Objects_Name name,
- char *c1,
- char *c2,
- char *c3,
- char *c4
-);
-
-/*
* _Objects_Build_id
*
* DESCRIPTION:
diff --git a/cpukit/score/include/rtems/score/objectmp.h b/cpukit/score/include/rtems/score/objectmp.h
index 0d29fda753..6ec5ed1781 100644
--- a/cpukit/score/include/rtems/score/objectmp.h
+++ b/cpukit/score/include/rtems/score/objectmp.h
@@ -28,7 +28,8 @@ extern "C" {
typedef struct {
Objects_Control Object;
- Objects_Name name;
+ unsigned32 name; /* XXX broken but works */
+ /* XXX If any API is MP with variable length names .. BOOM!!!! */
} Objects_MP_Control;
/*
@@ -93,7 +94,7 @@ STATIC INLINE boolean _Objects_MP_Is_null_global_object (
boolean _Objects_MP_Open (
Objects_Information *information,
- Objects_Name the_name,
+ unsigned32 the_name, /* XXX -- wrong for variable length */
Objects_Id the_id,
boolean is_fatal_error
);
diff --git a/cpukit/score/include/rtems/system.h b/cpukit/score/include/rtems/system.h
index 96b0abfff8..5f627c1a7c 100644
--- a/cpukit/score/include/rtems/system.h
+++ b/cpukit/score/include/rtems/system.h
@@ -127,6 +127,12 @@ extern const void * _Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ];
EXTERN rtems_cpu_table _CPU_Table; /* CPU dependent info */
+/*
+ * XXX weird RTEMS stuff
+ */
+
+#define RTEMS_MAXIMUM_NAME_LENGTH 4
+
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl
index da65807aa1..687ffd923b 100644
--- a/cpukit/score/inline/rtems/score/object.inl
+++ b/cpukit/score/inline/rtems/score/object.inl
@@ -19,39 +19,6 @@
/*PAGE
*
- * _Objects_Is_name_valid
- *
- */
-
-STATIC INLINE boolean _Objects_Is_name_valid (
- Objects_Name name
-)
-{
- return ( name != 0 );
-}
-
-/*PAGE
- *
- * rtems_name_to_characters
- *
- */
-
-STATIC INLINE void rtems_name_to_characters(
- Objects_Name name,
- char *c1,
- char *c2,
- char *c3,
- char *c4
-)
-{
- *c1 = (name >> 24) & 0xff;
- *c2 = (name >> 16) & 0xff;
- *c3 = (name >> 8) & 0xff;
- *c4 = name & 0xff;
-}
-
-/*PAGE
- *
* _Objects_Build_id
*
*/
@@ -186,12 +153,15 @@ STATIC INLINE void _Objects_Open(
Objects_Name name
)
{
- unsigned32 index;
+ unsigned32 index;
index = rtems_get_index( the_object->id );
information->local_table[ index ] = the_object;
- information->name_table[ index ] = name;
- the_object->name = &information->name_table[ index ];
+
+ if ( information->is_string )
+ _Objects_Copy_name_string( name, the_object->name );
+ else
+ _Objects_Copy_name_raw( name, the_object->name, information->name_length );
}
/*PAGE
@@ -209,8 +179,7 @@ STATIC INLINE void _Objects_Close(
index = rtems_get_index( the_object->id );
information->local_table[ index ] = NULL;
- information->name_table[ index ] = 0;
- the_object->name = 0;
+ _Objects_Clear_name( the_object->name, information->name_length );
}
#endif
diff --git a/cpukit/score/macros/rtems/score/object.inl b/cpukit/score/macros/rtems/score/object.inl
index 6c7caa383a..27675b19bf 100644
--- a/cpukit/score/macros/rtems/score/object.inl
+++ b/cpukit/score/macros/rtems/score/object.inl
@@ -19,28 +19,6 @@
/*PAGE
*
- * _Objects_Is_name_valid
- *
- */
-
-#define _Objects_Is_name_valid( _name ) \
- ( (_name) != 0 )
-
-/*
- * rtems_name_to_characters
- *
- */
-
-#define rtems_name_to_characters( _name, _c1, _c2, _c3, _c4 ) \
- { \
- (*(_c1) = ((_name) >> 24) & 0xff; \
- (*(_c2) = ((_name) >> 16) & 0xff; \
- (*(_c3) = ((_name) >> 8) & 0xff; \
- (*(_c4) = ((_name)) & 0xff; \
- }
-
-/*PAGE
- *
* _Objects_Build_id
*
*/
@@ -134,8 +112,12 @@
\
_index = rtems_get_index( (_the_object)->id ); \
(_information)->local_table[ _index ] = (_the_object); \
- (_information)->name_table[ _index ] = (_name); \
- (_the_object)->name = &(_information)->name_table[ _index ]; \
+ \
+ if ( (_information)->is_string ) \
+ _Objects_Copy_name_string( (_name), (_the_object)->name ); \
+ else \
+ _Objects_Copy_name_raw( \
+ (_name), (_the_object)->name, (_information)->name_length ); \
}
/*PAGE
@@ -150,8 +132,7 @@
\
_index = rtems_get_index( (_the_object)->id ); \
(_information)->local_table[ _index ] = NULL; \
- (_information)->name_table[ _index ] = 0; \
- (_the_object)->name = 0; \
+ _Objects_Clear_name( (_the_object)->name, (_information)->name_length ); \
}
#endif
diff --git a/cpukit/score/src/object.c b/cpukit/score/src/object.c
index 0181903647..5b64ea8802 100644
--- a/cpukit/score/src/object.c
+++ b/cpukit/score/src/object.c
@@ -55,6 +55,7 @@ void _Objects_Handler_initialization(
* the_class - object class
* supports_global - TRUE if this is a global object class
* maximum - maximum objects of this class
+ * is_string - TRUE if names for this object are strings
* size - size of this object's control block
*
* Output parameters: NONE
@@ -65,15 +66,24 @@ void _Objects_Initialize_information(
Objects_Classes the_class,
boolean supports_global,
unsigned32 maximum,
- unsigned32 size
+ unsigned32 size,
+ boolean is_string,
+ unsigned32 maximum_name_length
)
{
unsigned32 minimum_index;
unsigned32 index;
Objects_Control *the_object;
+ unsigned32 name_length;
+ void *name_area;
information->maximum = maximum;
information->the_class = the_class;
+ information->is_string = is_string;
+
+ /*
+ * Calculate minimum and maximum Id's
+ */
if ( maximum == 0 ) minimum_index = 0;
else minimum_index = 1;
@@ -84,24 +94,45 @@ void _Objects_Initialize_information(
information->maximum_id =
_Objects_Build_id( the_class, _Objects_Local_node, maximum );
+ /*
+ * Allocate local pointer table
+ */
+
information->local_table = _Workspace_Allocate_or_fatal_error(
(maximum + 1) * sizeof(Objects_Control *)
);
- information->name_table = _Workspace_Allocate_or_fatal_error(
- (maximum + 1) * sizeof(Objects_Name)
- );
+ /*
+ * Allocate name table
+ */
+
+ name_length = maximum_name_length;
+
+ if (name_length & (OBJECTS_NAME_ALIGNMENT-1))
+ name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
+ ~(OBJECTS_NAME_ALIGNMENT-1);
+
+ information->name_length = name_length;
+
+ name_area = _Workspace_Allocate_or_fatal_error( (maximum + 1) * name_length );
+ information->name_table = name_area;
+
+ /*
+ * Initialize local pointer table
+ */
- for ( index=0 ; index < maximum ; index++ ) {
+ for ( index=0 ; index <= maximum ; index++ ) {
information->local_table[ index ] = NULL;
- information->name_table[ index ] = 0;
}
+ /*
+ * Initialize objects .. if there are any
+ */
+
if ( maximum == 0 ) {
_Chain_Initialize_empty( &information->Inactive );
} else {
-
_Chain_Initialize(
&information->Inactive,
_Workspace_Allocate_or_fatal_error( maximum * size ),
@@ -110,31 +141,151 @@ void _Objects_Initialize_information(
);
the_object = (Objects_Control *) information->Inactive.first;
- for ( index=1;
- index <= maximum ;
- index++ ) {
+ for ( index=1; index <= maximum ; index++ ) {
the_object->id =
_Objects_Build_id( the_class, _Objects_Local_node, index );
+
+ the_object->name = (void *) name_area;
+
+ name_area = _Addresses_Add_offset( name_area, name_length );
+
the_object = (Objects_Control *) the_object->Node.next;
}
}
- if ( supports_global == TRUE && _Configuration_Is_multiprocessing() ) {
+ /*
+ * Take care of multiprocessing
+ */
- information->global_table = _Workspace_Allocate_or_fatal_error(
- (_Configuration_MP_table->maximum_nodes + 1) * sizeof(Chain_Control)
- );
+ if ( supports_global == TRUE && _Configuration_Is_multiprocessing() ) {
- for ( index=1;
- index <= _Configuration_MP_table->maximum_nodes ;
- index++ )
- _Chain_Initialize_empty( &information->global_table[ index ] );
- }
- else
- information->global_table = NULL;
+ information->global_table = _Workspace_Allocate_or_fatal_error(
+ (_Configuration_MP_table->maximum_nodes + 1) * sizeof(Chain_Control)
+ );
+
+ for ( index=1;
+ index <= _Configuration_MP_table->maximum_nodes ;
+ index++ )
+ _Chain_Initialize_empty( &information->global_table[ index ] );
+ }
+ else
+ information->global_table = NULL;
+}
+
+/*PAGE
+ *
+ * _Objects_Clear_name
+ *
+ * XXX
+ */
+
+void _Objects_Clear_name(
+ void *name,
+ unsigned32 length
+)
+{
+ unsigned32 index;
+ unsigned32 maximum = length / OBJECTS_NAME_ALIGNMENT;
+ unsigned32 *name_ptr = name;
+
+ for ( index=0 ; index < maximum ; index++ )
+ *name_ptr++ = 0;
+}
+
+/*PAGE
+ *
+ * _Objects_Copy_name_string
+ *
+ * XXX
+ */
+
+void _Objects_Copy_name_string(
+ void *source,
+ void *destination
+)
+{
+ unsigned8 *source_p = source;
+ unsigned8 *destination_p = destination;
+
+ do {
+ *destination_p++ = *source_p;
+ } while ( *source_p++ );
+}
+
+/*PAGE
+ *
+ * _Objects_Copy_name_raw
+ *
+ * XXX
+ */
+
+void _Objects_Copy_name_raw(
+ void *source,
+ void *destination,
+ unsigned32 length
+)
+{
+ unsigned32 *source_p = source;
+ unsigned32 *destination_p = destination;
+ unsigned32 tmp_length = length / OBJECTS_NAME_ALIGNMENT;
+
+ while ( tmp_length-- )
+ *destination_p++ = *source_p++;
+}
+
+/*PAGE
+ *
+ * _Objects_Compare_name_string
+ *
+ * XXX
+ */
+
+boolean _Objects_Compare_name_string(
+ void *name_1,
+ void *name_2,
+ unsigned32 length
+)
+{
+ unsigned8 *name_1_p = name_1;
+ unsigned8 *name_2_p = name_2;
+ unsigned32 tmp_length = length;
+
+ do {
+ if ( *name_1_p++ != *name_2_p++ )
+ return FALSE;
+ if ( !tmp_length-- )
+ return FALSE;
+ } while ( *name_1_p );
+
+ return TRUE;
+}
+
+/*PAGE
+ *
+ * _Objects_Compare_name_raw
+ *
+ * XXX
+ */
+
+boolean _Objects_Compare_name_raw(
+ void *name_1,
+ void *name_2,
+ unsigned32 length
+)
+{
+ unsigned32 *name_1_p = name_1;
+ unsigned32 *name_2_p = name_2;
+ unsigned32 tmp_length = length / OBJECTS_NAME_ALIGNMENT;
+
+ while ( tmp_length-- )
+ if ( *name_1_p++ != *name_2_p++ )
+ return FALSE;
+
+ return TRUE;
}
+
/*PAGE
*
* _Objects_Name_to_id
@@ -156,15 +307,17 @@ void _Objects_Initialize_information(
rtems_status_code _Objects_Name_to_id(
Objects_Information *information,
- Objects_Name name,
- unsigned32 node,
- Objects_Id *id
+ Objects_Name name,
+ unsigned32 node,
+ Objects_Id *id
)
{
- boolean search_local_node;
- Objects_Control **objects;
- Objects_Control *the_object;
- unsigned32 index;
+ boolean search_local_node;
+ Objects_Control **objects;
+ Objects_Control *the_object;
+ unsigned32 index;
+ unsigned32 name_length;
+ Objects_Name_comparators compare_them;
if ( name == 0 )
return( RTEMS_INVALID_NAME );
@@ -179,6 +332,11 @@ rtems_status_code _Objects_Name_to_id(
if ( search_local_node ) {
objects = information->local_table;
+ name_length = information->name_length;
+
+ if ( information->is_string ) compare_them = _Objects_Compare_name_string;
+ else compare_them = _Objects_Compare_name_raw;
+
for ( index = 1; index <= information->maximum; index++ ) {
the_object = objects[ index ];
@@ -186,7 +344,7 @@ rtems_status_code _Objects_Name_to_id(
if ( !the_object || !the_object->name )
continue;
- if ( name == *the_object->name ) {
+ if ( (*compare_them)( name, the_object->name, name_length ) ) {
*id = the_object->id;
return( RTEMS_SUCCESSFUL );
}
diff --git a/cpukit/score/src/objectmp.c b/cpukit/score/src/objectmp.c
index d75a34b150..a8b067020d 100644
--- a/cpukit/score/src/objectmp.c
+++ b/cpukit/score/src/objectmp.c
@@ -53,12 +53,12 @@ void _Objects_MP_Handler_initialization (
boolean _Objects_MP_Open (
Objects_Information *information,
- Objects_Name the_name,
+ unsigned32 the_name, /* XXX -- wrong for variable */
Objects_Id the_id,
boolean is_fatal_error
)
{
- Objects_MP_Control *the_global_object;
+ Objects_MP_Control *the_global_object;
the_global_object = _Objects_MP_Allocate_global_object();
if ( _Objects_MP_Is_null_global_object( the_global_object ) ) {
@@ -139,6 +139,7 @@ rtems_status_code _Objects_MP_Global_name_search (
Chain_Control *the_chain;
Chain_Node *the_node;
Objects_MP_Control *the_object;
+ unsigned32 name_to_use = *(unsigned32 *)the_name; /* XXX variable */
if ( nodes_to_search > _Configuration_MP_table->maximum_nodes )
@@ -174,7 +175,7 @@ rtems_status_code _Objects_MP_Global_name_search (
the_object = (Objects_MP_Control *) the_node;
- if ( the_object->name == the_name ) {
+ if ( the_object->name == name_to_use ) {
*the_id = the_object->Object.id;
_Thread_Enable_dispatch();
return ( RTEMS_SUCCESSFUL );
diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c
index 92c882d749..9793792b44 100644
--- a/cpukit/score/src/thread.c
+++ b/cpukit/score/src/thread.c
@@ -58,11 +58,13 @@ void _Thread_Handler_initialization(
_Thread_Ticks_per_timeslice = ticks_per_timeslice;
_Objects_Initialize_information(
- &_Thread_Information,
- OBJECTS_RTEMS_TASKS,
- TRUE,
- maximum_tasks,
- sizeof( Thread_Control )
+ &_Thread_Information,
+ OBJECTS_RTEMS_TASKS,
+ TRUE,
+ maximum_tasks,
+ sizeof( Thread_Control ),
+ FALSE,
+ RTEMS_MAXIMUM_NAME_LENGTH
);
_Thread_Ready_chain = _Workspace_Allocate_or_fatal_error(