Changeset 1c2d178 in rtems
- Timestamp:
- 11/25/18 19:15:26 (4 years ago)
- Branches:
- 5, master
- Children:
- f70079c
- Parents:
- 3899bc1a
- git-author:
- Sebastian Huber <sebastian.huber@…> (11/25/18 19:15:26)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (12/07/18 13:22:02)
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/include/rtems/score/objectimpl.h
r3899bc1a r1c2d178 125 125 /** This points to the table of local objects. */ 126 126 Objects_Control **local_table; 127 /** This is the maximum number of objects in this class. */128 Objects_Maximum maximum;129 127 /** This is the number of objects on the Inactive list. */ 130 128 Objects_Maximum inactive; … … 852 850 853 851 /** 852 * Returns the maximum index of the specified object class. 853 * 854 * @param[in] information The object information. 855 * 856 * @return The maximum index of the specified object class. 857 */ 858 RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Get_maximum_index( 859 const Objects_Information *information 860 ) 861 { 862 return _Objects_Get_index( information->maximum_id ); 863 } 864 865 /** 854 866 * This function sets the pointer to the local_table object 855 867 * referenced by the index. … … 877 889 */ 878 890 _Assert( index >= OBJECTS_INDEX_MINIMUM ); 879 _Assert( index <= information->maximum);891 _Assert( index <= _Objects_Get_maximum_index( information ) ); 880 892 881 893 information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object; -
cpukit/posix/src/killinfo.c
r3899bc1a r1c2d178 208 208 continue; 209 209 210 maximum = the_info->maximum;210 maximum = _Objects_Get_maximum_index( the_info ); 211 211 object_table = the_info->local_table; 212 212 -
cpukit/rtems/src/rtemsobjectgetclassinfo.c
r3899bc1a r1c2d178 48 48 info->maximum_id = obj_info->maximum_id; 49 49 info->auto_extend = obj_info->auto_extend; 50 info->maximum = obj_info->maximum;50 info->maximum = _Objects_Get_maximum_index( obj_info ); 51 51 52 52 for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) -
cpukit/score/src/objectactivecount.c
r3899bc1a r1c2d178 25 25 ) 26 26 { 27 size_tinactive;28 size_tmaximum;27 Objects_Maximum inactive; 28 Objects_Maximum maximum; 29 29 30 30 _Assert( _Objects_Allocator_is_owner() ); 31 31 32 inactive = _Chain_Node_count_unprotected( &information->Inactive ); 33 maximum = information->maximum; 32 inactive = (Objects_Maximum) 33 _Chain_Node_count_unprotected( &information->Inactive ); 34 maximum = _Objects_Get_maximum_index( information ); 34 35 35 return (Objects_Maximum) ( maximum - inactive );36 return maximum - inactive; 36 37 } -
cpukit/score/src/objectextendinformation.c
r3899bc1a r1c2d178 50 50 uint32_t index_end; 51 51 uint32_t index; 52 uint32_t maximum; 52 Objects_Maximum old_maximum; 53 uint32_t new_maximum; 53 54 size_t object_block_size; 54 55 Objects_Control *new_object_block; … … 60 61 ); 61 62 63 old_maximum = _Objects_Get_maximum_index( information ); 64 62 65 /* 63 66 * Search for a free block of indexes. If we do NOT need to allocate or … … 71 74 block_count = 0; 72 75 else { 73 block_count = information->maximum / information->objects_per_block;76 block_count = old_maximum / information->objects_per_block; 74 77 75 78 for ( ; block < block_count; block++ ) { … … 83 86 index_end = index_base + information->objects_per_block; 84 87 85 maximum = (uint32_t) information->maximum + information->objects_per_block;88 new_maximum = (uint32_t) old_maximum + information->objects_per_block; 86 89 87 90 /* … … 90 93 * case of 16-bit Ids, this is only 256 object instances. 91 94 */ 92 if ( maximum > OBJECTS_ID_FINAL_INDEX ) {95 if ( new_maximum > OBJECTS_ID_FINAL_INDEX ) { 93 96 return; 94 97 } … … 147 150 */ 148 151 object_blocks_size = block_count * sizeof( *object_blocks ); 149 local_table_size = maximum * sizeof( *local_table );152 local_table_size = new_maximum * sizeof( *local_table ); 150 153 table_size = object_blocks_size 151 154 + local_table_size … … 179 182 block_count--; 180 183 181 if ( information->maximum > 0 ) {184 if ( old_maximum > 0 ) { 182 185 /* 183 186 * Copy each section of the table over. This has to be performed as … … 197 200 local_table, 198 201 information->local_table, 199 information->maximum * sizeof( *local_table )202 old_maximum * sizeof( *local_table ) 200 203 ); 201 204 } … … 216 219 information->inactive_per_block = inactive_per_block; 217 220 information->local_table = local_table; 218 information->maximum = (Objects_Maximum) maximum;219 221 information->maximum_id = _Objects_Build_id( 220 222 information->the_api, 221 223 information->the_class, 222 224 _Objects_Local_node, 223 information->maximum225 new_maximum 224 226 ); 225 227 -
cpukit/score/src/objectgetinfo.c
r3899bc1a r1c2d178 56 56 */ 57 57 #if !defined(RTEMS_MULTIPROCESSING) 58 if ( info->maximum== 0 )58 if ( _Objects_Get_maximum_index( info ) == 0 ) 59 59 return NULL; 60 60 #endif -
cpukit/score/src/objectgetnext.c
r3899bc1a r1c2d178 29 29 Objects_Control *the_object; 30 30 Objects_Id next_id; 31 Objects_Maximum maximum; 31 32 32 33 if ( !information ) … … 42 43 43 44 _Objects_Allocator_lock(); 45 maximum = _Objects_Get_maximum_index( information ); 44 46 45 47 do { 46 /* walked off end of list? */ 47 if (_Objects_Get_index(next_id) > information->maximum) 48 { 49 _Objects_Allocator_unlock(); 50 *next_id_p = OBJECTS_ID_FINAL; 51 return NULL; 52 } 48 /* walked off end of list? */ 49 if (_Objects_Get_index( next_id ) > maximum) { 50 _Objects_Allocator_unlock(); 51 *next_id_p = OBJECTS_ID_FINAL; 52 return NULL; 53 } 53 54 54 55 55 /* try to grab one */ 56 the_object = _Objects_Get_no_protection( next_id, information ); 56 57 57 next_id++; 58 58 next_id++; 59 59 } while ( the_object == NULL ); 60 60 -
cpukit/score/src/objectinitializeinformation.c
r3899bc1a r1c2d178 40 40 Objects_Maximum maximum_per_allocation; 41 41 42 information->the_api = the_api; 43 information->the_class = the_class; 44 information->object_size = object_size; 45 information->local_table = 0; 46 information->inactive_per_block = 0; 47 information->object_blocks = 0; 48 information->inactive = 0; 49 information->local_table = NULL; 50 51 /* 52 * Set the maximum value to 0. It will be updated when objects are 53 * added to the inactive set from _Objects_Extend_information() 54 */ 55 information->maximum = 0; 42 information->the_api = the_api; 43 information->the_class = the_class; 44 information->object_size = object_size; 56 45 57 46 /* -
cpukit/score/src/objectnametoid.c
r3899bc1a r1c2d178 30 30 bool search_local_node; 31 31 Objects_Control *the_object; 32 Objects_Maximum maximum; 32 33 Objects_Maximum index; 33 34 #if defined(RTEMS_MULTIPROCESSING) … … 43 44 return OBJECTS_INVALID_NAME; 44 45 46 maximum = _Objects_Get_maximum_index( information ); 45 47 search_local_node = false; 46 48 47 if ( information->maximum !=0 &&49 if ( maximum > 0 && 48 50 (node == OBJECTS_SEARCH_ALL_NODES || 49 51 node == OBJECTS_SEARCH_LOCAL_NODE || … … 53 55 54 56 if ( search_local_node ) { 55 for ( index = 0; index < information->maximum; ++index ) {57 for ( index = 0; index < maximum; ++index ) { 56 58 the_object = information->local_table[ index ]; 57 59 if ( !the_object ) -
cpukit/score/src/objectnametoidstring.c
r3899bc1a r1c2d178 30 30 ) 31 31 { 32 size_t name_length; 33 size_t max_name_length; 34 uint32_t index; 32 size_t name_length; 33 size_t max_name_length; 34 Objects_Maximum maximum; 35 Objects_Maximum index; 35 36 36 37 _Assert( _Objects_Has_string_name( information ) ); … … 53 54 } 54 55 55 for ( index = 0; index < information->maximum; ++index ) { 56 maximum = _Objects_Get_maximum_index( information ); 57 58 for ( index = 0; index < maximum; ++index ) { 56 59 Objects_Control *the_object; 57 60 -
cpukit/score/src/objectshrinkinformation.c
r3899bc1a r1c2d178 40 40 41 41 objects_per_block = information->objects_per_block; 42 block_count = information->maximum/ objects_per_block;42 block_count = _Objects_Get_maximum_index( information ) / objects_per_block; 43 43 index_base = 0; 44 44 -
cpukit/score/src/threaditerate.c
r3899bc1a r1c2d178 28 28 for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; ++api_index ) { 29 29 const Objects_Information *information; 30 Objects_Maximum i; 30 Objects_Maximum maximum; 31 Objects_Maximum index; 31 32 32 33 if ( _Objects_Information_table[ api_index ] == NULL ) { … … 40 41 } 41 42 42 for ( i = 0 ; i < information->maximum ; ++i ) { 43 maximum = _Objects_Get_maximum_index( information ); 44 45 for ( index = 0 ; index < maximum ; ++index ) { 43 46 Thread_Control *the_thread; 44 47 45 the_thread = (Thread_Control *) information->local_table[ i ];48 the_thread = (Thread_Control *) information->local_table[ index ]; 46 49 47 50 if ( the_thread != NULL ) { -
testsuites/sptests/spsysinit01/init.c
r3899bc1a r1c2d178 249 249 FIRST(RTEMS_SYSINIT_DATA_STRUCTURES) 250 250 { 251 assert(_Thread_Internal_information.Objects.maximum == 0); 251 assert( 252 _Objects_Get_maximum_index(&_Thread_Internal_information.Objects) == 0 253 ); 252 254 next_step(DATA_STRUCTURES_PRE); 253 255 } … … 255 257 LAST(RTEMS_SYSINIT_DATA_STRUCTURES) 256 258 { 257 assert(_Thread_Internal_information.Objects.maximum != 0); 259 assert( 260 _Objects_Get_maximum_index(&_Thread_Internal_information.Objects) != 0 261 ); 258 262 next_step(DATA_STRUCTURES_POST); 259 263 } … … 261 265 FIRST(RTEMS_SYSINIT_USER_EXTENSIONS) 262 266 { 263 assert(_ Extension_Information.maximum== 0);267 assert(_Objects_Get_maximum_index(&_Extension_Information) == 0); 264 268 next_step(USER_EXTENSIONS_PRE); 265 269 } … … 267 271 LAST(RTEMS_SYSINIT_USER_EXTENSIONS) 268 272 { 269 assert(_ Extension_Information.maximum!= 0);273 assert(_Objects_Get_maximum_index(&_Extension_Information) != 0); 270 274 next_step(USER_EXTENSIONS_POST); 271 275 } … … 273 277 FIRST(RTEMS_SYSINIT_CLASSIC_TASKS) 274 278 { 275 assert(_ RTEMS_tasks_Information.Objects.maximum== 0);279 assert(_Objects_Get_maximum_index(&_RTEMS_tasks_Information.Objects) == 0); 276 280 next_step(CLASSIC_TASKS_PRE); 277 281 } … … 279 283 LAST(RTEMS_SYSINIT_CLASSIC_TASKS) 280 284 { 281 assert(_ RTEMS_tasks_Information.Objects.maximum!= 0);285 assert(_Objects_Get_maximum_index(&_RTEMS_tasks_Information.Objects) != 0); 282 286 next_step(CLASSIC_TASKS_POST); 283 287 } … … 285 289 FIRST(RTEMS_SYSINIT_CLASSIC_TIMER) 286 290 { 287 assert(_ Timer_Information.maximum== 0);291 assert(_Objects_Get_maximum_index(&_Timer_Information) == 0); 288 292 next_step(CLASSIC_TIMER_PRE); 289 293 } … … 291 295 LAST(RTEMS_SYSINIT_CLASSIC_TIMER) 292 296 { 293 assert(_ Timer_Information.maximum!= 0);297 assert(_Objects_Get_maximum_index(&_Timer_Information) != 0); 294 298 next_step(CLASSIC_TIMER_POST); 295 299 } … … 319 323 FIRST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE) 320 324 { 321 assert(_ Message_queue_Information.maximum== 0);325 assert(_Objects_Get_maximum_index(&_Message_queue_Information) == 0); 322 326 next_step(CLASSIC_MESSAGE_QUEUE_PRE); 323 327 } … … 325 329 LAST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE) 326 330 { 327 assert(_ Message_queue_Information.maximum!= 0);331 assert(_Objects_Get_maximum_index(&_Message_queue_Information) != 0); 328 332 next_step(CLASSIC_MESSAGE_QUEUE_POST); 329 333 } … … 331 335 FIRST(RTEMS_SYSINIT_CLASSIC_SEMAPHORE) 332 336 { 333 assert(_ Semaphore_Information.maximum== 0);337 assert(_Objects_Get_maximum_index(&_Semaphore_Information) == 0); 334 338 next_step(CLASSIC_SEMAPHORE_PRE); 335 339 } … … 337 341 LAST(RTEMS_SYSINIT_CLASSIC_SEMAPHORE) 338 342 { 339 assert(_ Semaphore_Information.maximum!= 0);343 assert(_Objects_Get_maximum_index(&_Semaphore_Information) != 0); 340 344 next_step(CLASSIC_SEMAPHORE_POST); 341 345 } … … 343 347 FIRST(RTEMS_SYSINIT_CLASSIC_PARTITION) 344 348 { 345 assert(_ Partition_Information.maximum== 0);349 assert(_Objects_Get_maximum_index(&_Partition_Information) == 0); 346 350 next_step(CLASSIC_PARTITION_PRE); 347 351 } … … 349 353 LAST(RTEMS_SYSINIT_CLASSIC_PARTITION) 350 354 { 351 assert(_ Partition_Information.maximum!= 0);355 assert(_Objects_Get_maximum_index(&_Partition_Information) != 0); 352 356 next_step(CLASSIC_PARTITION_POST); 353 357 } … … 355 359 FIRST(RTEMS_SYSINIT_CLASSIC_REGION) 356 360 { 357 assert(_ Region_Information.maximum== 0);361 assert(_Objects_Get_maximum_index(&_Region_Information) == 0); 358 362 next_step(CLASSIC_REGION_PRE); 359 363 } … … 361 365 LAST(RTEMS_SYSINIT_CLASSIC_REGION) 362 366 { 363 assert(_ Region_Information.maximum!= 0);367 assert(_Objects_Get_maximum_index(&_Region_Information) != 0); 364 368 next_step(CLASSIC_REGION_POST); 365 369 } … … 367 371 FIRST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY) 368 372 { 369 assert(_ Dual_ported_memory_Information.maximum== 0);373 assert(_Objects_Get_maximum_index(&_Dual_ported_memory_Information) == 0); 370 374 next_step(CLASSIC_DUAL_PORTED_MEMORY_PRE); 371 375 } … … 373 377 LAST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY) 374 378 { 375 assert(_ Dual_ported_memory_Information.maximum!= 0);379 assert(_Objects_Get_maximum_index(&_Dual_ported_memory_Information) != 0); 376 380 next_step(CLASSIC_DUAL_PORTED_MEMORY_POST); 377 381 } … … 379 383 FIRST(RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC) 380 384 { 381 assert(_ Rate_monotonic_Information.maximum== 0);385 assert(_Objects_Get_maximum_index(&_Rate_monotonic_Information) == 0); 382 386 next_step(CLASSIC_RATE_MONOTONIC_PRE); 383 387 } … … 385 389 LAST(RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC) 386 390 { 387 assert(_ Rate_monotonic_Information.maximum!= 0);391 assert(_Objects_Get_maximum_index(&_Rate_monotonic_Information) != 0); 388 392 next_step(CLASSIC_RATE_MONOTONIC_POST); 389 393 } … … 391 395 FIRST(RTEMS_SYSINIT_CLASSIC_BARRIER) 392 396 { 393 assert(_ Barrier_Information.maximum== 0);397 assert(_Objects_Get_maximum_index(&_Barrier_Information) == 0); 394 398 next_step(CLASSIC_BARRIER_PRE); 395 399 } … … 397 401 LAST(RTEMS_SYSINIT_CLASSIC_BARRIER) 398 402 { 399 assert(_ Barrier_Information.maximum!= 0);403 assert(_Objects_Get_maximum_index(&_Barrier_Information) != 0); 400 404 next_step(CLASSIC_BARRIER_POST); 401 405 } … … 429 433 FIRST(RTEMS_SYSINIT_POSIX_THREADS) 430 434 { 431 assert(_ POSIX_Threads_Information.Objects.maximum== 0);435 assert(_Objects_Get_maximum_index(&_POSIX_Threads_Information.Objects) == 0); 432 436 next_step(POSIX_THREADS_PRE); 433 437 } … … 435 439 LAST(RTEMS_SYSINIT_POSIX_THREADS) 436 440 { 437 assert(_ POSIX_Threads_Information.Objects.maximum!= 0);441 assert(_Objects_Get_maximum_index(&_POSIX_Threads_Information.Objects) != 0); 438 442 next_step(POSIX_THREADS_POST); 439 443 } … … 441 445 FIRST(RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE) 442 446 { 443 assert(_ POSIX_Message_queue_Information.maximum== 0);447 assert(_Objects_Get_maximum_index(&_POSIX_Message_queue_Information) == 0); 444 448 next_step(POSIX_MESSAGE_QUEUE_PRE); 445 449 } … … 447 451 LAST(RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE) 448 452 { 449 assert(_ POSIX_Message_queue_Information.maximum!= 0);453 assert(_Objects_Get_maximum_index(&_POSIX_Message_queue_Information) != 0); 450 454 next_step(POSIX_MESSAGE_QUEUE_POST); 451 455 } … … 453 457 FIRST(RTEMS_SYSINIT_POSIX_SEMAPHORE) 454 458 { 455 assert(_ POSIX_Semaphore_Information.maximum== 0);459 assert(_Objects_Get_maximum_index(&_POSIX_Semaphore_Information) == 0); 456 460 next_step(POSIX_SEMAPHORE_PRE); 457 461 } … … 459 463 LAST(RTEMS_SYSINIT_POSIX_SEMAPHORE) 460 464 { 461 assert(_ POSIX_Semaphore_Information.maximum!= 0);465 assert(_Objects_Get_maximum_index(&_POSIX_Semaphore_Information) != 0); 462 466 next_step(POSIX_SEMAPHORE_POST); 463 467 } … … 466 470 FIRST(RTEMS_SYSINIT_POSIX_TIMER) 467 471 { 468 assert(_ POSIX_Timer_Information.maximum== 0);472 assert(_Objects_Get_maximum_index(&_POSIX_Timer_Information) == 0); 469 473 next_step(POSIX_TIMER_PRE); 470 474 } … … 472 476 LAST(RTEMS_SYSINIT_POSIX_TIMER) 473 477 { 474 assert(_ POSIX_Timer_Information.maximum!= 0);478 assert(_Objects_Get_maximum_index(&_POSIX_Timer_Information) != 0); 475 479 next_step(POSIX_TIMER_POST); 476 480 } … … 479 483 FIRST(RTEMS_SYSINIT_POSIX_SHM) 480 484 { 481 assert(_ POSIX_Shm_Information.maximum== 0);485 assert(_Objects_Get_maximum_index(&_POSIX_Shm_Information) == 0); 482 486 next_step(POSIX_SHM_PRE); 483 487 } … … 485 489 LAST(RTEMS_SYSINIT_POSIX_SHM) 486 490 { 487 assert(_ POSIX_Shm_Information.maximum!= 0);491 assert(_Objects_Get_maximum_index(&_POSIX_Shm_Information) != 0); 488 492 next_step(POSIX_SHM_POST); 489 493 } … … 509 513 FIRST(RTEMS_SYSINIT_POSIX_KEYS) 510 514 { 511 assert(_ POSIX_Keys_Information.maximum== 0);515 assert(_Objects_Get_maximum_index(&_POSIX_Keys_Information) == 0); 512 516 next_step(POSIX_KEYS_PRE); 513 517 } … … 515 519 LAST(RTEMS_SYSINIT_POSIX_KEYS) 516 520 { 517 assert(_ POSIX_Keys_Information.maximum!= 0);521 assert(_Objects_Get_maximum_index(&_POSIX_Keys_Information) != 0); 518 522 next_step(POSIX_KEYS_POST); 519 523 }
Note: See TracChangeset
for help on using the changeset viewer.