From 95fbca1940805db2eca55e4ea605a5a552a36bc0 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 18 Aug 1995 21:41:27 +0000 Subject: + Added object type field to object id. + Added name pointer to Object_Control. + Modified Object Open and Close to address name field. + Removed name as separate element from Thread and Proxy Control. --- cpukit/score/include/rtems/score/object.h | 65 +++++++++++++++++++++++++++---- cpukit/score/include/rtems/score/thread.h | 8 ++-- 2 files changed, 61 insertions(+), 12 deletions(-) (limited to 'cpukit/score/include/rtems/score') diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h index 0553fe901d..7f4c01c53d 100644 --- a/cpukit/score/include/rtems/score/object.h +++ b/cpukit/score/include/rtems/score/object.h @@ -33,11 +33,44 @@ typedef unsigned32 Objects_Name; /* * The following type defines the control block used to manage - * object IDs. + * object IDs. The format is as follows (0=LSB): + * + * Bits 0 .. 15 = index + * Bits 16 .. 25 = node + * Bits 26 .. 31 = class */ typedef unsigned32 Objects_Id; +#define OBJECTS_INDEX_START_BIT 0 +#define OBJECTS_NODE_START_BIT 16 +#define OBJECTS_CLASS_START_BIT 26 + +#define OBJECTS_INDEX_MASK 0x0000ffff +#define OBJECTS_NODE_MASK 0x03ff0000 +#define OBJECTS_CLASS_MASK 0xfc000000 + +#define OBJECTS_INDEX_VALID_BITS 0x0000ffff +#define OBJECTS_NODE_VALID_BITS 0x000003ff +#define OBJECTS_CLASS_VALID_BITS 0x000000cf + +/* + * This enumerated type is used in the class field of the object ID. + */ + +typedef enum { + OBJECTS_NO_CLASS = 0, + OBJECTS_RTEMS_TASKS = 1, + OBJECTS_RTEMS_TIMERS = 2, + OBJECTS_RTEMS_SEMAPHORES = 3, + OBJECTS_RTEMS_MESSAGE_QUEUES = 4, + OBJECTS_RTEMS_PARTITIONS = 5, + OBJECTS_RTEMS_REGIONS = 6, + OBJECTS_RTEMS_PORTS = 7, + OBJECTS_RTEMS_PERIODS = 8, + OBJECTS_RTEMS_EXTENSIONS = 9 +} Objects_Classes; + /* * This enumerated type lists the locations which may be returned * by _Objects_Get. These codes indicate the success of locating @@ -56,8 +89,9 @@ typedef enum { */ typedef struct { - Chain_Node Node; - Objects_Id id; + Chain_Node Node; + Objects_Id id; + Objects_Name *name; } Objects_Control; /* @@ -66,6 +100,7 @@ typedef struct { */ typedef struct { + Objects_Classes the_class; /* Class of this object */ Objects_Id minimum_id; /* minimum valid id of this type */ Objects_Id maximum_id; /* maximum valid id of this type */ unsigned32 maximum; /* maximum number of objects */ @@ -88,7 +123,7 @@ EXTERN unsigned32 _Objects_Local_node; * */ -#define OBJECTS_ID_OF_SELF 0 +#define OBJECTS_ID_OF_SELF ((Objects_Id) 0) /* * The following define the constants which may be used in name searches. @@ -107,9 +142,10 @@ EXTERN unsigned32 _Objects_Local_node; #define RTEMS_OBJECT_ID_FINAL_INDEX (0xffff) #define RTEMS_OBJECT_ID_INITIAL(node) (_Objects_Build_id( \ + OBJECTS_NO_CLASS, \ node, \ RTEMS_OBJECT_ID_INITIAL_INDEX)) -#define RTEMS_OBJECT_ID_FINAL ((Objects_Id) ~0) +#define RTEMS_OBJECT_ID_FINAL ((Objects_Id)~0) /* * _Objects_Handler_initialization @@ -140,6 +176,7 @@ void _Objects_Handler_initialization( void _Objects_Initialize_information ( Objects_Information *information, + Objects_Classes the_class, boolean supports_global, unsigned32 maximum, unsigned32 size @@ -264,8 +301,22 @@ STATIC INLINE void rtems_name_to_characters( */ STATIC INLINE Objects_Id _Objects_Build_id( - unsigned32 node, - unsigned32 index + Objects_Classes the_class, + unsigned32 node, + unsigned32 index +); + +/* + * rtems_get_class + * + * DESCRIPTION: + * + * This function returns the class portion of the ID. + * + */ + +STATIC INLINE Objects_Classes rtems_get_class( + Objects_Id id ); /* diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 953e19ba95..ddae52a363 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -133,14 +133,13 @@ typedef struct { typedef struct { Objects_Control Object; - Objects_Name name; States_Control current_state; - rtems_task_priority current_priority; - rtems_task_priority real_priority; + rtems_task_priority current_priority; + rtems_task_priority real_priority; unsigned32 resource_count; Thread_Wait_information Wait; Watchdog_Control Timer; - rtems_packet_prefix *receive_packet; + rtems_packet_prefix *receive_packet; /****************** end of common block ********************/ Chain_Node Active; } Thread_Proxy_control; @@ -156,7 +155,6 @@ typedef struct { typedef struct { Objects_Control Object; - Objects_Name name; States_Control current_state; rtems_task_priority current_priority; rtems_task_priority real_priority; -- cgit v1.2.3