Changeset 95fbca1 in rtems
- Timestamp:
- 08/18/95 21:41:27 (28 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 9863dbf
- Parents:
- b06e68ef
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/score/headers/object.h
rb06e68ef r95fbca1 34 34 /* 35 35 * The following type defines the control block used to manage 36 * object IDs. 36 * object IDs. The format is as follows (0=LSB): 37 * 38 * Bits 0 .. 15 = index 39 * Bits 16 .. 25 = node 40 * Bits 26 .. 31 = class 37 41 */ 38 42 39 43 typedef unsigned32 Objects_Id; 44 45 #define OBJECTS_INDEX_START_BIT 0 46 #define OBJECTS_NODE_START_BIT 16 47 #define OBJECTS_CLASS_START_BIT 26 48 49 #define OBJECTS_INDEX_MASK 0x0000ffff 50 #define OBJECTS_NODE_MASK 0x03ff0000 51 #define OBJECTS_CLASS_MASK 0xfc000000 52 53 #define OBJECTS_INDEX_VALID_BITS 0x0000ffff 54 #define OBJECTS_NODE_VALID_BITS 0x000003ff 55 #define OBJECTS_CLASS_VALID_BITS 0x000000cf 56 57 /* 58 * This enumerated type is used in the class field of the object ID. 59 */ 60 61 typedef enum { 62 OBJECTS_NO_CLASS = 0, 63 OBJECTS_RTEMS_TASKS = 1, 64 OBJECTS_RTEMS_TIMERS = 2, 65 OBJECTS_RTEMS_SEMAPHORES = 3, 66 OBJECTS_RTEMS_MESSAGE_QUEUES = 4, 67 OBJECTS_RTEMS_PARTITIONS = 5, 68 OBJECTS_RTEMS_REGIONS = 6, 69 OBJECTS_RTEMS_PORTS = 7, 70 OBJECTS_RTEMS_PERIODS = 8, 71 OBJECTS_RTEMS_EXTENSIONS = 9 72 } Objects_Classes; 40 73 41 74 /* … … 57 90 58 91 typedef struct { 59 Chain_Node Node; 60 Objects_Id id; 92 Chain_Node Node; 93 Objects_Id id; 94 Objects_Name *name; 61 95 } Objects_Control; 62 96 … … 67 101 68 102 typedef struct { 103 Objects_Classes the_class; /* Class of this object */ 69 104 Objects_Id minimum_id; /* minimum valid id of this type */ 70 105 Objects_Id maximum_id; /* maximum valid id of this type */ … … 89 124 */ 90 125 91 #define OBJECTS_ID_OF_SELF 0126 #define OBJECTS_ID_OF_SELF ((Objects_Id) 0) 92 127 93 128 /* … … 108 143 109 144 #define RTEMS_OBJECT_ID_INITIAL(node) (_Objects_Build_id( \ 145 OBJECTS_NO_CLASS, \ 110 146 node, \ 111 147 RTEMS_OBJECT_ID_INITIAL_INDEX)) 112 #define RTEMS_OBJECT_ID_FINAL ((Objects_Id) 148 #define RTEMS_OBJECT_ID_FINAL ((Objects_Id)~0) 113 149 114 150 /* … … 141 177 void _Objects_Initialize_information ( 142 178 Objects_Information *information, 179 Objects_Classes the_class, 143 180 boolean supports_global, 144 181 unsigned32 maximum, … … 265 302 266 303 STATIC INLINE Objects_Id _Objects_Build_id( 267 unsigned32 node, 268 unsigned32 index 304 Objects_Classes the_class, 305 unsigned32 node, 306 unsigned32 index 307 ); 308 309 /* 310 * rtems_get_class 311 * 312 * DESCRIPTION: 313 * 314 * This function returns the class portion of the ID. 315 * 316 */ 317 318 STATIC INLINE Objects_Classes rtems_get_class( 319 Objects_Id id 269 320 ); 270 321 -
c/src/exec/score/headers/thread.h
rb06e68ef r95fbca1 134 134 typedef struct { 135 135 Objects_Control Object; 136 Objects_Name name;137 136 States_Control current_state; 138 rtems_task_priority 139 rtems_task_priority 137 rtems_task_priority current_priority; 138 rtems_task_priority real_priority; 140 139 unsigned32 resource_count; 141 140 Thread_Wait_information Wait; 142 141 Watchdog_Control Timer; 143 rtems_packet_prefix 142 rtems_packet_prefix *receive_packet; 144 143 /****************** end of common block ********************/ 145 144 Chain_Node Active; … … 157 156 typedef struct { 158 157 Objects_Control Object; 159 Objects_Name name;160 158 States_Control current_state; 161 159 rtems_task_priority current_priority; -
c/src/exec/score/include/rtems/score/object.h
rb06e68ef r95fbca1 34 34 /* 35 35 * The following type defines the control block used to manage 36 * object IDs. 36 * object IDs. The format is as follows (0=LSB): 37 * 38 * Bits 0 .. 15 = index 39 * Bits 16 .. 25 = node 40 * Bits 26 .. 31 = class 37 41 */ 38 42 39 43 typedef unsigned32 Objects_Id; 44 45 #define OBJECTS_INDEX_START_BIT 0 46 #define OBJECTS_NODE_START_BIT 16 47 #define OBJECTS_CLASS_START_BIT 26 48 49 #define OBJECTS_INDEX_MASK 0x0000ffff 50 #define OBJECTS_NODE_MASK 0x03ff0000 51 #define OBJECTS_CLASS_MASK 0xfc000000 52 53 #define OBJECTS_INDEX_VALID_BITS 0x0000ffff 54 #define OBJECTS_NODE_VALID_BITS 0x000003ff 55 #define OBJECTS_CLASS_VALID_BITS 0x000000cf 56 57 /* 58 * This enumerated type is used in the class field of the object ID. 59 */ 60 61 typedef enum { 62 OBJECTS_NO_CLASS = 0, 63 OBJECTS_RTEMS_TASKS = 1, 64 OBJECTS_RTEMS_TIMERS = 2, 65 OBJECTS_RTEMS_SEMAPHORES = 3, 66 OBJECTS_RTEMS_MESSAGE_QUEUES = 4, 67 OBJECTS_RTEMS_PARTITIONS = 5, 68 OBJECTS_RTEMS_REGIONS = 6, 69 OBJECTS_RTEMS_PORTS = 7, 70 OBJECTS_RTEMS_PERIODS = 8, 71 OBJECTS_RTEMS_EXTENSIONS = 9 72 } Objects_Classes; 40 73 41 74 /* … … 57 90 58 91 typedef struct { 59 Chain_Node Node; 60 Objects_Id id; 92 Chain_Node Node; 93 Objects_Id id; 94 Objects_Name *name; 61 95 } Objects_Control; 62 96 … … 67 101 68 102 typedef struct { 103 Objects_Classes the_class; /* Class of this object */ 69 104 Objects_Id minimum_id; /* minimum valid id of this type */ 70 105 Objects_Id maximum_id; /* maximum valid id of this type */ … … 89 124 */ 90 125 91 #define OBJECTS_ID_OF_SELF 0126 #define OBJECTS_ID_OF_SELF ((Objects_Id) 0) 92 127 93 128 /* … … 108 143 109 144 #define RTEMS_OBJECT_ID_INITIAL(node) (_Objects_Build_id( \ 145 OBJECTS_NO_CLASS, \ 110 146 node, \ 111 147 RTEMS_OBJECT_ID_INITIAL_INDEX)) 112 #define RTEMS_OBJECT_ID_FINAL ((Objects_Id) 148 #define RTEMS_OBJECT_ID_FINAL ((Objects_Id)~0) 113 149 114 150 /* … … 141 177 void _Objects_Initialize_information ( 142 178 Objects_Information *information, 179 Objects_Classes the_class, 143 180 boolean supports_global, 144 181 unsigned32 maximum, … … 265 302 266 303 STATIC INLINE Objects_Id _Objects_Build_id( 267 unsigned32 node, 268 unsigned32 index 304 Objects_Classes the_class, 305 unsigned32 node, 306 unsigned32 index 307 ); 308 309 /* 310 * rtems_get_class 311 * 312 * DESCRIPTION: 313 * 314 * This function returns the class portion of the ID. 315 * 316 */ 317 318 STATIC INLINE Objects_Classes rtems_get_class( 319 Objects_Id id 269 320 ); 270 321 -
c/src/exec/score/include/rtems/score/thread.h
rb06e68ef r95fbca1 134 134 typedef struct { 135 135 Objects_Control Object; 136 Objects_Name name;137 136 States_Control current_state; 138 rtems_task_priority 139 rtems_task_priority 137 rtems_task_priority current_priority; 138 rtems_task_priority real_priority; 140 139 unsigned32 resource_count; 141 140 Thread_Wait_information Wait; 142 141 Watchdog_Control Timer; 143 rtems_packet_prefix 142 rtems_packet_prefix *receive_packet; 144 143 /****************** end of common block ********************/ 145 144 Chain_Node Active; … … 157 156 typedef struct { 158 157 Objects_Control Object; 159 Objects_Name name;160 158 States_Control current_state; 161 159 rtems_task_priority current_priority; -
c/src/exec/score/inline/object.inl
rb06e68ef r95fbca1 58 58 59 59 STATIC INLINE Objects_Id _Objects_Build_id( 60 unsigned32 node, 61 unsigned32 index 62 ) 63 { 64 return ( (node << 16) | index ); 65 } 60 Objects_Classes the_class, 61 unsigned32 node, 62 unsigned32 index 63 ) 64 { 65 return ( (the_class << OBJECTS_CLASS_START_BIT) | 66 (node << OBJECTS_NODE_START_BIT) | 67 (index << OBJECTS_INDEX_START_BIT) ); 68 } 69 70 /*PAGE 71 * 72 * rtems_get_class 73 */ 74 75 STATIC INLINE Objects_Classes rtems_get_class( 76 Objects_Id id 77 ) 78 { 79 return (Objects_Classes) 80 ((id >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS); 81 } 82 66 83 67 84 /*PAGE … … 75 92 ) 76 93 { 77 return (id >> 16);94 return (id >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS; 78 95 } 79 96 … … 88 105 ) 89 106 { 90 return (id &0xFFFF);107 return (id >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS; 91 108 } 92 109 … … 175 192 information->local_table[ index ] = the_object; 176 193 information->name_table[ index ] = name; 194 the_object->name = &information->name_table[ index ]; 177 195 } 178 196 … … 193 211 information->local_table[ index ] = NULL; 194 212 information->name_table[ index ] = 0; 213 the_object->name = 0; 195 214 } 196 215 -
c/src/exec/score/inline/rtems/score/object.inl
rb06e68ef r95fbca1 58 58 59 59 STATIC INLINE Objects_Id _Objects_Build_id( 60 unsigned32 node, 61 unsigned32 index 62 ) 63 { 64 return ( (node << 16) | index ); 65 } 60 Objects_Classes the_class, 61 unsigned32 node, 62 unsigned32 index 63 ) 64 { 65 return ( (the_class << OBJECTS_CLASS_START_BIT) | 66 (node << OBJECTS_NODE_START_BIT) | 67 (index << OBJECTS_INDEX_START_BIT) ); 68 } 69 70 /*PAGE 71 * 72 * rtems_get_class 73 */ 74 75 STATIC INLINE Objects_Classes rtems_get_class( 76 Objects_Id id 77 ) 78 { 79 return (Objects_Classes) 80 ((id >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS); 81 } 82 66 83 67 84 /*PAGE … … 75 92 ) 76 93 { 77 return (id >> 16);94 return (id >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS; 78 95 } 79 96 … … 88 105 ) 89 106 { 90 return (id &0xFFFF);107 return (id >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS; 91 108 } 92 109 … … 175 192 information->local_table[ index ] = the_object; 176 193 information->name_table[ index ] = name; 194 the_object->name = &information->name_table[ index ]; 177 195 } 178 196 … … 193 211 information->local_table[ index ] = NULL; 194 212 information->name_table[ index ] = 0; 213 the_object->name = 0; 195 214 } 196 215 -
c/src/exec/score/macros/object.inl
rb06e68ef r95fbca1 46 46 */ 47 47 48 #define _Objects_Build_id( _node, _index ) \ 49 ( ((_node) << 16) | (_index) ) 48 #define _Objects_Build_id( _the_class, _node, _index ) \ 49 ( ((_the_class) << OBJECTS_CLASS_START_BIT) | \ 50 ((_node) << OBJECTS_NODE_START_BIT) | \ 51 ((_index) << OBJECTS_INDEX_START_BIT) ) 52 53 /*PAGE 54 * 55 * rtems_get_class 56 */ 57 58 #define rtems_get_class( _id ) \ 59 (Objects_Classes) \ 60 (((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS) 50 61 51 62 /*PAGE … … 56 67 57 68 #define rtems_get_node( _id ) \ 58 (( _id) >> 16)69 (((_id) >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS) 59 70 60 71 /*PAGE … … 65 76 66 77 #define rtems_get_index( _id ) \ 67 (( _id) & 0xFFFF)78 (((_id) >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS) 68 79 69 80 /*PAGE … … 125 136 (_information)->local_table[ _index ] = (_the_object); \ 126 137 (_information)->name_table[ _index ] = (_name); \ 138 (_the_object)->name = &(_information)->name_table[ _index ]; \ 127 139 } 128 140 … … 140 152 (_information)->local_table[ _index ] = NULL; \ 141 153 (_information)->name_table[ _index ] = 0; \ 154 (_the_object)->name = 0; \ 142 155 } 143 156 -
c/src/exec/score/macros/rtems/score/object.inl
rb06e68ef r95fbca1 46 46 */ 47 47 48 #define _Objects_Build_id( _node, _index ) \ 49 ( ((_node) << 16) | (_index) ) 48 #define _Objects_Build_id( _the_class, _node, _index ) \ 49 ( ((_the_class) << OBJECTS_CLASS_START_BIT) | \ 50 ((_node) << OBJECTS_NODE_START_BIT) | \ 51 ((_index) << OBJECTS_INDEX_START_BIT) ) 52 53 /*PAGE 54 * 55 * rtems_get_class 56 */ 57 58 #define rtems_get_class( _id ) \ 59 (Objects_Classes) \ 60 (((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS) 50 61 51 62 /*PAGE … … 56 67 57 68 #define rtems_get_node( _id ) \ 58 (( _id) >> 16)69 (((_id) >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS) 59 70 60 71 /*PAGE … … 65 76 66 77 #define rtems_get_index( _id ) \ 67 (( _id) & 0xFFFF)78 (((_id) >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS) 68 79 69 80 /*PAGE … … 125 136 (_information)->local_table[ _index ] = (_the_object); \ 126 137 (_information)->name_table[ _index ] = (_name); \ 138 (_the_object)->name = &(_information)->name_table[ _index ]; \ 127 139 } 128 140 … … 140 152 (_information)->local_table[ _index ] = NULL; \ 141 153 (_information)->name_table[ _index ] = 0; \ 154 (_the_object)->name = 0; \ 142 155 } 143 156 -
cpukit/score/include/rtems/score/object.h
rb06e68ef r95fbca1 34 34 /* 35 35 * The following type defines the control block used to manage 36 * object IDs. 36 * object IDs. The format is as follows (0=LSB): 37 * 38 * Bits 0 .. 15 = index 39 * Bits 16 .. 25 = node 40 * Bits 26 .. 31 = class 37 41 */ 38 42 39 43 typedef unsigned32 Objects_Id; 44 45 #define OBJECTS_INDEX_START_BIT 0 46 #define OBJECTS_NODE_START_BIT 16 47 #define OBJECTS_CLASS_START_BIT 26 48 49 #define OBJECTS_INDEX_MASK 0x0000ffff 50 #define OBJECTS_NODE_MASK 0x03ff0000 51 #define OBJECTS_CLASS_MASK 0xfc000000 52 53 #define OBJECTS_INDEX_VALID_BITS 0x0000ffff 54 #define OBJECTS_NODE_VALID_BITS 0x000003ff 55 #define OBJECTS_CLASS_VALID_BITS 0x000000cf 56 57 /* 58 * This enumerated type is used in the class field of the object ID. 59 */ 60 61 typedef enum { 62 OBJECTS_NO_CLASS = 0, 63 OBJECTS_RTEMS_TASKS = 1, 64 OBJECTS_RTEMS_TIMERS = 2, 65 OBJECTS_RTEMS_SEMAPHORES = 3, 66 OBJECTS_RTEMS_MESSAGE_QUEUES = 4, 67 OBJECTS_RTEMS_PARTITIONS = 5, 68 OBJECTS_RTEMS_REGIONS = 6, 69 OBJECTS_RTEMS_PORTS = 7, 70 OBJECTS_RTEMS_PERIODS = 8, 71 OBJECTS_RTEMS_EXTENSIONS = 9 72 } Objects_Classes; 40 73 41 74 /* … … 57 90 58 91 typedef struct { 59 Chain_Node Node; 60 Objects_Id id; 92 Chain_Node Node; 93 Objects_Id id; 94 Objects_Name *name; 61 95 } Objects_Control; 62 96 … … 67 101 68 102 typedef struct { 103 Objects_Classes the_class; /* Class of this object */ 69 104 Objects_Id minimum_id; /* minimum valid id of this type */ 70 105 Objects_Id maximum_id; /* maximum valid id of this type */ … … 89 124 */ 90 125 91 #define OBJECTS_ID_OF_SELF 0126 #define OBJECTS_ID_OF_SELF ((Objects_Id) 0) 92 127 93 128 /* … … 108 143 109 144 #define RTEMS_OBJECT_ID_INITIAL(node) (_Objects_Build_id( \ 145 OBJECTS_NO_CLASS, \ 110 146 node, \ 111 147 RTEMS_OBJECT_ID_INITIAL_INDEX)) 112 #define RTEMS_OBJECT_ID_FINAL ((Objects_Id) 148 #define RTEMS_OBJECT_ID_FINAL ((Objects_Id)~0) 113 149 114 150 /* … … 141 177 void _Objects_Initialize_information ( 142 178 Objects_Information *information, 179 Objects_Classes the_class, 143 180 boolean supports_global, 144 181 unsigned32 maximum, … … 265 302 266 303 STATIC INLINE Objects_Id _Objects_Build_id( 267 unsigned32 node, 268 unsigned32 index 304 Objects_Classes the_class, 305 unsigned32 node, 306 unsigned32 index 307 ); 308 309 /* 310 * rtems_get_class 311 * 312 * DESCRIPTION: 313 * 314 * This function returns the class portion of the ID. 315 * 316 */ 317 318 STATIC INLINE Objects_Classes rtems_get_class( 319 Objects_Id id 269 320 ); 270 321 -
cpukit/score/include/rtems/score/thread.h
rb06e68ef r95fbca1 134 134 typedef struct { 135 135 Objects_Control Object; 136 Objects_Name name;137 136 States_Control current_state; 138 rtems_task_priority 139 rtems_task_priority 137 rtems_task_priority current_priority; 138 rtems_task_priority real_priority; 140 139 unsigned32 resource_count; 141 140 Thread_Wait_information Wait; 142 141 Watchdog_Control Timer; 143 rtems_packet_prefix 142 rtems_packet_prefix *receive_packet; 144 143 /****************** end of common block ********************/ 145 144 Chain_Node Active; … … 157 156 typedef struct { 158 157 Objects_Control Object; 159 Objects_Name name;160 158 States_Control current_state; 161 159 rtems_task_priority current_priority; -
cpukit/score/inline/rtems/score/object.inl
rb06e68ef r95fbca1 58 58 59 59 STATIC INLINE Objects_Id _Objects_Build_id( 60 unsigned32 node, 61 unsigned32 index 62 ) 63 { 64 return ( (node << 16) | index ); 65 } 60 Objects_Classes the_class, 61 unsigned32 node, 62 unsigned32 index 63 ) 64 { 65 return ( (the_class << OBJECTS_CLASS_START_BIT) | 66 (node << OBJECTS_NODE_START_BIT) | 67 (index << OBJECTS_INDEX_START_BIT) ); 68 } 69 70 /*PAGE 71 * 72 * rtems_get_class 73 */ 74 75 STATIC INLINE Objects_Classes rtems_get_class( 76 Objects_Id id 77 ) 78 { 79 return (Objects_Classes) 80 ((id >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS); 81 } 82 66 83 67 84 /*PAGE … … 75 92 ) 76 93 { 77 return (id >> 16);94 return (id >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS; 78 95 } 79 96 … … 88 105 ) 89 106 { 90 return (id &0xFFFF);107 return (id >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS; 91 108 } 92 109 … … 175 192 information->local_table[ index ] = the_object; 176 193 information->name_table[ index ] = name; 194 the_object->name = &information->name_table[ index ]; 177 195 } 178 196 … … 193 211 information->local_table[ index ] = NULL; 194 212 information->name_table[ index ] = 0; 213 the_object->name = 0; 195 214 } 196 215 -
cpukit/score/macros/rtems/score/object.inl
rb06e68ef r95fbca1 46 46 */ 47 47 48 #define _Objects_Build_id( _node, _index ) \ 49 ( ((_node) << 16) | (_index) ) 48 #define _Objects_Build_id( _the_class, _node, _index ) \ 49 ( ((_the_class) << OBJECTS_CLASS_START_BIT) | \ 50 ((_node) << OBJECTS_NODE_START_BIT) | \ 51 ((_index) << OBJECTS_INDEX_START_BIT) ) 52 53 /*PAGE 54 * 55 * rtems_get_class 56 */ 57 58 #define rtems_get_class( _id ) \ 59 (Objects_Classes) \ 60 (((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS) 50 61 51 62 /*PAGE … … 56 67 57 68 #define rtems_get_node( _id ) \ 58 (( _id) >> 16)69 (((_id) >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS) 59 70 60 71 /*PAGE … … 65 76 66 77 #define rtems_get_index( _id ) \ 67 (( _id) & 0xFFFF)78 (((_id) >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS) 68 79 69 80 /*PAGE … … 125 136 (_information)->local_table[ _index ] = (_the_object); \ 126 137 (_information)->name_table[ _index ] = (_name); \ 138 (_the_object)->name = &(_information)->name_table[ _index ]; \ 127 139 } 128 140 … … 140 152 (_information)->local_table[ _index ] = NULL; \ 141 153 (_information)->name_table[ _index ] = 0; \ 154 (_the_object)->name = 0; \ 142 155 } 143 156
Note: See TracChangeset
for help on using the changeset viewer.