=============================================================================== 00016b10 <_CORE_message_queue_Broadcast>: { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 16b10: 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 ) { 16b14: 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 ) { 16b18: 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 ) { 16b1c: e1a07000 mov r7, r0 16b20: e1a05002 mov r5, r2 16b24: e1a08001 mov r8, r1 16b28: 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 ) { 16b2c: 3a000016 bcc 16b8c <_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 ) { 16b30: e5906048 ldr r6, [r0, #72] ; 0x48 16b34: e3560000 cmp r6, #0 *count = 0; 16b38: 13a00000 movne r0, #0 16b3c: 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 ) { 16b40: 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 = 16b44: e1a00007 mov r0, r7 16b48: eb000ac1 bl 19654 <_Thread_queue_Dequeue> 16b4c: e2504000 subs r4, r0, #0 16b50: 0a00000a beq 16b80 <_CORE_message_queue_Broadcast+0x70> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 16b54: e594002c ldr r0, [r4, #44] ; 0x2c 16b58: e1a01008 mov r1, r8 16b5c: e1a02005 mov r2, r5 16b60: eb002047 bl 1ec84 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 16b64: 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 = 16b68: e1a00007 mov r0, r7 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 16b6c: 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 = 16b70: eb000ab7 bl 19654 <_Thread_queue_Dequeue> 16b74: e2504000 subs r4, r0, #0 _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 16b78: 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 = 16b7c: 1afffff4 bne 16b54 <_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; 16b80: e58a6000 str r6, [sl] return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 16b84: e1a00004 mov r0, r4 16b88: 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; 16b8c: e3a00001 mov r0, #1 <== NOT EXECUTED #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 16b90: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== 0000aba4 <_CORE_mutex_Seize_interrupt_trylock>: { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; aba4: e59f215c ldr r2, [pc, #348] ; ad08 <_CORE_mutex_Seize_interrupt_trylock+0x164> executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { aba8: 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 ) { abac: e1a03000 mov r3, r0 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; abb0: e5922004 ldr r2, [r2, #4] executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; abb4: e3a00000 mov r0, #0 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { abb8: e15c0000 cmp ip, r0 abbc: 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; abc0: e5820034 str r0, [r2, #52] ; 0x34 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { abc4: 0a00000e beq ac04 <_CORE_mutex_Seize_interrupt_trylock+0x60> return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } abc8: e593c048 ldr ip, [r3, #72] ; 0x48 the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; abcc: e5925008 ldr r5, [r2, #8] the_mutex->nest_count = 1; abd0: e3a04001 mov r4, #1 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || abd4: 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; abd8: e5830050 str r0, [r3, #80] ; 0x50 the_mutex->holder = executing; abdc: e583205c str r2, [r3, #92] ; 0x5c the_mutex->holder_id = executing->Object.id; abe0: e5835060 str r5, [r3, #96] ; 0x60 the_mutex->nest_count = 1; abe4: e5834054 str r4, [r3, #84] ; 0x54 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || abe8: 0a000013 beq ac3c <_CORE_mutex_Seize_interrupt_trylock+0x98> abec: e35c0003 cmp ip, #3 abf0: 0a000018 beq ac58 <_CORE_mutex_Seize_interrupt_trylock+0xb4> abf4: e5913000 ldr r3, [r1] abf8: e129f003 msr CPSR_fc, r3 executing->resource_count++; } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { _ISR_Enable( *level_p ); return 0; abfc: e3a00000 mov r0, #0 ac00: 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 ) ) { ac04: e593005c ldr r0, [r3, #92] ; 0x5c ac08: e1520000 cmp r2, r0 /* * The mutex is not available and the caller must deal with the possibility * of blocking. */ return 1; ac0c: 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 ) ) { ac10: 18bd80f0 popne {r4, r5, r6, r7, pc} switch ( the_mutex->Attributes.lock_nesting_behavior ) { ac14: e5930040 ldr r0, [r3, #64] ; 0x40 ac18: e3500000 cmp r0, #0 ac1c: 1a00001e bne ac9c <_CORE_mutex_Seize_interrupt_trylock+0xf8> case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; ac20: e5932054 ldr r2, [r3, #84] ; 0x54 ac24: e2822001 add r2, r2, #1 ac28: e5832054 str r2, [r3, #84] ; 0x54 ac2c: e5913000 ldr r3, [r1] ac30: e129f003 msr CPSR_fc, r3 _ISR_Enable( *level_p ); return 0; ac34: e3a00000 mov r0, #0 ac38: 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++; ac3c: e592301c ldr r3, [r2, #28] ac40: e2833001 add r3, r3, #1 ac44: e582301c str r3, [r2, #28] ac48: e5913000 ldr r3, [r1] ac4c: e129f003 msr CPSR_fc, r3 } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { _ISR_Enable( *level_p ); return 0; ac50: e3a00000 mov r0, #0 ac54: 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++; ac58: e592c01c ldr ip, [r2, #28] */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; ac5c: e593704c ldr r7, [r3, #76] ; 0x4c current = executing->current_priority; ac60: 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++; ac64: e08c5004 add r5, ip, r4 Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; if ( current == ceiling ) { ac68: 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++; ac6c: e582501c str r5, [r2, #28] Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; if ( current == ceiling ) { ac70: 0a000020 beq acf8 <_CORE_mutex_Seize_interrupt_trylock+0x154> _ISR_Enable( *level_p ); return 0; } if ( current > ceiling ) { ac74: 3a000012 bcc acc4 <_CORE_mutex_Seize_interrupt_trylock+0x120> ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; ac78: e3a05006 mov r5, #6 ac7c: e5825034 str r5, [r2, #52] ; 0x34 the_mutex->lock = CORE_MUTEX_UNLOCKED; ac80: e5834050 str r4, [r3, #80] ; 0x50 the_mutex->nest_count = 0; /* undo locking above */ ac84: e5830054 str r0, [r3, #84] ; 0x54 executing->resource_count--; /* undo locking above */ ac88: e582c01c str ip, [r2, #28] ac8c: e5913000 ldr r3, [r1] ac90: e129f003 msr CPSR_fc, r3 _ISR_Enable( *level_p ); return 0; ac94: e3a00000 mov r0, #0 ac98: 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 ) { ac9c: e3500001 cmp r0, #1 aca0: 0a000001 beq acac <_CORE_mutex_Seize_interrupt_trylock+0x108> /* * The mutex is not available and the caller must deal with the possibility * of blocking. */ return 1; aca4: e3a00001 mov r0, #1 aca8: 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; acac: e3a03002 mov r3, #2 <== NOT EXECUTED acb0: e5823034 str r3, [r2, #52] ; 0x34 <== NOT EXECUTED acb4: e5913000 ldr r3, [r1] <== NOT EXECUTED acb8: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED _ISR_Enable( *level_p ); return 0; acbc: e3a00000 mov r0, #0 <== NOT EXECUTED acc0: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; acc4: e59f2040 ldr r2, [pc, #64] ; ad0c <_CORE_mutex_Seize_interrupt_trylock+0x168> acc8: e5920000 ldr r0, [r2] accc: e2800001 add r0, r0, #1 acd0: e5820000 str r0, [r2] acd4: e5912000 ldr r2, [r1] acd8: e129f002 msr CPSR_fc, r2 } if ( current > ceiling ) { _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); _Thread_Change_priority( acdc: e3a02000 mov r2, #0 ace0: e593005c ldr r0, [r3, #92] ; 0x5c ace4: e593104c ldr r1, [r3, #76] ; 0x4c ace8: ebfff201 bl 74f4 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); acec: ebfff33b bl 79e0 <_Thread_Enable_dispatch> return 0; acf0: e3a00000 mov r0, #0 acf4: e8bd80f0 pop {r4, r5, r6, r7, pc} acf8: e5913000 ldr r3, [r1] acfc: e129f003 msr CPSR_fc, r3 ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; if ( current == ceiling ) { _ISR_Enable( *level_p ); return 0; ad00: e3a00000 mov r0, #0 ad04: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 0000ad84 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ad84: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} ad88: e1a08002 mov r8, r2 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; ad8c: e5902010 ldr r2, [r0, #16] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ad90: e24dd01c sub sp, sp, #28 ad94: e1a05001 mov r5, r1 Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { ad98: e2911004 adds r1, r1, #4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ad9c: e1a07000 mov r7, r0 Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { ada0: e58d1000 str r1, [sp] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ada4: e1a0b003 mov fp, r3 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; ada8: e58d200c str r2, [sp, #12] Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { adac: 2a00007a bcs af9c <_Heap_Allocate_aligned_with_boundary+0x218> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { adb0: e3530000 cmp r3, #0 adb4: 1a000076 bne af94 <_Heap_Allocate_aligned_with_boundary+0x210> if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } adb8: e5979008 ldr r9, [r7, #8] do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { adbc: e1570009 cmp r7, r9 adc0: 0a000075 beq af9c <_Heap_Allocate_aligned_with_boundary+0x218> 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 adc4: e59d300c ldr r3, [sp, #12] + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; adc8: 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 adcc: e2833007 add r3, r3, #7 add0: e58d3010 str r3, [sp, #16] + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; add4: e58d1014 str r1, [sp, #20] do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { add8: e3a06001 mov 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 ) { addc: e599a004 ldr sl, [r9, #4] ade0: e59d2000 ldr r2, [sp] ade4: e152000a cmp r2, sl ade8: 2a000050 bcs af30 <_Heap_Allocate_aligned_with_boundary+0x1ac> if ( alignment == 0 ) { adec: 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; adf0: 02894008 addeq r4, r9, #8 adf4: 0a000053 beq af48 <_Heap_Allocate_aligned_with_boundary+0x1c4> if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } adf8: 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_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; adfc: 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; ae00: 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; ae04: 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; ae08: 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_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; ae0c: e081400a add r4, r1, sl if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } ae10: 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; ae14: e0633002 rsb r3, r3, r2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ae18: 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 ae1c: e083a00a add sl, r3, sl ae20: 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; ae24: e2893008 add r3, r9, #8 ae28: e58d3008 str r3, [sp, #8] RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ae2c: eb001576 bl 1040c <__umodsi3> ae30: 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 ) { ae34: e15a0004 cmp sl, r4 ae38: 2a000003 bcs ae4c <_Heap_Allocate_aligned_with_boundary+0xc8> ae3c: e1a0000a mov r0, sl ae40: e1a01008 mov r1, r8 ae44: eb001570 bl 1040c <__umodsi3> ae48: e060400a rsb r4, r0, sl } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { ae4c: e35b0000 cmp fp, #0 ae50: 0a000026 beq aef0 <_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; ae54: e084a005 add sl, r4, r5 ae58: e1a0000a mov r0, sl ae5c: e1a0100b mov r1, fp ae60: eb001569 bl 1040c <__umodsi3> ae64: 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 ) { ae68: e15a0000 cmp sl, r0 ae6c: 93a0a000 movls sl, #0 ae70: 83a0a001 movhi sl, #1 ae74: e1540000 cmp r4, r0 ae78: 23a0a000 movcs sl, #0 ae7c: e35a0000 cmp sl, #0 ae80: 0a00001a beq aef0 <_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; ae84: e59d1008 ldr r1, [sp, #8] ae88: e0813005 add r3, 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 ) { ae8c: e1530000 cmp r3, r0 ae90: 958d9018 strls r9, [sp, #24] ae94: 91a09003 movls r9, r3 ae98: 9a000002 bls aea8 <_Heap_Allocate_aligned_with_boundary+0x124> ae9c: ea000023 b af30 <_Heap_Allocate_aligned_with_boundary+0x1ac> aea0: e1590000 cmp r9, r0 aea4: 8a00003e bhi afa4 <_Heap_Allocate_aligned_with_boundary+0x220> return 0; } alloc_begin = boundary_line - alloc_size; aea8: e0654000 rsb r4, r5, r0 aeac: e1a01008 mov r1, r8 aeb0: e1a00004 mov r0, r4 aeb4: eb001554 bl 1040c <__umodsi3> aeb8: e0604004 rsb r4, r0, r4 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; aebc: e084a005 add sl, r4, r5 aec0: e1a0000a mov r0, sl aec4: e1a0100b mov r1, fp aec8: eb00154f bl 1040c <__umodsi3> aecc: 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 ) { aed0: e15a0000 cmp sl, r0 aed4: 93a0a000 movls sl, #0 aed8: 83a0a001 movhi sl, #1 aedc: e1540000 cmp r4, r0 aee0: 23a0a000 movcs sl, #0 aee4: e35a0000 cmp sl, #0 aee8: 1affffec bne aea0 <_Heap_Allocate_aligned_with_boundary+0x11c> aeec: e59d9018 ldr r9, [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 ) { aef0: e59d2008 ldr r2, [sp, #8] aef4: e1520004 cmp r2, r4 aef8: 8a00000c bhi af30 <_Heap_Allocate_aligned_with_boundary+0x1ac> aefc: e59d100c ldr r1, [sp, #12] af00: e1a00004 mov r0, r4 af04: eb001540 bl 1040c <__umodsi3> af08: e269a4ff rsb sl, r9, #-16777216 ; 0xff000000 af0c: e28aa8ff add sl, sl, #16711680 ; 0xff0000 af10: e28aacff add sl, sl, #65280 ; 0xff00 af14: 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); af18: 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 ) { af1c: e59d1004 ldr r1, [sp, #4] af20: e060300a rsb r3, r0, sl af24: e15a0000 cmp sl, r0 af28: 11510003 cmpne r1, r3 af2c: 9a000005 bls af48 <_Heap_Allocate_aligned_with_boundary+0x1c4> if ( alloc_begin != 0 ) { break; } block = block->next; af30: e5999008 ldr r9, [r9, #8] do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { af34: e1570009 cmp r7, r9 if ( alloc_begin != 0 ) { break; } block = block->next; af38: e2863001 add r3, r6, #1 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { af3c: 0a00001d beq afb8 <_Heap_Allocate_aligned_with_boundary+0x234> af40: e1a06003 mov r6, r3 af44: eaffffa4 b addc <_Heap_Allocate_aligned_with_boundary+0x58> } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { af48: e3540000 cmp r4, #0 af4c: 0afffff7 beq af30 <_Heap_Allocate_aligned_with_boundary+0x1ac> search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; af50: e2872048 add r2, r7, #72 ; 0x48 af54: e892000c ldm r2, {r2, r3} af58: e2822001 add r2, r2, #1 stats->searches += search_count; af5c: e0833006 add r3, r3, r6 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; af60: e5872048 str r2, [r7, #72] ; 0x48 stats->searches += search_count; af64: e587304c str r3, [r7, #76] ; 0x4c block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); af68: e1a00007 mov r0, r7 af6c: e1a01009 mov r1, r9 af70: e1a02004 mov r2, r4 af74: e1a03005 mov r3, r5 af78: ebffee07 bl 679c <_Heap_Block_allocate> af7c: e1a00004 mov r0, r4 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { af80: e5973044 ldr r3, [r7, #68] ; 0x44 af84: e1530006 cmp r3, r6 stats->max_search = search_count; af88: 35876044 strcc r6, [r7, #68] ; 0x44 } return (void *) alloc_begin; } af8c: e28dd01c add sp, sp, #28 af90: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { af94: e1550003 cmp r5, r3 af98: 9a000008 bls afc0 <_Heap_Allocate_aligned_with_boundary+0x23c> do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { af9c: e3a00000 mov r0, #0 afa0: eafffff9 b af8c <_Heap_Allocate_aligned_with_boundary+0x208> afa4: e59d9018 ldr r9, [sp, #24] <== NOT EXECUTED if ( alloc_begin != 0 ) { break; } block = block->next; afa8: e5999008 ldr r9, [r9, #8] <== NOT EXECUTED do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { afac: e1570009 cmp r7, r9 <== NOT EXECUTED if ( alloc_begin != 0 ) { break; } block = block->next; afb0: e2863001 add r3, r6, #1 <== NOT EXECUTED do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { afb4: 1affffe1 bne af40 <_Heap_Allocate_aligned_with_boundary+0x1bc><== NOT EXECUTED afb8: e3a00000 mov r0, #0 afbc: eaffffef b af80 <_Heap_Allocate_aligned_with_boundary+0x1fc> if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { alignment = page_size; afc0: e3580000 cmp r8, #0 afc4: 01a08002 moveq r8, r2 afc8: eaffff7a b adb8 <_Heap_Allocate_aligned_with_boundary+0x34> =============================================================================== 0000b314 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { b314: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} b318: e1a05000 mov r5, r0 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { b31c: e0916002 adds r6, r1, r2 Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { b320: e1a04001 mov r4, r1 Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; b324: e5908020 ldr r8, [r0, #32] Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; b328: e5951030 ldr r1, [r5, #48] ; 0x30 Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; b32c: e5900010 ldr r0, [r0, #16] Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { b330: e24dd024 sub sp, sp, #36 ; 0x24 Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; b334: e3a07000 mov r7, #0 Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { b338: e58d3010 str r3, [sp, #16] Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; b33c: e58d0008 str r0, [sp, #8] Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; b340: e58d7020 str r7, [sp, #32] Heap_Block *extend_last_block = NULL; b344: e58d701c str r7, [sp, #28] uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; b348: e5953014 ldr r3, [r5, #20] uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; b34c: e58d1018 str r1, [sp, #24] uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { return false; b350: 21a00007 movcs r0, r7 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { b354: 3a000001 bcc b360 <_Heap_Extend+0x4c> if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } b358: e28dd024 add sp, sp, #36 ; 0x24 b35c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} if ( extend_area_end < extend_area_begin ) { return false; } extend_area_ok = _Heap_Get_first_and_last_block( b360: e28dc020 add ip, sp, #32 b364: e1a01002 mov r1, r2 b368: e58dc000 str ip, [sp] b36c: e1a00004 mov r0, r4 b370: e28dc01c add ip, sp, #28 b374: e59d2008 ldr r2, [sp, #8] b378: e58dc004 str ip, [sp, #4] b37c: ebffed71 bl 6948 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { b380: e3500000 cmp r0, #0 b384: 0afffff3 beq b358 <_Heap_Extend+0x44> b388: e58d700c str r7, [sp, #12] b38c: e58d7014 str r7, [sp, #20] b390: e1a09008 mov r9, r8 b394: e1a0b007 mov fp, r7 return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; b398: e1590008 cmp r9, r8 b39c: 05953018 ldreq r3, [r5, #24] uintptr_t const sub_area_end = start_block->prev_size; b3a0: e599a000 ldr sl, [r9] return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; b3a4: 11a03009 movne r3, r9 uintptr_t const sub_area_end = start_block->prev_size; Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( b3a8: e1530006 cmp r3, r6 b3ac: 3154000a cmpcc r4, sl b3b0: 3a00006c bcc b568 <_Heap_Extend+0x254> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { b3b4: e1530006 cmp r3, r6 b3b8: 058d9014 streq r9, [sp, #20] b3bc: 0a000001 beq b3c8 <_Heap_Extend+0xb4> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { b3c0: e156000a cmp r6, sl b3c4: 31a0b009 movcc fp, r9 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); b3c8: e1a0000a mov r0, sl b3cc: e59d1008 ldr r1, [sp, #8] b3d0: eb001561 bl 1095c <__umodsi3> b3d4: e24a3008 sub r3, sl, #8 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { b3d8: e15a0004 cmp sl, r4 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); b3dc: e0603003 rsb r3, r0, r3 start_block->prev_size = extend_area_end; b3e0: 05896000 streq r6, [r9] RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) b3e4: 058d300c streq r3, [sp, #12] merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { b3e8: 0a000001 beq b3f4 <_Heap_Extend+0xe0> b3ec: e154000a cmp r4, sl b3f0: 81a07003 movhi r7, r3 - 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; b3f4: e5939004 ldr r9, [r3, #4] b3f8: e3c99001 bic r9, r9, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); b3fc: e0839009 add r9, r3, r9 } else if ( sub_area_end < extend_area_begin ) { link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); b400: e1580009 cmp r8, r9 b404: 1affffe3 bne b398 <_Heap_Extend+0x84> if ( extend_area_begin < heap->area_begin ) { b408: e5953018 ldr r3, [r5, #24] b40c: e1540003 cmp r4, r3 heap->area_begin = extend_area_begin; b410: 35854018 strcc r4, [r5, #24] } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); if ( extend_area_begin < heap->area_begin ) { b414: 3a000002 bcc b424 <_Heap_Extend+0x110> heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { b418: e595301c ldr r3, [r5, #28] b41c: e1560003 cmp r6, r3 heap->area_end = extend_area_end; b420: 8585601c strhi r6, [r5, #28] } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; b424: e28d201c add r2, sp, #28 b428: e892000c ldm r2, {r2, r3} extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { b42c: e595c020 ldr ip, [r5, #32] heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = b430: e0631002 rsb r1, r3, r2 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; b434: e3810001 orr r0, r1, #1 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; b438: e5836000 str r6, [r3] extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { b43c: e15c0003 cmp ip, r3 extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; b440: e5821000 str r1, [r2] extend_last_block->size_and_flag = 0; b444: e3a01000 mov r1, #0 extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = b448: e5830004 str r0, [r3, #4] extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; b44c: e5821004 str r1, [r2, #4] _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { heap->first_block = extend_first_block; b450: 85853020 strhi r3, [r5, #32] extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { b454: 8a000002 bhi b464 <_Heap_Extend+0x150> heap->first_block = extend_first_block; } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { b458: e5953024 ldr r3, [r5, #36] ; 0x24 b45c: e1530002 cmp r3, r2 heap->last_block = extend_last_block; b460: 35852024 strcc r2, [r5, #36] ; 0x24 } if ( merge_below_block != NULL ) { b464: e59d3014 ldr r3, [sp, #20] b468: e3530000 cmp r3, #0 b46c: 0a000050 beq b5b4 <_Heap_Extend+0x2a0> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; b470: e5958010 ldr r8, [r5, #16] <== NOT EXECUTED uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); b474: e2844008 add r4, r4, #8 <== NOT EXECUTED RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; b478: e1a00004 mov r0, r4 <== NOT EXECUTED b47c: e1a01008 mov r1, r8 <== NOT EXECUTED b480: eb001535 bl 1095c <__umodsi3> <== NOT EXECUTED if ( remainder != 0 ) { b484: e3500000 cmp r0, #0 <== NOT EXECUTED return value - remainder + alignment; b488: 10844008 addne r4, r4, r8 <== NOT EXECUTED b48c: 10604004 rsbne r4, r0, r4 <== NOT EXECUTED uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; b490: e59dc014 ldr ip, [sp, #20] <== NOT EXECUTED ) { uintptr_t const page_size = heap->page_size; uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = b494: e2441008 sub r1, r4, #8 <== NOT EXECUTED uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; b498: e59c2000 ldr r2, [ip] <== NOT EXECUTED uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = b49c: e061300c rsb r3, r1, ip <== NOT EXECUTED first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; b4a0: e3833001 orr r3, r3, #1 <== NOT EXECUTED uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; b4a4: e5042008 str r2, [r4, #-8] <== NOT EXECUTED new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; b4a8: e5813004 str r3, [r1, #4] <== NOT EXECUTED _Heap_Free_block( heap, new_first_block ); b4ac: e1a00005 mov r0, r5 <== NOT EXECUTED b4b0: ebffff8f bl b2f4 <_Heap_Free_block> <== NOT EXECUTED link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { b4b4: e59d000c ldr r0, [sp, #12] b4b8: e3500000 cmp r0, #0 b4bc: 0a00002b beq b570 <_Heap_Extend+0x25c> ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, b4c0: e2466008 sub r6, r6, #8 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( b4c4: e0606006 rsb r6, r0, r6 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); b4c8: e5951010 ldr r1, [r5, #16] b4cc: e1a00006 mov r0, r6 b4d0: eb001521 bl 1095c <__umodsi3> ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) b4d4: e59d100c ldr r1, [sp, #12] b4d8: e5913004 ldr r3, [r1, #4] b4dc: e0606006 rsb r6, r0, r6 b4e0: e0663003 rsb r3, r6, r3 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = b4e4: e0862001 add r2, r6, r1 (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; b4e8: e3833001 orr r3, r3, #1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = b4ec: e5823004 str r3, [r2, #4] RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; b4f0: e5913004 ldr r3, [r1, #4] b4f4: e2033001 and r3, r3, #1 block->size_and_flag = size | flag; b4f8: e1866003 orr r6, r6, r3 b4fc: e5816004 str r6, [r1, #4] (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); b500: e1a00005 mov r0, r5 b504: ebffff7a bl b2f4 <_Heap_Free_block> extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { b508: e59d200c ldr r2, [sp, #12] b50c: e59d3014 ldr r3, [sp, #20] b510: e3520000 cmp r2, #0 b514: 03530000 cmpeq r3, #0 b518: 0a000021 beq b5a4 <_Heap_Extend+0x290> if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } b51c: e5953024 ldr r3, [r5, #36] ; 0x24 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( b520: e595c020 ldr ip, [r5, #32] RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; b524: e5930004 ldr r0, [r3, #4] _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; b528: e5952030 ldr r2, [r5, #48] ; 0x30 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( b52c: e063c00c rsb ip, r3, ip b530: e59d4018 ldr r4, [sp, #24] RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; b534: e2000001 and r0, r0, #1 /* Statistics */ stats->size += extended_size; b538: e595102c ldr r1, [r5, #44] ; 0x2c block->size_and_flag = size | flag; b53c: e18c0000 orr r0, ip, r0 if ( extended_size_ptr != NULL ) b540: e59dc010 ldr ip, [sp, #16] _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; b544: e0642002 rsb r2, r4, r2 /* Statistics */ stats->size += extended_size; if ( extended_size_ptr != NULL ) b548: e35c0000 cmp ip, #0 _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; /* Statistics */ stats->size += extended_size; b54c: e0811002 add r1, r1, r2 b550: e5830004 str r0, [r3, #4] b554: e585102c str r1, [r5, #44] ; 0x2c if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; b558: 13a00001 movne r0, #1 /* Statistics */ stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; b55c: 158c2000 strne r2, [ip] return true; b560: 03a00001 moveq r0, #1 b564: eaffff7b b b358 <_Heap_Extend+0x44> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; b568: e3a00000 mov r0, #0 b56c: eaffff79 b b358 <_Heap_Extend+0x44> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { b570: e3570000 cmp r7, #0 b574: 0affffe3 beq b508 <_Heap_Extend+0x1f4> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; b578: e5973004 ldr r3, [r7, #4] ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); b57c: e59d2020 ldr r2, [sp, #32] b580: e2033001 and r3, r3, #1 b584: e0672002 rsb r2, r7, r2 block->size_and_flag = size | flag; b588: e1822003 orr r2, r2, r3 b58c: e5872004 str r2, [r7, #4] } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( b590: e59d301c ldr r3, [sp, #28] uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; b594: e5932004 ldr r2, [r3, #4] b598: e3822001 orr r2, r2, #1 b59c: e5832004 str r2, [r3, #4] b5a0: eaffffd8 b b508 <_Heap_Extend+0x1f4> extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { _Heap_Free_block( heap, extend_first_block ); b5a4: e1a00005 mov r0, r5 b5a8: e59d1020 ldr r1, [sp, #32] b5ac: ebffff50 bl b2f4 <_Heap_Free_block> b5b0: eaffffd9 b b51c <_Heap_Extend+0x208> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { b5b4: e35b0000 cmp fp, #0 { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; b5b8: 1062b00b rsbne fp, r2, fp b5bc: 138bb001 orrne fp, fp, #1 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = b5c0: 1582b004 strne fp, [r2, #4] b5c4: eaffffba b b4b4 <_Heap_Extend+0x1a0> =============================================================================== 0000afcc <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { afcc: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} afd0: e1a04000 mov r4, r0 afd4: e1a05001 mov r5, r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); afd8: e1a00001 mov r0, r1 afdc: e5941010 ldr r1, [r4, #16] afe0: eb001509 bl 1040c <__umodsi3> afe4: 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 afe8: 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); afec: 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; aff0: e1550003 cmp r5, r3 aff4: 3a00002f bcc b0b8 <_Heap_Free+0xec> aff8: e5941024 ldr r1, [r4, #36] ; 0x24 affc: e1550001 cmp r5, r1 b000: 8a00002c bhi b0b8 <_Heap_Free+0xec> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b004: 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; b008: 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); b00c: 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; b010: e1530002 cmp r3, r2 b014: 8a000027 bhi b0b8 <_Heap_Free+0xec> b018: e1510002 cmp r1, r2 b01c: 3a000027 bcc b0c0 <_Heap_Free+0xf4> b020: 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 ) ) { b024: e2170001 ands r0, r7, #1 b028: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return true; } 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 )); b02c: 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; b030: e3c77001 bic r7, r7, #1 b034: 03a08000 moveq r8, #0 b038: 0a000004 beq b050 <_Heap_Free+0x84> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b03c: 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; b040: e5900004 ldr r0, [r0, #4] return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) b044: e3100001 tst r0, #1 b048: 13a08000 movne r8, #0 b04c: 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 ) ) { b050: e21c0001 ands r0, ip, #1 b054: 1a00001b bne b0c8 <_Heap_Free+0xfc> uintptr_t const prev_size = block->prev_size; b058: 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); b05c: 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; b060: e153000a cmp r3, sl b064: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc} b068: e151000a cmp r1, sl b06c: 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; b070: 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) ) { b074: e2100001 ands r0, r0, #1 b078: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ b07c: e3580000 cmp r8, #0 b080: 0a000039 beq b16c <_Heap_Free+0x1a0> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; b084: 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; b088: e0867007 add r7, r6, r7 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b08c: 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; b090: e087c00c add ip, r7, ip --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b094: 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; b098: e2400001 sub r0, r0, #1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; b09c: 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; b0a0: e5823008 str r3, [r2, #8] next->prev = prev; b0a4: 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; b0a8: e5840038 str r0, [r4, #56] ; 0x38 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; b0ac: 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; b0b0: e78ac00c str ip, [sl, ip] b0b4: ea00000f b b0f8 <_Heap_Free+0x12c> _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; b0b8: e3a00000 mov r0, #0 b0bc: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} b0c0: e3a00000 mov r0, #0 <== NOT EXECUTED --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b0c4: 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 */ b0c8: e3580000 cmp r8, #0 b0cc: 0a000014 beq b124 <_Heap_Free+0x158> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b0d0: 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; b0d4: e0877006 add r7, r7, r6 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } b0d8: 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; b0dc: e3871001 orr r1, r7, #1 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; b0e0: e5853008 str r3, [r5, #8] new_block->prev = prev; b0e4: e585200c str r2, [r5, #12] next->prev = new_block; prev->next = new_block; b0e8: e5825008 str r5, [r2, #8] Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; b0ec: e583500c str r5, [r3, #12] b0f0: e5851004 str r1, [r5, #4] next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; b0f4: e7857007 str r7, [r5, r7] stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; b0f8: e5942040 ldr r2, [r4, #64] ; 0x40 ++stats->frees; b0fc: e5943050 ldr r3, [r4, #80] ; 0x50 stats->free_size += block_size; b100: e5941030 ldr r1, [r4, #48] ; 0x30 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; b104: e2422001 sub r2, r2, #1 ++stats->frees; b108: e2833001 add r3, r3, #1 stats->free_size += block_size; b10c: e0816006 add r6, r1, r6 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; b110: e5842040 str r2, [r4, #64] ; 0x40 ++stats->frees; b114: e5843050 str r3, [r4, #80] ; 0x50 stats->free_size += block_size; b118: e5846030 str r6, [r4, #48] ; 0x30 return( true ); b11c: e3a00001 mov r0, #1 b120: 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; b124: e3863001 orr r3, r6, #1 b128: e5853004 str r3, [r5, #4] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; b12c: e2843038 add r3, r4, #56 ; 0x38 b130: 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; b134: 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; b138: e5941008 ldr r1, [r4, #8] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; b13c: 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; b140: e3c00001 bic r0, r0, #1 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { b144: e153000c cmp r3, ip new_block->next = next; b148: e5851008 str r1, [r5, #8] new_block->prev = block_before; b14c: 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; b150: e5820004 str r0, [r2, #4] block_before->next = new_block; next->prev = new_block; b154: e581500c str r5, [r1, #12] next_block->prev_size = block_size; b158: 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; b15c: e5845008 str r5, [r4, #8] /* Statistics */ ++stats->free_blocks; b160: e5843038 str r3, [r4, #56] ; 0x38 if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; b164: 8584303c strhi r3, [r4, #60] ; 0x3c b168: eaffffe2 b b0f8 <_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; b16c: e086c00c add ip, r6, ip prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; b170: e38c3001 orr r3, ip, #1 b174: e58a3004 str r3, [sl, #4] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; b178: e5923004 ldr r3, [r2, #4] b17c: e3c33001 bic r3, r3, #1 b180: e5823004 str r3, [r2, #4] next_block->prev_size = size; b184: e785c006 str ip, [r5, r6] b188: eaffffda b b0f8 <_Heap_Free+0x12c> =============================================================================== 00012238 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 12238: e92d40f0 push {r4, r5, r6, r7, lr} 1223c: e1a04000 mov r4, r0 12240: e1a05001 mov r5, r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 12244: e1a00001 mov r0, r1 12248: e5941010 ldr r1, [r4, #16] 1224c: e1a07002 mov r7, r2 12250: ebfff86d bl 1040c <__umodsi3> 12254: 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 12258: 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); 1225c: 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; 12260: e1500003 cmp r0, r3 12264: 3a000010 bcc 122ac <_Heap_Size_of_alloc_area+0x74> 12268: e5942024 ldr r2, [r4, #36] ; 0x24 1226c: e1500002 cmp r0, r2 12270: 8a00000d bhi 122ac <_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; 12274: e5906004 ldr r6, [r0, #4] 12278: 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); 1227c: 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; 12280: e1530006 cmp r3, r6 12284: 8a000008 bhi 122ac <_Heap_Size_of_alloc_area+0x74> 12288: e1520006 cmp r2, r6 1228c: 3a000008 bcc 122b4 <_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; 12290: 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 ) 12294: e2100001 ands r0, r0, #1 ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 12298: 12655004 rsbne r5, r5, #4 1229c: 10856006 addne r6, r5, r6 122a0: 15876000 strne r6, [r7] return true; 122a4: 13a00001 movne r0, #1 122a8: e8bd80f0 pop {r4, r5, r6, r7, pc} if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 122ac: e3a00000 mov r0, #0 122b0: e8bd80f0 pop {r4, r5, r6, r7, pc} 122b4: e3a00000 mov r0, #0 <== NOT EXECUTED } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } 122b8: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED =============================================================================== 0000750c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 750c: 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() ) ) { 7510: e59f35cc ldr r3, [pc, #1484] ; 7ae4 <_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; 7514: e31200ff tst r2, #255 ; 0xff if ( !_System_state_Is_up( _System_state_Get() ) ) { 7518: 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; 751c: e59f25c4 ldr r2, [pc, #1476] ; 7ae8 <_Heap_Walk+0x5dc> 7520: e59f95c4 ldr r9, [pc, #1476] ; 7aec <_Heap_Walk+0x5e0> bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 7524: 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; 7528: 11a09002 movne r9, r2 Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size; 752c: 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() ) ) { 7530: 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; 7534: e5902014 ldr r2, [r0, #20] Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; 7538: e5903024 ldr r3, [r0, #36] ; 0x24 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 753c: e24dd038 sub sp, sp, #56 ; 0x38 7540: e1a04000 mov r4, r0 uintptr_t const page_size = heap->page_size; 7544: e58d1024 str r1, [sp, #36] ; 0x24 uintptr_t const min_block_size = heap->min_block_size; 7548: e58d2028 str r2, [sp, #40] ; 0x28 Heap_Block *const first_block = heap->first_block; 754c: e5908020 ldr r8, [r0, #32] Heap_Block *const last_block = heap->last_block; 7550: 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() ) ) { 7554: 0a000002 beq 7564 <_Heap_Walk+0x58> } block = next_block; } while ( block != first_block ); return true; 7558: e3a00001 mov r0, #1 } 755c: e28dd038 add sp, sp, #56 ; 0x38 7560: 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)( 7564: e594101c ldr r1, [r4, #28] 7568: e5900018 ldr r0, [r0, #24] 756c: e2842008 add r2, r4, #8 7570: e892000c ldm r2, {r2, r3} 7574: e59dc028 ldr ip, [sp, #40] ; 0x28 7578: e58d1008 str r1, [sp, #8] 757c: e59d102c ldr r1, [sp, #44] ; 0x2c 7580: e58d0004 str r0, [sp, #4] 7584: e58d1010 str r1, [sp, #16] 7588: e58d2014 str r2, [sp, #20] 758c: e58d3018 str r3, [sp, #24] 7590: e59f2558 ldr r2, [pc, #1368] ; 7af0 <_Heap_Walk+0x5e4> 7594: e58dc000 str ip, [sp] 7598: e58d800c str r8, [sp, #12] 759c: e1a0000a mov r0, sl 75a0: e3a01000 mov r1, #0 75a4: e59d3024 ldr r3, [sp, #36] ; 0x24 75a8: e1a0e00f mov lr, pc 75ac: e12fff19 bx r9 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 75b0: e59d2024 ldr r2, [sp, #36] ; 0x24 75b4: e3520000 cmp r2, #0 75b8: 0a000026 beq 7658 <_Heap_Walk+0x14c> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 75bc: e59d3024 ldr r3, [sp, #36] ; 0x24 75c0: e2135007 ands r5, r3, #7 75c4: 1a00002a bne 7674 <_Heap_Walk+0x168> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 75c8: e59d0028 ldr r0, [sp, #40] ; 0x28 75cc: e59d1024 ldr r1, [sp, #36] ; 0x24 75d0: ebffe572 bl ba0 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 75d4: e250b000 subs fp, r0, #0 75d8: 1a00002c bne 7690 <_Heap_Walk+0x184> 75dc: e2880008 add r0, r8, #8 75e0: e59d1024 ldr r1, [sp, #36] ; 0x24 75e4: ebffe56d bl ba0 <__umodsi3> ); return false; } if ( 75e8: e2506000 subs r6, r0, #0 75ec: 1a00002f bne 76b0 <_Heap_Walk+0x1a4> block = next_block; } while ( block != first_block ); return true; } 75f0: e598b004 ldr fp, [r8, #4] ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 75f4: e21b5001 ands r5, fp, #1 75f8: 0a0000cd beq 7934 <_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; 75fc: e59dc02c ldr ip, [sp, #44] ; 0x2c 7600: e59c3004 ldr r3, [ip, #4] 7604: 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); 7608: 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; 760c: e5935004 ldr r5, [r3, #4] ); return false; } if ( _Heap_Is_free( last_block ) ) { 7610: e2155001 ands r5, r5, #1 7614: 0a000008 beq 763c <_Heap_Walk+0x130> ); return false; } if ( 7618: e1580003 cmp r8, r3 761c: 0a00002b beq 76d0 <_Heap_Walk+0x1c4> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 7620: e1a0000a mov r0, sl <== NOT EXECUTED 7624: e3a01001 mov r1, #1 <== NOT EXECUTED 7628: e59f24c4 ldr r2, [pc, #1220] ; 7af4 <_Heap_Walk+0x5e8> <== NOT EXECUTED 762c: e1a0e00f mov lr, pc <== NOT EXECUTED 7630: 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; 7634: e1a00006 mov r0, r6 <== NOT EXECUTED 7638: eaffffc7 b 755c <_Heap_Walk+0x50> <== NOT EXECUTED return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 763c: e1a0000a mov r0, sl 7640: e3a01001 mov r1, #1 7644: e59f24ac ldr r2, [pc, #1196] ; 7af8 <_Heap_Walk+0x5ec> 7648: e1a0e00f mov lr, pc 764c: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7650: e1a00005 mov r0, r5 7654: eaffffc0 b 755c <_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" ); 7658: e1a0000a mov r0, sl 765c: e3a01001 mov r1, #1 7660: e59f2494 ldr r2, [pc, #1172] ; 7afc <_Heap_Walk+0x5f0> 7664: e1a0e00f mov lr, pc 7668: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 766c: e59d0024 ldr r0, [sp, #36] ; 0x24 7670: eaffffb9 b 755c <_Heap_Walk+0x50> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 7674: e1a0000a mov r0, sl 7678: e3a01001 mov r1, #1 767c: e59f247c ldr r2, [pc, #1148] ; 7b00 <_Heap_Walk+0x5f4> 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: e3a00000 mov r0, #0 768c: eaffffb2 b 755c <_Heap_Walk+0x50> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 7690: e1a0000a mov r0, sl 7694: e3a01001 mov r1, #1 7698: e59f2464 ldr r2, [pc, #1124] ; 7b04 <_Heap_Walk+0x5f8> 769c: e59d3028 ldr r3, [sp, #40] ; 0x28 76a0: e1a0e00f mov lr, pc 76a4: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 76a8: e1a00005 mov r0, r5 76ac: eaffffaa b 755c <_Heap_Walk+0x50> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 76b0: e1a0000a mov r0, sl 76b4: e3a01001 mov r1, #1 76b8: e59f2448 ldr r2, [pc, #1096] ; 7b08 <_Heap_Walk+0x5fc> 76bc: e1a03008 mov r3, r8 76c0: e1a0e00f mov lr, pc 76c4: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 76c8: e1a0000b mov r0, fp 76cc: eaffffa2 b 755c <_Heap_Walk+0x50> block = next_block; } while ( block != first_block ); return true; } 76d0: 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 ) { 76d4: e1540005 cmp r4, r5 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 76d8: 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 ) { 76dc: 05943020 ldreq r3, [r4, #32] 76e0: 0a00000d beq 771c <_Heap_Walk+0x210> block = next_block; } while ( block != first_block ); return true; } 76e4: 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; 76e8: e1530005 cmp r3, r5 76ec: 9a000097 bls 7950 <_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)( 76f0: e1a0000a mov r0, sl 76f4: e3a01001 mov r1, #1 76f8: e59f240c ldr r2, [pc, #1036] ; 7b0c <_Heap_Walk+0x600> 76fc: e1a03005 mov r3, r5 7700: e1a0e00f mov lr, pc 7704: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7708: e3a00000 mov r0, #0 770c: eaffff92 b 755c <_Heap_Walk+0x50> 7710: e1a03008 mov r3, r8 7714: e28d8030 add r8, sp, #48 ; 0x30 7718: e8980900 ldm r8, {r8, fp} ); return false; } if ( _Heap_Is_used( free_block ) ) { 771c: 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; 7720: 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); 7724: 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; 7728: e1530005 cmp r3, r5 772c: 9a000008 bls 7754 <_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)( 7730: e1a0000a mov r0, sl 7734: e58d5000 str r5, [sp] 7738: e3a01001 mov r1, #1 773c: e59f23cc ldr r2, [pc, #972] ; 7b10 <_Heap_Walk+0x604> 7740: e1a03006 mov r3, r6 7744: e1a0e00f mov lr, pc 7748: e12fff19 bx r9 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 774c: e3a00000 mov r0, #0 7750: eaffff81 b 755c <_Heap_Walk+0x50> 7754: e5943024 ldr r3, [r4, #36] ; 0x24 7758: e1530005 cmp r3, r5 775c: 3afffff3 bcc 7730 <_Heap_Walk+0x224> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 7760: e59d1024 ldr r1, [sp, #36] ; 0x24 7764: e1a00007 mov r0, r7 7768: ebffe50c 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; 776c: e59d102c ldr r1, [sp, #44] ; 0x2c 7770: e0563001 subs r3, r6, r1 7774: 13a03001 movne r3, #1 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 7778: e3500000 cmp r0, #0 777c: 0a000001 beq 7788 <_Heap_Walk+0x27c> 7780: e3530000 cmp r3, #0 7784: 1a0000aa bne 7a34 <_Heap_Walk+0x528> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 7788: e59d2028 ldr r2, [sp, #40] ; 0x28 778c: e1520007 cmp r2, r7 7790: 9a000001 bls 779c <_Heap_Walk+0x290> 7794: e3530000 cmp r3, #0 7798: 1a0000ae bne 7a58 <_Heap_Walk+0x54c> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 779c: e1560005 cmp r6, r5 77a0: 3a000001 bcc 77ac <_Heap_Walk+0x2a0> 77a4: e3530000 cmp r3, #0 77a8: 1a0000b4 bne 7a80 <_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; 77ac: e5953004 ldr r3, [r5, #4] ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 77b0: e3130001 tst r3, #1 77b4: e20bb001 and fp, fp, #1 77b8: 0a000018 beq 7820 <_Heap_Walk+0x314> if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 77bc: e35b0000 cmp fp, #0 77c0: 0a00000c beq 77f8 <_Heap_Walk+0x2ec> (*printer)( 77c4: e58d7000 str r7, [sp] 77c8: e1a0000a mov r0, sl 77cc: e3a01000 mov r1, #0 77d0: e59f233c ldr r2, [pc, #828] ; 7b14 <_Heap_Walk+0x608> 77d4: e1a03006 mov r3, r6 77d8: e1a0e00f mov lr, pc 77dc: e12fff19 bx r9 block->prev_size ); } block = next_block; } while ( block != first_block ); 77e0: e1580005 cmp r8, r5 77e4: 0affff5b beq 7558 <_Heap_Walk+0x4c> 77e8: e595b004 ldr fp, [r5, #4] 77ec: e5943020 ldr r3, [r4, #32] 77f0: e1a06005 mov r6, r5 77f4: eaffffc9 b 7720 <_Heap_Walk+0x214> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 77f8: e58d7000 str r7, [sp] 77fc: e5963000 ldr r3, [r6] 7800: e1a0000a mov r0, sl 7804: e58d3004 str r3, [sp, #4] 7808: e1a0100b mov r1, fp 780c: e59f2304 ldr r2, [pc, #772] ; 7b18 <_Heap_Walk+0x60c> 7810: e1a03006 mov r3, r6 7814: e1a0e00f mov lr, pc 7818: e12fff19 bx r9 781c: eaffffef b 77e0 <_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 ? 7820: 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)( 7824: e5943008 ldr r3, [r4, #8] 7828: e1530002 cmp r3, r2 block = next_block; } while ( block != first_block ); return true; } 782c: 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)( 7830: 059f02e4 ldreq r0, [pc, #740] ; 7b1c <_Heap_Walk+0x610> 7834: 0a000003 beq 7848 <_Heap_Walk+0x33c> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 7838: e59f32e0 ldr r3, [pc, #736] ; 7b20 <_Heap_Walk+0x614> 783c: e1540002 cmp r4, r2 7840: e59f02dc ldr r0, [pc, #732] ; 7b24 <_Heap_Walk+0x618> 7844: 01a00003 moveq r0, r3 block->next, block->next == last_free_block ? 7848: 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)( 784c: e1510003 cmp r1, r3 7850: 059f12d0 ldreq r1, [pc, #720] ; 7b28 <_Heap_Walk+0x61c> 7854: 0a000003 beq 7868 <_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)" : "") 7858: e59fc2cc ldr ip, [pc, #716] ; 7b2c <_Heap_Walk+0x620> 785c: e1540003 cmp r4, r3 7860: e59f12bc ldr r1, [pc, #700] ; 7b24 <_Heap_Walk+0x618> 7864: 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)( 7868: e58d2004 str r2, [sp, #4] 786c: e58d0008 str r0, [sp, #8] 7870: e58d300c str r3, [sp, #12] 7874: e58d1010 str r1, [sp, #16] 7878: e1a03006 mov r3, r6 787c: e58d7000 str r7, [sp] 7880: e1a0000a mov r0, sl 7884: e3a01000 mov r1, #0 7888: e59f22a0 ldr r2, [pc, #672] ; 7b30 <_Heap_Walk+0x624> 788c: e1a0e00f mov lr, pc 7890: e12fff19 bx r9 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 7894: e5953000 ldr r3, [r5] 7898: e1570003 cmp r7, r3 789c: 1a000011 bne 78e8 <_Heap_Walk+0x3dc> ); return false; } if ( !prev_used ) { 78a0: e35b0000 cmp fp, #0 78a4: 0a00001a beq 7914 <_Heap_Walk+0x408> block = next_block; } while ( block != first_block ); return true; } 78a8: 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 ) { 78ac: e1540003 cmp r4, r3 78b0: 0a000004 beq 78c8 <_Heap_Walk+0x3bc> if ( free_block == block ) { 78b4: e1560003 cmp r6, r3 78b8: 0affffc8 beq 77e0 <_Heap_Walk+0x2d4> return true; } free_block = free_block->next; 78bc: 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 ) { 78c0: e1540003 cmp r4, r3 78c4: 1afffffa bne 78b4 <_Heap_Walk+0x3a8> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 78c8: e1a0000a mov r0, sl 78cc: e3a01001 mov r1, #1 78d0: e59f225c ldr r2, [pc, #604] ; 7b34 <_Heap_Walk+0x628> 78d4: e1a03006 mov r3, r6 78d8: e1a0e00f mov lr, pc 78dc: e12fff19 bx r9 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 78e0: e3a00000 mov r0, #0 78e4: eaffff1c b 755c <_Heap_Walk+0x50> " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( 78e8: e58d3004 str r3, [sp, #4] 78ec: e1a0000a mov r0, sl 78f0: e58d7000 str r7, [sp] 78f4: e58d5008 str r5, [sp, #8] 78f8: e3a01001 mov r1, #1 78fc: e59f2234 ldr r2, [pc, #564] ; 7b38 <_Heap_Walk+0x62c> 7900: e1a03006 mov r3, r6 7904: e1a0e00f mov lr, pc 7908: e12fff19 bx r9 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 790c: e3a00000 mov r0, #0 7910: eaffff11 b 755c <_Heap_Walk+0x50> return false; } if ( !prev_used ) { (*printer)( 7914: e1a0000a mov r0, sl 7918: e3a01001 mov r1, #1 791c: e59f2218 ldr r2, [pc, #536] ; 7b3c <_Heap_Walk+0x630> 7920: e1a03006 mov r3, r6 7924: e1a0e00f mov lr, pc 7928: e12fff19 bx r9 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 792c: e1a0000b mov r0, fp 7930: eaffff09 b 755c <_Heap_Walk+0x50> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 7934: e1a0000a mov r0, sl 7938: e3a01001 mov r1, #1 793c: e59f21fc ldr r2, [pc, #508] ; 7b40 <_Heap_Walk+0x634> 7940: e1a0e00f mov lr, pc 7944: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7948: e1a00005 mov r0, r5 794c: eaffff02 b 755c <_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; 7950: e594c024 ldr ip, [r4, #36] ; 0x24 7954: e15c0005 cmp ip, r5 7958: 3affff64 bcc 76f0 <_Heap_Walk+0x1e4> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 795c: e2850008 add r0, r5, #8 7960: e1a01007 mov r1, r7 7964: e58d3020 str r3, [sp, #32] 7968: e58dc01c str ip, [sp, #28] 796c: ebffe48b bl ba0 <__umodsi3> ); return false; } if ( 7970: e3500000 cmp r0, #0 7974: e59d3020 ldr r3, [sp, #32] 7978: e59dc01c ldr ip, [sp, #28] 797c: 1a000048 bne 7aa4 <_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; 7980: e5952004 ldr r2, [r5, #4] 7984: e3c22001 bic r2, r2, #1 block = next_block; } while ( block != first_block ); return true; } 7988: 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; 798c: e5922004 ldr r2, [r2, #4] ); return false; } if ( _Heap_Is_used( free_block ) ) { 7990: e3120001 tst r2, #1 7994: 1a00004a bne 7ac4 <_Heap_Walk+0x5b8> 7998: e58d8030 str r8, [sp, #48] ; 0x30 799c: e58db034 str fp, [sp, #52] ; 0x34 79a0: e1a01004 mov r1, r4 79a4: e1a06005 mov r6, r5 79a8: e1a08003 mov r8, r3 79ac: e1a0b00c mov fp, ip 79b0: ea000013 b 7a04 <_Heap_Walk+0x4f8> return false; } prev_block = free_block; free_block = free_block->next; 79b4: 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 ) { 79b8: e1540005 cmp r4, r5 79bc: 0affff53 beq 7710 <_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; 79c0: e1580005 cmp r8, r5 79c4: 8affff49 bhi 76f0 <_Heap_Walk+0x1e4> 79c8: e155000b cmp r5, fp RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 79cc: e2850008 add r0, r5, #8 79d0: 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; 79d4: 8affff45 bhi 76f0 <_Heap_Walk+0x1e4> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 79d8: ebffe470 bl ba0 <__umodsi3> ); return false; } if ( 79dc: e3500000 cmp r0, #0 79e0: 1a00002f bne 7aa4 <_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; 79e4: e5953004 ldr r3, [r5, #4] 79e8: e3c33001 bic r3, r3, #1 block = next_block; } while ( block != first_block ); return true; } 79ec: 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; 79f0: e5933004 ldr r3, [r3, #4] ); return false; } if ( _Heap_Is_used( free_block ) ) { 79f4: e3130001 tst r3, #1 79f8: 1a000031 bne 7ac4 <_Heap_Walk+0x5b8> 79fc: e1a01006 mov r1, r6 7a00: e1a06005 mov r6, r5 ); return false; } if ( free_block->prev != prev_block ) { 7a04: e595200c ldr r2, [r5, #12] 7a08: e1520001 cmp r2, r1 7a0c: 0affffe8 beq 79b4 <_Heap_Walk+0x4a8> (*printer)( 7a10: e58d2000 str r2, [sp] 7a14: e1a0000a mov r0, sl 7a18: e3a01001 mov r1, #1 7a1c: e59f2120 ldr r2, [pc, #288] ; 7b44 <_Heap_Walk+0x638> 7a20: e1a03005 mov r3, r5 7a24: e1a0e00f mov lr, pc 7a28: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7a2c: e3a00000 mov r0, #0 7a30: eafffec9 b 755c <_Heap_Walk+0x50> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 7a34: e1a0000a mov r0, sl 7a38: e58d7000 str r7, [sp] 7a3c: e3a01001 mov r1, #1 7a40: e59f2100 ldr r2, [pc, #256] ; 7b48 <_Heap_Walk+0x63c> 7a44: e1a03006 mov r3, r6 7a48: e1a0e00f mov lr, pc 7a4c: e12fff19 bx r9 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 7a50: e3a00000 mov r0, #0 7a54: eafffec0 b 755c <_Heap_Walk+0x50> } if ( block_size < min_block_size && is_not_last_block ) { (*printer)( 7a58: e58d2004 str r2, [sp, #4] 7a5c: e1a0000a mov r0, sl 7a60: e58d7000 str r7, [sp] 7a64: e3a01001 mov r1, #1 7a68: e59f20dc ldr r2, [pc, #220] ; 7b4c <_Heap_Walk+0x640> 7a6c: e1a03006 mov r3, r6 7a70: e1a0e00f mov lr, pc 7a74: e12fff19 bx r9 block, block_size, min_block_size ); return false; 7a78: e3a00000 mov r0, #0 7a7c: eafffeb6 b 755c <_Heap_Walk+0x50> } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( 7a80: e1a0000a mov r0, sl 7a84: e58d5000 str r5, [sp] 7a88: e3a01001 mov r1, #1 7a8c: e59f20bc ldr r2, [pc, #188] ; 7b50 <_Heap_Walk+0x644> 7a90: e1a03006 mov r3, r6 7a94: e1a0e00f mov lr, pc 7a98: e12fff19 bx r9 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 7a9c: e3a00000 mov r0, #0 7aa0: eafffead b 755c <_Heap_Walk+0x50> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 7aa4: e1a0000a mov r0, sl 7aa8: e3a01001 mov r1, #1 7aac: e59f20a0 ldr r2, [pc, #160] ; 7b54 <_Heap_Walk+0x648> 7ab0: e1a03005 mov r3, r5 7ab4: e1a0e00f mov lr, pc 7ab8: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7abc: e3a00000 mov r0, #0 7ac0: eafffea5 b 755c <_Heap_Walk+0x50> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 7ac4: e1a0000a mov r0, sl 7ac8: e3a01001 mov r1, #1 7acc: e59f2084 ldr r2, [pc, #132] ; 7b58 <_Heap_Walk+0x64c> 7ad0: e1a03005 mov r3, r5 7ad4: e1a0e00f mov lr, pc 7ad8: e12fff19 bx r9 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7adc: e3a00000 mov r0, #0 7ae0: eafffe9d b 755c <_Heap_Walk+0x50> =============================================================================== 000069e8 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 69e8: 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 ) 69ec: e5904034 ldr r4, [r0, #52] ; 0x34 69f0: e3540000 cmp r4, #0 */ void _Objects_Extend_information( Objects_Information *information ) { 69f4: e24dd014 sub sp, sp, #20 69f8: 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 ); 69fc: e1d070b8 ldrh r7, [r0, #8] index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 6a00: 0a00009b beq 6c74 <_Objects_Extend_information+0x28c> block_count = 0; else { block_count = information->maximum / information->allocation_size; 6a04: e1d081b4 ldrh r8, [r0, #20] 6a08: e1d0a1b0 ldrh sl, [r0, #16] 6a0c: e1a01008 mov r1, r8 6a10: e1a0000a mov r0, sl 6a14: eb002636 bl 102f4 <__aeabi_uidiv> 6a18: e1a03800 lsl r3, r0, #16 for ( ; block < block_count; block++ ) { 6a1c: e1b03823 lsrs r3, r3, #16 6a20: 0a000099 beq 6c8c <_Objects_Extend_information+0x2a4> if ( information->object_blocks[ block ] == NULL ) { 6a24: e5949000 ldr r9, [r4] 6a28: e3590000 cmp r9, #0 6a2c: 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 ); 6a30: 01a06007 moveq r6, r7 index_base = minimum_index; block = 0; 6a34: 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 ) { 6a38: 0a00000c beq 6a70 <_Objects_Extend_information+0x88> 6a3c: e1a02004 mov r2, r4 6a40: 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 ); 6a44: e1a06007 mov r6, r7 index_base = minimum_index; block = 0; 6a48: e3a04000 mov r4, #0 6a4c: ea000002 b 6a5c <_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 ) { 6a50: e5b29004 ldr r9, [r2, #4]! 6a54: e3590000 cmp r9, #0 6a58: 0a000004 beq 6a70 <_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++ ) { 6a5c: e2844001 add r4, r4, #1 6a60: e1530004 cmp r3, r4 if ( information->object_blocks[ block ] == NULL ) { do_extend = false; break; } else index_base += information->allocation_size; 6a64: 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++ ) { 6a68: 8afffff8 bhi 6a50 <_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; 6a6c: e3a09001 mov r9, #1 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 6a70: 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 ) { 6a74: e35a0801 cmp sl, #65536 ; 0x10000 6a78: 2a000063 bcs 6c0c <_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 ) { 6a7c: 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; 6a80: e5950018 ldr r0, [r5, #24] if ( information->auto_extend ) { 6a84: 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; 6a88: e0000091 mul r0, r1, r0 if ( information->auto_extend ) { 6a8c: 1a000060 bne 6c14 <_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 ); 6a90: e58d3000 str r3, [sp] 6a94: eb000850 bl 8bdc <_Workspace_Allocate_or_fatal_error> 6a98: e59d3000 ldr r3, [sp] 6a9c: e1a08000 mov r8, r0 } /* * Do we need to grow the tables? */ if ( do_extend ) { 6aa0: e3590000 cmp r9, #0 6aa4: 0a000039 beq 6b90 <_Objects_Extend_information+0x1a8> */ /* * Up the block count and maximum */ block_count++; 6aa8: e283b001 add fp, r3, #1 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 6aac: e08b008b add r0, fp, fp, lsl #1 ((maximum + minimum_index) * sizeof(Objects_Control *)); 6ab0: e08a0000 add r0, sl, r0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 6ab4: e0800007 add r0, r0, r7 ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 6ab8: e1a00100 lsl r0, r0, #2 6abc: e58d3000 str r3, [sp] 6ac0: eb00083b bl 8bb4 <_Workspace_Allocate> if ( !object_blocks ) { 6ac4: e2509000 subs r9, r0, #0 6ac8: e59d3000 ldr r3, [sp] 6acc: 0a000073 beq 6ca0 <_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 ) { 6ad0: e1d521b0 ldrh r2, [r5, #16] 6ad4: e1570002 cmp r7, r2 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 6ad8: e089c10b add ip, r9, fp, lsl #2 6adc: e089b18b add fp, r9, fp, lsl #3 6ae0: 3a000051 bcc 6c2c <_Objects_Extend_information+0x244> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 6ae4: e3570000 cmp r7, #0 6ae8: 13a02000 movne r2, #0 6aec: 11a0100b movne r1, fp local_table[ index ] = NULL; 6af0: 11a00002 movne r0, r2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 6af4: 0a000003 beq 6b08 <_Objects_Extend_information+0x120> 6af8: e2822001 add r2, r2, #1 6afc: e1570002 cmp r7, r2 local_table[ index ] = NULL; 6b00: e4810004 str r0, [r1], #4 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 6b04: 8afffffb bhi 6af8 <_Objects_Extend_information+0x110> 6b08: 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 ); 6b0c: e1d511b4 ldrh r1, [r5, #20] 6b10: e0861001 add r1, r6, r1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 6b14: e3a00000 mov r0, #0 inactive_per_block[block_count] = 0; for ( index=index_base ; 6b18: e1560001 cmp r6, r1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 6b1c: e7890003 str r0, [r9, r3] inactive_per_block[block_count] = 0; 6b20: e78c0003 str r0, [ip, r3] for ( index=index_base ; 6b24: 2a000005 bcs 6b40 <_Objects_Extend_information+0x158> 6b28: e08b2106 add r2, fp, r6, lsl #2 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 6b2c: 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++ ) { 6b30: 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 ; 6b34: e1530001 cmp r3, r1 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 6b38: 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 ; 6b3c: 3afffffb bcc 6b30 <_Objects_Extend_information+0x148> 6b40: e10f3000 mrs r3, CPSR 6b44: e3832080 orr r2, r3, #128 ; 0x80 6b48: e129f002 msr CPSR_fc, r2 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 6b4c: 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( 6b50: e1d510b4 ldrh r1, [r5, #4] 6b54: 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; 6b58: e1a0a80a lsl sl, sl, #16 6b5c: e3822801 orr r2, r2, #65536 ; 0x10000 6b60: e1a0a82a lsr sl, sl, #16 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 6b64: 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) | 6b68: e182200a orr r2, r2, sl local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 6b6c: e5950034 ldr r0, [r5, #52] ; 0x34 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 6b70: e585c030 str ip, [r5, #48] ; 0x30 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 6b74: e5859034 str r9, [r5, #52] ; 0x34 information->inactive_per_block = inactive_per_block; information->local_table = local_table; 6b78: e585b01c str fp, [r5, #28] information->maximum = (Objects_Maximum) maximum; 6b7c: e1c5a1b0 strh sl, [r5, #16] information->maximum_id = _Objects_Build_id( 6b80: e585200c str r2, [r5, #12] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 6b84: e129f003 msr CPSR_fc, r3 information->maximum ); _ISR_Enable( level ); if ( old_tables ) 6b88: e3500000 cmp r0, #0 _Workspace_Free( old_tables ); 6b8c: 1b00080e blne 8bcc <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 6b90: e5953034 ldr r3, [r5, #52] ; 0x34 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 6b94: e28d7008 add r7, sp, #8 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 6b98: e7838104 str r8, [r3, r4, lsl #2] /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 6b9c: e1a01008 mov r1, r8 6ba0: e1a00007 mov r0, r7 6ba4: e1d521b4 ldrh r2, [r5, #20] 6ba8: e5953018 ldr r3, [r5, #24] 6bac: eb000fe3 bl ab40 <_Chain_Initialize> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 6bb0: e1a04104 lsl r4, r4, #2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 6bb4: 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 ) { 6bb8: ea000009 b 6be4 <_Objects_Extend_information+0x1fc> 6bbc: e5953000 ldr r3, [r5] the_object->id = _Objects_Build_id( 6bc0: e1d520b4 ldrh r2, [r5, #4] 6bc4: e1a03c03 lsl r3, r3, #24 6bc8: e3833801 orr r3, r3, #65536 ; 0x10000 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 6bcc: 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) | 6bd0: e1833006 orr r3, r3, r6 6bd4: e5813008 str r3, [r1, #8] information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 6bd8: e1a00008 mov r0, r8 6bdc: ebfffce6 bl 5f7c <_Chain_Append> index++; 6be0: 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 ) { 6be4: e1a00007 mov r0, r7 6be8: ebfffcf6 bl 5fc8 <_Chain_Get> 6bec: e2501000 subs r1, r0, #0 6bf0: 1afffff1 bne 6bbc <_Objects_Extend_information+0x1d4> index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 6bf4: e1d522bc ldrh r2, [r5, #44] ; 0x2c _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 6bf8: e1d531b4 ldrh r3, [r5, #20] 6bfc: e5951030 ldr r1, [r5, #48] ; 0x30 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 6c00: e0832002 add r2, r3, r2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 6c04: e7813004 str r3, [r1, r4] information->inactive = 6c08: e1c522bc strh r2, [r5, #44] ; 0x2c (Objects_Maximum)(information->inactive + information->allocation_size); } 6c0c: e28dd014 add sp, sp, #20 6c10: 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 ); 6c14: e58d3000 str r3, [sp] 6c18: eb0007e5 bl 8bb4 <_Workspace_Allocate> if ( !new_object_block ) 6c1c: e2508000 subs r8, r0, #0 6c20: e59d3000 ldr r3, [sp] 6c24: 1affff9d bne 6aa0 <_Objects_Extend_information+0xb8> 6c28: eafffff7 b 6c0c <_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, 6c2c: e1a03103 lsl r3, r3, #2 6c30: e5951034 ldr r1, [r5, #52] ; 0x34 6c34: e1a02003 mov r2, r3 6c38: e88d1008 stm sp, {r3, ip} 6c3c: eb001a3b bl d530 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 6c40: e89d1008 ldm sp, {r3, ip} 6c44: e1a0000c mov r0, ip 6c48: e1a02003 mov r2, r3 6c4c: e5951030 ldr r1, [r5, #48] ; 0x30 6c50: eb001a36 bl d530 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 6c54: e1d521b0 ldrh r2, [r5, #16] 6c58: 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, 6c5c: e1a0000b mov r0, fp 6c60: e595101c ldr r1, [r5, #28] 6c64: e1a02102 lsl r2, r2, #2 6c68: eb001a30 bl d530 6c6c: e89d1008 ldm sp, {r3, ip} 6c70: eaffffa5 b 6b0c <_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 ) 6c74: e1d0a1b0 ldrh sl, [r0, #16] 6c78: 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 ); 6c7c: 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; 6c80: e3a09001 mov r9, #1 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 6c84: e1a03004 mov r3, r4 6c88: eaffff78 b 6a70 <_Objects_Extend_information+0x88> else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 6c8c: 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 ); 6c90: 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; 6c94: e3a09001 mov r9, #1 <== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 6c98: e1a04003 mov r4, r3 <== NOT EXECUTED 6c9c: eaffff73 b 6a70 <_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 ); 6ca0: e1a00008 mov r0, r8 6ca4: eb0007c8 bl 8bcc <_Workspace_Free> return; 6ca8: eaffffd7 b 6c0c <_Objects_Extend_information+0x224> =============================================================================== 00006ff0 <_Objects_Shrink_information>: */ void _Objects_Shrink_information( Objects_Information *information ) { 6ff0: 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 ); 6ff4: e1d040b8 ldrh r4, [r0, #8] block_count = (information->maximum - index_base) / 6ff8: e1d051b4 ldrh r5, [r0, #20] */ void _Objects_Shrink_information( Objects_Information *information ) { 6ffc: 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) / 7000: e1d001b0 ldrh r0, [r0, #16] 7004: e1a01005 mov r1, r5 7008: e0640000 rsb r0, r4, r0 700c: eb0024b8 bl 102f4 <__aeabi_uidiv> information->allocation_size; for ( block = 0; block < block_count; block++ ) { 7010: e3500000 cmp r0, #0 7014: 08bd80f0 popeq {r4, r5, r6, r7, pc} if ( information->inactive_per_block[ block ] == 7018: e5962030 ldr r2, [r6, #48] ; 0x30 701c: e5923000 ldr r3, [r2] 7020: 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++ ) { 7024: 13a03000 movne r3, #0 if ( information->inactive_per_block[ block ] == 7028: 1a000005 bne 7044 <_Objects_Shrink_information+0x54> 702c: ea000008 b 7054 <_Objects_Shrink_information+0x64> <== NOT EXECUTED 7030: e5b21004 ldr r1, [r2, #4]! 7034: e1550001 cmp r5, r1 information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 7038: e0844005 add r4, r4, r5 703c: 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 ] == 7040: 0a000004 beq 7058 <_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++ ) { 7044: e2833001 add r3, r3, #1 7048: e1500003 cmp r0, r3 704c: 8afffff7 bhi 7030 <_Objects_Shrink_information+0x40> 7050: e8bd80f0 pop {r4, r5, r6, r7, pc} if ( information->inactive_per_block[ block ] == 7054: e3a07000 mov r7, #0 <== NOT EXECUTED information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) _Chain_First( &information->Inactive ); 7058: e5960020 ldr r0, [r6, #32] 705c: ea000002 b 706c <_Objects_Shrink_information+0x7c> if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 7060: e3550000 cmp r5, #0 7064: 0a00000b beq 7098 <_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; 7068: e1a00005 mov r0, r5 * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) _Chain_First( &information->Inactive ); do { index = _Objects_Get_index( the_object->id ); 706c: 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) && 7070: 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; 7074: e5905000 ldr r5, [r0] if ((index >= index_base) && 7078: 3afffff8 bcc 7060 <_Objects_Shrink_information+0x70> (index < (index_base + information->allocation_size))) { 707c: e1d621b4 ldrh r2, [r6, #20] 7080: 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) && 7084: e1530002 cmp r3, r2 7088: 2afffff4 bcs 7060 <_Objects_Shrink_information+0x70> (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 708c: ebfffbc5 bl 5fa8 <_Chain_Extract> } } while ( the_object ); 7090: e3550000 cmp r5, #0 7094: 1afffff3 bne 7068 <_Objects_Shrink_information+0x78> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 7098: e5963034 ldr r3, [r6, #52] ; 0x34 709c: e7930007 ldr r0, [r3, r7] 70a0: eb0006c9 bl 8bcc <_Workspace_Free> information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 70a4: e1d602bc ldrh r0, [r6, #44] ; 0x2c 70a8: 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; 70ac: e5961034 ldr r1, [r6, #52] ; 0x34 information->inactive_per_block[ block ] = 0; 70b0: e5962030 ldr r2, [r6, #48] ; 0x30 information->inactive -= information->allocation_size; 70b4: 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; 70b8: e7815007 str r5, [r1, r7] information->inactive_per_block[ block ] = 0; 70bc: e7825007 str r5, [r2, r7] information->inactive -= information->allocation_size; 70c0: e1c632bc strh r3, [r6, #44] ; 0x2c return; 70c4: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 00006648 <_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(); 6648: e59f30b8 ldr r3, [pc, #184] ; 6708 <_TOD_Validate+0xc0> */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 664c: 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) || 6650: 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(); 6654: 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; 6658: 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) || 665c: 08bd8010 popeq {r4, pc} ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 6660: e3a0093d mov r0, #999424 ; 0xf4000 6664: e2800d09 add r0, r0, #576 ; 0x240 6668: eb004507 bl 17a8c <__aeabi_uidiv> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 666c: e5943018 ldr r3, [r4, #24] 6670: e1500003 cmp r0, r3 6674: 9a00001f bls 66f8 <_TOD_Validate+0xb0> (the_tod->ticks >= ticks_per_second) || 6678: e5943014 ldr r3, [r4, #20] 667c: e353003b cmp r3, #59 ; 0x3b 6680: 8a00001c bhi 66f8 <_TOD_Validate+0xb0> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 6684: e5943010 ldr r3, [r4, #16] 6688: e353003b cmp r3, #59 ; 0x3b 668c: 8a000019 bhi 66f8 <_TOD_Validate+0xb0> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 6690: e594300c ldr r3, [r4, #12] 6694: e3530017 cmp r3, #23 6698: 8a000016 bhi 66f8 <_TOD_Validate+0xb0> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 669c: 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) || 66a0: e3500000 cmp r0, #0 66a4: 08bd8010 popeq {r4, pc} (the_tod->month == 0) || 66a8: e350000c cmp r0, #12 66ac: 8a000011 bhi 66f8 <_TOD_Validate+0xb0> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 66b0: 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) || 66b4: e3a03d1f mov r3, #1984 ; 0x7c0 66b8: e2833003 add r3, r3, #3 66bc: e1520003 cmp r2, r3 66c0: 9a00000c bls 66f8 <_TOD_Validate+0xb0> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 66c4: 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) || 66c8: e3540000 cmp r4, #0 66cc: 0a00000b beq 6700 <_TOD_Validate+0xb8> (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 66d0: e3120003 tst r2, #3 days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 66d4: 059f3030 ldreq r3, [pc, #48] ; 670c <_TOD_Validate+0xc4> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 66d8: 159f302c ldrne r3, [pc, #44] ; 670c <_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 ]; 66dc: 0280000d addeq r0, r0, #13 66e0: 07930100 ldreq r0, [r3, r0, lsl #2] else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 66e4: 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( 66e8: e1500004 cmp r0, r4 66ec: 33a00000 movcc r0, #0 66f0: 23a00001 movcs r0, #1 66f4: 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; 66f8: e3a00000 mov r0, #0 66fc: e8bd8010 pop {r4, pc} 6700: e1a00004 mov r0, r4 <== NOT EXECUTED if ( the_tod->day > days_in_month ) return false; return true; } 6704: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== 00007f20 <_Thread_queue_Enqueue_priority>: Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 7f20: 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 ) { 7f24: e92d07f0 push {r4, r5, r6, r7, r8, r9, sl} RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 7f28: e281403c add r4, r1, #60 ; 0x3c */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 7f2c: e281c038 add ip, r1, #56 ; 0x38 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 7f30: 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 ) ) 7f34: e3130020 tst r3, #32 head->previous = NULL; 7f38: e3a04000 mov r4, #0 7f3c: e581403c str r4, [r1, #60] ; 0x3c tail->previous = head; 7f40: 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); 7f44: e1a0a323 lsr sl, 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; 7f48: e5905038 ldr r5, [r0, #56] ; 0x38 if ( _Thread_queue_Is_reverse_search( priority ) ) 7f4c: 1a00001f bne 7fd0 <_Thread_queue_Enqueue_priority+0xb0> * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 7f50: e08aa08a add sl, sl, sl, lsl #1 7f54: e1a0910a lsl r9, sl, #2 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Tail(the_chain)); 7f58: e289a004 add sl, r9, #4 7f5c: e080a00a add sl, r0, sl 7f60: e0809009 add r9, r0, r9 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 7f64: e10f7000 mrs r7, CPSR 7f68: e387c080 orr ip, r7, #128 ; 0x80 7f6c: e129f00c msr CPSR_fc, ip 7f70: e1a08007 mov r8, r7 7f74: e599c000 ldr ip, [r9] restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 7f78: e15c000a cmp ip, sl 7f7c: 1a000009 bne 7fa8 <_Thread_queue_Enqueue_priority+0x88> 7f80: ea000052 b 80d0 <_Thread_queue_Enqueue_priority+0x1b0> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 7f84: e10f6000 mrs r6, CPSR 7f88: e129f007 msr CPSR_fc, r7 7f8c: 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); 7f90: 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) ) { 7f94: e1150006 tst r5, r6 7f98: 0a000035 beq 8074 <_Thread_queue_Enqueue_priority+0x154> _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 7f9c: e59cc000 ldr ip, [ip] restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 7fa0: e15c000a cmp ip, sl 7fa4: 0a000002 beq 7fb4 <_Thread_queue_Enqueue_priority+0x94> search_priority = search_thread->current_priority; 7fa8: e59c4014 ldr r4, [ip, #20] if ( priority <= search_priority ) 7fac: e1530004 cmp r3, r4 7fb0: 8afffff3 bhi 7f84 <_Thread_queue_Enqueue_priority+0x64> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 7fb4: e5905030 ldr r5, [r0, #48] ; 0x30 7fb8: e3550001 cmp r5, #1 7fbc: 0a00002e beq 807c <_Thread_queue_Enqueue_priority+0x15c> * 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; 7fc0: e5828000 str r8, [r2] return the_thread_queue->sync_state; } 7fc4: e1a00005 mov r0, r5 7fc8: e8bd07f0 pop {r4, r5, r6, r7, r8, r9, sl} 7fcc: e12fff1e bx lr 7fd0: e08aa08a add sl, sl, sl, lsl #1 7fd4: e59f90fc ldr r9, [pc, #252] ; 80d8 <_Thread_queue_Enqueue_priority+0x1b8> 7fd8: e080a10a add sl, r0, sl, lsl #2 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 7fdc: e5d94000 ldrb r4, [r9] 7fe0: e2844001 add r4, r4, #1 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 7fe4: e10f7000 mrs r7, CPSR 7fe8: e387c080 orr ip, r7, #128 ; 0x80 7fec: e129f00c msr CPSR_fc, ip 7ff0: e1a08007 mov r8, r7 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 7ff4: e59ac008 ldr ip, [sl, #8] restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 7ff8: e15c000a cmp ip, sl 7ffc: 1a000009 bne 8028 <_Thread_queue_Enqueue_priority+0x108> 8000: ea00000b b 8034 <_Thread_queue_Enqueue_priority+0x114> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 8004: e10f6000 mrs r6, CPSR 8008: e129f007 msr CPSR_fc, r7 800c: e129f006 msr CPSR_fc, r6 8010: 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) ) { 8014: e1150006 tst r5, r6 8018: 0a000013 beq 806c <_Thread_queue_Enqueue_priority+0x14c> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 801c: e59cc004 ldr ip, [ip, #4] restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8020: e15c000a cmp ip, sl 8024: 0a000002 beq 8034 <_Thread_queue_Enqueue_priority+0x114> search_priority = search_thread->current_priority; 8028: e59c4014 ldr r4, [ip, #20] if ( priority >= search_priority ) 802c: e1530004 cmp r3, r4 8030: 3afffff3 bcc 8004 <_Thread_queue_Enqueue_priority+0xe4> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8034: e5905030 ldr r5, [r0, #48] ; 0x30 8038: e3550001 cmp r5, #1 803c: 1affffdf bne 7fc0 <_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 ) 8040: 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; 8044: e3a03000 mov r3, #0 8048: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 804c: 0a000016 beq 80ac <_Thread_queue_Enqueue_priority+0x18c> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8050: e59c3000 ldr r3, [ip] the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 8054: e8811008 stm r1, {r3, ip} search_node->next = the_node; next_node->previous = the_node; 8058: 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; 805c: e58c1000 str r1, [ip] next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 8060: e5810044 str r0, [r1, #68] ; 0x44 static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 8064: e129f007 msr CPSR_fc, r7 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8068: eaffffd5 b 7fc4 <_Thread_queue_Enqueue_priority+0xa4> 806c: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED 8070: eaffffd9 b 7fdc <_Thread_queue_Enqueue_priority+0xbc> <== NOT EXECUTED 8074: e129f007 msr CPSR_fc, r7 8078: eaffffb9 b 7f64 <_Thread_queue_Enqueue_priority+0x44> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 807c: 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; 8080: e3a03000 mov r3, #0 8084: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 8088: 0a000007 beq 80ac <_Thread_queue_Enqueue_priority+0x18c> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 808c: e59c3004 ldr r3, [ip, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8090: e581c000 str ip, [r1] the_node->previous = previous_node; 8094: e5813004 str r3, [r1, #4] previous_node->next = the_node; 8098: e5831000 str r1, [r3] search_node->previous = the_node; 809c: e58c1004 str r1, [ip, #4] the_thread->Wait.queue = the_thread_queue; 80a0: e5810044 str r0, [r1, #68] ; 0x44 80a4: e129f007 msr CPSR_fc, r7 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 80a8: eaffffc5 b 7fc4 <_Thread_queue_Enqueue_priority+0xa4> _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; 80ac: e59c3040 ldr r3, [ip, #64] ; 0x40 the_thread->Wait.queue = the_thread_queue; _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 ); 80b0: e28c203c add r2, ip, #60 ; 0x3c previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 80b4: e881000c stm r1, {r2, r3} the_node->previous = previous_node; previous_node->next = the_node; 80b8: e5831000 str r1, [r3] search_node->previous = the_node; 80bc: e58c1040 str r1, [ip, #64] ; 0x40 the_thread->Wait.queue = the_thread_queue; 80c0: e5810044 str r0, [r1, #68] ; 0x44 80c4: e129f008 msr CPSR_fc, r8 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 80c8: e3a05001 mov r5, #1 80cc: eaffffbc b 7fc4 <_Thread_queue_Enqueue_priority+0xa4> if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 80d0: e3e04000 mvn r4, #0 80d4: eaffffb6 b 7fb4 <_Thread_queue_Enqueue_priority+0x94> =============================================================================== 0000a294 <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) a294: e5902000 ldr r2, [r0] a298: e5913000 ldr r3, [r1] a29c: e1520003 cmp r2, r3 return true; a2a0: c3a00001 movgt r0, #1 bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) a2a4: c12fff1e bxgt lr return true; if ( lhs->tv_sec < rhs->tv_sec ) a2a8: ba000005 blt a2c4 <_Timespec_Greater_than+0x30> #include #include #include bool _Timespec_Greater_than( a2ac: e5900004 ldr r0, [r0, #4] a2b0: e5913004 ldr r3, [r1, #4] a2b4: e1500003 cmp r0, r3 a2b8: d3a00000 movle r0, #0 a2bc: c3a00001 movgt r0, #1 a2c0: e12fff1e bx lr { if ( lhs->tv_sec > rhs->tv_sec ) return true; if ( lhs->tv_sec < rhs->tv_sec ) return false; a2c4: e3a00000 mov r0, #0 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } a2c8: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 00008748 <_User_extensions_Thread_create>: #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 8748: e92d40f0 push {r4, r5, r6, r7, lr} return false; } } return true; } 874c: e59f5050 ldr r5, [pc, #80] ; 87a4 <_User_extensions_Thread_create+0x5c> 8750: e4954004 ldr r4, [r5], #4 { Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _Chain_First( &_User_extensions_List ); 8754: e1540005 cmp r4, r5 #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 8758: e1a06000 mov r6, r0 Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _Chain_First( &_User_extensions_List ); 875c: 0a00000e beq 879c <_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)( 8760: e59f7040 ldr r7, [pc, #64] ; 87a8 <_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 ) { 8764: e5943014 ldr r3, [r4, #20] 8768: e3530000 cmp r3, #0 status = (*the_extension->Callouts.thread_create)( 876c: 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 ) { 8770: 0a000004 beq 8788 <_User_extensions_Thread_create+0x40> status = (*the_extension->Callouts.thread_create)( 8774: e5970004 ldr r0, [r7, #4] 8778: e1a0e00f mov lr, pc 877c: e12fff13 bx r3 _Thread_Executing, the_thread ); if ( !status ) 8780: e3500000 cmp r0, #0 8784: 08bd80f0 popeq {r4, r5, r6, r7, pc} User_extensions_Control *the_extension; bool status; for ( the_node = _Chain_First( &_User_extensions_List ); !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 8788: e5944000 ldr r4, [r4] { Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _Chain_First( &_User_extensions_List ); 878c: e1540005 cmp r4, r5 8790: 1afffff3 bne 8764 <_User_extensions_Thread_create+0x1c> if ( !status ) return false; } } return true; 8794: e3a00001 mov r0, #1 8798: e8bd80f0 pop {r4, r5, r6, r7, pc} 879c: e3a00001 mov r0, #1 <== NOT EXECUTED } 87a0: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED =============================================================================== 0000a5ac <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { a5ac: e92d41f0 push {r4, r5, r6, r7, r8, lr} a5b0: e1a04000 mov r4, r0 a5b4: e1a05002 mov r5, r2 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a5b8: e10f3000 mrs r3, CPSR a5bc: e3832080 orr r2, r3, #128 ; 0x80 a5c0: e129f002 msr CPSR_fc, r2 } } _ISR_Enable( level ); } a5c4: e1a07000 mov r7, r0 a5c8: 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 ) ) { a5cc: e1520007 cmp r2, r7 a5d0: 0a000018 beq a638 <_Watchdog_Adjust+0x8c> switch ( direction ) { a5d4: e3510000 cmp r1, #0 a5d8: 1a000018 bne a640 <_Watchdog_Adjust+0x94> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { a5dc: e3550000 cmp r5, #0 a5e0: 0a000014 beq a638 <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) { a5e4: e5926010 ldr r6, [r2, #16] a5e8: e1550006 cmp r5, r6 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; a5ec: 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 ) { a5f0: 2a000005 bcs a60c <_Watchdog_Adjust+0x60> a5f4: ea000018 b a65c <_Watchdog_Adjust+0xb0> <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { a5f8: e0555006 subs r5, r5, r6 a5fc: 0a00000d beq a638 <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) { a600: e5926010 ldr r6, [r2, #16] a604: e1560005 cmp r6, r5 a608: 8a000013 bhi a65c <_Watchdog_Adjust+0xb0> _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; a60c: e5828010 str r8, [r2, #16] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a610: e129f003 msr CPSR_fc, r3 _ISR_Enable( level ); _Watchdog_Tickle( header ); a614: e1a00004 mov r0, r4 a618: eb0000a0 bl a8a0 <_Watchdog_Tickle> static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a61c: e10f3000 mrs r3, CPSR a620: e3832080 orr r2, r3, #128 ; 0x80 a624: e129f002 msr CPSR_fc, r2 } } _ISR_Enable( level ); } a628: e5941000 ldr r1, [r4] _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) a62c: e1570001 cmp r7, r1 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); a630: e1a02001 mov r2, r1 a634: 1affffef bne a5f8 <_Watchdog_Adjust+0x4c> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a638: e129f003 msr CPSR_fc, r3 } } _ISR_Enable( level ); } a63c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { a640: e3510001 cmp r1, #1 a644: 1afffffb bne a638 <_Watchdog_Adjust+0x8c> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; a648: e5921010 ldr r1, [r2, #16] a64c: e0815005 add r5, r1, r5 a650: e5825010 str r5, [r2, #16] a654: e129f003 msr CPSR_fc, r3 } } _ISR_Enable( level ); } a658: 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; a65c: e0655006 rsb r5, r5, r6 a660: e5825010 str r5, [r2, #16] break; a664: eafffff3 b a638 <_Watchdog_Adjust+0x8c> =============================================================================== 00006fbc : rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 6fbc: e59f3150 ldr r3, [pc, #336] ; 7114 6fc0: 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; 6fc4: e59f314c ldr r3, [pc, #332] ; 7118 if ( rtems_interrupt_is_in_progress() ) 6fc8: 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 ) { 6fcc: e92d4030 push {r4, r5, lr} 6fd0: e1a04000 mov r4, r0 rtems_device_major_number major_limit = _IO_Number_of_drivers; 6fd4: e5930000 ldr r0, [r3] if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; 6fd8: 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() ) 6fdc: 18bd8030 popne {r4, r5, pc} return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 6fe0: e3520000 cmp r2, #0 6fe4: 0a00003f beq 70e8 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; if ( driver_table == NULL ) 6fe8: e3510000 cmp r1, #0 if ( registered_major == NULL ) return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 6fec: e5820000 str r0, [r2] if ( driver_table == NULL ) 6ff0: 0a00003c beq 70e8 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 6ff4: e591c000 ldr ip, [r1] 6ff8: e35c0000 cmp ip, #0 6ffc: 0a000036 beq 70dc return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 7000: e1500004 cmp r0, r4 7004: 9a000027 bls 70a8 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 7008: e59f010c ldr r0, [pc, #268] ; 711c 700c: e590c000 ldr ip, [r0] 7010: e28cc001 add ip, ip, #1 7014: e580c000 str ip, [r0] return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 7018: e3540000 cmp r4, #0 701c: 1a000023 bne 70b0 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 7020: e593c000 ldr ip, [r3] rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 7024: e35c0000 cmp ip, #0 7028: 0a000030 beq 70f0 702c: e59fe0ec ldr lr, [pc, #236] ; 7120 7030: e59e3000 ldr r3, [lr] 7034: ea000003 b 7048 7038: e2844001 add r4, r4, #1 703c: e15c0004 cmp ip, r4 7040: e2833018 add r3, r3, #24 7044: 9a000005 bls 7060 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 7048: e5930000 ldr r0, [r3] 704c: e3500000 cmp r0, #0 7050: 1afffff8 bne 7038 7054: e5930004 ldr r0, [r3, #4] 7058: e3500000 cmp r0, #0 705c: 1afffff5 bne 7038 } /* Assigns invalid value in case of failure */ *major = m; if ( m != n ) 7060: e15c0004 cmp ip, r4 7064: 1084c084 addne ip, r4, r4, lsl #1 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 7068: e5824000 str r4, [r2] if ( m != n ) 706c: 11a0c18c lslne ip, ip, #3 7070: 0a00001f beq 70f4 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 7074: e59e5000 ldr r5, [lr] 7078: e1a0e001 mov lr, r1 707c: e8be000f ldm lr!, {r0, r1, r2, r3} 7080: e085c00c add ip, r5, ip 7084: e8ac000f stmia ip!, {r0, r1, r2, r3} 7088: e89e0003 ldm lr, {r0, r1} 708c: e88c0003 stm ip, {r0, r1} _Thread_Enable_dispatch(); 7090: eb000739 bl 8d7c <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 7094: e3a01000 mov r1, #0 7098: e1a00004 mov r0, r4 709c: e1a02001 mov r2, r1 } 70a0: e8bd4030 pop {r4, r5, lr} _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 70a4: ea001ec1 b ebb0 if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; 70a8: e3a0000a mov r0, #10 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 70ac: 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; 70b0: e59fe068 ldr lr, [pc, #104] ; 7120 70b4: e59e3000 ldr r3, [lr] 70b8: 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; 70bc: 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; 70c0: 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; 70c4: e3500000 cmp r0, #0 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 70c8: 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; 70cc: 0a00000b beq 7100 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(); 70d0: eb000729 bl 8d7c <_Thread_Enable_dispatch> return RTEMS_RESOURCE_IN_USE; 70d4: e3a0000c mov r0, #12 70d8: 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; 70dc: e591c004 ldr ip, [r1, #4] 70e0: e35c0000 cmp ip, #0 70e4: 1affffc5 bne 7000 if ( driver_table == NULL ) return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; 70e8: e3a00009 mov r0, #9 70ec: e8bd8030 pop {r4, r5, pc} if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 70f0: 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(); 70f4: eb000720 bl 8d7c <_Thread_Enable_dispatch> *major = m; if ( m != n ) return RTEMS_SUCCESSFUL; return RTEMS_TOO_MANY; 70f8: 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; 70fc: 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; 7100: e5933004 ldr r3, [r3, #4] 7104: e3530000 cmp r3, #0 7108: 1afffff0 bne 70d0 if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 710c: e5824000 str r4, [r2] 7110: eaffffd7 b 7074 =============================================================================== 0000c7fc : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { c7fc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) c800: e2525000 subs r5, r2, #0 rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { c804: e1a04000 mov r4, r0 c808: e1a06001 mov r6, r1 bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; c80c: 03a00009 moveq r0, #9 ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) c810: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc} return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; c814: e59f9148 ldr r9, [pc, #328] ; c964 c818: e5997004 ldr r7, [r9, #4] api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; c81c: e5d7a074 ldrb sl, [r7, #116] ; 0x74 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; c820: e59780f4 ldr r8, [r7, #244] ; 0xf4 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) c824: e597307c ldr r3, [r7, #124] ; 0x7c executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; c828: e35a0000 cmp sl, #0 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; c82c: e5d8b008 ldrb fp, [r8, #8] executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; c830: 03a0ac01 moveq sl, #256 ; 0x100 c834: 13a0a000 movne sl, #0 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) c838: e3530000 cmp r3, #0 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; c83c: 138aac02 orrne sl, sl, #512 ; 0x200 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; c840: e35b0000 cmp fp, #0 c844: 03a0bb01 moveq fp, #1024 ; 0x400 c848: 13a0b000 movne fp, #0 old_mode |= _ISR_Get_level(); c84c: ebfff1d4 bl 8fa4 <_CPU_ISR_Get_level> if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; c850: e18bb000 orr fp, fp, r0 old_mode |= _ISR_Get_level(); c854: e18ba00a orr sl, fp, sl *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) c858: e3160c01 tst r6, #256 ; 0x100 old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; c85c: e585a000 str sl, [r5] /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) c860: 0a000003 beq c874 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; c864: e3140c01 tst r4, #256 ; 0x100 c868: 13a03000 movne r3, #0 c86c: 03a03001 moveq r3, #1 c870: e5c73074 strb r3, [r7, #116] ; 0x74 if ( mask & RTEMS_TIMESLICE_MASK ) { c874: e3160c02 tst r6, #512 ; 0x200 c878: 1a000028 bne c920 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) c87c: e3160080 tst r6, #128 ; 0x80 c880: 1a00002f bne c944 * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { c884: e2166b01 ands r6, r6, #1024 ; 0x400 c888: 0a000012 beq c8d8 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( c88c: e3140b01 tst r4, #1024 ; 0x400 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { c890: e5d82008 ldrb r2, [r8, #8] * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( c894: 13a03000 movne r3, #0 c898: 03a03001 moveq r3, #1 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { c89c: e1520003 cmp r2, r3 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; c8a0: 03a06000 moveq r6, #0 if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { c8a4: 0a00000b beq c8d8 asr->is_enabled = is_asr_enabled; c8a8: e5c83008 strb r3, [r8, #8] static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( c8ac: e10f3000 mrs r3, CPSR c8b0: e3832080 orr r2, r3, #128 ; 0x80 c8b4: e129f002 msr CPSR_fc, r2 { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; c8b8: e5981018 ldr r1, [r8, #24] information->signals_pending = information->signals_posted; c8bc: e5982014 ldr r2, [r8, #20] information->signals_posted = _signals; c8c0: e5881014 str r1, [r8, #20] rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; c8c4: e5882018 str r2, [r8, #24] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( c8c8: e129f003 msr CPSR_fc, r3 _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { c8cc: e5986014 ldr r6, [r8, #20] c8d0: e3560000 cmp r6, #0 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; c8d4: 13a06001 movne r6, #1 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { c8d8: e59f3088 ldr r3, [pc, #136] ; c968 c8dc: e5933000 ldr r3, [r3] c8e0: e3530003 cmp r3, #3 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; c8e4: 13a00000 movne r0, #0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { c8e8: 18bd8ff0 popne {r4, r5, r6, r7, r8, r9, sl, fp, pc} { Thread_Control *executing; executing = _Thread_Executing; if ( are_signals_pending || c8ec: e3560000 cmp r6, #0 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; c8f0: e5993004 ldr r3, [r9, #4] if ( are_signals_pending || c8f4: 1a000015 bne c950 c8f8: e59f2064 ldr r2, [pc, #100] ; c964 c8fc: e5922008 ldr r2, [r2, #8] c900: e1530002 cmp r3, r2 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; c904: 01a00006 moveq r0, r6 c908: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc} (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { c90c: e5d33074 ldrb r3, [r3, #116] ; 0x74 c910: e3530000 cmp r3, #0 c914: 1a00000d bne c950 c918: e1a00006 mov r0, r6 <== NOT EXECUTED } c91c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED */ if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { c920: e2143c02 ands r3, r4, #512 ; 0x200 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; c924: 159f3040 ldrne r3, [pc, #64] ; c96c c928: 15933000 ldrne r3, [r3] if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; c92c: 13a02001 movne r2, #1 c930: 1587207c strne r2, [r7, #124] ; 0x7c executing->cpu_time_budget = _Thread_Ticks_per_timeslice; c934: 15873078 strne r3, [r7, #120] ; 0x78 } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; c938: 0587307c streq r3, [r7, #124] ; 0x7c } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) c93c: e3160080 tst r6, #128 ; 0x80 c940: 0affffcf beq c884 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); c944: e2040080 and r0, r4, #128 ; 0x80 c948: ebfff190 bl 8f90 <_CPU_ISR_Set_level> c94c: eaffffcc b c884 _Thread_Dispatch_necessary = true; c950: e3a03001 mov r3, #1 c954: e5c93010 strb r3, [r9, #16] } } if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); c958: ebffebce bl 7898 <_Thread_Dispatch> } return RTEMS_SUCCESSFUL; c95c: e3a00000 mov r0, #0 c960: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}