=============================================================================== 00016bc4 <_CORE_message_queue_Broadcast>: { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 16bc4: e590304c ldr r3, [r0, #76] ; 0x4c Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 16bc8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 16bcc: e1530002 cmp r3, r2 Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 16bd0: e1a07000 mov r7, r0 16bd4: e1a05002 mov r5, r2 16bd8: e1a08001 mov r8, r1 16bdc: e59da020 ldr sl, [sp, #32] Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 16be0: 3a000016 bcc 16c40 <_CORE_message_queue_Broadcast+0x7c> * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 16be4: e5906048 ldr r6, [r0, #72] ; 0x48 16be8: e3560000 cmp r6, #0 *count = 0; 16bec: 13a00000 movne r0, #0 16bf0: 158a0000 strne r0, [sl] * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 16bf4: 18bd85f0 popne {r4, r5, r6, r7, r8, sl, pc} /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 16bf8: e1a00007 mov r0, r7 16bfc: eb000a0e bl 1943c <_Thread_queue_Dequeue> 16c00: e2504000 subs r4, r0, #0 16c04: 0a00000a beq 16c34 <_CORE_message_queue_Broadcast+0x70> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 16c08: e594002c ldr r0, [r4, #44] ; 0x2c 16c0c: e1a01008 mov r1, r8 16c10: e1a02005 mov r2, r5 16c14: eb002084 bl 1ee2c buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 16c18: e5943028 ldr r3, [r4, #40] ; 0x28 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 16c1c: e1a00007 mov r0, r7 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 16c20: e5835000 str r5, [r3] /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 16c24: eb000a04 bl 1943c <_Thread_queue_Dequeue> 16c28: e2504000 subs r4, r0, #0 _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 16c2c: e2866001 add r6, r6, #1 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 16c30: 1afffff4 bne 16c08 <_CORE_message_queue_Broadcast+0x44> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 16c34: e58a6000 str r6, [sl] return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 16c38: e1a00004 mov r0, r4 16c3c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE; 16c40: e3a00001 mov r0, #1 <== NOT EXECUTED #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 16c44: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== 0000ab6c <_CORE_mutex_Seize_interrupt_trylock>: { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; ab6c: e59f215c ldr r2, [pc, #348] ; acd0 <_CORE_mutex_Seize_interrupt_trylock+0x164> executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { ab70: e590c050 ldr ip, [r0, #80] ; 0x50 #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { ab74: e1a03000 mov r3, r0 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; ab78: e5922004 ldr r2, [r2, #4] executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; ab7c: e3a00000 mov r0, #0 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { ab80: e15c0000 cmp ip, r0 ab84: e92d40f0 push {r4, r5, r6, r7, lr} Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; ab88: e5820034 str r0, [r2, #52] ; 0x34 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { ab8c: 0a00000e beq abcc <_CORE_mutex_Seize_interrupt_trylock+0x60> return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } ab90: e593c048 ldr ip, [r3, #72] ; 0x48 the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; ab94: e5925008 ldr r5, [r2, #8] the_mutex->nest_count = 1; ab98: e3a04001 mov r4, #1 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || ab9c: e35c0002 cmp ip, #2 /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; aba0: e5830050 str r0, [r3, #80] ; 0x50 the_mutex->holder = executing; aba4: e583205c str r2, [r3, #92] ; 0x5c the_mutex->holder_id = executing->Object.id; aba8: e5835060 str r5, [r3, #96] ; 0x60 the_mutex->nest_count = 1; abac: e5834054 str r4, [r3, #84] ; 0x54 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || abb0: 0a000013 beq ac04 <_CORE_mutex_Seize_interrupt_trylock+0x98> abb4: e35c0003 cmp ip, #3 abb8: 0a000018 beq ac20 <_CORE_mutex_Seize_interrupt_trylock+0xb4> abbc: e5913000 ldr r3, [r1] abc0: e129f003 msr CPSR_fc, r3 executing->resource_count++; } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { _ISR_Enable( *level_p ); return 0; abc4: e3a00000 mov r0, #0 abc8: e8bd80f0 pop {r4, r5, r6, r7, pc} /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { abcc: e593005c ldr r0, [r3, #92] ; 0x5c abd0: e1520000 cmp r2, r0 /* * The mutex is not available and the caller must deal with the possibility * of blocking. */ return 1; abd4: 13a00001 movne r0, #1 /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { abd8: 18bd80f0 popne {r4, r5, r6, r7, pc} switch ( the_mutex->Attributes.lock_nesting_behavior ) { abdc: e5930040 ldr r0, [r3, #64] ; 0x40 abe0: e3500000 cmp r0, #0 abe4: 1a00001e bne ac64 <_CORE_mutex_Seize_interrupt_trylock+0xf8> case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; abe8: e5932054 ldr r2, [r3, #84] ; 0x54 abec: e2822001 add r2, r2, #1 abf0: e5832054 str r2, [r3, #84] ; 0x54 abf4: e5913000 ldr r3, [r1] abf8: e129f003 msr CPSR_fc, r3 _ISR_Enable( *level_p ); return 0; abfc: e3a00000 mov r0, #0 ac00: e8bd80f0 pop {r4, r5, r6, r7, pc} _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; ac04: e592301c ldr r3, [r2, #28] ac08: e2833001 add r3, r3, #1 ac0c: e582301c str r3, [r2, #28] ac10: e5913000 ldr r3, [r1] ac14: e129f003 msr CPSR_fc, r3 } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { _ISR_Enable( *level_p ); return 0; ac18: e3a00000 mov r0, #0 ac1c: e8bd80f0 pop {r4, r5, r6, r7, pc} _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; ac20: e592c01c ldr ip, [r2, #28] */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; ac24: e593704c ldr r7, [r3, #76] ; 0x4c current = executing->current_priority; ac28: e5926014 ldr r6, [r2, #20] _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; ac2c: e08c5004 add r5, ip, r4 Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; if ( current == ceiling ) { ac30: e1570006 cmp r7, r6 _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; ac34: e582501c str r5, [r2, #28] Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; if ( current == ceiling ) { ac38: 0a000020 beq acc0 <_CORE_mutex_Seize_interrupt_trylock+0x154> _ISR_Enable( *level_p ); return 0; } if ( current > ceiling ) { ac3c: 3a000012 bcc ac8c <_CORE_mutex_Seize_interrupt_trylock+0x120> ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; ac40: e3a05006 mov r5, #6 ac44: e5825034 str r5, [r2, #52] ; 0x34 the_mutex->lock = CORE_MUTEX_UNLOCKED; ac48: e5834050 str r4, [r3, #80] ; 0x50 the_mutex->nest_count = 0; /* undo locking above */ ac4c: e5830054 str r0, [r3, #84] ; 0x54 executing->resource_count--; /* undo locking above */ ac50: e582c01c str ip, [r2, #28] ac54: e5913000 ldr r3, [r1] ac58: e129f003 msr CPSR_fc, r3 _ISR_Enable( *level_p ); return 0; ac5c: e3a00000 mov r0, #0 ac60: e8bd80f0 pop {r4, r5, r6, r7, pc} * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { switch ( the_mutex->Attributes.lock_nesting_behavior ) { ac64: e3500001 cmp r0, #1 ac68: 0a000001 beq ac74 <_CORE_mutex_Seize_interrupt_trylock+0x108> /* * The mutex is not available and the caller must deal with the possibility * of blocking. */ return 1; ac6c: e3a00001 mov r0, #1 ac70: e8bd80f0 pop {r4, r5, r6, r7, pc} case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; _ISR_Enable( *level_p ); return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; ac74: e3a03002 mov r3, #2 <== NOT EXECUTED ac78: e5823034 str r3, [r2, #52] ; 0x34 <== NOT EXECUTED ac7c: e5913000 ldr r3, [r1] <== NOT EXECUTED ac80: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED _ISR_Enable( *level_p ); return 0; ac84: e3a00000 mov r0, #0 <== NOT EXECUTED ac88: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ac8c: e59f2040 ldr r2, [pc, #64] ; acd4 <_CORE_mutex_Seize_interrupt_trylock+0x168> ac90: e5920000 ldr r0, [r2] ac94: e2800001 add r0, r0, #1 ac98: e5820000 str r0, [r2] ac9c: e5912000 ldr r2, [r1] aca0: e129f002 msr CPSR_fc, r2 } if ( current > ceiling ) { _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); _Thread_Change_priority( aca4: e3a02000 mov r2, #0 aca8: e593005c ldr r0, [r3, #92] ; 0x5c acac: e593104c ldr r1, [r3, #76] ; 0x4c acb0: ebfff14d bl 71ec <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); acb4: ebfff2a8 bl 775c <_Thread_Enable_dispatch> return 0; acb8: e3a00000 mov r0, #0 acbc: e8bd80f0 pop {r4, r5, r6, r7, pc} acc0: e5913000 ldr r3, [r1] acc4: e129f003 msr CPSR_fc, r3 ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; if ( current == ceiling ) { _ISR_Enable( *level_p ); return 0; acc8: e3a00000 mov r0, #0 accc: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 0000ab10 <_Chain_Initialize>: count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { ab10: e3520000 cmp r2, #0 Chain_Node *current; Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; ab14: e3a0c000 mov ip, #0 Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { ab18: e92d0070 push {r4, r5, r6} Chain_Node *current; Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; ab1c: e580c004 str ip, [r0, #4] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; ab20: e1a04000 mov r4, r0 next = starting_address; ab24: 11a05002 movne r5, r2 ab28: 11a0c001 movne ip, r1 while ( count-- ) { ab2c: 1a000002 bne ab3c <_Chain_Initialize+0x2c> ab30: ea000008 b ab58 <_Chain_Initialize+0x48> <== NOT EXECUTED ab34: e1a0400c mov r4, ip current->next = next; next->previous = current; current = next; next = (Chain_Node *) ab38: e1a0c006 mov ip, r6 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { ab3c: e2555001 subs r5, r5, #1 current->next = next; ab40: e584c000 str ip, [r4] next->previous = current; ab44: e58c4004 str r4, [ip, #4] * node_size - size of node in bytes * * Output parameters: NONE */ void _Chain_Initialize( ab48: e08c6003 add r6, ip, r3 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { ab4c: 1afffff8 bne ab34 <_Chain_Initialize+0x24> * node_size - size of node in bytes * * Output parameters: NONE */ void _Chain_Initialize( ab50: e2422001 sub r2, r2, #1 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { ab54: e0241293 mla r4, r3, r2, r1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; ab58: e2803004 add r3, r0, #4 next->previous = current; current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = _Chain_Tail( the_chain ); ab5c: e5843000 str r3, [r4] the_chain->last = current; ab60: e5804008 str r4, [r0, #8] } ab64: e8bd0070 pop {r4, r5, r6} ab68: e12fff1e bx lr =============================================================================== 0000ad4c <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ad4c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} ad50: e1a08002 mov r8, r2 Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; ad54: e5902010 ldr r2, [r0, #16] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ad58: e24dd01c sub sp, sp, #28 ad5c: e1a05001 mov r5, r1 - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { ad60: e2911004 adds r1, r1, #4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ad64: e1a07000 mov r7, r0 - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { ad68: e58d1000 str r1, [sp] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ad6c: e1a0b003 mov fp, r3 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } ad70: e5909008 ldr r9, [r0, #8] Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; ad74: e58d200c str r2, [sp, #12] uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { ad78: 2a000075 bcs af54 <_Heap_Allocate_aligned_with_boundary+0x208> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { ad7c: e3530000 cmp r3, #0 ad80: 1a000071 bne af4c <_Heap_Allocate_aligned_with_boundary+0x200> if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { ad84: e1570009 cmp r7, r9 ad88: 0a000071 beq af54 <_Heap_Allocate_aligned_with_boundary+0x208> uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size ad8c: e59d300c ldr r3, [sp, #12] + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; ad90: e2651004 rsb r1, r5, #4 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size ad94: e2833007 add r3, r3, #7 ad98: e58d3010 str r3, [sp, #16] + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; ad9c: e58d1014 str r1, [sp, #20] if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { ada0: e3a06000 mov r6, #0 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { ada4: e599a004 ldr sl, [r9, #4] ada8: e59d2000 ldr r2, [sp] adac: e152000a cmp r2, sl while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; adb0: e2866001 add r6, r6, #1 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { adb4: 2a000051 bcs af00 <_Heap_Allocate_aligned_with_boundary+0x1b4> if ( alignment == 0 ) { adb8: e3580000 cmp r8, #0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; adbc: 02894008 addeq r4, r9, #8 adc0: 0a00004c beq aef8 <_Heap_Allocate_aligned_with_boundary+0x1ac> if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } adc4: e5973014 ldr r3, [r7, #20] uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; adc8: e59d1014 ldr r1, [sp, #20] uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; adcc: e59d2010 ldr r2, [sp, #16] - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; add0: e3caa001 bic sl, sl, #1 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; add4: e089a00a add sl, r9, sl uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; add8: e081400a add r4, r1, sl if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } addc: e58d3004 str r3, [sp, #4] uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; ade0: e0633002 rsb r3, r3, r2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ade4: e1a00004 mov r0, r4 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size ade8: e083a00a add sl, r3, sl adec: e1a01008 mov r1, r8 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; adf0: e2893008 add r3, r9, #8 adf4: e58d3008 str r3, [sp, #8] RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); adf8: eb001588 bl 10420 <__umodsi3> adfc: e0604004 rsb r4, r0, r4 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { ae00: e15a0004 cmp sl, r4 ae04: 2a000003 bcs ae18 <_Heap_Allocate_aligned_with_boundary+0xcc> ae08: e1a0000a mov r0, sl ae0c: e1a01008 mov r1, r8 ae10: eb001582 bl 10420 <__umodsi3> ae14: e060400a rsb r4, r0, sl } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { ae18: e35b0000 cmp fp, #0 ae1c: 0a000025 beq aeb8 <_Heap_Allocate_aligned_with_boundary+0x16c> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; ae20: e084a005 add sl, r4, r5 ae24: e1a0000a mov r0, sl ae28: e1a0100b mov r1, fp ae2c: eb00157b bl 10420 <__umodsi3> ae30: e060000a rsb r0, r0, sl /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { ae34: e1540000 cmp r4, r0 ae38: 23a03000 movcs r3, #0 ae3c: 33a03001 movcc r3, #1 ae40: e15a0000 cmp sl, r0 ae44: 93a03000 movls r3, #0 ae48: e3530000 cmp r3, #0 ae4c: 0a000019 beq aeb8 <_Heap_Allocate_aligned_with_boundary+0x16c> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; ae50: e59d1008 ldr r1, [sp, #8] ae54: e081a005 add sl, r1, r5 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { ae58: e15a0000 cmp sl, r0 ae5c: 958d6018 strls r6, [sp, #24] ae60: 9a000002 bls ae70 <_Heap_Allocate_aligned_with_boundary+0x124> ae64: ea000025 b af00 <_Heap_Allocate_aligned_with_boundary+0x1b4> ae68: e15a0000 cmp sl, r0 ae6c: 8a00003a bhi af5c <_Heap_Allocate_aligned_with_boundary+0x210> return 0; } alloc_begin = boundary_line - alloc_size; ae70: e0654000 rsb r4, r5, r0 ae74: e1a01008 mov r1, r8 ae78: e1a00004 mov r0, r4 ae7c: eb001567 bl 10420 <__umodsi3> ae80: e0604004 rsb r4, r0, r4 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; ae84: e0846005 add r6, r4, r5 ae88: e1a00006 mov r0, r6 ae8c: e1a0100b mov r1, fp ae90: eb001562 bl 10420 <__umodsi3> ae94: e0600006 rsb r0, r0, r6 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { ae98: e1560000 cmp r6, r0 ae9c: 93a06000 movls r6, #0 aea0: 83a06001 movhi r6, #1 aea4: e1540000 cmp r4, r0 aea8: 23a06000 movcs r6, #0 aeac: e3560000 cmp r6, #0 aeb0: 1affffec bne ae68 <_Heap_Allocate_aligned_with_boundary+0x11c> aeb4: e59d6018 ldr r6, [sp, #24] boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { aeb8: e59d2008 ldr r2, [sp, #8] aebc: e1520004 cmp r2, r4 aec0: 8a00000e bhi af00 <_Heap_Allocate_aligned_with_boundary+0x1b4> aec4: e59d100c ldr r1, [sp, #12] aec8: e1a00004 mov r0, r4 aecc: eb001553 bl 10420 <__umodsi3> aed0: e269a4ff rsb sl, r9, #-16777216 ; 0xff000000 aed4: e28aa8ff add sl, sl, #16711680 ; 0xff0000 aed8: e28aacff add sl, sl, #65280 ; 0xff00 aedc: e28aa0f8 add sl, sl, #248 ; 0xf8 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); aee0: e08aa004 add sl, sl, r4 uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; if ( free_size >= min_block_size || free_size == 0 ) { aee4: e59d1004 ldr r1, [sp, #4] aee8: e060300a rsb r3, r0, sl aeec: e15a0000 cmp sl, r0 aef0: 11510003 cmpne r1, r3 aef4: 8a000001 bhi af00 <_Heap_Allocate_aligned_with_boundary+0x1b4> boundary ); } } if ( alloc_begin != 0 ) { aef8: e3540000 cmp r4, #0 aefc: 1a000004 bne af14 <_Heap_Allocate_aligned_with_boundary+0x1c8> break; } block = block->next; af00: e5999008 ldr r9, [r9, #8] if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { af04: e1570009 cmp r7, r9 af08: 1affffa5 bne ada4 <_Heap_Allocate_aligned_with_boundary+0x58> af0c: e3a00000 mov r0, #0 af10: ea000008 b af38 <_Heap_Allocate_aligned_with_boundary+0x1ec> block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; af14: e597304c ldr r3, [r7, #76] ; 0x4c af18: e0833006 add r3, r3, r6 af1c: e587304c str r3, [r7, #76] ; 0x4c block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); af20: e1a00007 mov r0, r7 af24: e1a01009 mov r1, r9 af28: e1a02004 mov r2, r4 af2c: e1a03005 mov r3, r5 af30: ebffee2d bl 67ec <_Heap_Block_allocate> af34: e1a00004 mov r0, r4 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { af38: e5973044 ldr r3, [r7, #68] ; 0x44 af3c: e1530006 cmp r3, r6 stats->max_search = search_count; af40: 35876044 strcc r6, [r7, #68] ; 0x44 } return (void *) alloc_begin; } af44: e28dd01c add sp, sp, #28 af48: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { af4c: e1550003 cmp r5, r3 af50: 9a000006 bls af70 <_Heap_Allocate_aligned_with_boundary+0x224> if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { af54: e3a00000 mov r0, #0 af58: eafffff9 b af44 <_Heap_Allocate_aligned_with_boundary+0x1f8> if ( alloc_begin != 0 ) { break; } block = block->next; af5c: e5999008 ldr r9, [r9, #8] <== NOT EXECUTED if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { af60: e1570009 cmp r7, r9 <== NOT EXECUTED af64: e59d6018 ldr r6, [sp, #24] <== NOT EXECUTED af68: 1affff8d bne ada4 <_Heap_Allocate_aligned_with_boundary+0x58><== NOT EXECUTED af6c: eaffffe6 b af0c <_Heap_Allocate_aligned_with_boundary+0x1c0><== NOT EXECUTED if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { alignment = page_size; af70: e3580000 cmp r8, #0 af74: 01a08002 moveq r8, r2 af78: eaffff81 b ad84 <_Heap_Allocate_aligned_with_boundary+0x38> =============================================================================== 0000af7c <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { af7c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} af80: e1a04000 mov r4, r0 af84: e1a05001 mov r5, r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); af88: e1a00001 mov r0, r1 af8c: e5941010 ldr r1, [r4, #16] af90: eb001522 bl 10420 <__umodsi3> af94: e2455008 sub r5, r5, #8 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block af98: e5943020 ldr r3, [r4, #32] uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); af9c: e0605005 rsb r5, r0, r5 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; afa0: e1550003 cmp r5, r3 afa4: 3a00002f bcc b068 <_Heap_Free+0xec> afa8: e5941024 ldr r1, [r4, #36] ; 0x24 afac: e1550001 cmp r5, r1 afb0: 8a00002c bhi b068 <_Heap_Free+0xec> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } afb4: e595c004 ldr ip, [r5, #4] - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; afb8: e3cc6001 bic r6, ip, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); afbc: e0852006 add r2, r5, r6 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; afc0: e1530002 cmp r3, r2 afc4: 8a000027 bhi b068 <_Heap_Free+0xec> afc8: e1510002 cmp r1, r2 afcc: 3a000027 bcc b070 <_Heap_Free+0xf4> afd0: e5927004 ldr r7, [r2, #4] if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { afd4: e2170001 ands r0, r7, #1 afd8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); afdc: e1510002 cmp r1, r2 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; afe0: e3c77001 bic r7, r7, #1 afe4: 03a08000 moveq r8, #0 afe8: 0a000004 beq b000 <_Heap_Free+0x84> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } afec: e0820007 add r0, r2, r7 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; aff0: e5900004 ldr r0, [r0, #4] #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) aff4: e3100001 tst r0, #1 aff8: 13a08000 movne r8, #0 affc: 03a08001 moveq r8, #1 next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { b000: e21c0001 ands r0, ip, #1 b004: 1a00001b bne b078 <_Heap_Free+0xfc> uintptr_t const prev_size = block->prev_size; b008: e595c000 ldr ip, [r5] RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); b00c: e06ca005 rsb sl, ip, r5 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; b010: e153000a cmp r3, sl b014: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc} b018: e151000a cmp r1, sl b01c: 38bd85f0 popcc {r4, r5, r6, r7, r8, sl, pc} block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; b020: e59a0004 ldr r0, [sl, #4] return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { b024: e2100001 ands r0, r0, #1 b028: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ b02c: e3580000 cmp r8, #0 b030: 0a000039 beq b11c <_Heap_Free+0x1a0> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; b034: e5940038 ldr r0, [r4, #56] ; 0x38 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; b038: e0867007 add r7, r6, r7 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b03c: e5923008 ldr r3, [r2, #8] _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; b040: e087c00c add ip, r7, ip --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b044: e592200c ldr r2, [r2, #12] } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; b048: e2400001 sub r0, r0, #1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; b04c: e38c1001 orr r1, ip, #1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; b050: e5823008 str r3, [r2, #8] next->prev = prev; b054: e583200c str r2, [r3, #12] } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; b058: e5840038 str r0, [r4, #56] ; 0x38 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; b05c: e58a1004 str r1, [sl, #4] next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; b060: e78ac00c str ip, [sl, ip] b064: ea00000f b b0a8 <_Heap_Free+0x12c> block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; b068: e3a00000 mov r0, #0 b06c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} b070: e3a00000 mov r0, #0 <== NOT EXECUTED --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b074: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ b078: e3580000 cmp r8, #0 b07c: 0a000014 beq b0d4 <_Heap_Free+0x158> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b080: e5923008 ldr r3, [r2, #8] prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; b084: e0877006 add r7, r7, r6 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b088: e592200c ldr r2, [r2, #12] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; b08c: e3871001 orr r1, r7, #1 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; b090: e5853008 str r3, [r5, #8] new_block->prev = prev; b094: e585200c str r2, [r5, #12] next->prev = new_block; prev->next = new_block; b098: e5825008 str r5, [r2, #8] Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; b09c: e583500c str r5, [r3, #12] b0a0: e5851004 str r1, [r5, #4] next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; b0a4: e7857007 str r7, [r5, r7] stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; b0a8: e5942040 ldr r2, [r4, #64] ; 0x40 ++stats->frees; b0ac: e5943050 ldr r3, [r4, #80] ; 0x50 stats->free_size += block_size; b0b0: e5941030 ldr r1, [r4, #48] ; 0x30 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; b0b4: e2422001 sub r2, r2, #1 ++stats->frees; b0b8: e2833001 add r3, r3, #1 stats->free_size += block_size; b0bc: e0816006 add r6, r1, r6 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; b0c0: e5842040 str r2, [r4, #64] ; 0x40 ++stats->frees; b0c4: e5843050 str r3, [r4, #80] ; 0x50 stats->free_size += block_size; b0c8: e5846030 str r6, [r4, #48] ; 0x30 return( true ); b0cc: e3a00001 mov r0, #1 b0d0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; b0d4: e3863001 orr r3, r6, #1 b0d8: e5853004 str r3, [r5, #4] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; b0dc: e2843038 add r3, r4, #56 ; 0x38 b0e0: e8931008 ldm r3, {r3, ip} } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; b0e4: e5920004 ldr r0, [r2, #4] RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; b0e8: e5941008 ldr r1, [r4, #8] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; b0ec: e2833001 add r3, r3, #1 } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; b0f0: e3c00001 bic r0, r0, #1 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { b0f4: e153000c cmp r3, ip new_block->next = next; b0f8: e5851008 str r1, [r5, #8] new_block->prev = block_before; b0fc: e585400c str r4, [r5, #12] } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; b100: e5820004 str r0, [r2, #4] block_before->next = new_block; next->prev = new_block; b104: e581500c str r5, [r1, #12] next_block->prev_size = block_size; b108: e7856006 str r6, [r5, r6] { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; b10c: e5845008 str r5, [r4, #8] /* Statistics */ ++stats->free_blocks; b110: e5843038 str r3, [r4, #56] ; 0x38 if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; b114: 8584303c strhi r3, [r4, #60] ; 0x3c b118: eaffffe2 b b0a8 <_Heap_Free+0x12c> prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; b11c: e086c00c add ip, r6, ip prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; b120: e38c3001 orr r3, ip, #1 b124: e58a3004 str r3, [sl, #4] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; b128: e5923004 ldr r3, [r2, #4] b12c: e3c33001 bic r3, r3, #1 b130: e5823004 str r3, [r2, #4] next_block->prev_size = size; b134: e785c006 str ip, [r5, r6] b138: eaffffda b b0a8 <_Heap_Free+0x12c> =============================================================================== 000122a8 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 122a8: e92d40f0 push {r4, r5, r6, r7, lr} 122ac: e1a04000 mov r4, r0 122b0: e1a05001 mov r5, r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 122b4: e1a00001 mov r0, r1 122b8: e5941010 ldr r1, [r4, #16] 122bc: e1a07002 mov r7, r2 122c0: ebfff856 bl 10420 <__umodsi3> 122c4: e2456008 sub r6, r5, #8 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 122c8: e5943020 ldr r3, [r4, #32] uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 122cc: e0600006 rsb r0, r0, r6 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 122d0: e1500003 cmp r0, r3 122d4: 3a000010 bcc 1231c <_Heap_Size_of_alloc_area+0x74> 122d8: e5942024 ldr r2, [r4, #36] ; 0x24 122dc: e1500002 cmp r0, r2 122e0: 8a00000d bhi 1231c <_Heap_Size_of_alloc_area+0x74> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 122e4: e5906004 ldr r6, [r0, #4] 122e8: e3c66001 bic r6, r6, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 122ec: e0806006 add r6, r0, r6 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 122f0: e1530006 cmp r3, r6 122f4: 8a000008 bhi 1231c <_Heap_Size_of_alloc_area+0x74> 122f8: e1520006 cmp r2, r6 122fc: 3a000008 bcc 12324 <_Heap_Size_of_alloc_area+0x7c> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 12300: e5960004 ldr r0, [r6, #4] block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 12304: e2100001 ands r0, r0, #1 ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 12308: 12655004 rsbne r5, r5, #4 1230c: 10856006 addne r6, r5, r6 12310: 15876000 strne r6, [r7] return true; 12314: 13a00001 movne r0, #1 12318: e8bd80f0 pop {r4, r5, r6, r7, pc} if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 1231c: e3a00000 mov r0, #0 12320: e8bd80f0 pop {r4, r5, r6, r7, pc} 12324: e3a00000 mov r0, #0 <== NOT EXECUTED } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; return true; } 12328: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED =============================================================================== 00007544 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 7544: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 7548: e59f35cc ldr r3, [pc, #1484] ; 7b1c <_Heap_Walk+0x5d8> uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 754c: e31200ff tst r2, #255 ; 0xff if ( !_System_state_Is_up( _System_state_Get() ) ) { 7550: e5933000 ldr r3, [r3] uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 7554: e59f25c4 ldr r2, [pc, #1476] ; 7b20 <_Heap_Walk+0x5dc> 7558: e59f95c4 ldr r9, [pc, #1476] ; 7b24 <_Heap_Walk+0x5e0> bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 755c: e1a0a001 mov sl, r1 uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 7560: 11a09002 movne r9, r2 Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size; 7564: e5901010 ldr r1, [r0, #16] Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 7568: e3530003 cmp r3, #3 int source, bool dump ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 756c: e5902014 ldr r2, [r0, #20] Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; 7570: e5903024 ldr r3, [r0, #36] ; 0x24 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 7574: e24dd038 sub sp, sp, #56 ; 0x38 7578: e1a04000 mov r4, r0 uintptr_t const page_size = heap->page_size; 757c: e58d1024 str r1, [sp, #36] ; 0x24 uintptr_t const min_block_size = heap->min_block_size; 7580: e58d2028 str r2, [sp, #40] ; 0x28 Heap_Block *const first_block = heap->first_block; 7584: e5908020 ldr r8, [r0, #32] Heap_Block *const last_block = heap->last_block; 7588: e58d302c str r3, [sp, #44] ; 0x2c Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 758c: 0a000002 beq 759c <_Heap_Walk+0x58> } block = next_block; } while ( block != first_block ); return true; 7590: e3a00001 mov r0, #1 } 7594: e28dd038 add sp, sp, #56 ; 0x38 7598: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; (*printer)( 759c: e594101c ldr r1, [r4, #28] 75a0: e5900018 ldr r0, [r0, #24] 75a4: e2842008 add r2, r4, #8 75a8: e892000c ldm r2, {r2, r3} 75ac: e59dc028 ldr ip, [sp, #40] ; 0x28 75b0: e58d1008 str r1, [sp, #8] 75b4: e59d102c ldr r1, [sp, #44] ; 0x2c 75b8: e58d0004 str r0, [sp, #4] 75bc: e58d1010 str r1, [sp, #16] 75c0: e58d2014 str r2, [sp, #20] 75c4: e58d3018 str r3, [sp, #24] 75c8: e59f2558 ldr r2, [pc, #1368] ; 7b28 <_Heap_Walk+0x5e4> 75cc: e58dc000 str ip, [sp] 75d0: e58d800c str r8, [sp, #12] 75d4: e1a0000a mov r0, sl 75d8: e3a01000 mov r1, #0 75dc: e59d3024 ldr r3, [sp, #36] ; 0x24 75e0: e1a0e00f mov lr, pc 75e4: e12fff19 bx r9 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 75e8: e59d2024 ldr r2, [sp, #36] ; 0x24 75ec: e3520000 cmp r2, #0 75f0: 0a000026 beq 7690 <_Heap_Walk+0x14c> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 75f4: e59d3024 ldr r3, [sp, #36] ; 0x24 75f8: e2135003 ands r5, r3, #3 75fc: 1a00002a bne 76ac <_Heap_Walk+0x168> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 7600: e59d0028 ldr r0, [sp, #40] ; 0x28 7604: e59d1024 ldr r1, [sp, #36] ; 0x24 7608: ebffe564 bl ba0 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 760c: e250b000 subs fp, r0, #0 7610: 1a00002c bne 76c8 <_Heap_Walk+0x184> 7614: e2880008 add r0, r8, #8 7618: e59d1024 ldr r1, [sp, #36] ; 0x24 761c: ebffe55f bl ba0 <__umodsi3> ); return false; } if ( 7620: e2506000 subs r6, r0, #0 7624: 1a00002f bne 76e8 <_Heap_Walk+0x1a4> block = next_block; } while ( block != first_block ); return true; } 7628: e598b004 ldr fp, [r8, #4] ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 762c: e21b5001 ands r5, fp, #1 7630: 0a0000cd beq 796c <_Heap_Walk+0x428> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 7634: e59dc02c ldr ip, [sp, #44] ; 0x2c 7638: e59c3004 ldr r3, [ip, #4] 763c: e3c33001 bic r3, r3, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 7640: e08c3003 add r3, ip, r3 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 7644: e5935004 ldr r5, [r3, #4] ); return false; } if ( _Heap_Is_free( last_block ) ) { 7648: e2155001 ands r5, r5, #1 764c: 0a000008 beq 7674 <_Heap_Walk+0x130> ); return false; } if ( 7650: e1580003 cmp r8, r3 7654: 0a00002b beq 7708 <_Heap_Walk+0x1c4> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 7658: e1a0000a mov r0, sl <== NOT EXECUTED 765c: e3a01001 mov r1, #1 <== NOT EXECUTED 7660: e59f24c4 ldr r2, [pc, #1220] ; 7b2c <_Heap_Walk+0x5e8> <== NOT EXECUTED 7664: e1a0e00f mov lr, pc <== NOT EXECUTED 7668: e12fff19 bx r9 <== NOT EXECUTED if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 766c: e1a00006 mov r0, r6 <== NOT EXECUTED 7670: eaffffc7 b 7594 <_Heap_Walk+0x50> <== NOT EXECUTED return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 7674: e1a0000a mov r0, sl 7678: e3a01001 mov r1, #1 767c: e59f24ac ldr r2, [pc, #1196] ; 7b30 <_Heap_Walk+0x5ec> 7680: e1a0e00f mov lr, pc 7684: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7688: e1a00005 mov r0, r5 768c: eaffffc0 b 7594 <_Heap_Walk+0x50> first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 7690: e1a0000a mov r0, sl 7694: e3a01001 mov r1, #1 7698: e59f2494 ldr r2, [pc, #1172] ; 7b34 <_Heap_Walk+0x5f0> 769c: e1a0e00f mov lr, pc 76a0: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 76a4: e59d0024 ldr r0, [sp, #36] ; 0x24 76a8: eaffffb9 b 7594 <_Heap_Walk+0x50> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 76ac: e1a0000a mov r0, sl 76b0: e3a01001 mov r1, #1 76b4: e59f247c ldr r2, [pc, #1148] ; 7b38 <_Heap_Walk+0x5f4> 76b8: e1a0e00f mov lr, pc 76bc: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 76c0: e3a00000 mov r0, #0 76c4: eaffffb2 b 7594 <_Heap_Walk+0x50> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 76c8: e1a0000a mov r0, sl 76cc: e3a01001 mov r1, #1 76d0: e59f2464 ldr r2, [pc, #1124] ; 7b3c <_Heap_Walk+0x5f8> 76d4: e59d3028 ldr r3, [sp, #40] ; 0x28 76d8: e1a0e00f mov lr, pc 76dc: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 76e0: e1a00005 mov r0, r5 76e4: eaffffaa b 7594 <_Heap_Walk+0x50> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 76e8: e1a0000a mov r0, sl 76ec: e3a01001 mov r1, #1 76f0: e59f2448 ldr r2, [pc, #1096] ; 7b40 <_Heap_Walk+0x5fc> 76f4: e1a03008 mov r3, r8 76f8: e1a0e00f mov lr, pc 76fc: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7700: e1a0000b mov r0, fp 7704: eaffffa2 b 7594 <_Heap_Walk+0x50> block = next_block; } while ( block != first_block ); return true; } 7708: e5945008 ldr r5, [r4, #8] const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 770c: e1540005 cmp r4, r5 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 7710: e5947010 ldr r7, [r4, #16] const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 7714: 05943020 ldreq r3, [r4, #32] 7718: 0a00000d beq 7754 <_Heap_Walk+0x210> block = next_block; } while ( block != first_block ); return true; } 771c: e5943020 ldr r3, [r4, #32] const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 7720: e1530005 cmp r3, r5 7724: 9a000097 bls 7988 <_Heap_Walk+0x444> const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( 7728: e1a0000a mov r0, sl 772c: e3a01001 mov r1, #1 7730: e59f240c ldr r2, [pc, #1036] ; 7b44 <_Heap_Walk+0x600> 7734: e1a03005 mov r3, r5 7738: e1a0e00f mov lr, pc 773c: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7740: e3a00000 mov r0, #0 7744: eaffff92 b 7594 <_Heap_Walk+0x50> 7748: e1a03008 mov r3, r8 774c: e28d8030 add r8, sp, #48 ; 0x30 7750: e8980900 ldm r8, {r8, fp} ); return false; } if ( _Heap_Is_used( free_block ) ) { 7754: e1a06008 mov r6, r8 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 7758: e3cb7001 bic r7, fp, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 775c: e0875006 add r5, r7, r6 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 7760: e1530005 cmp r3, r5 7764: 9a000008 bls 778c <_Heap_Walk+0x248> Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 7768: e1a0000a mov r0, sl 776c: e58d5000 str r5, [sp] 7770: e3a01001 mov r1, #1 7774: e59f23cc ldr r2, [pc, #972] ; 7b48 <_Heap_Walk+0x604> 7778: e1a03006 mov r3, r6 777c: e1a0e00f mov lr, pc 7780: e12fff19 bx r9 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 7784: e3a00000 mov r0, #0 7788: eaffff81 b 7594 <_Heap_Walk+0x50> 778c: e5943024 ldr r3, [r4, #36] ; 0x24 7790: e1530005 cmp r3, r5 7794: 3afffff3 bcc 7768 <_Heap_Walk+0x224> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 7798: e59d1024 ldr r1, [sp, #36] ; 0x24 779c: e1a00007 mov r0, r7 77a0: ebffe4fe bl ba0 <__umodsi3> uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 77a4: e59d102c ldr r1, [sp, #44] ; 0x2c 77a8: e0563001 subs r3, r6, r1 77ac: 13a03001 movne r3, #1 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 77b0: e3500000 cmp r0, #0 77b4: 0a000001 beq 77c0 <_Heap_Walk+0x27c> 77b8: e3530000 cmp r3, #0 77bc: 1a0000aa bne 7a6c <_Heap_Walk+0x528> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 77c0: e59d2028 ldr r2, [sp, #40] ; 0x28 77c4: e1520007 cmp r2, r7 77c8: 9a000001 bls 77d4 <_Heap_Walk+0x290> 77cc: e3530000 cmp r3, #0 77d0: 1a0000ae bne 7a90 <_Heap_Walk+0x54c> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 77d4: e1560005 cmp r6, r5 77d8: 3a000001 bcc 77e4 <_Heap_Walk+0x2a0> 77dc: e3530000 cmp r3, #0 77e0: 1a0000b4 bne 7ab8 <_Heap_Walk+0x574> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 77e4: e5953004 ldr r3, [r5, #4] ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 77e8: e3130001 tst r3, #1 77ec: e20bb001 and fp, fp, #1 77f0: 0a000018 beq 7858 <_Heap_Walk+0x314> if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 77f4: e35b0000 cmp fp, #0 77f8: 0a00000c beq 7830 <_Heap_Walk+0x2ec> (*printer)( 77fc: e58d7000 str r7, [sp] 7800: e1a0000a mov r0, sl 7804: e3a01000 mov r1, #0 7808: e59f233c ldr r2, [pc, #828] ; 7b4c <_Heap_Walk+0x608> 780c: e1a03006 mov r3, r6 7810: e1a0e00f mov lr, pc 7814: e12fff19 bx r9 block->prev_size ); } block = next_block; } while ( block != first_block ); 7818: e1580005 cmp r8, r5 781c: 0affff5b beq 7590 <_Heap_Walk+0x4c> 7820: e595b004 ldr fp, [r5, #4] 7824: e5943020 ldr r3, [r4, #32] 7828: e1a06005 mov r6, r5 782c: eaffffc9 b 7758 <_Heap_Walk+0x214> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 7830: e58d7000 str r7, [sp] 7834: e5963000 ldr r3, [r6] 7838: e1a0000a mov r0, sl 783c: e58d3004 str r3, [sp, #4] 7840: e1a0100b mov r1, fp 7844: e59f2304 ldr r2, [pc, #772] ; 7b50 <_Heap_Walk+0x60c> 7848: e1a03006 mov r3, r6 784c: e1a0e00f mov lr, pc 7850: e12fff19 bx r9 7854: eaffffef b 7818 <_Heap_Walk+0x2d4> false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 7858: e596200c ldr r2, [r6, #12] Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 785c: e5943008 ldr r3, [r4, #8] 7860: e1530002 cmp r3, r2 block = next_block; } while ( block != first_block ); return true; } 7864: e594100c ldr r1, [r4, #12] Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 7868: 059f02e4 ldreq r0, [pc, #740] ; 7b54 <_Heap_Walk+0x610> 786c: 0a000003 beq 7880 <_Heap_Walk+0x33c> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 7870: e59f32e0 ldr r3, [pc, #736] ; 7b58 <_Heap_Walk+0x614> 7874: e1540002 cmp r4, r2 7878: e59f02dc ldr r0, [pc, #732] ; 7b5c <_Heap_Walk+0x618> 787c: 01a00003 moveq r0, r3 block->next, block->next == last_free_block ? 7880: e5963008 ldr r3, [r6, #8] Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 7884: e1510003 cmp r1, r3 7888: 059f12d0 ldreq r1, [pc, #720] ; 7b60 <_Heap_Walk+0x61c> 788c: 0a000003 beq 78a0 <_Heap_Walk+0x35c> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 7890: e59fc2cc ldr ip, [pc, #716] ; 7b64 <_Heap_Walk+0x620> 7894: e1540003 cmp r4, r3 7898: e59f12bc ldr r1, [pc, #700] ; 7b5c <_Heap_Walk+0x618> 789c: 01a0100c moveq r1, ip Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 78a0: e58d2004 str r2, [sp, #4] 78a4: e58d0008 str r0, [sp, #8] 78a8: e58d300c str r3, [sp, #12] 78ac: e58d1010 str r1, [sp, #16] 78b0: e1a03006 mov r3, r6 78b4: e58d7000 str r7, [sp] 78b8: e1a0000a mov r0, sl 78bc: e3a01000 mov r1, #0 78c0: e59f22a0 ldr r2, [pc, #672] ; 7b68 <_Heap_Walk+0x624> 78c4: e1a0e00f mov lr, pc 78c8: e12fff19 bx r9 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 78cc: e5953000 ldr r3, [r5] 78d0: e1570003 cmp r7, r3 78d4: 1a000011 bne 7920 <_Heap_Walk+0x3dc> ); return false; } if ( !prev_used ) { 78d8: e35b0000 cmp fp, #0 78dc: 0a00001a beq 794c <_Heap_Walk+0x408> block = next_block; } while ( block != first_block ); return true; } 78e0: e5943008 ldr r3, [r4, #8] ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { 78e4: e1540003 cmp r4, r3 78e8: 0a000004 beq 7900 <_Heap_Walk+0x3bc> if ( free_block == block ) { 78ec: e1560003 cmp r6, r3 78f0: 0affffc8 beq 7818 <_Heap_Walk+0x2d4> return true; } free_block = free_block->next; 78f4: e5933008 ldr r3, [r3, #8] ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { 78f8: e1540003 cmp r4, r3 78fc: 1afffffa bne 78ec <_Heap_Walk+0x3a8> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 7900: e1a0000a mov r0, sl 7904: e3a01001 mov r1, #1 7908: e59f225c ldr r2, [pc, #604] ; 7b6c <_Heap_Walk+0x628> 790c: e1a03006 mov r3, r6 7910: e1a0e00f mov lr, pc 7914: e12fff19 bx r9 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 7918: e3a00000 mov r0, #0 791c: eaffff1c b 7594 <_Heap_Walk+0x50> " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( 7920: e58d3004 str r3, [sp, #4] 7924: e1a0000a mov r0, sl 7928: e58d7000 str r7, [sp] 792c: e58d5008 str r5, [sp, #8] 7930: e3a01001 mov r1, #1 7934: e59f2234 ldr r2, [pc, #564] ; 7b70 <_Heap_Walk+0x62c> 7938: e1a03006 mov r3, r6 793c: e1a0e00f mov lr, pc 7940: e12fff19 bx r9 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 7944: e3a00000 mov r0, #0 7948: eaffff11 b 7594 <_Heap_Walk+0x50> return false; } if ( !prev_used ) { (*printer)( 794c: e1a0000a mov r0, sl 7950: e3a01001 mov r1, #1 7954: e59f2218 ldr r2, [pc, #536] ; 7b74 <_Heap_Walk+0x630> 7958: e1a03006 mov r3, r6 795c: e1a0e00f mov lr, pc 7960: e12fff19 bx r9 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 7964: e1a0000b mov r0, fp 7968: eaffff09 b 7594 <_Heap_Walk+0x50> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 796c: e1a0000a mov r0, sl 7970: e3a01001 mov r1, #1 7974: e59f21fc ldr r2, [pc, #508] ; 7b78 <_Heap_Walk+0x634> 7978: e1a0e00f mov lr, pc 797c: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7980: e1a00005 mov r0, r5 7984: eaffff02 b 7594 <_Heap_Walk+0x50> const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 7988: e594c024 ldr ip, [r4, #36] ; 0x24 798c: e15c0005 cmp ip, r5 7990: 3affff64 bcc 7728 <_Heap_Walk+0x1e4> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 7994: e2850008 add r0, r5, #8 7998: e1a01007 mov r1, r7 799c: e58d301c str r3, [sp, #28] 79a0: e58dc020 str ip, [sp, #32] 79a4: ebffe47d bl ba0 <__umodsi3> ); return false; } if ( 79a8: e3500000 cmp r0, #0 79ac: e28d301c add r3, sp, #28 79b0: e8931008 ldm r3, {r3, ip} 79b4: 1a000048 bne 7adc <_Heap_Walk+0x598> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 79b8: e5952004 ldr r2, [r5, #4] 79bc: e3c22001 bic r2, r2, #1 block = next_block; } while ( block != first_block ); return true; } 79c0: e0852002 add r2, r5, r2 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 79c4: e5922004 ldr r2, [r2, #4] ); return false; } if ( _Heap_Is_used( free_block ) ) { 79c8: e3120001 tst r2, #1 79cc: 1a00004a bne 7afc <_Heap_Walk+0x5b8> 79d0: e58d8030 str r8, [sp, #48] ; 0x30 79d4: e58db034 str fp, [sp, #52] ; 0x34 79d8: e1a01004 mov r1, r4 79dc: e1a06005 mov r6, r5 79e0: e1a0b00c mov fp, ip 79e4: e1a08003 mov r8, r3 79e8: ea000013 b 7a3c <_Heap_Walk+0x4f8> return false; } prev_block = free_block; free_block = free_block->next; 79ec: e5955008 ldr r5, [r5, #8] const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 79f0: e1540005 cmp r4, r5 79f4: 0affff53 beq 7748 <_Heap_Walk+0x204> const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 79f8: e1580005 cmp r8, r5 79fc: 8affff49 bhi 7728 <_Heap_Walk+0x1e4> 7a00: e155000b cmp r5, fp RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 7a04: e2850008 add r0, r5, #8 7a08: e1a01007 mov r1, r7 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 7a0c: 8affff45 bhi 7728 <_Heap_Walk+0x1e4> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 7a10: ebffe462 bl ba0 <__umodsi3> ); return false; } if ( 7a14: e3500000 cmp r0, #0 7a18: 1a00002f bne 7adc <_Heap_Walk+0x598> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 7a1c: e5953004 ldr r3, [r5, #4] 7a20: e3c33001 bic r3, r3, #1 block = next_block; } while ( block != first_block ); return true; } 7a24: e0833005 add r3, r3, r5 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 7a28: e5933004 ldr r3, [r3, #4] ); return false; } if ( _Heap_Is_used( free_block ) ) { 7a2c: e3130001 tst r3, #1 7a30: 1a000031 bne 7afc <_Heap_Walk+0x5b8> 7a34: e1a01006 mov r1, r6 7a38: e1a06005 mov r6, r5 ); return false; } if ( free_block->prev != prev_block ) { 7a3c: e595200c ldr r2, [r5, #12] 7a40: e1520001 cmp r2, r1 7a44: 0affffe8 beq 79ec <_Heap_Walk+0x4a8> (*printer)( 7a48: e58d2000 str r2, [sp] 7a4c: e1a0000a mov r0, sl 7a50: e3a01001 mov r1, #1 7a54: e59f2120 ldr r2, [pc, #288] ; 7b7c <_Heap_Walk+0x638> 7a58: e1a03005 mov r3, r5 7a5c: e1a0e00f mov lr, pc 7a60: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7a64: e3a00000 mov r0, #0 7a68: eafffec9 b 7594 <_Heap_Walk+0x50> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 7a6c: e1a0000a mov r0, sl 7a70: e58d7000 str r7, [sp] 7a74: e3a01001 mov r1, #1 7a78: e59f2100 ldr r2, [pc, #256] ; 7b80 <_Heap_Walk+0x63c> 7a7c: e1a03006 mov r3, r6 7a80: e1a0e00f mov lr, pc 7a84: e12fff19 bx r9 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 7a88: e3a00000 mov r0, #0 7a8c: eafffec0 b 7594 <_Heap_Walk+0x50> } if ( block_size < min_block_size && is_not_last_block ) { (*printer)( 7a90: e58d2004 str r2, [sp, #4] 7a94: e1a0000a mov r0, sl 7a98: e58d7000 str r7, [sp] 7a9c: e3a01001 mov r1, #1 7aa0: e59f20dc ldr r2, [pc, #220] ; 7b84 <_Heap_Walk+0x640> 7aa4: e1a03006 mov r3, r6 7aa8: e1a0e00f mov lr, pc 7aac: e12fff19 bx r9 block, block_size, min_block_size ); return false; 7ab0: e3a00000 mov r0, #0 7ab4: eafffeb6 b 7594 <_Heap_Walk+0x50> } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( 7ab8: e1a0000a mov r0, sl 7abc: e58d5000 str r5, [sp] 7ac0: e3a01001 mov r1, #1 7ac4: e59f20bc ldr r2, [pc, #188] ; 7b88 <_Heap_Walk+0x644> 7ac8: e1a03006 mov r3, r6 7acc: e1a0e00f mov lr, pc 7ad0: e12fff19 bx r9 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 7ad4: e3a00000 mov r0, #0 7ad8: eafffead b 7594 <_Heap_Walk+0x50> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 7adc: e1a0000a mov r0, sl 7ae0: e3a01001 mov r1, #1 7ae4: e59f20a0 ldr r2, [pc, #160] ; 7b8c <_Heap_Walk+0x648> 7ae8: e1a03005 mov r3, r5 7aec: e1a0e00f mov lr, pc 7af0: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7af4: e3a00000 mov r0, #0 7af8: eafffea5 b 7594 <_Heap_Walk+0x50> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 7afc: e1a0000a mov r0, sl 7b00: e3a01001 mov r1, #1 7b04: e59f2084 ldr r2, [pc, #132] ; 7b90 <_Heap_Walk+0x64c> 7b08: e1a03005 mov r3, r5 7b0c: e1a0e00f mov lr, pc 7b10: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7b14: e3a00000 mov r0, #0 7b18: eafffe9d b 7594 <_Heap_Walk+0x50> =============================================================================== 00006a38 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 6a38: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 6a3c: e5904034 ldr r4, [r0, #52] ; 0x34 6a40: e3540000 cmp r4, #0 */ void _Objects_Extend_information( Objects_Information *information ) { 6a44: e24dd014 sub sp, sp, #20 6a48: e1a05000 mov r5, r0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 6a4c: e1d070b8 ldrh r7, [r0, #8] index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 6a50: 0a00009b beq 6cc4 <_Objects_Extend_information+0x28c> block_count = 0; else { block_count = information->maximum / information->allocation_size; 6a54: e1d081b4 ldrh r8, [r0, #20] 6a58: e1d0a1b0 ldrh sl, [r0, #16] 6a5c: e1a01008 mov r1, r8 6a60: e1a0000a mov r0, sl 6a64: eb002627 bl 10308 <__aeabi_uidiv> 6a68: e1a03800 lsl r3, r0, #16 for ( ; block < block_count; block++ ) { 6a6c: e1b03823 lsrs r3, r3, #16 6a70: 0a000099 beq 6cdc <_Objects_Extend_information+0x2a4> if ( information->object_blocks[ block ] == NULL ) { 6a74: e5949000 ldr r9, [r4] 6a78: e3590000 cmp r9, #0 6a7c: 01a01008 moveq r1, r8 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 6a80: 01a06007 moveq r6, r7 index_base = minimum_index; block = 0; 6a84: 01a04009 moveq r4, r9 block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 6a88: 0a00000c beq 6ac0 <_Objects_Extend_information+0x88> 6a8c: e1a02004 mov r2, r4 6a90: e1a01008 mov r1, r8 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 6a94: e1a06007 mov r6, r7 index_base = minimum_index; block = 0; 6a98: e3a04000 mov r4, #0 6a9c: ea000002 b 6aac <_Objects_Extend_information+0x74> block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 6aa0: e5b29004 ldr r9, [r2, #4]! 6aa4: e3590000 cmp r9, #0 6aa8: 0a000004 beq 6ac0 <_Objects_Extend_information+0x88> if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 6aac: e2844001 add r4, r4, #1 6ab0: e1530004 cmp r3, r4 if ( information->object_blocks[ block ] == NULL ) { do_extend = false; break; } else index_base += information->allocation_size; 6ab4: e0866008 add r6, r6, r8 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 6ab8: 8afffff8 bhi 6aa0 <_Objects_Extend_information+0x68> /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 6abc: e3a09001 mov r9, #1 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 6ac0: e08aa001 add sl, sl, r1 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 6ac4: e35a0801 cmp sl, #65536 ; 0x10000 6ac8: 2a000063 bcs 6c5c <_Objects_Extend_information+0x224> /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { 6acc: e5d52012 ldrb r2, [r5, #18] /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 6ad0: e5950018 ldr r0, [r5, #24] if ( information->auto_extend ) { 6ad4: e3520000 cmp r2, #0 /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 6ad8: e0000091 mul r0, r1, r0 if ( information->auto_extend ) { 6adc: 1a000060 bne 6c64 <_Objects_Extend_information+0x22c> new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 6ae0: e58d3000 str r3, [sp] 6ae4: eb00080e bl 8b24 <_Workspace_Allocate_or_fatal_error> 6ae8: e59d3000 ldr r3, [sp] 6aec: e1a08000 mov r8, r0 } /* * Do we need to grow the tables? */ if ( do_extend ) { 6af0: e3590000 cmp r9, #0 6af4: 0a000039 beq 6be0 <_Objects_Extend_information+0x1a8> */ /* * Up the block count and maximum */ block_count++; 6af8: e283b001 add fp, r3, #1 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 6afc: e08b008b add r0, fp, fp, lsl #1 ((maximum + minimum_index) * sizeof(Objects_Control *)); 6b00: e08a0000 add r0, sl, r0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 6b04: e0800007 add r0, r0, r7 ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 6b08: e1a00100 lsl r0, r0, #2 6b0c: e58d3000 str r3, [sp] 6b10: eb0007f9 bl 8afc <_Workspace_Allocate> if ( !object_blocks ) { 6b14: e2509000 subs r9, r0, #0 6b18: e59d3000 ldr r3, [sp] 6b1c: 0a000073 beq 6cf0 <_Objects_Extend_information+0x2b8> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 6b20: e1d521b0 ldrh r2, [r5, #16] 6b24: e1570002 cmp r7, r2 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 6b28: e089c10b add ip, r9, fp, lsl #2 6b2c: e089b18b add fp, r9, fp, lsl #3 6b30: 3a000051 bcc 6c7c <_Objects_Extend_information+0x244> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 6b34: e3570000 cmp r7, #0 6b38: 13a02000 movne r2, #0 6b3c: 11a0100b movne r1, fp local_table[ index ] = NULL; 6b40: 11a00002 movne r0, r2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 6b44: 0a000003 beq 6b58 <_Objects_Extend_information+0x120> 6b48: e2822001 add r2, r2, #1 6b4c: e1570002 cmp r7, r2 local_table[ index ] = NULL; 6b50: e4810004 str r0, [r1], #4 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 6b54: 8afffffb bhi 6b48 <_Objects_Extend_information+0x110> 6b58: e1a03103 lsl r3, r3, #2 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 6b5c: e1d511b4 ldrh r1, [r5, #20] 6b60: e0861001 add r1, r6, r1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 6b64: e3a00000 mov r0, #0 inactive_per_block[block_count] = 0; for ( index=index_base ; 6b68: e1560001 cmp r6, r1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 6b6c: e7890003 str r0, [r9, r3] inactive_per_block[block_count] = 0; 6b70: e78c0003 str r0, [ip, r3] for ( index=index_base ; 6b74: 2a000005 bcs 6b90 <_Objects_Extend_information+0x158> 6b78: e08b2106 add r2, fp, r6, lsl #2 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 6b7c: e1a03006 mov r3, r6 object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 6b80: e2833001 add r3, r3, #1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 6b84: e1530001 cmp r3, r1 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 6b88: e4820004 str r0, [r2], #4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 6b8c: 3afffffb bcc 6b80 <_Objects_Extend_information+0x148> 6b90: e10f3000 mrs r3, CPSR 6b94: e3832080 orr r2, r3, #128 ; 0x80 6b98: e129f002 msr CPSR_fc, r2 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 6b9c: e5952000 ldr r2, [r5] information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 6ba0: e1d510b4 ldrh r1, [r5, #4] 6ba4: e1a02c02 lsl r2, r2, #24 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 6ba8: e1a0a80a lsl sl, sl, #16 6bac: e3822801 orr r2, r2, #65536 ; 0x10000 6bb0: e1a0a82a lsr sl, sl, #16 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 6bb4: e1822d81 orr r2, r2, r1, lsl #27 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 6bb8: e182200a orr r2, r2, sl local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 6bbc: e5950034 ldr r0, [r5, #52] ; 0x34 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 6bc0: e585c030 str ip, [r5, #48] ; 0x30 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 6bc4: e5859034 str r9, [r5, #52] ; 0x34 information->inactive_per_block = inactive_per_block; information->local_table = local_table; 6bc8: e585b01c str fp, [r5, #28] information->maximum = (Objects_Maximum) maximum; 6bcc: e1c5a1b0 strh sl, [r5, #16] information->maximum_id = _Objects_Build_id( 6bd0: e585200c str r2, [r5, #12] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 6bd4: e129f003 msr CPSR_fc, r3 information->maximum ); _ISR_Enable( level ); if ( old_tables ) 6bd8: e3500000 cmp r0, #0 _Workspace_Free( old_tables ); 6bdc: 1b0007cc blne 8b14 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 6be0: e5953034 ldr r3, [r5, #52] ; 0x34 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 6be4: e28d7008 add r7, sp, #8 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 6be8: e7838104 str r8, [r3, r4, lsl #2] /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 6bec: e1a01008 mov r1, r8 6bf0: e1a00007 mov r0, r7 6bf4: e1d521b4 ldrh r2, [r5, #20] 6bf8: e5953018 ldr r3, [r5, #24] 6bfc: eb000fc3 bl ab10 <_Chain_Initialize> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 6c00: e1a04104 lsl r4, r4, #2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 6c04: e2858020 add r8, r5, #32 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 6c08: ea000009 b 6c34 <_Objects_Extend_information+0x1fc> 6c0c: e5953000 ldr r3, [r5] the_object->id = _Objects_Build_id( 6c10: e1d520b4 ldrh r2, [r5, #4] 6c14: e1a03c03 lsl r3, r3, #24 6c18: e3833801 orr r3, r3, #65536 ; 0x10000 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 6c1c: e1833d82 orr r3, r3, r2, lsl #27 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 6c20: e1833006 orr r3, r3, r6 6c24: e5813008 str r3, [r1, #8] information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 6c28: e1a00008 mov r0, r8 6c2c: ebfffce3 bl 5fc0 <_Chain_Append> index++; 6c30: e2866001 add r6, r6, #1 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 6c34: e1a00007 mov r0, r7 6c38: ebfffcf3 bl 600c <_Chain_Get> 6c3c: e2501000 subs r1, r0, #0 6c40: 1afffff1 bne 6c0c <_Objects_Extend_information+0x1d4> index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 6c44: e1d522bc ldrh r2, [r5, #44] ; 0x2c _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 6c48: e1d531b4 ldrh r3, [r5, #20] 6c4c: e5951030 ldr r1, [r5, #48] ; 0x30 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 6c50: e0832002 add r2, r3, r2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 6c54: e7813004 str r3, [r1, r4] information->inactive = 6c58: e1c522bc strh r2, [r5, #44] ; 0x2c (Objects_Maximum)(information->inactive + information->allocation_size); } 6c5c: e28dd014 add sp, sp, #20 6c60: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); 6c64: e58d3000 str r3, [sp] 6c68: eb0007a3 bl 8afc <_Workspace_Allocate> if ( !new_object_block ) 6c6c: e2508000 subs r8, r0, #0 6c70: e59d3000 ldr r3, [sp] 6c74: 1affff9d bne 6af0 <_Objects_Extend_information+0xb8> 6c78: eafffff7 b 6c5c <_Objects_Extend_information+0x224> /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 6c7c: e1a03103 lsl r3, r3, #2 6c80: e5951034 ldr r1, [r5, #52] ; 0x34 6c84: e1a02003 mov r2, r3 6c88: e88d1008 stm sp, {r3, ip} 6c8c: eb001a1c bl d504 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 6c90: e89d1008 ldm sp, {r3, ip} 6c94: e1a0000c mov r0, ip 6c98: e1a02003 mov r2, r3 6c9c: e5951030 ldr r1, [r5, #48] ; 0x30 6ca0: eb001a17 bl d504 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 6ca4: e1d521b0 ldrh r2, [r5, #16] 6ca8: e0872002 add r2, r7, r2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 6cac: e1a0000b mov r0, fp 6cb0: e595101c ldr r1, [r5, #28] 6cb4: e1a02102 lsl r2, r2, #2 6cb8: eb001a11 bl d504 6cbc: e89d1008 ldm sp, {r3, ip} 6cc0: eaffffa5 b 6b5c <_Objects_Extend_information+0x124> minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 6cc4: e1d0a1b0 ldrh sl, [r0, #16] 6cc8: e1d011b4 ldrh r1, [r0, #20] /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 6ccc: e1a06007 mov r6, r7 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 6cd0: e3a09001 mov r9, #1 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 6cd4: e1a03004 mov r3, r4 6cd8: eaffff78 b 6ac0 <_Objects_Extend_information+0x88> else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 6cdc: e1a01008 mov r1, r8 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 6ce0: e1a06007 mov r6, r7 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 6ce4: e3a09001 mov r9, #1 <== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 6ce8: e1a04003 mov r4, r3 <== NOT EXECUTED 6cec: eaffff73 b 6ac0 <_Objects_Extend_information+0x88> <== NOT EXECUTED (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 6cf0: e1a00008 mov r0, r8 6cf4: eb000786 bl 8b14 <_Workspace_Free> return; 6cf8: eaffffd7 b 6c5c <_Objects_Extend_information+0x224> =============================================================================== 00007034 <_Objects_Shrink_information>: */ void _Objects_Shrink_information( Objects_Information *information ) { 7034: e92d40f0 push {r4, r5, r6, r7, lr} /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 7038: e1d040b8 ldrh r4, [r0, #8] block_count = (information->maximum - index_base) / 703c: e1d051b4 ldrh r5, [r0, #20] */ void _Objects_Shrink_information( Objects_Information *information ) { 7040: e1a06000 mov r6, r0 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / 7044: e1d001b0 ldrh r0, [r0, #16] 7048: e1a01005 mov r1, r5 704c: e0640000 rsb r0, r4, r0 7050: eb0024ac bl 10308 <__aeabi_uidiv> information->allocation_size; for ( block = 0; block < block_count; block++ ) { 7054: e3500000 cmp r0, #0 7058: 08bd80f0 popeq {r4, r5, r6, r7, pc} if ( information->inactive_per_block[ block ] == 705c: e5962030 ldr r2, [r6, #48] ; 0x30 7060: e5923000 ldr r3, [r2] 7064: e1550003 cmp r5, r3 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 7068: 13a03000 movne r3, #0 if ( information->inactive_per_block[ block ] == 706c: 1a000005 bne 7088 <_Objects_Shrink_information+0x54> 7070: ea000008 b 7098 <_Objects_Shrink_information+0x64> <== NOT EXECUTED 7074: e5b21004 ldr r1, [r2, #4]! 7078: e1550001 cmp r5, r1 information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 707c: e0844005 add r4, r4, r5 7080: e1a07103 lsl r7, r3, #2 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 7084: 0a000004 beq 709c <_Objects_Shrink_information+0x68> index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 7088: e2833001 add r3, r3, #1 708c: e1500003 cmp r0, r3 7090: 8afffff7 bhi 7074 <_Objects_Shrink_information+0x40> 7094: e8bd80f0 pop {r4, r5, r6, r7, pc} if ( information->inactive_per_block[ block ] == 7098: e3a07000 mov r7, #0 <== NOT EXECUTED information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; 709c: e5960020 ldr r0, [r6, #32] 70a0: ea000002 b 70b0 <_Objects_Shrink_information+0x7c> if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 70a4: e3550000 cmp r5, #0 70a8: 0a00000b beq 70dc <_Objects_Shrink_information+0xa8> index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 70ac: e1a00005 mov r0, r5 * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; do { index = _Objects_Get_index( the_object->id ); 70b0: e1d030b8 ldrh r3, [r0, #8] /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 70b4: e1530004 cmp r3, r4 index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 70b8: e5905000 ldr r5, [r0] if ((index >= index_base) && 70bc: 3afffff8 bcc 70a4 <_Objects_Shrink_information+0x70> (index < (index_base + information->allocation_size))) { 70c0: e1d621b4 ldrh r2, [r6, #20] 70c4: e0842002 add r2, r4, r2 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 70c8: e1530002 cmp r3, r2 70cc: 2afffff4 bcs 70a4 <_Objects_Shrink_information+0x70> (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 70d0: ebfffbc5 bl 5fec <_Chain_Extract> } } while ( the_object ); 70d4: e3550000 cmp r5, #0 70d8: 1afffff3 bne 70ac <_Objects_Shrink_information+0x78> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 70dc: e5963034 ldr r3, [r6, #52] ; 0x34 70e0: e7930007 ldr r0, [r3, r7] 70e4: eb00068a bl 8b14 <_Workspace_Free> information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 70e8: e1d602bc ldrh r0, [r6, #44] ; 0x2c 70ec: e1d631b4 ldrh r3, [r6, #20] /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 70f0: e5961034 ldr r1, [r6, #52] ; 0x34 information->inactive_per_block[ block ] = 0; 70f4: e5962030 ldr r2, [r6, #48] ; 0x30 information->inactive -= information->allocation_size; 70f8: e0633000 rsb r3, r3, r0 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 70fc: e7815007 str r5, [r1, r7] information->inactive_per_block[ block ] = 0; 7100: e7825007 str r5, [r2, r7] information->inactive -= information->allocation_size; 7104: e1c632bc strh r3, [r6, #44] ; 0x2c return; 7108: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 000066a8 <_TOD_Validate>: { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 66a8: e59f30b8 ldr r3, [pc, #184] ; 6768 <_TOD_Validate+0xc0> */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 66ac: e92d4010 push {r4, lr} uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 66b0: e2504000 subs r4, r0, #0 { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 66b4: e593100c ldr r1, [r3, #12] (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 66b8: 01a00004 moveq r0, r4 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 66bc: 08bd8010 popeq {r4, pc} ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 66c0: e3a0093d mov r0, #999424 ; 0xf4000 66c4: e2800d09 add r0, r0, #576 ; 0x240 66c8: eb00454f bl 17c0c <__aeabi_uidiv> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 66cc: e5943018 ldr r3, [r4, #24] 66d0: e1500003 cmp r0, r3 66d4: 9a00001f bls 6758 <_TOD_Validate+0xb0> (the_tod->ticks >= ticks_per_second) || 66d8: e5943014 ldr r3, [r4, #20] 66dc: e353003b cmp r3, #59 ; 0x3b 66e0: 8a00001c bhi 6758 <_TOD_Validate+0xb0> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 66e4: e5943010 ldr r3, [r4, #16] 66e8: e353003b cmp r3, #59 ; 0x3b 66ec: 8a000019 bhi 6758 <_TOD_Validate+0xb0> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 66f0: e594300c ldr r3, [r4, #12] 66f4: e3530017 cmp r3, #23 66f8: 8a000016 bhi 6758 <_TOD_Validate+0xb0> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 66fc: e5940004 ldr r0, [r4, #4] rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 6700: e3500000 cmp r0, #0 6704: 08bd8010 popeq {r4, pc} (the_tod->month == 0) || 6708: e350000c cmp r0, #12 670c: 8a000011 bhi 6758 <_TOD_Validate+0xb0> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 6710: e5942000 ldr r2, [r4] (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 6714: e3a03d1f mov r3, #1984 ; 0x7c0 6718: e2833003 add r3, r3, #3 671c: e1520003 cmp r2, r3 6720: 9a00000c bls 6758 <_TOD_Validate+0xb0> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 6724: e5944008 ldr r4, [r4, #8] (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 6728: e3540000 cmp r4, #0 672c: 0a00000b beq 6760 <_TOD_Validate+0xb8> (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 6730: e3120003 tst r2, #3 days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 6734: 059f3030 ldreq r3, [pc, #48] ; 676c <_TOD_Validate+0xc4> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 6738: 159f302c ldrne r3, [pc, #44] ; 676c <_TOD_Validate+0xc4> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 673c: 0280000d addeq r0, r0, #13 6740: 07930100 ldreq r0, [r3, r0, lsl #2] else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 6744: 17930100 ldrne r0, [r3, r0, lsl #2] * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 6748: e1500004 cmp r0, r4 674c: 33a00000 movcc r0, #0 6750: 23a00001 movcs r0, #1 6754: e8bd8010 pop {r4, pc} (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 6758: e3a00000 mov r0, #0 675c: e8bd8010 pop {r4, pc} 6760: e1a00004 mov r0, r4 <== NOT EXECUTED if ( the_tod->day > days_in_month ) return false; return true; } 6764: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== 00007ca8 <_Thread_queue_Enqueue_priority>: Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 7ca8: e5913014 ldr r3, [r1, #20] Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 7cac: e92d0ff0 push {r4, r5, r6, r7, r8, r9, sl, fp} 7cb0: e281403c add r4, r1, #60 ; 0x3c Chain_Node *previous_node; Chain_Node *search_node; Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); 7cb4: e281c038 add ip, r1, #56 ; 0x38 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 7cb8: e5814038 str r4, [r1, #56] ; 0x38 priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 7cbc: e3130020 tst r3, #32 the_chain->permanent_null = NULL; 7cc0: e3a04000 mov r4, #0 7cc4: e581403c str r4, [r1, #60] ; 0x3c the_chain->last = _Chain_Head(the_chain); 7cc8: e581c040 str ip, [r1, #64] ; 0x40 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 7ccc: e1a08323 lsr r8, r3, #6 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; 7cd0: e5905038 ldr r5, [r0, #56] ; 0x38 if ( _Thread_queue_Is_reverse_search( priority ) ) 7cd4: 1a00001f bne 7d58 <_Thread_queue_Enqueue_priority+0xb0> goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; 7cd8: e0888088 add r8, r8, r8, lsl #1 7cdc: e1a09108 lsl r9, r8, #2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 7ce0: e2898004 add r8, r9, #4 7ce4: e0808008 add r8, r0, r8 7ce8: e0809009 add r9, r0, r9 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 7cec: e10f7000 mrs r7, CPSR 7cf0: e387c080 orr ip, r7, #128 ; 0x80 7cf4: e129f00c msr CPSR_fc, ip 7cf8: e1a0a007 mov sl, r7 7cfc: e599c000 ldr ip, [r9] while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 7d00: e15c0008 cmp ip, r8 7d04: 1a000009 bne 7d30 <_Thread_queue_Enqueue_priority+0x88> 7d08: ea000054 b 7e60 <_Thread_queue_Enqueue_priority+0x1b8> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 7d0c: e10f6000 mrs r6, CPSR 7d10: e129f007 msr CPSR_fc, r7 7d14: e129f006 msr CPSR_fc, r6 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 7d18: e59c6010 ldr r6, [ip, #16] search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { 7d1c: e1150006 tst r5, r6 7d20: 0a000036 beq 7e00 <_Thread_queue_Enqueue_priority+0x158> _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 7d24: e59cc000 ldr ip, [ip] restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 7d28: e15c0008 cmp ip, r8 7d2c: 0a000002 beq 7d3c <_Thread_queue_Enqueue_priority+0x94> search_priority = search_thread->current_priority; 7d30: e59c4014 ldr r4, [ip, #20] if ( priority <= search_priority ) 7d34: e1530004 cmp r3, r4 7d38: 8afffff3 bhi 7d0c <_Thread_queue_Enqueue_priority+0x64> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 7d3c: e5905030 ldr r5, [r0, #48] ; 0x30 7d40: e3550001 cmp r5, #1 7d44: 0a00002f beq 7e08 <_Thread_queue_Enqueue_priority+0x160> * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 7d48: e582a000 str sl, [r2] return the_thread_queue->sync_state; } 7d4c: e1a00005 mov r0, r5 7d50: e8bd0ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp} 7d54: e12fff1e bx lr _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 7d58: e0888088 add r8, r8, r8, lsl #1 7d5c: e0808108 add r8, r0, r8, lsl #2 7d60: e59f9100 ldr r9, [pc, #256] ; 7e68 <_Thread_queue_Enqueue_priority+0x1c0> restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; 7d64: e1a0b008 mov fp, r8 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 7d68: e5d94000 ldrb r4, [r9] 7d6c: e2844001 add r4, r4, #1 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 7d70: e10f7000 mrs r7, CPSR 7d74: e387c080 orr ip, r7, #128 ; 0x80 7d78: e129f00c msr CPSR_fc, ip 7d7c: e1a0a007 mov sl, r7 _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; 7d80: e59bc008 ldr ip, [fp, #8] while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 7d84: e15c0008 cmp ip, r8 7d88: 1a000009 bne 7db4 <_Thread_queue_Enqueue_priority+0x10c> 7d8c: ea00000b b 7dc0 <_Thread_queue_Enqueue_priority+0x118> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 7d90: e10f6000 mrs r6, CPSR 7d94: e129f007 msr CPSR_fc, r7 7d98: e129f006 msr CPSR_fc, r6 7d9c: e59c6010 ldr r6, [ip, #16] search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { 7da0: e1150006 tst r5, r6 7da4: 0a000013 beq 7df8 <_Thread_queue_Enqueue_priority+0x150> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 7da8: e59cc004 ldr ip, [ip, #4] restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 7dac: e15c0008 cmp ip, r8 7db0: 0a000002 beq 7dc0 <_Thread_queue_Enqueue_priority+0x118> search_priority = search_thread->current_priority; 7db4: e59c4014 ldr r4, [ip, #20] if ( priority >= search_priority ) 7db8: e1530004 cmp r3, r4 7dbc: 3afffff3 bcc 7d90 <_Thread_queue_Enqueue_priority+0xe8> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 7dc0: e5905030 ldr r5, [r0, #48] ; 0x30 7dc4: e3550001 cmp r5, #1 7dc8: 1affffde bne 7d48 <_Thread_queue_Enqueue_priority+0xa0> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 7dcc: e1530004 cmp r3, r4 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 7dd0: e3a03000 mov r3, #0 7dd4: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 7dd8: 0a000016 beq 7e38 <_Thread_queue_Enqueue_priority+0x190> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 7ddc: e59c3000 ldr r3, [ip] the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 7de0: e8811008 stm r1, {r3, ip} search_node->next = the_node; next_node->previous = the_node; 7de4: e5831004 str r1, [r3, #4] next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 7de8: e58c1000 str r1, [ip] next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 7dec: e5810044 str r0, [r1, #68] ; 0x44 static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 7df0: e129f007 msr CPSR_fc, r7 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 7df4: eaffffd4 b 7d4c <_Thread_queue_Enqueue_priority+0xa4> 7df8: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED 7dfc: eaffffd9 b 7d68 <_Thread_queue_Enqueue_priority+0xc0> <== NOT EXECUTED 7e00: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED 7e04: eaffffb8 b 7cec <_Thread_queue_Enqueue_priority+0x44> <== NOT EXECUTED THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 7e08: e1530004 cmp r3, r4 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 7e0c: e3a03000 mov r3, #0 7e10: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 7e14: 0a000007 beq 7e38 <_Thread_queue_Enqueue_priority+0x190> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 7e18: e59c3004 ldr r3, [ip, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 7e1c: e581c000 str ip, [r1] the_node->previous = previous_node; 7e20: e5813004 str r3, [r1, #4] previous_node->next = the_node; 7e24: e5831000 str r1, [r3] search_node->previous = the_node; 7e28: e58c1004 str r1, [ip, #4] the_thread->Wait.queue = the_thread_queue; 7e2c: e5810044 str r0, [r1, #68] ; 0x44 7e30: e129f007 msr CPSR_fc, r7 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 7e34: eaffffc4 b 7d4c <_Thread_queue_Enqueue_priority+0xa4> 7e38: e28cc03c add ip, ip, #60 ; 0x3c _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 7e3c: e59c3004 ldr r3, [ip, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 7e40: e581c000 str ip, [r1] the_node->previous = previous_node; 7e44: e5813004 str r3, [r1, #4] previous_node->next = the_node; 7e48: e5831000 str r1, [r3] search_node->previous = the_node; 7e4c: e58c1004 str r1, [ip, #4] the_thread->Wait.queue = the_thread_queue; 7e50: e5810044 str r0, [r1, #68] ; 0x44 7e54: e129f00a msr CPSR_fc, sl _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 7e58: e3a05001 mov r5, #1 7e5c: eaffffba b 7d4c <_Thread_queue_Enqueue_priority+0xa4> if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 7e60: e3e04000 mvn r4, #0 7e64: eaffffb4 b 7d3c <_Thread_queue_Enqueue_priority+0x94> =============================================================================== 0000b2b8 <_Thread_queue_Extract_priority_helper>: void _Thread_queue_Extract_priority_helper( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread, bool requeuing ) { b2b8: e92d4070 push {r4, r5, r6, lr} b2bc: e20220ff and r2, r2, #255 ; 0xff b2c0: e1a04001 mov r4, r1 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( b2c4: e10f1000 mrs r1, CPSR b2c8: e3813080 orr r3, r1, #128 ; 0x80 b2cc: e129f003 msr CPSR_fc, r3 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); b2d0: e5943010 ldr r3, [r4, #16] b2d4: e3c334ff bic r3, r3, #-16777216 ; 0xff000000 b2d8: e3c3373f bic r3, r3, #16515072 ; 0xfc0000 b2dc: e3c33c41 bic r3, r3, #16640 ; 0x4100 b2e0: e3c3301f bic r3, r3, #31 Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { b2e4: e3530000 cmp r3, #0 b2e8: 0a000023 beq b37c <_Thread_queue_Extract_priority_helper+0xc4> */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); b2ec: e5943038 ldr r3, [r4, #56] ; 0x38 /* * The thread was actually waiting on a thread queue so let's remove it. */ next_node = the_node->next; b2f0: e594c000 ldr ip, [r4] previous_node = the_node->previous; b2f4: e5945004 ldr r5, [r4, #4] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; b2f8: e284003c add r0, r4, #60 ; 0x3c if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { b2fc: e1530000 cmp r3, r0 new_first_thread->Wait.Block2n.last = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; b300: 0585c000 streq ip, [r5] next_node->previous = previous_node; b304: 058c5004 streq r5, [ip, #4] */ next_node = the_node->next; previous_node = the_node->previous; if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { b308: 0a00000d beq b344 <_Thread_queue_Extract_priority_helper+0x8c> new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; b30c: e5940040 ldr r0, [r4, #64] ; 0x40 previous_node->next = new_first_node; next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { b310: e1500003 cmp r0, r3 if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; b314: e5936000 ldr r6, [r3] previous_node->next = new_first_node; next_node->previous = new_first_node; b318: e58c3004 str r3, [ip, #4] new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; b31c: e5853000 str r3, [r5] next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; b320: e5835004 str r5, [r3, #4] last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; next_node->previous = new_first_node; new_first_node->next = next_node; b324: e583c000 str ip, [r3] new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { b328: 0a000005 beq b344 <_Thread_queue_Extract_priority_helper+0x8c> /* > two threads on 2-n */ new_second_node->previous = _Chain_Head( &new_first_thread->Wait.Block2n ); b32c: e2835038 add r5, r3, #56 ; 0x38 b330: e283c03c add ip, r3, #60 ; 0x3c new_first_node->next = next_node; new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ new_second_node->previous = b334: e5865004 str r5, [r6, #4] _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; b338: e5836038 str r6, [r3, #56] ; 0x38 new_first_thread->Wait.Block2n.last = last_node; b33c: e5830040 str r0, [r3, #64] ; 0x40 last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); b340: e580c000 str ip, [r0] /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { b344: e3520000 cmp r2, #0 b348: 1a000009 bne b374 <_Thread_queue_Extract_priority_helper+0xbc> _ISR_Enable( level ); return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { b34c: e5943050 ldr r3, [r4, #80] ; 0x50 b350: e3530002 cmp r3, #2 b354: 0a00000a beq b384 <_Thread_queue_Extract_priority_helper+0xcc> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( b358: e129f001 msr CPSR_fc, r1 b35c: e3a01201 mov r1, #268435456 ; 0x10000000 b360: e2811bff add r1, r1, #261120 ; 0x3fc00 b364: e1a00004 mov r0, r4 b368: e2811ffe add r1, r1, #1016 ; 0x3f8 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } b36c: e8bd4070 pop {r4, r5, r6, lr} b370: eafff002 b 7380 <_Thread_Clear_state> b374: e129f001 msr CPSR_fc, r1 b378: e8bd8070 pop {r4, r5, r6, pc} b37c: e129f001 msr CPSR_fc, r1 b380: e8bd8070 pop {r4, r5, r6, pc} b384: e3a03003 mov r3, #3 <== NOT EXECUTED b388: e5843050 str r3, [r4, #80] ; 0x50 <== NOT EXECUTED b38c: e129f001 msr CPSR_fc, r1 <== NOT EXECUTED if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); b390: e2840048 add r0, r4, #72 ; 0x48 <== NOT EXECUTED b394: ebfff56f bl 8958 <_Watchdog_Remove> <== NOT EXECUTED b398: eaffffef b b35c <_Thread_queue_Extract_priority_helper+0xa4><== NOT EXECUTED =============================================================================== 00015f94 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 15f94: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 15f98: e24dd024 sub sp, sp, #36 ; 0x24 15f9c: e28d700c add r7, sp, #12 15fa0: e28d2018 add r2, sp, #24 15fa4: e282a004 add sl, r2, #4 15fa8: e2872004 add r2, r7, #4 15fac: e58d2000 str r2, [sp] Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 15fb0: e28d2018 add r2, sp, #24 15fb4: e58d2020 str r2, [sp, #32] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 15fb8: e59d2000 ldr r2, [sp] 15fbc: e58d200c str r2, [sp, #12] 15fc0: e2802008 add r2, r0, #8 the_chain->permanent_null = NULL; 15fc4: e3a03000 mov r3, #0 15fc8: e58d2004 str r2, [sp, #4] 15fcc: e2802040 add r2, r0, #64 ; 0x40 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 15fd0: e58da018 str sl, [sp, #24] the_chain->permanent_null = NULL; 15fd4: e58d301c str r3, [sp, #28] 15fd8: e58d3010 str r3, [sp, #16] the_chain->last = _Chain_Head(the_chain); 15fdc: e58d7014 str r7, [sp, #20] 15fe0: e59f91a8 ldr r9, [pc, #424] ; 16190 <_Timer_server_Body+0x1fc> 15fe4: e59fb1a8 ldr fp, [pc, #424] ; 16194 <_Timer_server_Body+0x200> 15fe8: e58d2008 str r2, [sp, #8] 15fec: e1a04000 mov r4, r0 15ff0: e2806030 add r6, r0, #48 ; 0x30 15ff4: e2808068 add r8, r0, #104 ; 0x68 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 15ff8: e28d3018 add r3, sp, #24 15ffc: e5843078 str r3, [r4, #120] ; 0x78 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 16000: e5993000 ldr r3, [r9] /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 16004: e594103c ldr r1, [r4, #60] ; 0x3c watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 16008: e1a02007 mov r2, r7 1600c: e1a00006 mov r0, r6 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 16010: e584303c str r3, [r4, #60] ; 0x3c _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 16014: e0611003 rsb r1, r1, r3 16018: eb001158 bl 1a580 <_Watchdog_Adjust_to_chain> static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 1601c: e59b5000 ldr r5, [fp] Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 16020: e5942074 ldr r2, [r4, #116] ; 0x74 /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 16024: e1550002 cmp r5, r2 16028: 8a000022 bhi 160b8 <_Timer_server_Body+0x124> * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 1602c: 3a000018 bcc 16094 <_Timer_server_Body+0x100> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 16030: e5845074 str r5, [r4, #116] ; 0x74 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 16034: e5940078 ldr r0, [r4, #120] ; 0x78 16038: eb0002bd bl 16b34 <_Chain_Get> if ( timer == NULL ) { 1603c: e2501000 subs r1, r0, #0 16040: 0a00000b beq 16074 <_Timer_server_Body+0xe0> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 16044: e5913038 ldr r3, [r1, #56] ; 0x38 16048: e3530001 cmp r3, #1 1604c: 0a000015 beq 160a8 <_Timer_server_Body+0x114> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 16050: e3530003 cmp r3, #3 16054: 1afffff6 bne 16034 <_Timer_server_Body+0xa0> _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 16058: e2811010 add r1, r1, #16 1605c: e1a00008 mov r0, r8 16060: eb001170 bl 1a628 <_Watchdog_Insert> } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 16064: e5940078 ldr r0, [r4, #120] ; 0x78 16068: eb0002b1 bl 16b34 <_Chain_Get> if ( timer == NULL ) { 1606c: e2501000 subs r1, r0, #0 16070: 1afffff3 bne 16044 <_Timer_server_Body+0xb0> static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 16074: e10f2000 mrs r2, CPSR 16078: e3823080 orr r3, r2, #128 ; 0x80 1607c: e129f003 msr CPSR_fc, r3 * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { 16080: e59d3018 ldr r3, [sp, #24] 16084: e15a0003 cmp sl, r3 16088: 0a00000f beq 160cc <_Timer_server_Body+0x138> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 1608c: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED 16090: eaffffda b 16000 <_Timer_server_Body+0x6c> <== NOT EXECUTED /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 16094: e1a00008 mov r0, r8 16098: e3a01001 mov r1, #1 1609c: e0652002 rsb r2, r5, r2 160a0: eb001107 bl 1a4c4 <_Watchdog_Adjust> 160a4: eaffffe1 b 16030 <_Timer_server_Body+0x9c> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 160a8: e1a00006 mov r0, r6 160ac: e2811010 add r1, r1, #16 160b0: eb00115c bl 1a628 <_Watchdog_Insert> 160b4: eaffffde b 16034 <_Timer_server_Body+0xa0> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 160b8: e0621005 rsb r1, r2, r5 160bc: e1a00008 mov r0, r8 160c0: e1a02007 mov r2, r7 160c4: eb00112d bl 1a580 <_Watchdog_Adjust_to_chain> 160c8: eaffffd8 b 16030 <_Timer_server_Body+0x9c> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 160cc: e5841078 str r1, [r4, #120] ; 0x78 160d0: e129f002 msr CPSR_fc, r2 _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 160d4: e59d300c ldr r3, [sp, #12] 160d8: e59d2000 ldr r2, [sp] 160dc: e1520003 cmp r2, r3 160e0: 0a000015 beq 1613c <_Timer_server_Body+0x1a8> 160e4: e1a05004 mov r5, r4 160e8: e59d4000 ldr r4, [sp] 160ec: ea000009 b 16118 <_Timer_server_Body+0x184> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 160f0: e5932000 ldr r2, [r3] the_chain->first = new_first; new_first->previous = _Chain_Head(the_chain); 160f4: e5827004 str r7, [r2, #4] Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; the_chain->first = new_first; 160f8: e58d200c str r2, [sp, #12] * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 160fc: e3a02000 mov r2, #0 16100: e5832008 str r2, [r3, #8] 16104: e129f001 msr CPSR_fc, r1 /* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); 16108: e2830020 add r0, r3, #32 1610c: e8900003 ldm r0, {r0, r1} 16110: e1a0e00f mov lr, pc 16114: e593f01c ldr pc, [r3, #28] static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 16118: e10f1000 mrs r1, CPSR 1611c: e3813080 orr r3, r1, #128 ; 0x80 16120: e129f003 msr CPSR_fc, r3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 16124: e59d300c ldr r3, [sp, #12] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 16128: e1540003 cmp r4, r3 1612c: 1affffef bne 160f0 <_Timer_server_Body+0x15c> 16130: e1a04005 mov r4, r5 static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 16134: e129f001 msr CPSR_fc, r1 16138: eaffffae b 15ff8 <_Timer_server_Body+0x64> } } else { ts->active = false; 1613c: e3a03000 mov r3, #0 16140: e5c4307c strb r3, [r4, #124] ; 0x7c 16144: e59f204c ldr r2, [pc, #76] ; 16198 <_Timer_server_Body+0x204> 16148: e5923000 ldr r3, [r2] 1614c: e2833001 add r3, r3, #1 16150: e5823000 str r3, [r2] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 16154: e3a01008 mov r1, #8 16158: e5940000 ldr r0, [r4] 1615c: eb000e7e bl 19b5c <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 16160: e1a00004 mov r0, r4 16164: ebffff5e bl 15ee4 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 16168: e1a00004 mov r0, r4 1616c: ebffff72 bl 15f3c <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 16170: eb000be8 bl 19118 <_Thread_Enable_dispatch> ts->active = true; 16174: e3a03001 mov r3, #1 16178: e5c4307c strb r3, [r4, #124] ; 0x7c static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 1617c: e59d0004 ldr r0, [sp, #4] 16180: eb00118b bl 1a7b4 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 16184: e59d0008 ldr r0, [sp, #8] 16188: eb001189 bl 1a7b4 <_Watchdog_Remove> 1618c: eaffff99 b 15ff8 <_Timer_server_Body+0x64> =============================================================================== 0000a2cc <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) a2cc: e5902000 ldr r2, [r0] a2d0: e5913000 ldr r3, [r1] a2d4: e1520003 cmp r2, r3 return true; a2d8: c3a00001 movgt r0, #1 bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) a2dc: c12fff1e bxgt lr return true; if ( lhs->tv_sec < rhs->tv_sec ) a2e0: ba000005 blt a2fc <_Timespec_Greater_than+0x30> #include #include #include bool _Timespec_Greater_than( a2e4: e5900004 ldr r0, [r0, #4] a2e8: e5913004 ldr r3, [r1, #4] a2ec: e1500003 cmp r0, r3 a2f0: d3a00000 movle r0, #0 a2f4: c3a00001 movgt r0, #1 a2f8: e12fff1e bx lr { if ( lhs->tv_sec > rhs->tv_sec ) return true; if ( lhs->tv_sec < rhs->tv_sec ) return false; a2fc: e3a00000 mov r0, #0 <== NOT EXECUTED /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } a300: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 00008690 <_User_extensions_Thread_create>: #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 8690: e92d40f0 push {r4, r5, r6, r7, lr} Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 8694: e59f5050 ldr r5, [pc, #80] ; 86ec <_User_extensions_Thread_create+0x5c> 8698: e4954004 ldr r4, [r5], #4 869c: e1540005 cmp r4, r5 #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 86a0: e1a06000 mov r6, r0 Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 86a4: 0a00000e beq 86e4 <_User_extensions_Thread_create+0x54> the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_create != NULL ) { status = (*the_extension->Callouts.thread_create)( 86a8: e59f7040 ldr r7, [pc, #64] ; 86f0 <_User_extensions_Thread_create+0x60> !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_create != NULL ) { 86ac: e5943014 ldr r3, [r4, #20] 86b0: e3530000 cmp r3, #0 status = (*the_extension->Callouts.thread_create)( 86b4: e1a01006 mov r1, r6 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_create != NULL ) { 86b8: 0a000004 beq 86d0 <_User_extensions_Thread_create+0x40> status = (*the_extension->Callouts.thread_create)( 86bc: e5970004 ldr r0, [r7, #4] 86c0: e1a0e00f mov lr, pc 86c4: e12fff13 bx r3 _Thread_Executing, the_thread ); if ( !status ) 86c8: e3500000 cmp r0, #0 86cc: 08bd80f0 popeq {r4, r5, r6, r7, pc} User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 86d0: e5944000 ldr r4, [r4] { Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 86d4: e1540005 cmp r4, r5 86d8: 1afffff3 bne 86ac <_User_extensions_Thread_create+0x1c> if ( !status ) return false; } } return true; 86dc: e3a00001 mov r0, #1 86e0: e8bd80f0 pop {r4, r5, r6, r7, pc} 86e4: e3a00001 mov r0, #1 <== NOT EXECUTED } 86e8: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED =============================================================================== 0000a660 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { a660: e92d41f0 push {r4, r5, r6, r7, r8, lr} a664: e1a04000 mov r4, r0 a668: e1a05002 mov r5, r2 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a66c: e10f3000 mrs r3, CPSR a670: e3832080 orr r2, r3, #128 ; 0x80 a674: e129f002 msr CPSR_fc, r2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); a678: e1a07000 mov r7, r0 a67c: e4972004 ldr r2, [r7], #4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { a680: e1520007 cmp r2, r7 a684: 0a000018 beq a6ec <_Watchdog_Adjust+0x8c> switch ( direction ) { a688: e3510000 cmp r1, #0 a68c: 1a000018 bne a6f4 <_Watchdog_Adjust+0x94> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { a690: e3550000 cmp r5, #0 a694: 0a000014 beq a6ec <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) { a698: e5926010 ldr r6, [r2, #16] a69c: e1550006 cmp r5, r6 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; a6a0: 23a08001 movcs r8, #1 case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { a6a4: 2a000005 bcs a6c0 <_Watchdog_Adjust+0x60> a6a8: ea000018 b a710 <_Watchdog_Adjust+0xb0> <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { a6ac: e0555006 subs r5, r5, r6 a6b0: 0a00000d beq a6ec <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) { a6b4: e5926010 ldr r6, [r2, #16] a6b8: e1560005 cmp r6, r5 a6bc: 8a000013 bhi a710 <_Watchdog_Adjust+0xb0> _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; a6c0: e5828010 str r8, [r2, #16] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a6c4: e129f003 msr CPSR_fc, r3 _ISR_Enable( level ); _Watchdog_Tickle( header ); a6c8: e1a00004 mov r0, r4 a6cc: eb0000a0 bl a954 <_Watchdog_Tickle> static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a6d0: e10f3000 mrs r3, CPSR a6d4: e3832080 orr r2, r3, #128 ; 0x80 a6d8: e129f002 msr CPSR_fc, r2 a6dc: e5941000 ldr r1, [r4] _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) a6e0: e1570001 cmp r7, r1 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); a6e4: e1a02001 mov r2, r1 a6e8: 1affffef bne a6ac <_Watchdog_Adjust+0x4c> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a6ec: e129f003 msr CPSR_fc, r3 } } _ISR_Enable( level ); } a6f0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { a6f4: e3510001 cmp r1, #1 a6f8: 1afffffb bne a6ec <_Watchdog_Adjust+0x8c> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; a6fc: e5921010 ldr r1, [r2, #16] a700: e0815005 add r5, r1, r5 a704: e5825010 str r5, [r2, #16] a708: e129f003 msr CPSR_fc, r3 } } _ISR_Enable( level ); } a70c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; a710: e0655006 rsb r5, r5, r6 a714: e5825010 str r5, [r2, #16] break; a718: eafffff3 b a6ec <_Watchdog_Adjust+0x8c> =============================================================================== 00007000 : rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 7000: e59f3150 ldr r3, [pc, #336] ; 7158 7004: e593c000 ldr ip, [r3] rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; 7008: e59f314c ldr r3, [pc, #332] ; 715c if ( rtems_interrupt_is_in_progress() ) 700c: e35c0000 cmp ip, #0 rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 7010: e92d4030 push {r4, r5, lr} 7014: e1a04000 mov r4, r0 rtems_device_major_number major_limit = _IO_Number_of_drivers; 7018: e5930000 ldr r0, [r3] if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; 701c: 13a00012 movne r0, #18 rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 7020: 18bd8030 popne {r4, r5, pc} return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 7024: e3520000 cmp r2, #0 7028: 0a00003f beq 712c return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; if ( driver_table == NULL ) 702c: e3510000 cmp r1, #0 if ( registered_major == NULL ) return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 7030: e5820000 str r0, [r2] if ( driver_table == NULL ) 7034: 0a00003c beq 712c static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 7038: e591c000 ldr ip, [r1] 703c: e35c0000 cmp ip, #0 7040: 0a000036 beq 7120 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 7044: e1500004 cmp r0, r4 7048: 9a000027 bls 70ec rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 704c: e59f010c ldr r0, [pc, #268] ; 7160 7050: e590c000 ldr ip, [r0] 7054: e28cc001 add ip, ip, #1 7058: e580c000 str ip, [r0] return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 705c: e3540000 cmp r4, #0 7060: 1a000023 bne 70f4 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 7064: e593c000 ldr ip, [r3] rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 7068: e35c0000 cmp ip, #0 706c: 0a000030 beq 7134 7070: e59fe0ec ldr lr, [pc, #236] ; 7164 7074: e59e3000 ldr r3, [lr] 7078: ea000003 b 708c 707c: e2844001 add r4, r4, #1 7080: e15c0004 cmp ip, r4 7084: e2833018 add r3, r3, #24 7088: 9a000005 bls 70a4 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 708c: e5930000 ldr r0, [r3] 7090: e3500000 cmp r0, #0 7094: 1afffff8 bne 707c 7098: e5930004 ldr r0, [r3, #4] 709c: e3500000 cmp r0, #0 70a0: 1afffff5 bne 707c } /* Assigns invalid value in case of failure */ *major = m; if ( m != n ) 70a4: e15c0004 cmp ip, r4 70a8: 1084c084 addne ip, r4, r4, lsl #1 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 70ac: e5824000 str r4, [r2] if ( m != n ) 70b0: 11a0c18c lslne ip, ip, #3 70b4: 0a00001f beq 7138 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 70b8: e59e5000 ldr r5, [lr] 70bc: e1a0e001 mov lr, r1 70c0: e8be000f ldm lr!, {r0, r1, r2, r3} 70c4: e085c00c add ip, r5, ip 70c8: e8ac000f stmia ip!, {r0, r1, r2, r3} 70cc: e89e0003 ldm lr, {r0, r1} 70d0: e88c0003 stm ip, {r0, r1} _Thread_Enable_dispatch(); 70d4: eb000687 bl 8af8 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 70d8: e3a01000 mov r1, #0 70dc: e1a00004 mov r0, r4 70e0: e1a02001 mov r2, r1 } 70e4: e8bd4030 pop {r4, r5, lr} _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 70e8: ea001eb0 b ebb0 if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; 70ec: e3a0000a mov r0, #10 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 70f0: e8bd8030 pop {r4, r5, pc} _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 70f4: e59fe068 ldr lr, [pc, #104] ; 7164 70f8: e59e3000 ldr r3, [lr] 70fc: e084c084 add ip, r4, r4, lsl #1 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 7100: e793018c ldr r0, [r3, ip, lsl #3] _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 7104: e1a0c18c lsl ip, ip, #3 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 7108: e3500000 cmp r0, #0 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 710c: e083300c add r3, r3, ip static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 7110: 0a00000b beq 7144 major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); 7114: eb000677 bl 8af8 <_Thread_Enable_dispatch> return RTEMS_RESOURCE_IN_USE; 7118: e3a0000c mov r0, #12 711c: e8bd8030 pop {r4, r5, pc} static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 7120: e591c004 ldr ip, [r1, #4] 7124: e35c0000 cmp ip, #0 7128: 1affffc5 bne 7044 if ( driver_table == NULL ) return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; 712c: e3a00009 mov r0, #9 7130: e8bd8030 pop {r4, r5, pc} if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 7134: e5824000 str r4, [r2] <== NOT EXECUTED if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 7138: eb00066e bl 8af8 <_Thread_Enable_dispatch> *major = m; if ( m != n ) return RTEMS_SUCCESSFUL; return RTEMS_TOO_MANY; 713c: e3a00005 mov r0, #5 if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); return sc; 7140: e8bd8030 pop {r4, r5, pc} static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 7144: e5933004 ldr r3, [r3, #4] 7148: e3530000 cmp r3, #0 714c: 1afffff0 bne 7114 if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 7150: e5824000 str r4, [r2] 7154: eaffffd7 b 70b8