00009c78 <_CORE_mutex_Seize_interrupt_trylock>: { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 9c78: e59f3154 ldr r3, [pc, #340] ; 9dd4 <_CORE_mutex_Seize_interrupt_trylock+0x15c> 9c7c: e5933000 ldr r3, [r3] executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 9c80: e3a02000 mov r2, #0 9c84: e5832034 str r2, [r3, #52] ; 0x34 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 9c88: e590c050 ldr ip, [r0, #80] ; 0x50 9c8c: e15c0002 cmp ip, r2 #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { 9c90: e92d4070 push {r4, r5, r6, lr} 9c94: 0a00000e beq 9cd4 <_CORE_mutex_Seize_interrupt_trylock+0x5c> the_mutex->lock = CORE_MUTEX_LOCKED; 9c98: e5802050 str r2, [r0, #80] ; 0x50 */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 9c9c: e590c048 ldr ip, [r0, #72] ; 0x48 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 9ca0: e5935008 ldr r5, [r3, #8] the_mutex->nest_count = 1; 9ca4: e3a04001 mov r4, #1 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 9ca8: e35c0002 cmp ip, #2 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 9cac: e5805060 str r5, [r0, #96] ; 0x60 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; 9cb0: e580305c str r3, [r0, #92] ; 0x5c the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 9cb4: e5804054 str r4, [r0, #84] ; 0x54 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 9cb8: 0a00000a beq 9ce8 <_CORE_mutex_Seize_interrupt_trylock+0x70> 9cbc: e35c0003 cmp ip, #3 9cc0: 0a000019 beq 9d2c <_CORE_mutex_Seize_interrupt_trylock+0xb4> 9cc4: e5913000 ldr r3, [r1] 9cc8: e129f003 msr CPSR_fc, r3 9ccc: e3a00000 mov r0, #0 9cd0: e8bd8070 pop {r4, r5, r6, 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 ) ) { 9cd4: e590205c ldr r2, [r0, #92] ; 0x5c 9cd8: e1530002 cmp r3, r2 9cdc: 0a000008 beq 9d04 <_CORE_mutex_Seize_interrupt_trylock+0x8c> 9ce0: e3a00001 mov r0, #1 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 9ce4: e8bd8070 pop {r4, r5, r6, pc} _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 9ce8: e593201c ldr r2, [r3, #28] 9cec: e2822001 add r2, r2, #1 9cf0: e583201c str r2, [r3, #28] 9cf4: e5913000 ldr r3, [r1] 9cf8: e129f003 msr CPSR_fc, r3 9cfc: e3a00000 mov r0, #0 9d00: e8bd8070 pop {r4, r5, r6, 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 ) { 9d04: e5902040 ldr r2, [r0, #64] ; 0x40 9d08: e3520000 cmp r2, #0 9d0c: 1a000017 bne 9d70 <_CORE_mutex_Seize_interrupt_trylock+0xf8> case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 9d10: e5903054 ldr r3, [r0, #84] ; 0x54 9d14: e2833001 add r3, r3, #1 9d18: e5803054 str r3, [r0, #84] ; 0x54 9d1c: e5913000 ldr r3, [r1] 9d20: e129f003 msr CPSR_fc, r3 9d24: e3a00000 mov r0, #0 9d28: e8bd8070 pop {r4, r5, r6, pc} _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 9d2c: e593c01c ldr ip, [r3, #28] 9d30: e08c5004 add r5, ip, r4 9d34: e583501c str r5, [r3, #28] { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; 9d38: e5935014 ldr r5, [r3, #20] */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 9d3c: e590604c ldr r6, [r0, #76] ; 0x4c current = executing->current_priority; if ( current == ceiling ) { 9d40: e1560005 cmp r6, r5 9d44: 0a00001e beq 9dc4 <_CORE_mutex_Seize_interrupt_trylock+0x14c> _ISR_Enable( *level_p ); return 0; } if ( current > ceiling ) { 9d48: 3a000010 bcc 9d90 <_CORE_mutex_Seize_interrupt_trylock+0x118> ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 9d4c: e3a05006 mov r5, #6 9d50: e5835034 str r5, [r3, #52] ; 0x34 the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */ 9d54: e5802054 str r2, [r0, #84] ; 0x54 _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; the_mutex->lock = CORE_MUTEX_UNLOCKED; 9d58: e5804050 str r4, [r0, #80] ; 0x50 the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ 9d5c: e583c01c str ip, [r3, #28] 9d60: e5913000 ldr r3, [r1] 9d64: e129f003 msr CPSR_fc, r3 9d68: e3a00000 mov r0, #0 9d6c: e8bd8070 pop {r4, r5, r6, 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 ) { 9d70: e3520001 cmp r2, #1 9d74: 1affffd9 bne 9ce0 <_CORE_mutex_Seize_interrupt_trylock+0x68> 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; 9d78: e3a02002 mov r2, #2 <== NOT EXECUTED 9d7c: e5832034 str r2, [r3, #52] ; 0x34 <== NOT EXECUTED 9d80: e5913000 ldr r3, [r1] <== NOT EXECUTED 9d84: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED 9d88: e3a00000 mov r0, #0 <== NOT EXECUTED 9d8c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 9d90: e59f3040 ldr r3, [pc, #64] ; 9dd8 <_CORE_mutex_Seize_interrupt_trylock+0x160> 9d94: e5932000 ldr r2, [r3] 9d98: e2822001 add r2, r2, #1 9d9c: e5832000 str r2, [r3] 9da0: e5913000 ldr r3, [r1] 9da4: e129f003 msr CPSR_fc, r3 } if ( current > ceiling ) { _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); _Thread_Change_priority( 9da8: e3a02000 mov r2, #0 9dac: e590104c ldr r1, [r0, #76] ; 0x4c 9db0: e590005c ldr r0, [r0, #92] ; 0x5c 9db4: ebfff0e7 bl 6158 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 9db8: ebfff251 bl 6704 <_Thread_Enable_dispatch> 9dbc: e3a00000 mov r0, #0 9dc0: e8bd8070 pop {r4, r5, r6, pc} 9dc4: e5913000 ldr r3, [r1] 9dc8: e129f003 msr CPSR_fc, r3 9dcc: e3a00000 mov r0, #0 9dd0: e8bd8070 pop {r4, r5, r6, pc} 9dd4: 00019380 .word 0x00019380 9dd8: 000192cc .word 0x000192cc 0000431c <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 431c: e92d40f0 push {r4, r5, r6, r7, lr} rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; RTEMS_API_Control *api; api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 4320: e5901100 ldr r1, [r0, #256] ; 0x100 option_set = (rtems_option) the_thread->Wait.option; 4324: e5905030 ldr r5, [r0, #48] ; 0x30 */ void _Event_Surrender( Thread_Control *the_thread ) { 4328: e1a04000 mov r4, r0 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 432c: e10f0000 mrs r0, CPSR 4330: e3803080 orr r3, r0, #128 ; 0x80 4334: e129f003 msr CPSR_fc, r3 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); pending_events = api->pending_events; 4338: e5912000 ldr r2, [r1] event_condition = (rtems_event_set) the_thread->Wait.count; 433c: e5943024 ldr r3, [r4, #36] ; 0x24 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 4340: e013c002 ands ip, r3, r2 4344: 0a000023 beq 43d8 <_Event_Surrender+0xbc> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 4348: e59f6110 ldr r6, [pc, #272] ; 4460 <_Event_Surrender+0x144> 434c: e5966000 ldr r6, [r6] 4350: e3560000 cmp r6, #0 4354: 0a000003 beq 4368 <_Event_Surrender+0x4c> 4358: e59f6104 ldr r6, [pc, #260] ; 4464 <_Event_Surrender+0x148> 435c: e5966000 ldr r6, [r6] 4360: e1540006 cmp r4, r6 4364: 0a000028 beq 440c <_Event_Surrender+0xf0> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 4368: e5946010 ldr r6, [r4, #16] 436c: e3160c01 tst r6, #256 ; 0x100 4370: 0a000016 beq 43d0 <_Event_Surrender+0xb4> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 4374: e153000c cmp r3, ip 4378: 0a000001 beq 4384 <_Event_Surrender+0x68> 437c: e3150002 tst r5, #2 4380: 0a000012 beq 43d0 <_Event_Surrender+0xb4> api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4384: e5943028 ldr r3, [r4, #40] ; 0x28 /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 4388: e1c2200c bic r2, r2, ip 438c: e5812000 str r2, [r1] the_thread->Wait.count = 0; 4390: e3a02000 mov r2, #0 4394: e5842024 str r2, [r4, #36] ; 0x24 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4398: e583c000 str ip, [r3] static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 439c: e10f3000 mrs r3, CPSR 43a0: e129f000 msr CPSR_fc, r0 43a4: e129f003 msr CPSR_fc, r3 _ISR_Flash( level ); if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 43a8: e5943050 ldr r3, [r4, #80] ; 0x50 43ac: e3530002 cmp r3, #2 43b0: 0a00000a beq 43e0 <_Event_Surrender+0xc4> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 43b4: e129f000 msr CPSR_fc, r0 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 43b8: e3a01201 mov r1, #268435456 ; 0x10000000 43bc: e2811bff add r1, r1, #261120 ; 0x3fc00 43c0: e1a00004 mov r0, r4 43c4: e2811ffe add r1, r1, #1016 ; 0x3f8 } return; } } _ISR_Enable( level ); } 43c8: e8bd40f0 pop {r4, r5, r6, r7, lr} 43cc: ea0007ca b 62fc <_Thread_Clear_state> 43d0: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED 43d4: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED 43d8: e129f000 msr CPSR_fc, r0 43dc: e8bd80f0 pop {r4, r5, r6, r7, pc} RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 43e0: e3a03003 mov r3, #3 43e4: e5843050 str r3, [r4, #80] ; 0x50 43e8: e129f000 msr CPSR_fc, r0 _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); 43ec: e2840048 add r0, r4, #72 ; 0x48 43f0: eb000d55 bl 794c <_Watchdog_Remove> 43f4: e3a01201 mov r1, #268435456 ; 0x10000000 43f8: e2811bff add r1, r1, #261120 ; 0x3fc00 43fc: e1a00004 mov r0, r4 4400: e2811ffe add r1, r1, #1016 ; 0x3f8 } return; } } _ISR_Enable( level ); } 4404: e8bd40f0 pop {r4, r5, r6, r7, lr} 4408: ea0007bb b 62fc <_Thread_Clear_state> * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 440c: e59f6054 ldr r6, [pc, #84] ; 4468 <_Event_Surrender+0x14c> 4410: e5967000 ldr r7, [r6] /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 4414: e3570002 cmp r7, #2 4418: 0a000002 beq 4428 <_Event_Surrender+0x10c> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 441c: e5967000 ldr r7, [r6] /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 4420: e3570001 cmp r7, #1 4424: 1affffcf bne 4368 <_Event_Surrender+0x4c> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 4428: e153000c cmp r3, ip 442c: 0a000001 beq 4438 <_Event_Surrender+0x11c> 4430: e3150002 tst r5, #2 4434: 0a000007 beq 4458 <_Event_Surrender+0x13c> api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 4438: e1c2200c bic r2, r2, ip 443c: e5812000 str r2, [r1] the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4440: e5943028 ldr r3, [r4, #40] ; 0x28 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 4444: e3a02003 mov r2, #3 4448: e5862000 str r2, [r6] _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; 444c: e3a02000 mov r2, #0 4450: e5842024 str r2, [r4, #36] ; 0x24 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4454: e583c000 str ip, [r3] 4458: e129f000 msr CPSR_fc, r0 445c: e8bd80f0 pop {r4, r5, r6, r7, pc} 4460: 0001935c .word 0x0001935c 4464: 00019380 .word 0x00019380 4468: 000194cc .word 0x000194cc 00009ec4 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 9ec4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 9ec8: e1a08002 mov r8, r2 Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; 9ecc: e5902010 ldr r2, [r0, #16] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 9ed0: e24dd01c sub sp, sp, #28 9ed4: e1a05001 mov r5, r1 - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 9ed8: e2911004 adds r1, r1, #4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 9edc: e1a07000 mov r7, r0 - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 9ee0: e58d1000 str r1, [sp] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 9ee4: e1a0b003 mov fp, r3 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 9ee8: e590a008 ldr sl, [r0, #8] Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; 9eec: e58d200c str r2, [sp, #12] uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 9ef0: 2a000076 bcs a0d0 <_Heap_Allocate_aligned_with_boundary+0x20c> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 9ef4: e3530000 cmp r3, #0 9ef8: 1a000072 bne a0c8 <_Heap_Allocate_aligned_with_boundary+0x204> if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 9efc: e157000a cmp r7, sl 9f00: 03a06000 moveq r6, #0 9f04: 0a000074 beq a0dc <_Heap_Allocate_aligned_with_boundary+0x218> 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; 9f08: e59d300c ldr r3, [sp, #12] uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 9f0c: e2651004 rsb r1, r5, #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; 9f10: e2833007 add r3, r3, #7 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 9f14: e3a06000 mov r6, #0 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; 9f18: e58d3010 str r3, [sp, #16] uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 9f1c: e58d1014 str r1, [sp, #20] 9f20: ea000004 b 9f38 <_Heap_Allocate_aligned_with_boundary+0x74> boundary ); } } if ( alloc_begin != 0 ) { 9f24: e3540000 cmp r4, #0 9f28: 1a000059 bne a094 <_Heap_Allocate_aligned_with_boundary+0x1d0> break; } block = block->next; 9f2c: e59aa008 ldr sl, [sl, #8] if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 9f30: e157000a cmp r7, sl 9f34: 0a000068 beq a0dc <_Heap_Allocate_aligned_with_boundary+0x218> /* * 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 ) { 9f38: e59a9004 ldr r9, [sl, #4] 9f3c: e59d2000 ldr r2, [sp] 9f40: e1520009 cmp r2, r9 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 9f44: e2866001 add r6, r6, #1 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 9f48: 2afffff7 bcs 9f2c <_Heap_Allocate_aligned_with_boundary+0x68> if ( alignment == 0 ) { 9f4c: 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; 9f50: 028a4008 addeq r4, sl, #8 9f54: 0afffff2 beq 9f24 <_Heap_Allocate_aligned_with_boundary+0x60> uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 9f58: e59d1014 ldr r1, [sp, #20] 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; 9f5c: e3c99001 bic r9, r9, #1 9f60: e08a9009 add r9, sl, r9 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 9f64: e5973014 ldr r3, [r7, #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; 9f68: e59d2010 ldr r2, [sp, #16] uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 9f6c: e0814009 add r4, r1, r9 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 9f70: e58d3004 str r3, [sp, #4] RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 9f74: e1a00004 mov r0, r4 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; 9f78: e0633002 rsb r3, r3, r2 9f7c: e1a01008 mov r1, r8 9f80: e0839009 add r9, r3, r9 9f84: eb002e75 bl 15960 <__umodsi3> 9f88: e0604004 rsb r4, r0, r4 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 9f8c: e28a3008 add r3, sl, #8 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 ) { 9f90: e1590004 cmp r9, r4 9f94: e58d3008 str r3, [sp, #8] 9f98: 2a000003 bcs 9fac <_Heap_Allocate_aligned_with_boundary+0xe8> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 9f9c: e1a00009 mov r0, r9 9fa0: e1a01008 mov r1, r8 9fa4: eb002e6d bl 15960 <__umodsi3> 9fa8: e0604009 rsb r4, r0, r9 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 9fac: e35b0000 cmp fp, #0 9fb0: 0a000025 beq a04c <_Heap_Allocate_aligned_with_boundary+0x188> /* 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; 9fb4: e0849005 add r9, r4, r5 9fb8: e1a00009 mov r0, r9 9fbc: e1a0100b mov r1, fp 9fc0: eb002e66 bl 15960 <__umodsi3> 9fc4: e0600009 rsb r0, r0, r9 /* 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 ) { 9fc8: e1590000 cmp r9, r0 9fcc: 93a03000 movls r3, #0 9fd0: 83a03001 movhi r3, #1 9fd4: e1540000 cmp r4, r0 9fd8: 23a03000 movcs r3, #0 9fdc: e3530000 cmp r3, #0 9fe0: 0a000019 beq a04c <_Heap_Allocate_aligned_with_boundary+0x188> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 9fe4: e59d1008 ldr r1, [sp, #8] 9fe8: e0819005 add r9, 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 ) { 9fec: e1590000 cmp r9, r0 9ff0: 958d6018 strls r6, [sp, #24] 9ff4: 9a000002 bls a004 <_Heap_Allocate_aligned_with_boundary+0x140> 9ff8: eaffffcb b 9f2c <_Heap_Allocate_aligned_with_boundary+0x68> 9ffc: e1590000 cmp r9, r0 a000: 8a000037 bhi a0e4 <_Heap_Allocate_aligned_with_boundary+0x220> return 0; } alloc_begin = boundary_line - alloc_size; a004: e0654000 rsb r4, r5, r0 a008: e1a01008 mov r1, r8 a00c: e1a00004 mov r0, r4 a010: eb002e52 bl 15960 <__umodsi3> a014: e0604004 rsb r4, r0, r4 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; a018: e0846005 add r6, r4, r5 a01c: e1a00006 mov r0, r6 a020: e1a0100b mov r1, fp a024: eb002e4d bl 15960 <__umodsi3> a028: e0600006 rsb r0, r0, r6 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { a02c: e1560000 cmp r6, r0 a030: 93a03000 movls r3, #0 a034: 83a03001 movhi r3, #1 a038: e1540000 cmp r4, r0 a03c: 23a03000 movcs r3, #0 a040: e3530000 cmp r3, #0 a044: 1affffec bne 9ffc <_Heap_Allocate_aligned_with_boundary+0x138> a048: e59d6018 ldr r6, [sp, #24] boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { a04c: e59d2008 ldr r2, [sp, #8] a050: e1520004 cmp r2, r4 a054: 8affffb4 bhi 9f2c <_Heap_Allocate_aligned_with_boundary+0x68> 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; a058: e59d100c ldr r1, [sp, #12] a05c: e1a00004 mov r0, r4 a060: eb002e3e bl 15960 <__umodsi3> a064: e26a94ff rsb r9, sl, #-16777216 ; 0xff000000 a068: e28998ff add r9, r9, #16711680 ; 0xff0000 a06c: e2899cff add r9, r9, #65280 ; 0xff00 a070: e28990f8 add r9, r9, #248 ; 0xf8 a074: e0899004 add r9, r9, r4 if ( free_size >= min_block_size || free_size == 0 ) { a078: e59d1004 ldr r1, [sp, #4] a07c: e0603009 rsb r3, r0, r9 a080: e1590000 cmp r9, r0 a084: 11510003 cmpne r1, r3 a088: 8affffa7 bhi 9f2c <_Heap_Allocate_aligned_with_boundary+0x68> boundary ); } } if ( alloc_begin != 0 ) { a08c: e3540000 cmp r4, #0 a090: 0affffa5 beq 9f2c <_Heap_Allocate_aligned_with_boundary+0x68> block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; a094: e597304c ldr r3, [r7, #76] ; 0x4c a098: e0833006 add r3, r3, r6 a09c: e587304c str r3, [r7, #76] ; 0x4c block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); a0a0: e1a0100a mov r1, sl a0a4: e1a03005 mov r3, r5 a0a8: e1a00007 mov r0, r7 a0ac: e1a02004 mov r2, r4 a0b0: ebffedc4 bl 57c8 <_Heap_Block_allocate> a0b4: e1a00004 mov r0, r4 uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; a0b8: e5973044 ldr r3, [r7, #68] ; 0x44 a0bc: e1530006 cmp r3, r6 ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; a0c0: 35876044 strcc r6, [r7, #68] ; 0x44 a0c4: ea000002 b a0d4 <_Heap_Allocate_aligned_with_boundary+0x210> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { a0c8: e1550003 cmp r5, r3 a0cc: 9a000006 bls a0ec <_Heap_Allocate_aligned_with_boundary+0x228> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; a0d0: e3a00000 mov r0, #0 } return (void *) alloc_begin; } a0d4: e28dd01c add sp, sp, #28 a0d8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { a0dc: e3a00000 mov r0, #0 a0e0: eafffff4 b a0b8 <_Heap_Allocate_aligned_with_boundary+0x1f4> a0e4: e59d6018 ldr r6, [sp, #24] <== NOT EXECUTED a0e8: eaffff8f b 9f2c <_Heap_Allocate_aligned_with_boundary+0x68> <== NOT EXECUTED if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { a0ec: e3580000 cmp r8, #0 a0f0: 01a08002 moveq r8, r2 a0f4: eaffff80 b 9efc <_Heap_Allocate_aligned_with_boundary+0x38> 00006558 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 6558: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 655c: e59f35d0 ldr r3, [pc, #1488] ; 6b34 <_Heap_Walk+0x5dc> uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 6560: e31200ff tst r2, #255 ; 0xff if ( !_System_state_Is_up( _System_state_Get() ) ) { 6564: e5933000 ldr r3, [r3] uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 6568: e59f25c8 ldr r2, [pc, #1480] ; 6b38 <_Heap_Walk+0x5e0> 656c: e59fa5c8 ldr sl, [pc, #1480] ; 6b3c <_Heap_Walk+0x5e4> 6570: 01a0a002 moveq sl, r2 if ( !_System_state_Is_up( _System_state_Get() ) ) { 6574: e3530003 cmp r3, #3 Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size; 6578: e5902010 ldr r2, [r0, #16] uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; 657c: e5903024 ldr r3, [r0, #36] ; 0x24 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 6580: e24dd038 sub sp, sp, #56 ; 0x38 6584: e1a04000 mov r4, r0 6588: e1a08001 mov r8, r1 uintptr_t const page_size = heap->page_size; 658c: e58d2020 str r2, [sp, #32] uintptr_t const min_block_size = heap->min_block_size; 6590: e590b014 ldr fp, [r0, #20] Heap_Block *const last_block = heap->last_block; 6594: e58d3024 str r3, [sp, #36] ; 0x24 Heap_Block *block = heap->first_block; 6598: e5905020 ldr r5, [r0, #32] Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 659c: 0a000002 beq 65ac <_Heap_Walk+0x54> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 65a0: e3a00001 mov r0, #1 block = next_block; } return true; } 65a4: e28dd038 add sp, sp, #56 ; 0x38 65a8: 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)( 65ac: e5900018 ldr r0, [r0, #24] 65b0: e594101c ldr r1, [r4, #28] 65b4: e2842008 add r2, r4, #8 65b8: e892000c ldm r2, {r2, r3} 65bc: e59dc024 ldr ip, [sp, #36] ; 0x24 65c0: e98d0003 stmib sp, {r0, r1} 65c4: e58d2014 str r2, [sp, #20] 65c8: e58d3018 str r3, [sp, #24] 65cc: e59f256c ldr r2, [pc, #1388] ; 6b40 <_Heap_Walk+0x5e8> 65d0: e58db000 str fp, [sp] 65d4: e58d500c str r5, [sp, #12] 65d8: e58dc010 str ip, [sp, #16] 65dc: e1a00008 mov r0, r8 65e0: e3a01000 mov r1, #0 65e4: e59d3020 ldr r3, [sp, #32] 65e8: e1a0e00f mov lr, pc 65ec: e12fff1a bx sl heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 65f0: e59d2020 ldr r2, [sp, #32] 65f4: e3520000 cmp r2, #0 65f8: 0a000032 beq 66c8 <_Heap_Walk+0x170> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 65fc: e59d3020 ldr r3, [sp, #32] 6600: e2139003 ands r9, r3, #3 6604: 1a000036 bne 66e4 <_Heap_Walk+0x18c> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 6608: e1a0000b mov r0, fp 660c: e59d1020 ldr r1, [sp, #32] 6610: ebffe980 bl c18 <__umodsi3> 6614: e2506000 subs r6, r0, #0 6618: 1a000038 bne 6700 <_Heap_Walk+0x1a8> ); return false; } if ( 661c: e2850008 add r0, r5, #8 6620: e59d1020 ldr r1, [sp, #32] 6624: ebffe97b bl c18 <__umodsi3> 6628: e2509000 subs r9, r0, #0 662c: 1a00003b bne 6720 <_Heap_Walk+0x1c8> 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; 6630: e5957004 ldr r7, [r5, #4] ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 6634: e2176001 ands r6, r7, #1 6638: 0a000040 beq 6740 <_Heap_Walk+0x1e8> ); return false; } if ( first_block->prev_size != page_size ) { 663c: e5953000 ldr r3, [r5] 6640: e59dc020 ldr ip, [sp, #32] 6644: e15c0003 cmp ip, r3 6648: 1a000016 bne 66a8 <_Heap_Walk+0x150> ); return false; } if ( _Heap_Is_free( last_block ) ) { 664c: e59d2024 ldr r2, [sp, #36] ; 0x24 6650: e5923004 ldr r3, [r2, #4] 6654: e3c33001 bic r3, r3, #1 6658: e0823003 add r3, r2, r3 665c: e5939004 ldr r9, [r3, #4] 6660: e2199001 ands r9, r9, #1 6664: 0a000112 beq 6ab4 <_Heap_Walk+0x55c> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 6668: e5949008 ldr r9, [r4, #8] int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 666c: e5943010 ldr r3, [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 ) { 6670: e1540009 cmp r4, r9 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 6674: e58d3028 str r3, [sp, #40] ; 0x28 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 ) { 6678: 0a00006c beq 6830 <_Heap_Walk+0x2d8> 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; 667c: e594c020 ldr ip, [r4, #32] 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 6680: e15c0009 cmp ip, r9 6684: 9a000034 bls 675c <_Heap_Walk+0x204> if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( 6688: e1a00008 mov r0, r8 668c: e1a03009 mov r3, r9 6690: e3a01001 mov r1, #1 6694: e59f24a8 ldr r2, [pc, #1192] ; 6b44 <_Heap_Walk+0x5ec> 6698: e1a0e00f mov lr, pc 669c: e12fff1a bx sl 66a0: e3a00000 mov r0, #0 66a4: eaffffbe b 65a4 <_Heap_Walk+0x4c> return false; } if ( first_block->prev_size != page_size ) { (*printer)( 66a8: e1a00008 mov r0, r8 66ac: e58dc000 str ip, [sp] 66b0: e3a01001 mov r1, #1 66b4: e59f248c ldr r2, [pc, #1164] ; 6b48 <_Heap_Walk+0x5f0> 66b8: e1a0e00f mov lr, pc 66bc: e12fff1a bx sl 66c0: e1a00009 mov r0, r9 66c4: eaffffb6 b 65a4 <_Heap_Walk+0x4c> first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 66c8: e1a00008 mov r0, r8 66cc: e3a01001 mov r1, #1 66d0: e59f2474 ldr r2, [pc, #1140] ; 6b4c <_Heap_Walk+0x5f4> 66d4: e1a0e00f mov lr, pc 66d8: e12fff1a bx sl 66dc: e59d0020 ldr r0, [sp, #32] 66e0: eaffffaf b 65a4 <_Heap_Walk+0x4c> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 66e4: e1a00008 mov r0, r8 66e8: e3a01001 mov r1, #1 66ec: e59f245c ldr r2, [pc, #1116] ; 6b50 <_Heap_Walk+0x5f8> 66f0: e1a0e00f mov lr, pc 66f4: e12fff1a bx sl 66f8: e3a00000 mov r0, #0 66fc: eaffffa8 b 65a4 <_Heap_Walk+0x4c> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 6700: e1a00008 mov r0, r8 6704: e1a0300b mov r3, fp 6708: e3a01001 mov r1, #1 670c: e59f2440 ldr r2, [pc, #1088] ; 6b54 <_Heap_Walk+0x5fc> 6710: e1a0e00f mov lr, pc 6714: e12fff1a bx sl 6718: e1a00009 mov r0, r9 671c: eaffffa0 b 65a4 <_Heap_Walk+0x4c> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 6720: e1a00008 mov r0, r8 6724: e1a03005 mov r3, r5 6728: e3a01001 mov r1, #1 672c: e59f2424 ldr r2, [pc, #1060] ; 6b58 <_Heap_Walk+0x600> 6730: e1a0e00f mov lr, pc 6734: e12fff1a bx sl 6738: e1a00006 mov r0, r6 673c: eaffff98 b 65a4 <_Heap_Walk+0x4c> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 6740: e1a00008 mov r0, r8 6744: e3a01001 mov r1, #1 6748: e59f240c ldr r2, [pc, #1036] ; 6b5c <_Heap_Walk+0x604> 674c: e1a0e00f mov lr, pc 6750: e12fff1a bx sl 6754: e1a00006 mov r0, r6 6758: eaffff91 b 65a4 <_Heap_Walk+0x4c> && (uintptr_t) block <= (uintptr_t) heap->last_block; 675c: e5942024 ldr r2, [r4, #36] ; 0x24 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 6760: e1520009 cmp r2, r9 && (uintptr_t) block <= (uintptr_t) heap->last_block; 6764: e58d202c str r2, [sp, #44] ; 0x2c 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 6768: 3affffc6 bcc 6688 <_Heap_Walk+0x130> ); return false; } if ( 676c: e2890008 add r0, r9, #8 6770: e1a01003 mov r1, r3 6774: e58dc01c str ip, [sp, #28] 6778: ebffe926 bl c18 <__umodsi3> 677c: e3500000 cmp r0, #0 6780: e59dc01c ldr ip, [sp, #28] 6784: 1a0000d1 bne 6ad0 <_Heap_Walk+0x578> ); return false; } if ( _Heap_Is_used( free_block ) ) { 6788: e5993004 ldr r3, [r9, #4] 678c: e3c33001 bic r3, r3, #1 6790: e0893003 add r3, r9, r3 6794: e5933004 ldr r3, [r3, #4] 6798: e3130001 tst r3, #1 679c: 1a0000dc bne 6b14 <_Heap_Walk+0x5bc> ); return false; } if ( free_block->prev != prev_block ) { 67a0: e599200c ldr r2, [r9, #12] 67a4: e1540002 cmp r4, r2 67a8: 1a0000d0 bne 6af0 <_Heap_Walk+0x598> 67ac: e58d7030 str r7, [sp, #48] ; 0x30 67b0: e58db034 str fp, [sp, #52] ; 0x34 67b4: e59d702c ldr r7, [sp, #44] ; 0x2c 67b8: e59db028 ldr fp, [sp, #40] ; 0x28 67bc: e58d502c str r5, [sp, #44] ; 0x2c 67c0: e58d6028 str r6, [sp, #40] ; 0x28 67c4: e1a0600c mov r6, ip 67c8: ea000011 b 6814 <_Heap_Walk+0x2bc> 67cc: e1590006 cmp r9, r6 67d0: 3affffac bcc 6688 <_Heap_Walk+0x130> 67d4: e1570009 cmp r7, r9 ); return false; } if ( 67d8: e2890008 add r0, r9, #8 67dc: e1a0100b mov r1, fp 67e0: 3affffa8 bcc 6688 <_Heap_Walk+0x130> 67e4: ebffe90b bl c18 <__umodsi3> 67e8: e3500000 cmp r0, #0 67ec: 1a0000b7 bne 6ad0 <_Heap_Walk+0x578> ); return false; } if ( _Heap_Is_used( free_block ) ) { 67f0: e5993004 ldr r3, [r9, #4] 67f4: e3c33001 bic r3, r3, #1 67f8: e0833009 add r3, r3, r9 67fc: e5933004 ldr r3, [r3, #4] 6800: e3130001 tst r3, #1 6804: 1a0000c2 bne 6b14 <_Heap_Walk+0x5bc> ); return false; } if ( free_block->prev != prev_block ) { 6808: e599200c ldr r2, [r9, #12] 680c: e1520005 cmp r2, r5 6810: 1a0000b6 bne 6af0 <_Heap_Walk+0x598> (*printer)( 6814: e1a05009 mov r5, r9 return false; } prev_block = free_block; free_block = free_block->next; 6818: e5999008 ldr r9, [r9, #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 ) { 681c: e1540009 cmp r4, r9 6820: 1affffe9 bne 67cc <_Heap_Walk+0x274> 6824: e28d502c add r5, sp, #44 ; 0x2c 6828: e89508a0 ldm r5, {r5, r7, fp} 682c: e59d6028 ldr r6, [sp, #40] ; 0x28 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 6830: e59d3024 ldr r3, [sp, #36] ; 0x24 6834: e1530005 cmp r3, r5 "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 6838: 158db028 strne fp, [sp, #40] ; 0x28 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 683c: 0affff57 beq 65a0 <_Heap_Walk+0x48> - 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; 6840: e3c77001 bic r7, r7, #1 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; if ( prev_used ) { 6844: e21610ff ands r1, r6, #255 ; 0xff RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 6848: e0876005 add r6, r7, r5 684c: 0a000012 beq 689c <_Heap_Walk+0x344> (*printer)( 6850: e1a03005 mov r3, r5 6854: e58d7000 str r7, [sp] 6858: e1a00008 mov r0, r8 685c: e3a01000 mov r1, #0 6860: e59f22f8 ldr r2, [pc, #760] ; 6b60 <_Heap_Walk+0x608> 6864: e1a0e00f mov lr, pc 6868: e12fff1a bx sl 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 686c: e5943020 ldr r3, [r4, #32] 6870: e1530006 cmp r3, r6 6874: 9a000013 bls 68c8 <_Heap_Walk+0x370> block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 6878: e1a00008 mov r0, r8 687c: e58d6000 str r6, [sp] 6880: e1a03005 mov r3, r5 6884: e3a01001 mov r1, #1 6888: e59f22d4 ldr r2, [pc, #724] ; 6b64 <_Heap_Walk+0x60c> 688c: e1a0e00f mov lr, pc 6890: e12fff1a bx sl 6894: e3a00000 mov r0, #0 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 6898: eaffff41 b 65a4 <_Heap_Walk+0x4c> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 689c: e58d7000 str r7, [sp] 68a0: e5953000 ldr r3, [r5] 68a4: e1a00008 mov r0, r8 68a8: e58d3004 str r3, [sp, #4] 68ac: e59f22b4 ldr r2, [pc, #692] ; 6b68 <_Heap_Walk+0x610> 68b0: e1a03005 mov r3, r5 68b4: e1a0e00f mov lr, pc 68b8: e12fff1a bx sl 68bc: e5943020 ldr r3, [r4, #32] 68c0: e1530006 cmp r3, r6 68c4: 8affffeb bhi 6878 <_Heap_Walk+0x320> 68c8: e5943024 ldr r3, [r4, #36] ; 0x24 68cc: e1530006 cmp r3, r6 68d0: 3affffe8 bcc 6878 <_Heap_Walk+0x320> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 68d4: e1a00007 mov r0, r7 68d8: e59d1020 ldr r1, [sp, #32] 68dc: ebffe8cd bl c18 <__umodsi3> 68e0: e2509000 subs r9, r0, #0 68e4: 1a000055 bne 6a40 <_Heap_Walk+0x4e8> ); return false; } if ( block_size < min_block_size ) { 68e8: e59d3028 ldr r3, [sp, #40] ; 0x28 68ec: e1530007 cmp r3, r7 68f0: 8a00005b bhi 6a64 <_Heap_Walk+0x50c> ); return false; } if ( next_block_begin <= block_begin ) { 68f4: e1550006 cmp r5, r6 68f8: 2a000064 bcs 6a90 <_Heap_Walk+0x538> ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 68fc: e5963004 ldr r3, [r6, #4] 6900: e3130001 tst r3, #1 6904: 1a000036 bne 69e4 <_Heap_Walk+0x48c> 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; 6908: e595b004 ldr fp, [r5, #4] 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)( 690c: e595200c ldr r2, [r5, #12] return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 6910: e5943008 ldr r3, [r4, #8] - 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; 6914: e3cb7001 bic r7, fp, #1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 6918: e1530002 cmp r3, r2 } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 691c: e594100c ldr r1, [r4, #12] RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 6920: e0859007 add r9, r5, r7 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 6924: 059f0240 ldreq r0, [pc, #576] ; 6b6c <_Heap_Walk+0x614> 6928: 0a000003 beq 693c <_Heap_Walk+0x3e4> "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 692c: e59fc23c ldr ip, [pc, #572] ; 6b70 <_Heap_Walk+0x618> 6930: e1520004 cmp r2, r4 6934: e59f0238 ldr r0, [pc, #568] ; 6b74 <_Heap_Walk+0x61c> 6938: 11a0000c movne r0, 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)( 693c: e5953008 ldr r3, [r5, #8] 6940: e1510003 cmp r1, r3 6944: 059f122c ldreq r1, [pc, #556] ; 6b78 <_Heap_Walk+0x620> 6948: 0a000003 beq 695c <_Heap_Walk+0x404> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 694c: e59fc21c ldr ip, [pc, #540] ; 6b70 <_Heap_Walk+0x618> 6950: e1530004 cmp r3, r4 6954: e59f1220 ldr r1, [pc, #544] ; 6b7c <_Heap_Walk+0x624> 6958: 11a0100c movne 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)( 695c: e58d2000 str r2, [sp] 6960: e98d0009 stmib sp, {r0, r3} 6964: e58d100c str r1, [sp, #12] 6968: e1a03005 mov r3, r5 696c: e1a00008 mov r0, r8 6970: e3a01000 mov r1, #0 6974: e59f2204 ldr r2, [pc, #516] ; 6b80 <_Heap_Walk+0x628> 6978: e1a0e00f mov lr, pc 697c: e12fff1a bx sl block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 6980: e5993000 ldr r3, [r9] 6984: e1570003 cmp r7, r3 6988: 0a00000a beq 69b8 <_Heap_Walk+0x460> (*printer)( 698c: e58d3004 str r3, [sp, #4] 6990: e1a00008 mov r0, r8 6994: e58d7000 str r7, [sp] 6998: e58d9008 str r9, [sp, #8] 699c: e1a03005 mov r3, r5 69a0: e3a01001 mov r1, #1 69a4: e59f21d8 ldr r2, [pc, #472] ; 6b84 <_Heap_Walk+0x62c> 69a8: e1a0e00f mov lr, pc 69ac: e12fff1a bx sl 69b0: e3a00000 mov r0, #0 69b4: eafffefa b 65a4 <_Heap_Walk+0x4c> ); return false; } if ( !prev_used ) { 69b8: e21b9001 ands r9, fp, #1 69bc: 0a000017 beq 6a20 <_Heap_Walk+0x4c8> 69c0: 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 ) { 69c4: e1530004 cmp r3, r4 69c8: 1a000003 bne 69dc <_Heap_Walk+0x484> 69cc: ea00000b b 6a00 <_Heap_Walk+0x4a8> <== NOT EXECUTED if ( free_block == block ) { return true; } free_block = free_block->next; 69d0: 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 ) { 69d4: e1530004 cmp r3, r4 69d8: 0a000008 beq 6a00 <_Heap_Walk+0x4a8> if ( free_block == block ) { 69dc: e1530005 cmp r3, r5 69e0: 1afffffa bne 69d0 <_Heap_Walk+0x478> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 69e4: e59d2024 ldr r2, [sp, #36] ; 0x24 69e8: e1520006 cmp r2, r6 69ec: 0afffeeb beq 65a0 <_Heap_Walk+0x48> 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 ) { 69f0: e5967004 ldr r7, [r6, #4] 69f4: e1a05006 mov r5, r6 69f8: e2076001 and r6, r7, #1 69fc: eaffff8f b 6840 <_Heap_Walk+0x2e8> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 6a00: e1a00008 mov r0, r8 6a04: e1a03005 mov r3, r5 6a08: e3a01001 mov r1, #1 6a0c: e59f2174 ldr r2, [pc, #372] ; 6b88 <_Heap_Walk+0x630> 6a10: e1a0e00f mov lr, pc 6a14: e12fff1a bx sl 6a18: e3a00000 mov r0, #0 6a1c: eafffee0 b 65a4 <_Heap_Walk+0x4c> return false; } if ( !prev_used ) { (*printer)( 6a20: e1a00008 mov r0, r8 6a24: e1a03005 mov r3, r5 6a28: e3a01001 mov r1, #1 6a2c: e59f2158 ldr r2, [pc, #344] ; 6b8c <_Heap_Walk+0x634> 6a30: e1a0e00f mov lr, pc 6a34: e12fff1a bx sl 6a38: e1a00009 mov r0, r9 6a3c: eafffed8 b 65a4 <_Heap_Walk+0x4c> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { (*printer)( 6a40: e1a00008 mov r0, r8 6a44: e58d7000 str r7, [sp] 6a48: e1a03005 mov r3, r5 6a4c: e3a01001 mov r1, #1 6a50: e59f2138 ldr r2, [pc, #312] ; 6b90 <_Heap_Walk+0x638> 6a54: e1a0e00f mov lr, pc 6a58: e12fff1a bx sl 6a5c: e3a00000 mov r0, #0 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 6a60: eafffecf b 65a4 <_Heap_Walk+0x4c> } if ( block_size < min_block_size ) { (*printer)( 6a64: e58d3004 str r3, [sp, #4] 6a68: e1a00008 mov r0, r8 6a6c: e1a0b003 mov fp, r3 6a70: e58d7000 str r7, [sp] 6a74: e1a03005 mov r3, r5 6a78: e3a01001 mov r1, #1 6a7c: e59f2110 ldr r2, [pc, #272] ; 6b94 <_Heap_Walk+0x63c> 6a80: e1a0e00f mov lr, pc 6a84: e12fff1a bx sl 6a88: e1a00009 mov r0, r9 block, block_size, min_block_size ); return false; 6a8c: eafffec4 b 65a4 <_Heap_Walk+0x4c> } if ( next_block_begin <= block_begin ) { (*printer)( 6a90: e1a00008 mov r0, r8 6a94: e58d6000 str r6, [sp] 6a98: e1a03005 mov r3, r5 6a9c: e3a01001 mov r1, #1 6aa0: e59f20f0 ldr r2, [pc, #240] ; 6b98 <_Heap_Walk+0x640> 6aa4: e1a0e00f mov lr, pc 6aa8: e12fff1a bx sl 6aac: e1a00009 mov r0, r9 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 6ab0: eafffebb b 65a4 <_Heap_Walk+0x4c> return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 6ab4: e1a00008 mov r0, r8 6ab8: e3a01001 mov r1, #1 6abc: e59f20d8 ldr r2, [pc, #216] ; 6b9c <_Heap_Walk+0x644> 6ac0: e1a0e00f mov lr, pc 6ac4: e12fff1a bx sl 6ac8: e1a00009 mov r0, r9 6acc: eafffeb4 b 65a4 <_Heap_Walk+0x4c> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 6ad0: e1a00008 mov r0, r8 6ad4: e1a03009 mov r3, r9 6ad8: e3a01001 mov r1, #1 6adc: e59f20bc ldr r2, [pc, #188] ; 6ba0 <_Heap_Walk+0x648> 6ae0: e1a0e00f mov lr, pc 6ae4: e12fff1a bx sl 6ae8: e3a00000 mov r0, #0 6aec: eafffeac b 65a4 <_Heap_Walk+0x4c> return false; } if ( free_block->prev != prev_block ) { (*printer)( 6af0: e58d2000 str r2, [sp] 6af4: e1a00008 mov r0, r8 6af8: e1a03009 mov r3, r9 6afc: e3a01001 mov r1, #1 6b00: e59f209c ldr r2, [pc, #156] ; 6ba4 <_Heap_Walk+0x64c> 6b04: e1a0e00f mov lr, pc 6b08: e12fff1a bx sl 6b0c: e3a00000 mov r0, #0 6b10: eafffea3 b 65a4 <_Heap_Walk+0x4c> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 6b14: e1a00008 mov r0, r8 6b18: e1a03009 mov r3, r9 6b1c: e3a01001 mov r1, #1 6b20: e59f2080 ldr r2, [pc, #128] ; 6ba8 <_Heap_Walk+0x650> 6b24: e1a0e00f mov lr, pc 6b28: e12fff1a bx sl 6b2c: e3a00000 mov r0, #0 6b30: eafffe9b b 65a4 <_Heap_Walk+0x4c> 6b34: 0001bc10 .word 0x0001bc10 6b38: 0000654c .word 0x0000654c 6b3c: 00006bac .word 0x00006bac 6b40: 00019d9c .word 0x00019d9c 6b44: 00019f30 .word 0x00019f30 6b48: 00019eec .word 0x00019eec 6b4c: 00019e30 .word 0x00019e30 6b50: 00019e44 .word 0x00019e44 6b54: 00019e64 .word 0x00019e64 6b58: 00019e88 .word 0x00019e88 6b5c: 00019ebc .word 0x00019ebc 6b60: 00019fd0 .word 0x00019fd0 6b64: 0001a010 .word 0x0001a010 6b68: 00019fe8 .word 0x00019fe8 6b6c: 0001a0d0 .word 0x0001a0d0 6b70: 00019d54 .word 0x00019d54 6b74: 0001a0dc .word 0x0001a0dc 6b78: 0001a0e8 .word 0x0001a0e8 6b7c: 0001a0f4 .word 0x0001a0f4 6b80: 0001a100 .word 0x0001a100 6b84: 0001a12c .word 0x0001a12c 6b88: 0001a198 .word 0x0001a198 6b8c: 0001a168 .word 0x0001a168 6b90: 0001a040 .word 0x0001a040 6b94: 0001a070 .word 0x0001a070 6b98: 0001a09c .word 0x0001a09c 6b9c: 00019f18 .word 0x00019f18 6ba0: 00019f50 .word 0x00019f50 6ba4: 00019f9c .word 0x00019f9c 6ba8: 00019f80 .word 0x00019f80 00005a38 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 5a38: 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 ) 5a3c: e5908034 ldr r8, [r0, #52] ; 0x34 5a40: e3580000 cmp r8, #0 */ void _Objects_Extend_information( Objects_Information *information ) { 5a44: e24dd014 sub sp, sp, #20 5a48: e1a05000 mov r5, r0 /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); 5a4c: e1d070b8 ldrh r7, [r0, #8] index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 5a50: 0a00009c beq 5cc8 <_Objects_Extend_information+0x290> block_count = 0; else { block_count = information->maximum / information->allocation_size; 5a54: e1d091b4 ldrh r9, [r0, #20] 5a58: e1d0a1b0 ldrh sl, [r0, #16] 5a5c: e1a01009 mov r1, r9 5a60: e1a0000a mov r0, sl 5a64: eb003f79 bl 15850 <__aeabi_uidiv> 5a68: e1a03800 lsl r3, r0, #16 for ( ; block < block_count; block++ ) { 5a6c: e1b03823 lsrs r3, r3, #16 5a70: 01a01009 moveq r1, r9 5a74: 01a06007 moveq r6, r7 5a78: 01a04003 moveq r4, r3 5a7c: 0a00000f beq 5ac0 <_Objects_Extend_information+0x88> if ( information->object_blocks[ block ] == NULL ) 5a80: e5984000 ldr r4, [r8] 5a84: e3540000 cmp r4, #0 5a88: 11a01009 movne r1, r9 5a8c: 11a06007 movne r6, r7 5a90: 13a04000 movne r4, #0 5a94: 01a01009 moveq r1, r9 5a98: 01a06007 moveq r6, r7 5a9c: 1a000003 bne 5ab0 <_Objects_Extend_information+0x78> 5aa0: ea000006 b 5ac0 <_Objects_Extend_information+0x88> <== NOT EXECUTED 5aa4: e7982104 ldr r2, [r8, r4, lsl #2] 5aa8: e3520000 cmp r2, #0 5aac: 0a000003 beq 5ac0 <_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++ ) { 5ab0: e2844001 add r4, r4, #1 5ab4: e1530004 cmp r3, r4 if ( information->object_blocks[ block ] == NULL ) break; else index_base += information->allocation_size; 5ab8: e0866009 add r6, r6, r9 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 5abc: 8afffff8 bhi 5aa4 <_Objects_Extend_information+0x6c> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 5ac0: 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 ) { 5ac4: e35a0801 cmp sl, #65536 ; 0x10000 5ac8: 2a000064 bcs 5c60 <_Objects_Extend_information+0x228> /* * 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 ) { 5acc: e5d50012 ldrb r0, [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; 5ad0: e5952018 ldr r2, [r5, #24] if ( information->auto_extend ) { 5ad4: e3500000 cmp r0, #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; 5ad8: e0000192 mul r0, r2, r1 if ( information->auto_extend ) { 5adc: 1a000061 bne 5c68 <_Objects_Extend_information+0x230> new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 5ae0: e58d3000 str r3, [sp] 5ae4: eb0007e9 bl 7a90 <_Workspace_Allocate_or_fatal_error> 5ae8: e59d3000 ldr r3, [sp] 5aec: e1a09000 mov r9, r0 } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 5af0: e1d521b0 ldrh r2, [r5, #16] 5af4: e1560002 cmp r6, r2 5af8: 3a000038 bcc 5be0 <_Objects_Extend_information+0x1a8> */ /* * Up the block count and maximum */ block_count++; 5afc: e283c001 add ip, r3, #1 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 5b00: e08c008c add r0, ip, ip, lsl #1 5b04: e08a0000 add r0, sl, r0 5b08: e0800007 add r0, r0, r7 5b0c: e1a00100 lsl r0, r0, #2 5b10: e88d1008 stm sp, {r3, ip} 5b14: eb0007e9 bl 7ac0 <_Workspace_Allocate> if ( !object_blocks ) { 5b18: e250b000 subs fp, r0, #0 5b1c: e89d1008 ldm sp, {r3, ip} 5b20: 0a00006e beq 5ce0 <_Objects_Extend_information+0x2a8> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 5b24: e1d521b0 ldrh r2, [r5, #16] 5b28: e1570002 cmp r7, r2 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 5b2c: e08b818c add r8, fp, ip, lsl #3 5b30: e08bc10c add ip, fp, ip, lsl #2 5b34: 3a000051 bcc 5c80 <_Objects_Extend_information+0x248> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 5b38: e3570000 cmp r7, #0 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 5b3c: 13a02000 movne r2, #0 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 5b40: 11a01002 movne r1, r2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 5b44: 0a000003 beq 5b58 <_Objects_Extend_information+0x120> local_table[ index ] = NULL; 5b48: e7881102 str r1, [r8, r2, lsl #2] } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 5b4c: e2822001 add r2, r2, #1 5b50: e1570002 cmp r7, r2 5b54: 8afffffb bhi 5b48 <_Objects_Extend_information+0x110> 5b58: 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 ); 5b5c: e1d511b4 ldrh r1, [r5, #20] 5b60: e0861001 add r1, r6, r1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 5b64: e3a00000 mov r0, #0 inactive_per_block[block_count] = 0; for ( index=index_base ; 5b68: e1560001 cmp r6, r1 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 5b6c: e78c0003 str r0, [ip, r3] } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 5b70: e78b0003 str r0, [fp, r3] inactive_per_block[block_count] = 0; for ( index=index_base ; 5b74: 2a000005 bcs 5b90 <_Objects_Extend_information+0x158> 5b78: e0882106 add r2, r8, r6, lsl #2 5b7c: e1a03006 mov r3, r6 index < ( information->allocation_size + index_base ); index++ ) { 5b80: 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 ; 5b84: e1530001 cmp r3, r1 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 5b88: 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 ; 5b8c: 3afffffb bcc 5b80 <_Objects_Extend_information+0x148> 5b90: e10f3000 mrs r3, CPSR 5b94: e3832080 orr r2, r3, #128 ; 0x80 5b98: e129f002 msr CPSR_fc, r2 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( 5b9c: e5952000 ldr r2, [r5] 5ba0: e1d510b4 ldrh r1, [r5, #4] 5ba4: 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; 5ba8: e1a0a80a lsl sl, sl, #16 information->maximum_id = _Objects_Build_id( 5bac: e3822801 orr r2, r2, #65536 ; 0x10000 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; 5bb0: e1a0a82a lsr sl, sl, #16 information->maximum_id = _Objects_Build_id( 5bb4: e1822d81 orr r2, r2, r1, lsl #27 5bb8: e182200a orr r2, r2, sl local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 5bbc: e5950034 ldr r0, [r5, #52] ; 0x34 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 5bc0: e585c030 str ip, [r5, #48] ; 0x30 information->local_table = local_table; 5bc4: e585801c str r8, [r5, #28] information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 5bc8: e585200c str r2, [r5, #12] 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; 5bcc: e1c5a1b0 strh sl, [r5, #16] _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 5bd0: e585b034 str fp, [r5, #52] ; 0x34 static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 5bd4: e129f003 msr CPSR_fc, r3 information->maximum ); _ISR_Enable( level ); if ( old_tables ) 5bd8: e3500000 cmp r0, #0 _Workspace_Free( old_tables ); 5bdc: 1b0007bd blne 7ad8 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 5be0: e5953034 ldr r3, [r5, #52] ; 0x34 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 5be4: e28d7008 add r7, sp, #8 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 5be8: e7839104 str r9, [r3, r4, lsl #2] /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 5bec: e1a01009 mov r1, r9 5bf0: e1a00007 mov r0, r7 5bf4: e1d521b4 ldrh r2, [r5, #20] 5bf8: e5953018 ldr r3, [r5, #24] 5bfc: eb00100e bl 9c3c <_Chain_Initialize> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 5c00: e1a04104 lsl r4, r4, #2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 5c04: 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 ) { 5c08: ea000008 b 5c30 <_Objects_Extend_information+0x1f8> the_object->id = _Objects_Build_id( 5c0c: e5952000 ldr r2, [r5] 5c10: e1d5c0b4 ldrh ip, [r5, #4] 5c14: e1a02c02 lsl r2, r2, #24 5c18: e3822801 orr r2, r2, #65536 ; 0x10000 5c1c: e1822d8c orr r2, r2, ip, lsl #27 5c20: e1822006 orr r2, r2, r6 5c24: e5832008 str r2, [r3, #8] information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 5c28: ebfffd25 bl 50c4 <_Chain_Append> index++; 5c2c: 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 ) { 5c30: e1a00007 mov r0, r7 5c34: eb000ff3 bl 9c08 <_Chain_Get> 5c38: e2503000 subs r3, r0, #0 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 5c3c: e1a01003 mov r1, r3 5c40: e1a00008 mov r0, r8 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 5c44: 1afffff0 bne 5c0c <_Objects_Extend_information+0x1d4> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 5c48: e1d531b4 ldrh r3, [r5, #20] information->inactive = 5c4c: e1d522bc ldrh r2, [r5, #44] ; 0x2c _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 5c50: e5951030 ldr r1, [r5, #48] ; 0x30 information->inactive = 5c54: e0832002 add r2, r3, r2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 5c58: e7813004 str r3, [r1, r4] information->inactive = 5c5c: e1c522bc strh r2, [r5, #44] ; 0x2c (Objects_Maximum)(information->inactive + information->allocation_size); } 5c60: e28dd014 add sp, sp, #20 5c64: 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 ); 5c68: e58d3000 str r3, [sp] 5c6c: eb000793 bl 7ac0 <_Workspace_Allocate> if ( !new_object_block ) 5c70: e2509000 subs r9, r0, #0 5c74: e59d3000 ldr r3, [sp] 5c78: 1affff9c bne 5af0 <_Objects_Extend_information+0xb8> 5c7c: eafffff7 b 5c60 <_Objects_Extend_information+0x228> /* * 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, 5c80: e1a03103 lsl r3, r3, #2 5c84: e1a02003 mov r2, r3 5c88: e5951034 ldr r1, [r5, #52] ; 0x34 5c8c: e88d1008 stm sp, {r3, ip} 5c90: eb001b89 bl cabc information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 5c94: e89d1008 ldm sp, {r3, ip} 5c98: e1a0000c mov r0, ip 5c9c: e1a02003 mov r2, r3 5ca0: e5951030 ldr r1, [r5, #48] ; 0x30 5ca4: eb001b84 bl cabc information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 5ca8: e1d521b0 ldrh r2, [r5, #16] 5cac: e0872002 add r2, r7, r2 5cb0: e1a02102 lsl r2, r2, #2 5cb4: e1a00008 mov r0, r8 5cb8: e595101c ldr r1, [r5, #28] 5cbc: eb001b7e bl cabc 5cc0: e89d1008 ldm sp, {r3, ip} 5cc4: eaffffa4 b 5b5c <_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 ) 5cc8: e1a04008 mov r4, r8 5ccc: e1d0a1b0 ldrh sl, [r0, #16] 5cd0: e1d011b4 ldrh r1, [r0, #20] 5cd4: e1a06007 mov r6, r7 5cd8: e1a03008 mov r3, r8 5cdc: eaffff77 b 5ac0 <_Objects_Extend_information+0x88> (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 ); 5ce0: e1a00009 mov r0, r9 5ce4: eb00077b bl 7ad8 <_Workspace_Free> return; 5ce8: eaffffdc b 5c60 <_Objects_Extend_information+0x228> 00006c88 <_Thread_queue_Enqueue_priority>: Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 6c88: 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 ) { 6c8c: e92d05f0 push {r4, r5, r6, r7, r8, sl} _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 ]; 6c90: e1a0c323 lsr ip, r3, #6 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 6c94: e281503c add r5, r1, #60 ; 0x3c 6c98: e08cc08c add ip, ip, ip, lsl #1 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 6c9c: e3130020 tst r3, #32 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 6ca0: e2814038 add r4, r1, #56 ; 0x38 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 6ca4: e5815038 str r5, [r1, #56] ; 0x38 the_chain->permanent_null = NULL; 6ca8: e3a05000 mov r5, #0 6cac: e581503c str r5, [r1, #60] ; 0x3c the_chain->last = _Chain_Head(the_chain); 6cb0: e5814040 str r4, [r1, #64] ; 0x40 _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 ]; 6cb4: e080c10c add ip, r0, ip, lsl #2 block_state = the_thread_queue->state; 6cb8: e5906038 ldr r6, [r0, #56] ; 0x38 6cbc: 159fa178 ldrne sl, [pc, #376] ; 6e3c <_Thread_queue_Enqueue_priority+0x1b4> if ( _Thread_queue_Is_reverse_search( priority ) ) 6cc0: 1a00001c bne 6d38 <_Thread_queue_Enqueue_priority+0xb0> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 6cc4: e28ca004 add sl, ip, #4 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 6cc8: e10f8000 mrs r8, CPSR 6ccc: e3884080 orr r4, r8, #128 ; 0x80 6cd0: e129f004 msr CPSR_fc, r4 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; 6cd4: e59c4000 ldr r4, [ip] while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 6cd8: e154000a cmp r4, sl 6cdc: 1a000009 bne 6d08 <_Thread_queue_Enqueue_priority+0x80> 6ce0: ea000052 b 6e30 <_Thread_queue_Enqueue_priority+0x1a8> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 6ce4: e10f7000 mrs r7, CPSR 6ce8: e129f008 msr CPSR_fc, r8 6cec: e129f007 msr CPSR_fc, r7 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) ) { 6cf0: e5947010 ldr r7, [r4, #16] 6cf4: e1160007 tst r6, r7 6cf8: 0a000033 beq 6dcc <_Thread_queue_Enqueue_priority+0x144> _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 6cfc: e5944000 ldr r4, [r4] restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 6d00: e154000a cmp r4, sl 6d04: 0a000002 beq 6d14 <_Thread_queue_Enqueue_priority+0x8c> search_priority = search_thread->current_priority; 6d08: e5945014 ldr r5, [r4, #20] if ( priority <= search_priority ) 6d0c: e1530005 cmp r3, r5 6d10: 8afffff3 bhi 6ce4 <_Thread_queue_Enqueue_priority+0x5c> restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 6d14: e1a06008 mov r6, r8 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 6d18: e590c030 ldr ip, [r0, #48] ; 0x30 6d1c: e35c0001 cmp ip, #1 6d20: 0a00002b beq 6dd4 <_Thread_queue_Enqueue_priority+0x14c> * 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; 6d24: e5826000 str r6, [r2] return the_thread_queue->sync_state; 6d28: e1a0000c mov r0, ip } 6d2c: e8bd05f0 pop {r4, r5, r6, r7, r8, sl} 6d30: e12fff1e bx lr static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 6d34: e129f008 msr CPSR_fc, r8 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 6d38: e5da5000 ldrb r5, [sl] 6d3c: e2855001 add r5, r5, #1 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 6d40: e10f8000 mrs r8, CPSR 6d44: e3884080 orr r4, r8, #128 ; 0x80 6d48: e129f004 msr CPSR_fc, r4 _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; 6d4c: e59c4008 ldr r4, [ip, #8] while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 6d50: e154000c cmp r4, ip 6d54: 1a000009 bne 6d80 <_Thread_queue_Enqueue_priority+0xf8> 6d58: ea00000b b 6d8c <_Thread_queue_Enqueue_priority+0x104> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 6d5c: e10f7000 mrs r7, CPSR 6d60: e129f008 msr CPSR_fc, r8 6d64: e129f007 msr CPSR_fc, r7 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) ) { 6d68: e5947010 ldr r7, [r4, #16] 6d6c: e1160007 tst r6, r7 6d70: 0affffef beq 6d34 <_Thread_queue_Enqueue_priority+0xac> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 6d74: e5944004 ldr r4, [r4, #4] restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 6d78: e154000c cmp r4, ip 6d7c: 0a000002 beq 6d8c <_Thread_queue_Enqueue_priority+0x104> search_priority = search_thread->current_priority; 6d80: e5945014 ldr r5, [r4, #20] if ( priority >= search_priority ) 6d84: e1530005 cmp r3, r5 6d88: 3afffff3 bcc 6d5c <_Thread_queue_Enqueue_priority+0xd4> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 6d8c: e590c030 ldr ip, [r0, #48] ; 0x30 6d90: e35c0001 cmp ip, #1 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 6d94: e1a06008 mov r6, r8 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 6d98: 1affffe1 bne 6d24 <_Thread_queue_Enqueue_priority+0x9c> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 6d9c: e1530005 cmp r3, r5 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 6da0: e3a03000 mov r3, #0 6da4: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 6da8: 0a000016 beq 6e08 <_Thread_queue_Enqueue_priority+0x180> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 6dac: e5943000 ldr r3, [r4] the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 6db0: e8810018 stm r1, {r3, r4} search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 6db4: e5810044 str r0, [r1, #68] ; 0x44 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; 6db8: e5841000 str r1, [r4] next_node->previous = the_node; 6dbc: e5831004 str r1, [r3, #4] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 6dc0: e129f008 msr CPSR_fc, r8 6dc4: e3a00001 mov r0, #1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 6dc8: eaffffd7 b 6d2c <_Thread_queue_Enqueue_priority+0xa4> 6dcc: e129f008 msr CPSR_fc, r8 <== NOT EXECUTED 6dd0: eaffffbc b 6cc8 <_Thread_queue_Enqueue_priority+0x40> <== NOT EXECUTED THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 6dd4: e1530005 cmp r3, r5 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 6dd8: e3a03000 mov r3, #0 6ddc: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 6de0: 0a000008 beq 6e08 <_Thread_queue_Enqueue_priority+0x180> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 6de4: e5943004 ldr r3, [r4, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 6de8: e5814000 str r4, [r1] the_node->previous = previous_node; 6dec: e5813004 str r3, [r1, #4] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 6df0: e5810044 str r0, [r1, #68] ; 0x44 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 6df4: e5831000 str r1, [r3] search_node->previous = the_node; 6df8: e5841004 str r1, [r4, #4] 6dfc: e129f008 msr CPSR_fc, r8 6e00: e3a00001 mov r0, #1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 6e04: eaffffc8 b 6d2c <_Thread_queue_Enqueue_priority+0xa4> 6e08: e284403c add r4, r4, #60 ; 0x3c _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 6e0c: e5943004 ldr r3, [r4, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 6e10: e5814000 str r4, [r1] the_node->previous = previous_node; 6e14: e5813004 str r3, [r1, #4] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 6e18: e5810044 str r0, [r1, #68] ; 0x44 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 6e1c: e5831000 str r1, [r3] search_node->previous = the_node; 6e20: e5841004 str r1, [r4, #4] 6e24: e129f006 msr CPSR_fc, r6 6e28: e3a00001 mov r0, #1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 6e2c: eaffffbe b 6d2c <_Thread_queue_Enqueue_priority+0xa4> restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 6e30: e1a06008 mov r6, r8 6e34: e3e05000 mvn r5, #0 6e38: eaffffb6 b 6d18 <_Thread_queue_Enqueue_priority+0x90> 6e3c: 00017c00 .word 0x00017c00 000154d4 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 154d4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 154d8: e24dd024 sub sp, sp, #36 ; 0x24 154dc: e28d700c add r7, sp, #12 154e0: e28d2018 add r2, sp, #24 154e4: e1a04000 mov r4, r0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 154e8: e3a03000 mov r3, #0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 154ec: e282a004 add sl, r2, #4 154f0: e2872004 add r2, r7, #4 154f4: e58d2000 str r2, [sp] RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 154f8: e58d301c str r3, [sp, #28] the_chain->last = _Chain_Head(the_chain); 154fc: e28d0018 add r0, sp, #24 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 15500: e58d200c str r2, [sp, #12] the_chain->permanent_null = NULL; 15504: e58d3010 str r3, [sp, #16] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 15508: e2842008 add r2, r4, #8 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 1550c: e2843040 add r3, r4, #64 ; 0x40 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 15510: e58da018 str sl, [sp, #24] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 15514: e58d0020 str r0, [sp, #32] 15518: e58d7014 str r7, [sp, #20] 1551c: e59f91a0 ldr r9, [pc, #416] ; 156c4 <_Timer_server_Body+0x1f0> 15520: e59fb1a0 ldr fp, [pc, #416] ; 156c8 <_Timer_server_Body+0x1f4> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 15524: e58d2008 str r2, [sp, #8] static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 15528: e58d3004 str r3, [sp, #4] */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 1552c: e2846030 add r6, r4, #48 ; 0x30 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 15530: e2848068 add r8, r4, #104 ; 0x68 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 15534: e28d0018 add r0, sp, #24 15538: e5840078 str r0, [r4, #120] ; 0x78 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 1553c: e5993000 ldr r3, [r9] /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 15540: e594103c ldr r1, [r4, #60] ; 0x3c watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 15544: e1a00006 mov r0, r6 15548: e0611003 rsb r1, r1, r3 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 1554c: e584303c str r3, [r4, #60] ; 0x3c _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 15550: e1a02007 mov r2, r7 15554: eb001086 bl 19774 <_Watchdog_Adjust_to_chain> static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 15558: e59b5000 ldr r5, [fp] Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 1555c: e5941074 ldr r1, [r4, #116] ; 0x74 /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 15560: e1550001 cmp r5, r1 15564: 8a000022 bhi 155f4 <_Timer_server_Body+0x120> * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 15568: 3a000018 bcc 155d0 <_Timer_server_Body+0xfc> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 1556c: e5845074 str r5, [r4, #116] ; 0x74 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 15570: e5940078 ldr r0, [r4, #120] ; 0x78 15574: eb000249 bl 15ea0 <_Chain_Get> if ( timer == NULL ) { 15578: e3500000 cmp r0, #0 1557c: 0a00000b beq 155b0 <_Timer_server_Body+0xdc> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 15580: e5903038 ldr r3, [r0, #56] ; 0x38 15584: e3530001 cmp r3, #1 15588: 0a000015 beq 155e4 <_Timer_server_Body+0x110> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 1558c: e3530003 cmp r3, #3 15590: 1afffff6 bne 15570 <_Timer_server_Body+0x9c> _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 15594: e2801010 add r1, r0, #16 15598: e1a00008 mov r0, r8 1559c: eb0010a3 bl 19830 <_Watchdog_Insert> } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 155a0: e5940078 ldr r0, [r4, #120] ; 0x78 155a4: eb00023d bl 15ea0 <_Chain_Get> if ( timer == NULL ) { 155a8: e3500000 cmp r0, #0 155ac: 1afffff3 bne 15580 <_Timer_server_Body+0xac> static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 155b0: e10f2000 mrs r2, CPSR 155b4: e3823080 orr r3, r2, #128 ; 0x80 155b8: e129f003 msr CPSR_fc, r3 * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { 155bc: e59d3018 ldr r3, [sp, #24] 155c0: e15a0003 cmp sl, r3 155c4: 0a00000f beq 15608 <_Timer_server_Body+0x134> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 155c8: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED 155cc: eaffffda b 1553c <_Timer_server_Body+0x68> <== NOT EXECUTED /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 155d0: e0652001 rsb r2, r5, r1 155d4: e1a00008 mov r0, r8 155d8: e3a01001 mov r1, #1 155dc: eb001035 bl 196b8 <_Watchdog_Adjust> 155e0: eaffffe1 b 1556c <_Timer_server_Body+0x98> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 155e4: e2801010 add r1, r0, #16 155e8: e1a00006 mov r0, r6 155ec: eb00108f bl 19830 <_Watchdog_Insert> 155f0: eaffffde b 15570 <_Timer_server_Body+0x9c> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 155f4: e0611005 rsb r1, r1, r5 155f8: e1a00008 mov r0, r8 155fc: e1a02007 mov r2, r7 15600: eb00105b bl 19774 <_Watchdog_Adjust_to_chain> 15604: eaffffd8 b 1556c <_Timer_server_Body+0x98> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 15608: e5840078 str r0, [r4, #120] ; 0x78 1560c: e129f002 msr CPSR_fc, r2 _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 15610: e59d300c ldr r3, [sp, #12] 15614: e59d2000 ldr r2, [sp] 15618: e1520003 cmp r2, r3 1561c: 159d5000 ldrne r5, [sp] 15620: 1a00000a bne 15650 <_Timer_server_Body+0x17c> 15624: ea000011 b 15670 <_Timer_server_Body+0x19c> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 15628: e5932000 ldr r2, [r3] * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 1562c: e3a00000 mov r0, #0 the_chain->first = new_first; 15630: e58d200c str r2, [sp, #12] 15634: e5830008 str r0, [r3, #8] new_first->previous = _Chain_Head(the_chain); 15638: e5827004 str r7, [r2, #4] 1563c: e129f001 msr CPSR_fc, r1 /* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); 15640: e2830020 add r0, r3, #32 15644: e8900003 ldm r0, {r0, r1} 15648: e1a0e00f mov lr, pc 1564c: e593f01c ldr pc, [r3, #28] static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 15650: e10f1000 mrs r1, CPSR 15654: e3813080 orr r3, r1, #128 ; 0x80 15658: e129f003 msr CPSR_fc, r3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 1565c: e59d300c ldr r3, [sp, #12] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 15660: e1550003 cmp r5, r3 15664: 1affffef bne 15628 <_Timer_server_Body+0x154> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 15668: e129f001 msr CPSR_fc, r1 1566c: eaffffb0 b 15534 <_Timer_server_Body+0x60> } } else { ts->active = false; 15670: e3a02000 mov r2, #0 15674: e5c4207c strb r2, [r4, #124] ; 0x7c 15678: e59f004c ldr r0, [pc, #76] ; 156cc <_Timer_server_Body+0x1f8> 1567c: e5903000 ldr r3, [r0] 15680: e2833001 add r3, r3, #1 15684: e5803000 str r3, [r0] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 15688: e3a01008 mov r1, #8 1568c: e5940000 ldr r0, [r4] 15690: eb000d9c bl 18d08 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 15694: e1a00004 mov r0, r4 15698: ebffff61 bl 15424 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 1569c: e1a00004 mov r0, r4 156a0: ebffff75 bl 1547c <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 156a4: eb000ae9 bl 18250 <_Thread_Enable_dispatch> ts->active = true; 156a8: e3a02001 mov r2, #1 156ac: e5c4207c strb r2, [r4, #124] ; 0x7c static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 156b0: e59d0008 ldr r0, [sp, #8] 156b4: eb0010c0 bl 199bc <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 156b8: e59d0004 ldr r0, [sp, #4] 156bc: eb0010be bl 199bc <_Watchdog_Remove> 156c0: eaffff9b b 15534 <_Timer_server_Body+0x60> 156c4: 00039fe4 .word 0x00039fe4 156c8: 00039f14 .word 0x00039f14 156cc: 00039e8c .word 0x00039e8c 000096f0 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 96f0: e92d41f0 push {r4, r5, r6, r7, r8, lr} 96f4: e1a04000 mov r4, r0 96f8: e1a05002 mov r5, r2 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 96fc: e10f3000 mrs r3, CPSR 9700: e3832080 orr r2, r3, #128 ; 0x80 9704: e129f002 msr CPSR_fc, r2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 9708: e1a07000 mov r7, r0 970c: 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 ) ) { 9710: e1520007 cmp r2, r7 9714: 0a000018 beq 977c <_Watchdog_Adjust+0x8c> switch ( direction ) { 9718: e3510000 cmp r1, #0 971c: 1a000018 bne 9784 <_Watchdog_Adjust+0x94> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 9720: e3550000 cmp r5, #0 9724: 0a000014 beq 977c <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) { 9728: e5926010 ldr r6, [r2, #16] 972c: e1550006 cmp r5, r6 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 9730: 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 ) { 9734: 2a000005 bcs 9750 <_Watchdog_Adjust+0x60> 9738: ea000018 b 97a0 <_Watchdog_Adjust+0xb0> <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 973c: e0555006 subs r5, r5, r6 9740: 0a00000d beq 977c <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) { 9744: e5926010 ldr r6, [r2, #16] 9748: e1560005 cmp r6, r5 974c: 8a000013 bhi 97a0 <_Watchdog_Adjust+0xb0> _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 9750: e5828010 str r8, [r2, #16] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 9754: e129f003 msr CPSR_fc, r3 _ISR_Enable( level ); _Watchdog_Tickle( header ); 9758: e1a00004 mov r0, r4 975c: eb0000a0 bl 99e4 <_Watchdog_Tickle> static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 9760: e10f3000 mrs r3, CPSR 9764: e3832080 orr r2, r3, #128 ; 0x80 9768: e129f002 msr CPSR_fc, r2 976c: e5941000 ldr r1, [r4] _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 9770: e1570001 cmp r7, r1 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 9774: e1a02001 mov r2, r1 9778: 1affffef bne 973c <_Watchdog_Adjust+0x4c> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 977c: e129f003 msr CPSR_fc, r3 } } _ISR_Enable( level ); } 9780: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { 9784: e3510001 cmp r1, #1 9788: 1afffffb bne 977c <_Watchdog_Adjust+0x8c> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 978c: e5921010 ldr r1, [r2, #16] 9790: e0815005 add r5, r1, r5 9794: e5825010 str r5, [r2, #16] 9798: e129f003 msr CPSR_fc, r3 } } _ISR_Enable( level ); } 979c: 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; 97a0: e0655006 rsb r5, r5, r6 97a4: e5825010 str r5, [r2, #16] break; 97a8: eafffff3 b 977c <_Watchdog_Adjust+0x8c> 00006984 : rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 6984: e59f3144 ldr r3, [pc, #324] ; 6ad0 6988: 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; 698c: e59f3140 ldr r3, [pc, #320] ; 6ad4 if ( rtems_interrupt_is_in_progress() ) 6990: 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 ) { 6994: e92d4010 push {r4, lr} 6998: e1a04000 mov r4, r0 rtems_device_major_number major_limit = _IO_Number_of_drivers; 699c: e5930000 ldr r0, [r3] if ( rtems_interrupt_is_in_progress() ) 69a0: 13a00012 movne r0, #18 69a4: 18bd8010 popne {r4, pc} return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 69a8: e3520000 cmp r2, #0 69ac: 0a00003c beq 6aa4 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; if ( driver_table == NULL ) 69b0: e3510000 cmp r1, #0 if ( registered_major == NULL ) return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 69b4: e5820000 str r0, [r2] if ( driver_table == NULL ) 69b8: 0a000039 beq 6aa4 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 69bc: e591c000 ldr ip, [r1] 69c0: e35c0000 cmp ip, #0 69c4: 0a000033 beq 6a98 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 69c8: e1500004 cmp r0, r4 69cc: 93a0000a movls r0, #10 69d0: 98bd8010 popls {r4, pc} rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 69d4: e59f00fc ldr r0, [pc, #252] ; 6ad8 69d8: e590c000 ldr ip, [r0] 69dc: e28cc001 add ip, ip, #1 69e0: e580c000 str ip, [r0] return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 69e4: e3540000 cmp r4, #0 69e8: 1a000020 bne 6a70 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 69ec: e593e000 ldr lr, [r3] rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 69f0: e35e0000 cmp lr, #0 69f4: 0a00002c beq 6aac 69f8: e59f30dc ldr r3, [pc, #220] ; 6adc 69fc: e593c000 ldr ip, [r3] 6a00: e1a0300c mov r3, ip 6a04: ea000003 b 6a18 6a08: e2844001 add r4, r4, #1 6a0c: e15e0004 cmp lr, r4 6a10: e2833018 add r3, r3, #24 6a14: 9a000005 bls 6a30 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 6a18: e5930000 ldr r0, [r3] 6a1c: e3500000 cmp r0, #0 6a20: 1afffff8 bne 6a08 6a24: e5930004 ldr r0, [r3, #4] 6a28: e3500000 cmp r0, #0 6a2c: 1afffff5 bne 6a08 } /* Assigns invalid value in case of failure */ *major = m; if ( m != n ) 6a30: e15e0004 cmp lr, r4 6a34: 10843084 addne r3, r4, r4, lsl #1 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 6a38: e5824000 str r4, [r2] if ( m != n ) 6a3c: 108cc183 addne ip, ip, r3, lsl #3 6a40: 0a00001a beq 6ab0 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 6a44: e1a0e001 mov lr, r1 6a48: e8be000f ldm lr!, {r0, r1, r2, r3} 6a4c: e8ac000f stmia ip!, {r0, r1, r2, r3} 6a50: e89e0003 ldm lr, {r0, r1} 6a54: e88c0003 stm ip, {r0, r1} _Thread_Enable_dispatch(); 6a58: eb00067f bl 845c <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 6a5c: e3a01000 mov r1, #0 6a60: e1a00004 mov r0, r4 6a64: e1a02001 mov r2, r1 } 6a68: e8bd4010 pop {r4, lr} _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 6a6c: ea00213a b ef5c _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 6a70: e59f3064 ldr r3, [pc, #100] ; 6adc 6a74: e5933000 ldr r3, [r3] 6a78: 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; 6a7c: e793018c ldr r0, [r3, ip, lsl #3] 6a80: e3500000 cmp r0, #0 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 6a84: e083c18c add ip, r3, ip, lsl #3 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 6a88: 0a00000b beq 6abc 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(); 6a8c: eb000672 bl 845c <_Thread_Enable_dispatch> 6a90: e3a0000c mov r0, #12 return RTEMS_RESOURCE_IN_USE; 6a94: e8bd8010 pop {r4, pc} static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 6a98: e591c004 ldr ip, [r1, #4] 6a9c: e35c0000 cmp ip, #0 6aa0: 1affffc8 bne 69c8 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 6aa4: e3a00009 mov r0, #9 } 6aa8: e8bd8010 pop {r4, pc} if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 6aac: 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(); 6ab0: eb000669 bl 845c <_Thread_Enable_dispatch> 6ab4: e3a00005 mov r0, #5 return sc; 6ab8: e8bd8010 pop {r4, pc} static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 6abc: e59c3004 ldr r3, [ip, #4] 6ac0: e3530000 cmp r3, #0 6ac4: 1afffff0 bne 6a8c if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 6ac8: e5824000 str r4, [r2] 6acc: eaffffdc b 6a44 6ad0: 0001f13c .word 0x0001f13c 6ad4: 0001f324 .word 0x0001f324 6ad8: 0001f0ac .word 0x0001f0ac 6adc: 0001f328 .word 0x0001f328