Changeset 059529e in rtems
- Timestamp:
- Jul 21, 2016, 8:15:02 AM (5 years ago)
- Branches:
- 5, master
- Children:
- 64ed0bb3
- Parents:
- 3cdda03
- git-author:
- Sebastian Huber <sebastian.huber@…> (07/21/16 08:15:02)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (07/22/16 07:13:07)
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libcsupport/src/malloc_deferred.c
r3cdda03 r059529e 128 128 { 129 129 rtems_interrupt_lock_context lock_context; 130 rtems_chain_node *node; 131 132 node = (rtems_chain_node *) p; 130 133 131 134 rtems_interrupt_lock_acquire( &_Malloc_GC_lock, &lock_context ); 132 rtems_chain_append_unprotected( &_Malloc_GC_list, (rtems_chain_node *) p ); 135 rtems_chain_initialize_node( node ); 136 rtems_chain_append_unprotected( &_Malloc_GC_list, node ); 133 137 rtems_interrupt_lock_release( &_Malloc_GC_lock, &lock_context ); 134 138 } -
cpukit/libcsupport/src/mount-mgr.c
r3cdda03 r059529e 125 125 rtems_libio_lock(); 126 126 if ( rtems_filesystem_get_mount_handler( type ) == NULL ) { 127 rtems_chain_initialize_node( &fsn->node ); 127 128 rtems_chain_append_unprotected( chain, &fsn->node ); 128 129 } else { -
cpukit/libcsupport/src/printertask.c
r3cdda03 r059529e 195 195 printer_task_buffer buffer; 196 196 197 rtems_chain_initialize_node( &buffer.node ); 197 198 buffer.action_kind = ACTION_DRAIN; 198 199 buffer.action_data.task = rtems_task_self(); -
cpukit/libcsupport/src/sup_fs_location.c
r3cdda03 r059529e 49 49 dst->handlers = src->handlers; 50 50 dst->mt_entry = src->mt_entry; 51 rtems_chain_initialize_node(&dst->mt_entry_node); 51 52 rtems_filesystem_location_add_to_mt_entry(dst); 52 53 -
cpukit/libcsupport/src/termios.c
r3cdda03 r059529e 150 150 } 151 151 152 rtems_chain_initialize_node(&new_device_node->node); 152 153 new_device_node->major = major; 153 154 new_device_node->minor = minor; -
cpukit/posix/src/aio_misc.c
r3cdda03 r059529e 117 117 r_chain = malloc (sizeof (rtems_aio_request_chain)); 118 118 rtems_chain_initialize_empty (&r_chain->perfd); 119 rtems_chain_initialize_node (&r_chain->next_fd); 119 120 120 121 if (rtems_chain_is_empty (chain)) … … 223 224 while (!rtems_chain_is_tail (chain, node)) 224 225 { 225 rtems_chain_extract (node);226 226 rtems_aio_request *req = (rtems_aio_request *) node; 227 227 node = rtems_chain_next (node); 228 rtems_chain_extract (&req->next_prio); 228 229 req->aiocbp->error_code = ECANCELED; 229 230 req->aiocbp->return_value = -1; … … 312 313 pthread_getschedparam (pthread_self(), &policy, ¶m); 313 314 315 rtems_chain_initialize_node (&req->next_prio); 314 316 req->caller_thread = pthread_self (); 315 317 req->priority = param.sched_priority - req->aiocbp->aio_reqprio; -
cpukit/sapi/include/rtems/chain.h
r3cdda03 r059529e 189 189 190 190 /** 191 * @brief Initializes a chain node. 192 * 193 * In debug configurations, the node is set off chain. In all other 194 * configurations, this function does nothing. 195 * 196 * @param[in] the_node The chain node to initialize. 197 */ 198 RTEMS_INLINE_ROUTINE void rtems_chain_initialize_node( 199 rtems_chain_node *node 200 ) 201 { 202 _Chain_Initialize_node( node ); 203 } 204 205 /** 191 206 * @brief Is the node off chain. 192 207 * -
cpukit/sapi/include/rtems/rbheap.h
r3cdda03 r059529e 211 211 rtems_rbheap_get_spare_descriptor_chain(control); 212 212 213 rtems_chain_initialize_node(&chunk->chain_node); 213 214 rtems_chain_prepend_unprotected(chain, &chunk->chain_node); 214 215 } -
cpukit/sapi/src/rbheap.c
r3cdda03 r059529e 77 77 ) 78 78 { 79 rtems_chain_initialize_node(&chunk->chain_node); 79 80 rtems_chain_prepend_unprotected(chain, &chunk->chain_node); 80 81 } -
cpukit/score/include/rtems/score/chainimpl.h
r3cdda03 r059529e 105 105 { 106 106 node->next = NULL; 107 #if defined(RTEMS_DEBUG) 108 node->previous = NULL; 109 #endif 110 } 111 112 /** 113 * @brief Initializes a chain node. 114 * 115 * In debug configurations, the node is set off chain. In all other 116 * configurations, this function does nothing. 117 * 118 * @param[in] the_node The chain node to initialize. 119 */ 120 RTEMS_INLINE_ROUTINE void _Chain_Initialize_node( Chain_Node *the_node ) 121 { 122 #if defined(RTEMS_DEBUG) 123 _Chain_Set_off_chain( the_node ); 124 #else 125 (void) the_node; 126 #endif 107 127 } 108 128 … … 520 540 next->previous = previous; 521 541 previous->next = next; 542 543 #if defined(RTEMS_DEBUG) 544 _Chain_Set_off_chain( the_node ); 545 #endif 522 546 } 523 547 … … 541 565 ) 542 566 { 543 Chain_Node *head = _Chain_Head( the_chain ); 544 Chain_Node *old_first = head->next; 545 Chain_Node *new_first = old_first->next; 567 Chain_Node *head; 568 Chain_Node *old_first; 569 Chain_Node *new_first; 570 571 _Assert( !_Chain_Is_empty( the_chain ) ); 572 573 head = _Chain_Head( the_chain ); 574 old_first = head->next; 575 new_first = old_first->next; 546 576 547 577 head->next = new_first; 548 578 new_first->previous = head; 579 580 #if defined(RTEMS_DEBUG) 581 _Chain_Set_off_chain( old_first ); 582 #endif 549 583 550 584 return old_first; … … 594 628 { 595 629 Chain_Node *before_node; 630 631 _Assert( _Chain_Is_node_off_chain( the_node ) ); 596 632 597 633 the_node->previous = after_node; … … 618 654 ) 619 655 { 620 Chain_Node *tail = _Chain_Tail( the_chain ); 621 Chain_Node *old_last = tail->previous; 656 Chain_Node *tail; 657 Chain_Node *old_last; 658 659 _Assert( _Chain_Is_node_off_chain( the_node ) ); 660 661 tail = _Chain_Tail( the_chain ); 662 old_last = tail->previous; 622 663 623 664 the_node->next = tail; … … 979 1020 ) 980 1021 { 1022 _Chain_Initialize_node( &the_iterator->Registry_node ); 981 1023 _Chain_Append_unprotected( 982 1024 &the_registry->Iterators, -
cpukit/score/include/rtems/score/resourceimpl.h
r3cdda03 r059529e 60 60 node->dependency = NULL; 61 61 node->root = node; 62 _Chain_Initialize_node( &node->Node ); 62 63 _Chain_Initialize_empty( &node->Resources ); 63 64 } … … 107 108 { 108 109 resource->owner = NULL; 110 _Chain_Initialize_node( &resource->Node ); 109 111 _Chain_Initialize_empty( &resource->Rivals ); 110 112 } -
cpukit/score/include/rtems/score/schedulerpriorityimpl.h
r3cdda03 r059529e 132 132 if ( _Chain_Has_only_one_node( ready_chain ) ) { 133 133 _Chain_Initialize_empty( ready_chain ); 134 _Chain_Initialize_node( node ); 134 135 _Priority_bit_map_Remove( bit_map, &ready_queue->Priority_map ); 135 136 } else { -
cpukit/score/include/rtems/score/threadqimpl.h
r3cdda03 r059529e 123 123 124 124 for ( i = 0; i < _Scheduler_Count; ++i ) { 125 _Chain_Initialize_node( &heads->Priority[ i ].Node ); 125 126 _RBTree_Initialize_empty( &heads->Priority[ i ].Queue ); 126 127 } … … 128 129 129 130 _Chain_Initialize_empty( &heads->Free_chain ); 131 _Chain_Initialize_node( &heads->Free_node ); 130 132 } 131 133 -
cpukit/score/src/freechain.c
r3cdda03 r059529e 76 76 { 77 77 if ( node != NULL ) { 78 _Chain_Initialize_node( node ); 78 79 _Chain_Prepend_unprotected( &freechain->Free, node ); 79 80 } -
cpukit/score/src/objectextendinformation.c
r3cdda03 r059529e 266 266 ); 267 267 268 _Chain_Initialize_node( &the_object->Node ); 268 269 _Chain_Append_unprotected( &information->Inactive, &the_object->Node ); 269 270 -
cpukit/score/src/threadqops.c
r3cdda03 r059529e 100 100 ) 101 101 { 102 _Chain_Initialize_node( &the_thread->Wait.Node.Chain ); 102 103 _Chain_Append_unprotected( 103 104 &heads->Heads.Fifo, -
testsuites/sptests/spchain/init.c
r3cdda03 r059529e 44 44 45 45 _Chain_Initialize_empty( &chain ); 46 _Chain_Initialize_node( &a ); 47 _Chain_Initialize_node( &b ); 48 _Chain_Initialize_node( &c ); 46 49 _Chain_Iterator_registry_initialize( ® ); 47 50 _Chain_Iterator_initialize( &chain, ®, &fit, CHAIN_ITERATOR_FORWARD ); … … 226 229 227 230 rtems_chain_initialize_empty( &chain ); 231 rtems_chain_initialize_node( &node1 ); 232 rtems_chain_initialize_node( &node2 ); 228 233 rtems_chain_append( &chain, &node1 ); 229 234 rtems_chain_insert( &node1, &node2 ); … … 256 261 puts( "INIT - Verify rtems_chain_append_with_notification" ); 257 262 rtems_chain_initialize_empty( &chain ); 263 rtems_chain_initialize_node( &a ); 258 264 sc = rtems_chain_append_with_notification( 259 265 &chain, … … 268 274 269 275 rtems_chain_initialize_empty( &chain ); 276 rtems_chain_initialize_node( &a ); 277 rtems_chain_initialize_node( &b ); 270 278 271 279 rtems_chain_append( &chain, &b ); … … 281 289 puts( "INIT - Verify rtems_chain_prepend_with_notification" ); 282 290 rtems_chain_initialize_empty( &chain ); 291 rtems_chain_initialize_node( &a ); 292 rtems_chain_initialize_node( &b ); 283 293 sc = rtems_chain_prepend_with_notification( 284 294 &chain, … … 304 314 puts( "INIT - Verify rtems_chain_get_with_notification" ); 305 315 rtems_chain_initialize_empty( &chain ); 316 rtems_chain_initialize_node( &a ); 317 rtems_chain_initialize_node( &b ); 306 318 307 319 rtems_chain_append( &chain, &b ); … … 330 342 rtems_chain_node a; 331 343 rtems_chain_node b; 344 rtems_chain_node c; 332 345 rtems_chain_node *p; 333 346 bool empty; … … 335 348 puts( "INIT - Verify rtems_chain_append_with_empty_check" ); 336 349 rtems_chain_initialize_empty( &chain ); 350 rtems_chain_initialize_node( &a ); 351 rtems_chain_initialize_node( &b ); 337 352 empty = rtems_chain_append_with_empty_check( &chain, &a ); 338 353 rtems_test_assert( empty ); 339 empty = rtems_chain_append_with_empty_check( &chain, & a);354 empty = rtems_chain_append_with_empty_check( &chain, &b ); 340 355 rtems_test_assert( !empty ); 341 356 342 357 puts( "INIT - Verify rtems_chain_prepend_with_empty_check" ); 343 358 rtems_chain_initialize_empty( &chain ); 359 rtems_chain_initialize_node( &a ); 360 rtems_chain_initialize_node( &b ); 361 rtems_chain_initialize_node( &c ); 344 362 empty = rtems_chain_prepend_with_empty_check( &chain, &a ); 345 363 rtems_test_assert( empty ); 346 empty = rtems_chain_prepend_with_empty_check( &chain, &a );347 rtems_test_assert( !empty );348 364 empty = rtems_chain_prepend_with_empty_check( &chain, &b ); 349 365 rtems_test_assert( !empty ); 366 empty = rtems_chain_prepend_with_empty_check( &chain, &c ); 367 rtems_test_assert( !empty ); 350 368 351 369 puts( "INIT - Verify rtems_chain_get_with_empty_check" ); 352 370 rtems_chain_initialize_empty( &chain ); 371 rtems_chain_initialize_node( &a ); 372 rtems_chain_initialize_node( &b ); 353 373 empty = rtems_chain_get_with_empty_check( &chain, &p ); 354 374 rtems_test_assert( empty ); … … 378 398 379 399 for (i = 0; i < RTEMS_ARRAY_SIZE( nodes ); ++i) { 400 rtems_chain_initialize_node( &nodes[ i ] ); 380 401 rtems_chain_append_unprotected( &chain, &nodes[i] ); 381 402 count = rtems_chain_node_count_unprotected( &chain ); … … 396 417 const Chain_Node *node; 397 418 size_t n = RTEMS_ARRAY_SIZE( nodes ); 398 size_t i = 0;419 size_t i; 399 420 400 421 puts( "INIT - Verify _Chain_Insert_ordered_unprotected" ); 422 423 for ( i = 0; i < n; ++i ) { 424 _Chain_Initialize_node( &nodes[ i ] ); 425 } 401 426 402 427 _Chain_Insert_ordered_unprotected( &chain, &nodes[4], test_order ); … … 408 433 tail = _Chain_Immutable_tail( &chain ); 409 434 node = _Chain_Immutable_first( &chain ); 435 i = 0; 410 436 while ( node != tail && i < n ) { 411 437 rtems_test_assert( node == &nodes[ i ] ); … … 430 456 puts( "Init - Initialize chain empty" ); 431 457 rtems_chain_initialize_empty( &chain1 ); 458 rtems_chain_initialize_node( &node1.Node ); 459 rtems_chain_initialize_node( &node2.Node ); 432 460 433 461 /* verify that the chain append and insert work */
Note: See TracChangeset
for help on using the changeset viewer.