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: e5901104 ldr r1, [r0, #260] ; 0x104 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: ea0007e7 b 6370 <_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: eb000d92 bl 7a40 <_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: ea0007d8 b 6370 <_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: 0001aadc .word 0x0001aadc 4464: 0001ab00 .word 0x0001ab00 4468: 0001b2d0 .word 0x0001b2d0 0000a880 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { a880: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} a884: 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; a888: e5902010 ldr r2, [r0, #16] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { a88c: e24dd01c sub sp, sp, #28 a890: 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 ) { a894: e2911004 adds r1, r1, #4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { a898: 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 ) { a89c: e58d1000 str r1, [sp] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { a8a0: 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; a8a4: 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; a8a8: e58d200c str r2, [sp, #12] uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { a8ac: 2a000076 bcs aa8c <_Heap_Allocate_aligned_with_boundary+0x20c> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { a8b0: e3530000 cmp r3, #0 a8b4: 1a000072 bne aa84 <_Heap_Allocate_aligned_with_boundary+0x204> if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { a8b8: e157000a cmp r7, sl a8bc: 03a06000 moveq r6, #0 a8c0: 0a000074 beq aa98 <_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; a8c4: e59d300c ldr r3, [sp, #12] uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; a8c8: 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; a8cc: e2833007 add r3, r3, #7 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { a8d0: 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; a8d4: e58d3010 str r3, [sp, #16] uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; a8d8: e58d1014 str r1, [sp, #20] a8dc: ea000004 b a8f4 <_Heap_Allocate_aligned_with_boundary+0x74> boundary ); } } if ( alloc_begin != 0 ) { a8e0: e3540000 cmp r4, #0 a8e4: 1a000059 bne aa50 <_Heap_Allocate_aligned_with_boundary+0x1d0> break; } block = block->next; a8e8: e59aa008 ldr sl, [sl, #8] if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { a8ec: e157000a cmp r7, sl a8f0: 0a000068 beq aa98 <_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 ) { a8f4: e59a9004 ldr r9, [sl, #4] a8f8: e59d2000 ldr r2, [sp] a8fc: e1520009 cmp r2, r9 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; a900: 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 ) { a904: 2afffff7 bcs a8e8 <_Heap_Allocate_aligned_with_boundary+0x68> if ( alignment == 0 ) { a908: 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; a90c: 028a4008 addeq r4, sl, #8 a910: 0afffff2 beq a8e0 <_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; a914: 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; a918: e3c99001 bic r9, r9, #1 a91c: 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; a920: 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; a924: e59d2010 ldr r2, [sp, #16] uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; a928: 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; a92c: e58d3004 str r3, [sp, #4] RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); a930: 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; a934: e0633002 rsb r3, r3, r2 a938: e1a01008 mov r1, r8 a93c: e0839009 add r9, r3, r9 a940: eb003156 bl 16ea0 <__umodsi3> a944: 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; a948: 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 ) { a94c: e1590004 cmp r9, r4 a950: e58d3008 str r3, [sp, #8] a954: 2a000003 bcs a968 <_Heap_Allocate_aligned_with_boundary+0xe8> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); a958: e1a00009 mov r0, r9 a95c: e1a01008 mov r1, r8 a960: eb00314e bl 16ea0 <__umodsi3> a964: e0604009 rsb r4, r0, r9 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { a968: e35b0000 cmp fp, #0 a96c: 0a000025 beq aa08 <_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; a970: e0849005 add r9, r4, r5 a974: e1a00009 mov r0, r9 a978: e1a0100b mov r1, fp a97c: eb003147 bl 16ea0 <__umodsi3> a980: 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 ) { a984: e1590000 cmp r9, r0 a988: 93a03000 movls r3, #0 a98c: 83a03001 movhi r3, #1 a990: e1540000 cmp r4, r0 a994: 23a03000 movcs r3, #0 a998: e3530000 cmp r3, #0 a99c: 0a000019 beq aa08 <_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; a9a0: e59d1008 ldr r1, [sp, #8] a9a4: 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 ) { a9a8: e1590000 cmp r9, r0 a9ac: 958d6018 strls r6, [sp, #24] a9b0: 9a000002 bls a9c0 <_Heap_Allocate_aligned_with_boundary+0x140> a9b4: eaffffcb b a8e8 <_Heap_Allocate_aligned_with_boundary+0x68> a9b8: e1590000 cmp r9, r0 a9bc: 8a000037 bhi aaa0 <_Heap_Allocate_aligned_with_boundary+0x220> return 0; } alloc_begin = boundary_line - alloc_size; a9c0: e0654000 rsb r4, r5, r0 a9c4: e1a01008 mov r1, r8 a9c8: e1a00004 mov r0, r4 a9cc: eb003133 bl 16ea0 <__umodsi3> a9d0: e0604004 rsb r4, r0, r4 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; a9d4: e0846005 add r6, r4, r5 a9d8: e1a00006 mov r0, r6 a9dc: e1a0100b mov r1, fp a9e0: eb00312e bl 16ea0 <__umodsi3> a9e4: 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 ) { a9e8: e1560000 cmp r6, r0 a9ec: 93a03000 movls r3, #0 a9f0: 83a03001 movhi r3, #1 a9f4: e1540000 cmp r4, r0 a9f8: 23a03000 movcs r3, #0 a9fc: e3530000 cmp r3, #0 aa00: 1affffec bne a9b8 <_Heap_Allocate_aligned_with_boundary+0x138> aa04: 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 ) { aa08: e59d2008 ldr r2, [sp, #8] aa0c: e1520004 cmp r2, r4 aa10: 8affffb4 bhi a8e8 <_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; aa14: e59d100c ldr r1, [sp, #12] aa18: e1a00004 mov r0, r4 aa1c: eb00311f bl 16ea0 <__umodsi3> aa20: e26a94ff rsb r9, sl, #-16777216 ; 0xff000000 aa24: e28998ff add r9, r9, #16711680 ; 0xff0000 aa28: e2899cff add r9, r9, #65280 ; 0xff00 aa2c: e28990f8 add r9, r9, #248 ; 0xf8 aa30: e0899004 add r9, r9, r4 if ( free_size >= min_block_size || free_size == 0 ) { aa34: e59d1004 ldr r1, [sp, #4] aa38: e0603009 rsb r3, r0, r9 aa3c: e1590000 cmp r9, r0 aa40: 11510003 cmpne r1, r3 aa44: 8affffa7 bhi a8e8 <_Heap_Allocate_aligned_with_boundary+0x68> boundary ); } } if ( alloc_begin != 0 ) { aa48: e3540000 cmp r4, #0 aa4c: 0affffa5 beq a8e8 <_Heap_Allocate_aligned_with_boundary+0x68> block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; aa50: e597304c ldr r3, [r7, #76] ; 0x4c aa54: e0833006 add r3, r3, r6 aa58: e587304c str r3, [r7, #76] ; 0x4c block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); aa5c: e1a0100a mov r1, sl aa60: e1a03005 mov r3, r5 aa64: e1a00007 mov r0, r7 aa68: e1a02004 mov r2, r4 aa6c: ebffeb68 bl 5814 <_Heap_Block_allocate> aa70: e1a00004 mov r0, r4 uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; aa74: e5973044 ldr r3, [r7, #68] ; 0x44 aa78: e1530006 cmp r3, r6 ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; aa7c: 35876044 strcc r6, [r7, #68] ; 0x44 aa80: ea000002 b aa90 <_Heap_Allocate_aligned_with_boundary+0x210> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { aa84: e1550003 cmp r5, r3 aa88: 9a000006 bls aaa8 <_Heap_Allocate_aligned_with_boundary+0x228> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; aa8c: e3a00000 mov r0, #0 } return (void *) alloc_begin; } aa90: e28dd01c add sp, sp, #28 aa94: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { aa98: e3a00000 mov r0, #0 aa9c: eafffff4 b aa74 <_Heap_Allocate_aligned_with_boundary+0x1f4> aaa0: e59d6018 ldr r6, [sp, #24] <== NOT EXECUTED aaa4: eaffff8f b a8e8 <_Heap_Allocate_aligned_with_boundary+0x68> <== NOT EXECUTED if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { aaa8: e3580000 cmp r8, #0 aaac: 01a08002 moveq r8, r2 aab0: eaffff80 b a8b8 <_Heap_Allocate_aligned_with_boundary+0x38> 000065a4 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 65a4: 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() ) ) { 65a8: e59f35d0 ldr r3, [pc, #1488] ; 6b80 <_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; 65ac: e31200ff tst r2, #255 ; 0xff if ( !_System_state_Is_up( _System_state_Get() ) ) { 65b0: 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; 65b4: e59f25c8 ldr r2, [pc, #1480] ; 6b84 <_Heap_Walk+0x5e0> 65b8: e59fa5c8 ldr sl, [pc, #1480] ; 6b88 <_Heap_Walk+0x5e4> 65bc: 01a0a002 moveq sl, r2 if ( !_System_state_Is_up( _System_state_Get() ) ) { 65c0: e3530003 cmp r3, #3 Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size; 65c4: e5902010 ldr r2, [r0, #16] uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; 65c8: e5903024 ldr r3, [r0, #36] ; 0x24 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 65cc: e24dd038 sub sp, sp, #56 ; 0x38 65d0: e1a04000 mov r4, r0 65d4: e1a08001 mov r8, r1 uintptr_t const page_size = heap->page_size; 65d8: e58d2020 str r2, [sp, #32] uintptr_t const min_block_size = heap->min_block_size; 65dc: e590b014 ldr fp, [r0, #20] Heap_Block *const last_block = heap->last_block; 65e0: e58d3024 str r3, [sp, #36] ; 0x24 Heap_Block *block = heap->first_block; 65e4: 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() ) ) { 65e8: 0a000002 beq 65f8 <_Heap_Walk+0x54> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 65ec: e3a00001 mov r0, #1 block = next_block; } return true; } 65f0: e28dd038 add sp, sp, #56 ; 0x38 65f4: 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)( 65f8: e5900018 ldr r0, [r0, #24] 65fc: e594101c ldr r1, [r4, #28] 6600: e2842008 add r2, r4, #8 6604: e892000c ldm r2, {r2, r3} 6608: e59dc024 ldr ip, [sp, #36] ; 0x24 660c: e98d0003 stmib sp, {r0, r1} 6610: e58d2014 str r2, [sp, #20] 6614: e58d3018 str r3, [sp, #24] 6618: e59f256c ldr r2, [pc, #1388] ; 6b8c <_Heap_Walk+0x5e8> 661c: e58db000 str fp, [sp] 6620: e58d500c str r5, [sp, #12] 6624: e58dc010 str ip, [sp, #16] 6628: e1a00008 mov r0, r8 662c: e3a01000 mov r1, #0 6630: e59d3020 ldr r3, [sp, #32] 6634: e1a0e00f mov lr, pc 6638: e12fff1a bx sl heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 663c: e59d2020 ldr r2, [sp, #32] 6640: e3520000 cmp r2, #0 6644: 0a000032 beq 6714 <_Heap_Walk+0x170> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 6648: e59d3020 ldr r3, [sp, #32] 664c: e2139003 ands r9, r3, #3 6650: 1a000036 bne 6730 <_Heap_Walk+0x18c> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 6654: e1a0000b mov r0, fp 6658: e59d1020 ldr r1, [sp, #32] 665c: ebffe96c bl c14 <__umodsi3> 6660: e2506000 subs r6, r0, #0 6664: 1a000038 bne 674c <_Heap_Walk+0x1a8> ); return false; } if ( 6668: e2850008 add r0, r5, #8 666c: e59d1020 ldr r1, [sp, #32] 6670: ebffe967 bl c14 <__umodsi3> 6674: e2509000 subs r9, r0, #0 6678: 1a00003b bne 676c <_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; 667c: e5957004 ldr r7, [r5, #4] ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 6680: e2176001 ands r6, r7, #1 6684: 0a000040 beq 678c <_Heap_Walk+0x1e8> ); return false; } if ( first_block->prev_size != page_size ) { 6688: e5953000 ldr r3, [r5] 668c: e59dc020 ldr ip, [sp, #32] 6690: e15c0003 cmp ip, r3 6694: 1a000016 bne 66f4 <_Heap_Walk+0x150> ); return false; } if ( _Heap_Is_free( last_block ) ) { 6698: e59d2024 ldr r2, [sp, #36] ; 0x24 669c: e5923004 ldr r3, [r2, #4] 66a0: e3c33001 bic r3, r3, #1 66a4: e0823003 add r3, r2, r3 66a8: e5939004 ldr r9, [r3, #4] 66ac: e2199001 ands r9, r9, #1 66b0: 0a000112 beq 6b00 <_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; 66b4: e5949008 ldr r9, [r4, #8] int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 66b8: 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 ) { 66bc: e1540009 cmp r4, r9 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 66c0: 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 ) { 66c4: 0a00006c beq 687c <_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; 66c8: 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 66cc: e15c0009 cmp ip, r9 66d0: 9a000034 bls 67a8 <_Heap_Walk+0x204> if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( 66d4: e1a00008 mov r0, r8 66d8: e1a03009 mov r3, r9 66dc: e3a01001 mov r1, #1 66e0: e59f24a8 ldr r2, [pc, #1192] ; 6b90 <_Heap_Walk+0x5ec> 66e4: e1a0e00f mov lr, pc 66e8: e12fff1a bx sl 66ec: e3a00000 mov r0, #0 66f0: eaffffbe b 65f0 <_Heap_Walk+0x4c> return false; } if ( first_block->prev_size != page_size ) { (*printer)( 66f4: e1a00008 mov r0, r8 66f8: e58dc000 str ip, [sp] 66fc: e3a01001 mov r1, #1 6700: e59f248c ldr r2, [pc, #1164] ; 6b94 <_Heap_Walk+0x5f0> 6704: e1a0e00f mov lr, pc 6708: e12fff1a bx sl 670c: e1a00009 mov r0, r9 6710: eaffffb6 b 65f0 <_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" ); 6714: e1a00008 mov r0, r8 6718: e3a01001 mov r1, #1 671c: e59f2474 ldr r2, [pc, #1140] ; 6b98 <_Heap_Walk+0x5f4> 6720: e1a0e00f mov lr, pc 6724: e12fff1a bx sl 6728: e59d0020 ldr r0, [sp, #32] 672c: eaffffaf b 65f0 <_Heap_Walk+0x4c> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 6730: e1a00008 mov r0, r8 6734: e3a01001 mov r1, #1 6738: e59f245c ldr r2, [pc, #1116] ; 6b9c <_Heap_Walk+0x5f8> 673c: e1a0e00f mov lr, pc 6740: e12fff1a bx sl 6744: e3a00000 mov r0, #0 6748: eaffffa8 b 65f0 <_Heap_Walk+0x4c> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 674c: e1a00008 mov r0, r8 6750: e1a0300b mov r3, fp 6754: e3a01001 mov r1, #1 6758: e59f2440 ldr r2, [pc, #1088] ; 6ba0 <_Heap_Walk+0x5fc> 675c: e1a0e00f mov lr, pc 6760: e12fff1a bx sl 6764: e1a00009 mov r0, r9 6768: eaffffa0 b 65f0 <_Heap_Walk+0x4c> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 676c: e1a00008 mov r0, r8 6770: e1a03005 mov r3, r5 6774: e3a01001 mov r1, #1 6778: e59f2424 ldr r2, [pc, #1060] ; 6ba4 <_Heap_Walk+0x600> 677c: e1a0e00f mov lr, pc 6780: e12fff1a bx sl 6784: e1a00006 mov r0, r6 6788: eaffff98 b 65f0 <_Heap_Walk+0x4c> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 678c: e1a00008 mov r0, r8 6790: e3a01001 mov r1, #1 6794: e59f240c ldr r2, [pc, #1036] ; 6ba8 <_Heap_Walk+0x604> 6798: e1a0e00f mov lr, pc 679c: e12fff1a bx sl 67a0: e1a00006 mov r0, r6 67a4: eaffff91 b 65f0 <_Heap_Walk+0x4c> && (uintptr_t) block <= (uintptr_t) heap->last_block; 67a8: 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 67ac: e1520009 cmp r2, r9 && (uintptr_t) block <= (uintptr_t) heap->last_block; 67b0: 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 67b4: 3affffc6 bcc 66d4 <_Heap_Walk+0x130> ); return false; } if ( 67b8: e2890008 add r0, r9, #8 67bc: e1a01003 mov r1, r3 67c0: e58dc01c str ip, [sp, #28] 67c4: ebffe912 bl c14 <__umodsi3> 67c8: e3500000 cmp r0, #0 67cc: e59dc01c ldr ip, [sp, #28] 67d0: 1a0000d1 bne 6b1c <_Heap_Walk+0x578> ); return false; } if ( _Heap_Is_used( free_block ) ) { 67d4: e5993004 ldr r3, [r9, #4] 67d8: e3c33001 bic r3, r3, #1 67dc: e0893003 add r3, r9, r3 67e0: e5933004 ldr r3, [r3, #4] 67e4: e3130001 tst r3, #1 67e8: 1a0000dc bne 6b60 <_Heap_Walk+0x5bc> ); return false; } if ( free_block->prev != prev_block ) { 67ec: e599200c ldr r2, [r9, #12] 67f0: e1540002 cmp r4, r2 67f4: 1a0000d0 bne 6b3c <_Heap_Walk+0x598> 67f8: e58d7030 str r7, [sp, #48] ; 0x30 67fc: e58db034 str fp, [sp, #52] ; 0x34 6800: e59d702c ldr r7, [sp, #44] ; 0x2c 6804: e59db028 ldr fp, [sp, #40] ; 0x28 6808: e58d502c str r5, [sp, #44] ; 0x2c 680c: e58d6028 str r6, [sp, #40] ; 0x28 6810: e1a0600c mov r6, ip 6814: ea000011 b 6860 <_Heap_Walk+0x2bc> 6818: e1590006 cmp r9, r6 681c: 3affffac bcc 66d4 <_Heap_Walk+0x130> 6820: e1570009 cmp r7, r9 ); return false; } if ( 6824: e2890008 add r0, r9, #8 6828: e1a0100b mov r1, fp 682c: 3affffa8 bcc 66d4 <_Heap_Walk+0x130> 6830: ebffe8f7 bl c14 <__umodsi3> 6834: e3500000 cmp r0, #0 6838: 1a0000b7 bne 6b1c <_Heap_Walk+0x578> ); return false; } if ( _Heap_Is_used( free_block ) ) { 683c: e5993004 ldr r3, [r9, #4] 6840: e3c33001 bic r3, r3, #1 6844: e0833009 add r3, r3, r9 6848: e5933004 ldr r3, [r3, #4] 684c: e3130001 tst r3, #1 6850: 1a0000c2 bne 6b60 <_Heap_Walk+0x5bc> ); return false; } if ( free_block->prev != prev_block ) { 6854: e599200c ldr r2, [r9, #12] 6858: e1520005 cmp r2, r5 685c: 1a0000b6 bne 6b3c <_Heap_Walk+0x598> (*printer)( 6860: e1a05009 mov r5, r9 return false; } prev_block = free_block; free_block = free_block->next; 6864: 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 ) { 6868: e1540009 cmp r4, r9 686c: 1affffe9 bne 6818 <_Heap_Walk+0x274> 6870: e28d502c add r5, sp, #44 ; 0x2c 6874: e89508a0 ldm r5, {r5, r7, fp} 6878: e59d6028 ldr r6, [sp, #40] ; 0x28 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 687c: e59d3024 ldr r3, [sp, #36] ; 0x24 6880: 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)" : ""), 6884: 158db028 strne fp, [sp, #40] ; 0x28 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 6888: 0affff57 beq 65ec <_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; 688c: 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 ) { 6890: 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); 6894: e0876005 add r6, r7, r5 6898: 0a000012 beq 68e8 <_Heap_Walk+0x344> (*printer)( 689c: e1a03005 mov r3, r5 68a0: e58d7000 str r7, [sp] 68a4: e1a00008 mov r0, r8 68a8: e3a01000 mov r1, #0 68ac: e59f22f8 ldr r2, [pc, #760] ; 6bac <_Heap_Walk+0x608> 68b0: e1a0e00f mov lr, pc 68b4: 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 68b8: e5943020 ldr r3, [r4, #32] 68bc: e1530006 cmp r3, r6 68c0: 9a000013 bls 6914 <_Heap_Walk+0x370> block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 68c4: e1a00008 mov r0, r8 68c8: e58d6000 str r6, [sp] 68cc: e1a03005 mov r3, r5 68d0: e3a01001 mov r1, #1 68d4: e59f22d4 ldr r2, [pc, #724] ; 6bb0 <_Heap_Walk+0x60c> 68d8: e1a0e00f mov lr, pc 68dc: e12fff1a bx sl 68e0: e3a00000 mov r0, #0 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 68e4: eaffff41 b 65f0 <_Heap_Walk+0x4c> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 68e8: e58d7000 str r7, [sp] 68ec: e5953000 ldr r3, [r5] 68f0: e1a00008 mov r0, r8 68f4: e58d3004 str r3, [sp, #4] 68f8: e59f22b4 ldr r2, [pc, #692] ; 6bb4 <_Heap_Walk+0x610> 68fc: e1a03005 mov r3, r5 6900: e1a0e00f mov lr, pc 6904: e12fff1a bx sl 6908: e5943020 ldr r3, [r4, #32] 690c: e1530006 cmp r3, r6 6910: 8affffeb bhi 68c4 <_Heap_Walk+0x320> 6914: e5943024 ldr r3, [r4, #36] ; 0x24 6918: e1530006 cmp r3, r6 691c: 3affffe8 bcc 68c4 <_Heap_Walk+0x320> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 6920: e1a00007 mov r0, r7 6924: e59d1020 ldr r1, [sp, #32] 6928: ebffe8b9 bl c14 <__umodsi3> 692c: e2509000 subs r9, r0, #0 6930: 1a000055 bne 6a8c <_Heap_Walk+0x4e8> ); return false; } if ( block_size < min_block_size ) { 6934: e59d3028 ldr r3, [sp, #40] ; 0x28 6938: e1530007 cmp r3, r7 693c: 8a00005b bhi 6ab0 <_Heap_Walk+0x50c> ); return false; } if ( next_block_begin <= block_begin ) { 6940: e1550006 cmp r5, r6 6944: 2a000064 bcs 6adc <_Heap_Walk+0x538> ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 6948: e5963004 ldr r3, [r6, #4] 694c: e3130001 tst r3, #1 6950: 1a000036 bne 6a30 <_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; 6954: 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)( 6958: 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; 695c: 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; 6960: 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; 6964: e1530002 cmp r3, r2 } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 6968: 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); 696c: 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; 6970: 059f0240 ldreq r0, [pc, #576] ; 6bb8 <_Heap_Walk+0x614> 6974: 0a000003 beq 6988 <_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)" : ""), 6978: e59fc23c ldr ip, [pc, #572] ; 6bbc <_Heap_Walk+0x618> 697c: e1520004 cmp r2, r4 6980: e59f0238 ldr r0, [pc, #568] ; 6bc0 <_Heap_Walk+0x61c> 6984: 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)( 6988: e5953008 ldr r3, [r5, #8] 698c: e1510003 cmp r1, r3 6990: 059f122c ldreq r1, [pc, #556] ; 6bc4 <_Heap_Walk+0x620> 6994: 0a000003 beq 69a8 <_Heap_Walk+0x404> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 6998: e59fc21c ldr ip, [pc, #540] ; 6bbc <_Heap_Walk+0x618> 699c: e1530004 cmp r3, r4 69a0: e59f1220 ldr r1, [pc, #544] ; 6bc8 <_Heap_Walk+0x624> 69a4: 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)( 69a8: e58d2000 str r2, [sp] 69ac: e98d0009 stmib sp, {r0, r3} 69b0: e58d100c str r1, [sp, #12] 69b4: e1a03005 mov r3, r5 69b8: e1a00008 mov r0, r8 69bc: e3a01000 mov r1, #0 69c0: e59f2204 ldr r2, [pc, #516] ; 6bcc <_Heap_Walk+0x628> 69c4: e1a0e00f mov lr, pc 69c8: e12fff1a bx sl block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 69cc: e5993000 ldr r3, [r9] 69d0: e1570003 cmp r7, r3 69d4: 0a00000a beq 6a04 <_Heap_Walk+0x460> (*printer)( 69d8: e58d3004 str r3, [sp, #4] 69dc: e1a00008 mov r0, r8 69e0: e58d7000 str r7, [sp] 69e4: e58d9008 str r9, [sp, #8] 69e8: e1a03005 mov r3, r5 69ec: e3a01001 mov r1, #1 69f0: e59f21d8 ldr r2, [pc, #472] ; 6bd0 <_Heap_Walk+0x62c> 69f4: e1a0e00f mov lr, pc 69f8: e12fff1a bx sl 69fc: e3a00000 mov r0, #0 6a00: eafffefa b 65f0 <_Heap_Walk+0x4c> ); return false; } if ( !prev_used ) { 6a04: e21b9001 ands r9, fp, #1 6a08: 0a000017 beq 6a6c <_Heap_Walk+0x4c8> 6a0c: 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 ) { 6a10: e1530004 cmp r3, r4 6a14: 1a000003 bne 6a28 <_Heap_Walk+0x484> 6a18: ea00000b b 6a4c <_Heap_Walk+0x4a8> <== NOT EXECUTED if ( free_block == block ) { return true; } free_block = free_block->next; 6a1c: 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 ) { 6a20: e1530004 cmp r3, r4 6a24: 0a000008 beq 6a4c <_Heap_Walk+0x4a8> if ( free_block == block ) { 6a28: e1530005 cmp r3, r5 6a2c: 1afffffa bne 6a1c <_Heap_Walk+0x478> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 6a30: e59d2024 ldr r2, [sp, #36] ; 0x24 6a34: e1520006 cmp r2, r6 6a38: 0afffeeb beq 65ec <_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 ) { 6a3c: e5967004 ldr r7, [r6, #4] 6a40: e1a05006 mov r5, r6 6a44: e2076001 and r6, r7, #1 6a48: eaffff8f b 688c <_Heap_Walk+0x2e8> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 6a4c: e1a00008 mov r0, r8 6a50: e1a03005 mov r3, r5 6a54: e3a01001 mov r1, #1 6a58: e59f2174 ldr r2, [pc, #372] ; 6bd4 <_Heap_Walk+0x630> 6a5c: e1a0e00f mov lr, pc 6a60: e12fff1a bx sl 6a64: e3a00000 mov r0, #0 6a68: eafffee0 b 65f0 <_Heap_Walk+0x4c> return false; } if ( !prev_used ) { (*printer)( 6a6c: e1a00008 mov r0, r8 6a70: e1a03005 mov r3, r5 6a74: e3a01001 mov r1, #1 6a78: e59f2158 ldr r2, [pc, #344] ; 6bd8 <_Heap_Walk+0x634> 6a7c: e1a0e00f mov lr, pc 6a80: e12fff1a bx sl 6a84: e1a00009 mov r0, r9 6a88: eafffed8 b 65f0 <_Heap_Walk+0x4c> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { (*printer)( 6a8c: e1a00008 mov r0, r8 6a90: e58d7000 str r7, [sp] 6a94: e1a03005 mov r3, r5 6a98: e3a01001 mov r1, #1 6a9c: e59f2138 ldr r2, [pc, #312] ; 6bdc <_Heap_Walk+0x638> 6aa0: e1a0e00f mov lr, pc 6aa4: e12fff1a bx sl 6aa8: e3a00000 mov r0, #0 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 6aac: eafffecf b 65f0 <_Heap_Walk+0x4c> } if ( block_size < min_block_size ) { (*printer)( 6ab0: e58d3004 str r3, [sp, #4] 6ab4: e1a00008 mov r0, r8 6ab8: e1a0b003 mov fp, r3 6abc: e58d7000 str r7, [sp] 6ac0: e1a03005 mov r3, r5 6ac4: e3a01001 mov r1, #1 6ac8: e59f2110 ldr r2, [pc, #272] ; 6be0 <_Heap_Walk+0x63c> 6acc: e1a0e00f mov lr, pc 6ad0: e12fff1a bx sl 6ad4: e1a00009 mov r0, r9 block, block_size, min_block_size ); return false; 6ad8: eafffec4 b 65f0 <_Heap_Walk+0x4c> } if ( next_block_begin <= block_begin ) { (*printer)( 6adc: e1a00008 mov r0, r8 6ae0: e58d6000 str r6, [sp] 6ae4: e1a03005 mov r3, r5 6ae8: e3a01001 mov r1, #1 6aec: e59f20f0 ldr r2, [pc, #240] ; 6be4 <_Heap_Walk+0x640> 6af0: e1a0e00f mov lr, pc 6af4: e12fff1a bx sl 6af8: e1a00009 mov r0, r9 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 6afc: eafffebb b 65f0 <_Heap_Walk+0x4c> return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 6b00: e1a00008 mov r0, r8 6b04: e3a01001 mov r1, #1 6b08: e59f20d8 ldr r2, [pc, #216] ; 6be8 <_Heap_Walk+0x644> 6b0c: e1a0e00f mov lr, pc 6b10: e12fff1a bx sl 6b14: e1a00009 mov r0, r9 6b18: eafffeb4 b 65f0 <_Heap_Walk+0x4c> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 6b1c: e1a00008 mov r0, r8 6b20: e1a03009 mov r3, r9 6b24: e3a01001 mov r1, #1 6b28: e59f20bc ldr r2, [pc, #188] ; 6bec <_Heap_Walk+0x648> 6b2c: e1a0e00f mov lr, pc 6b30: e12fff1a bx sl 6b34: e3a00000 mov r0, #0 6b38: eafffeac b 65f0 <_Heap_Walk+0x4c> return false; } if ( free_block->prev != prev_block ) { (*printer)( 6b3c: e58d2000 str r2, [sp] 6b40: e1a00008 mov r0, r8 6b44: e1a03009 mov r3, r9 6b48: e3a01001 mov r1, #1 6b4c: e59f209c ldr r2, [pc, #156] ; 6bf0 <_Heap_Walk+0x64c> 6b50: e1a0e00f mov lr, pc 6b54: e12fff1a bx sl 6b58: e3a00000 mov r0, #0 6b5c: eafffea3 b 65f0 <_Heap_Walk+0x4c> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 6b60: e1a00008 mov r0, r8 6b64: e1a03009 mov r3, r9 6b68: e3a01001 mov r1, #1 6b6c: e59f2080 ldr r2, [pc, #128] ; 6bf4 <_Heap_Walk+0x650> 6b70: e1a0e00f mov lr, pc 6b74: e12fff1a bx sl 6b78: e3a00000 mov r0, #0 6b7c: eafffe9b b 65f0 <_Heap_Walk+0x4c> 6b80: 0001d390 .word 0x0001d390 6b84: 00006598 .word 0x00006598 6b88: 00006bf8 .word 0x00006bf8 6b8c: 0001b4d8 .word 0x0001b4d8 6b90: 0001b66c .word 0x0001b66c 6b94: 0001b628 .word 0x0001b628 6b98: 0001b56c .word 0x0001b56c 6b9c: 0001b580 .word 0x0001b580 6ba0: 0001b5a0 .word 0x0001b5a0 6ba4: 0001b5c4 .word 0x0001b5c4 6ba8: 0001b5f8 .word 0x0001b5f8 6bac: 0001b70c .word 0x0001b70c 6bb0: 0001b74c .word 0x0001b74c 6bb4: 0001b724 .word 0x0001b724 6bb8: 0001b80c .word 0x0001b80c 6bbc: 0001b490 .word 0x0001b490 6bc0: 0001b818 .word 0x0001b818 6bc4: 0001b824 .word 0x0001b824 6bc8: 0001b830 .word 0x0001b830 6bcc: 0001b83c .word 0x0001b83c 6bd0: 0001b868 .word 0x0001b868 6bd4: 0001b8d4 .word 0x0001b8d4 6bd8: 0001b8a4 .word 0x0001b8a4 6bdc: 0001b77c .word 0x0001b77c 6be0: 0001b7ac .word 0x0001b7ac 6be4: 0001b7d8 .word 0x0001b7d8 6be8: 0001b654 .word 0x0001b654 6bec: 0001b68c .word 0x0001b68c 6bf0: 0001b6d8 .word 0x0001b6d8 6bf4: 0001b6bc .word 0x0001b6bc 00005a84 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 5a84: 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 ) 5a88: e5908034 ldr r8, [r0, #52] ; 0x34 5a8c: e3580000 cmp r8, #0 */ void _Objects_Extend_information( Objects_Information *information ) { 5a90: e24dd014 sub sp, sp, #20 5a94: 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 ); 5a98: e1d070b8 ldrh r7, [r0, #8] index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 5a9c: 0a00009c beq 5d14 <_Objects_Extend_information+0x290> block_count = 0; else { block_count = information->maximum / information->allocation_size; 5aa0: e1d091b4 ldrh r9, [r0, #20] 5aa4: e1d0a1b0 ldrh sl, [r0, #16] 5aa8: e1a01009 mov r1, r9 5aac: e1a0000a mov r0, sl 5ab0: eb0044b6 bl 16d90 <__aeabi_uidiv> 5ab4: e1a03800 lsl r3, r0, #16 for ( ; block < block_count; block++ ) { 5ab8: e1b03823 lsrs r3, r3, #16 5abc: 01a01009 moveq r1, r9 5ac0: 01a06007 moveq r6, r7 5ac4: 01a04003 moveq r4, r3 5ac8: 0a00000f beq 5b0c <_Objects_Extend_information+0x88> if ( information->object_blocks[ block ] == NULL ) 5acc: e5984000 ldr r4, [r8] 5ad0: e3540000 cmp r4, #0 5ad4: 11a01009 movne r1, r9 5ad8: 11a06007 movne r6, r7 5adc: 13a04000 movne r4, #0 5ae0: 01a01009 moveq r1, r9 5ae4: 01a06007 moveq r6, r7 5ae8: 1a000003 bne 5afc <_Objects_Extend_information+0x78> 5aec: ea000006 b 5b0c <_Objects_Extend_information+0x88> <== NOT EXECUTED 5af0: e7982104 ldr r2, [r8, r4, lsl #2] 5af4: e3520000 cmp r2, #0 5af8: 0a000003 beq 5b0c <_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++ ) { 5afc: e2844001 add r4, r4, #1 5b00: e1530004 cmp r3, r4 if ( information->object_blocks[ block ] == NULL ) break; else index_base += information->allocation_size; 5b04: 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++ ) { 5b08: 8afffff8 bhi 5af0 <_Objects_Extend_information+0x6c> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 5b0c: 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 ) { 5b10: e35a0801 cmp sl, #65536 ; 0x10000 5b14: 2a000064 bcs 5cac <_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 ) { 5b18: 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; 5b1c: e5952018 ldr r2, [r5, #24] if ( information->auto_extend ) { 5b20: 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; 5b24: e0000192 mul r0, r2, r1 if ( information->auto_extend ) { 5b28: 1a000061 bne 5cb4 <_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 ); 5b2c: e58d3000 str r3, [sp] 5b30: eb000813 bl 7b84 <_Workspace_Allocate_or_fatal_error> 5b34: e59d3000 ldr r3, [sp] 5b38: e1a09000 mov r9, r0 } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 5b3c: e1d521b0 ldrh r2, [r5, #16] 5b40: e1560002 cmp r6, r2 5b44: 3a000038 bcc 5c2c <_Objects_Extend_information+0x1a8> */ /* * Up the block count and maximum */ block_count++; 5b48: 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 ); 5b4c: e08c008c add r0, ip, ip, lsl #1 5b50: e08a0000 add r0, sl, r0 5b54: e0800007 add r0, r0, r7 5b58: e1a00100 lsl r0, r0, #2 5b5c: e88d1008 stm sp, {r3, ip} 5b60: eb000813 bl 7bb4 <_Workspace_Allocate> if ( !object_blocks ) { 5b64: e250b000 subs fp, r0, #0 5b68: e89d1008 ldm sp, {r3, ip} 5b6c: 0a00006e beq 5d2c <_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 ) { 5b70: e1d521b0 ldrh r2, [r5, #16] 5b74: e1570002 cmp r7, r2 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 5b78: e08b818c add r8, fp, ip, lsl #3 5b7c: e08bc10c add ip, fp, ip, lsl #2 5b80: 3a000051 bcc 5ccc <_Objects_Extend_information+0x248> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 5b84: 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, 5b88: 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; 5b8c: 11a01002 movne r1, r2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 5b90: 0a000003 beq 5ba4 <_Objects_Extend_information+0x120> local_table[ index ] = NULL; 5b94: 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++ ) { 5b98: e2822001 add r2, r2, #1 5b9c: e1570002 cmp r7, r2 5ba0: 8afffffb bhi 5b94 <_Objects_Extend_information+0x110> 5ba4: 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 ); 5ba8: e1d511b4 ldrh r1, [r5, #20] 5bac: e0861001 add r1, r6, r1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 5bb0: e3a00000 mov r0, #0 inactive_per_block[block_count] = 0; for ( index=index_base ; 5bb4: e1560001 cmp r6, r1 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 5bb8: e78c0003 str r0, [ip, r3] } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 5bbc: e78b0003 str r0, [fp, r3] inactive_per_block[block_count] = 0; for ( index=index_base ; 5bc0: 2a000005 bcs 5bdc <_Objects_Extend_information+0x158> 5bc4: e0882106 add r2, r8, r6, lsl #2 5bc8: e1a03006 mov r3, r6 index < ( information->allocation_size + index_base ); index++ ) { 5bcc: 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 ; 5bd0: e1530001 cmp r3, r1 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 5bd4: 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 ; 5bd8: 3afffffb bcc 5bcc <_Objects_Extend_information+0x148> 5bdc: e10f3000 mrs r3, CPSR 5be0: e3832080 orr r2, r3, #128 ; 0x80 5be4: 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( 5be8: e5952000 ldr r2, [r5] 5bec: e1d510b4 ldrh r1, [r5, #4] 5bf0: 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; 5bf4: e1a0a80a lsl sl, sl, #16 information->maximum_id = _Objects_Build_id( 5bf8: 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; 5bfc: e1a0a82a lsr sl, sl, #16 information->maximum_id = _Objects_Build_id( 5c00: e1822d81 orr r2, r2, r1, lsl #27 5c04: e182200a orr r2, r2, sl local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 5c08: e5950034 ldr r0, [r5, #52] ; 0x34 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 5c0c: e585c030 str ip, [r5, #48] ; 0x30 information->local_table = local_table; 5c10: e585801c str r8, [r5, #28] information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 5c14: 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; 5c18: e1c5a1b0 strh sl, [r5, #16] _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 5c1c: e585b034 str fp, [r5, #52] ; 0x34 static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 5c20: e129f003 msr CPSR_fc, r3 information->maximum ); _ISR_Enable( level ); if ( old_tables ) 5c24: e3500000 cmp r0, #0 _Workspace_Free( old_tables ); 5c28: 1b0007e7 blne 7bcc <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 5c2c: e5953034 ldr r3, [r5, #52] ; 0x34 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 5c30: e28d7008 add r7, sp, #8 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 5c34: e7839104 str r9, [r3, r4, lsl #2] /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 5c38: e1a01009 mov r1, r9 5c3c: e1a00007 mov r0, r7 5c40: e1d521b4 ldrh r2, [r5, #20] 5c44: e5953018 ldr r3, [r5, #24] 5c48: eb00126a bl a5f8 <_Chain_Initialize> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 5c4c: e1a04104 lsl r4, r4, #2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 5c50: 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 ) { 5c54: ea000008 b 5c7c <_Objects_Extend_information+0x1f8> the_object->id = _Objects_Build_id( 5c58: e5952000 ldr r2, [r5] 5c5c: e1d5c0b4 ldrh ip, [r5, #4] 5c60: e1a02c02 lsl r2, r2, #24 5c64: e3822801 orr r2, r2, #65536 ; 0x10000 5c68: e1822d8c orr r2, r2, ip, lsl #27 5c6c: e1822006 orr r2, r2, r6 5c70: e5832008 str r2, [r3, #8] information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 5c74: ebfffd25 bl 5110 <_Chain_Append> index++; 5c78: 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 ) { 5c7c: e1a00007 mov r0, r7 5c80: eb00124f bl a5c4 <_Chain_Get> 5c84: e2503000 subs r3, r0, #0 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 5c88: e1a01003 mov r1, r3 5c8c: 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 ) { 5c90: 1afffff0 bne 5c58 <_Objects_Extend_information+0x1d4> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 5c94: e1d531b4 ldrh r3, [r5, #20] information->inactive = 5c98: e1d522bc ldrh r2, [r5, #44] ; 0x2c _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 5c9c: e5951030 ldr r1, [r5, #48] ; 0x30 information->inactive = 5ca0: e0832002 add r2, r3, r2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 5ca4: e7813004 str r3, [r1, r4] information->inactive = 5ca8: e1c522bc strh r2, [r5, #44] ; 0x2c (Objects_Maximum)(information->inactive + information->allocation_size); } 5cac: e28dd014 add sp, sp, #20 5cb0: 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 ); 5cb4: e58d3000 str r3, [sp] 5cb8: eb0007bd bl 7bb4 <_Workspace_Allocate> if ( !new_object_block ) 5cbc: e2509000 subs r9, r0, #0 5cc0: e59d3000 ldr r3, [sp] 5cc4: 1affff9c bne 5b3c <_Objects_Extend_information+0xb8> 5cc8: eafffff7 b 5cac <_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, 5ccc: e1a03103 lsl r3, r3, #2 5cd0: e1a02003 mov r2, r3 5cd4: e5951034 ldr r1, [r5, #52] ; 0x34 5cd8: e88d1008 stm sp, {r3, ip} 5cdc: eb0020c6 bl dffc information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 5ce0: e89d1008 ldm sp, {r3, ip} 5ce4: e1a0000c mov r0, ip 5ce8: e1a02003 mov r2, r3 5cec: e5951030 ldr r1, [r5, #48] ; 0x30 5cf0: eb0020c1 bl dffc information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 5cf4: e1d521b0 ldrh r2, [r5, #16] 5cf8: e0872002 add r2, r7, r2 5cfc: e1a02102 lsl r2, r2, #2 5d00: e1a00008 mov r0, r8 5d04: e595101c ldr r1, [r5, #28] 5d08: eb0020bb bl dffc 5d0c: e89d1008 ldm sp, {r3, ip} 5d10: eaffffa4 b 5ba8 <_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 ) 5d14: e1a04008 mov r4, r8 5d18: e1d0a1b0 ldrh sl, [r0, #16] 5d1c: e1d011b4 ldrh r1, [r0, #20] 5d20: e1a06007 mov r6, r7 5d24: e1a03008 mov r3, r8 5d28: eaffff77 b 5b0c <_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 ); 5d2c: e1a00009 mov r0, r9 5d30: eb0007a5 bl 7bcc <_Workspace_Free> return; 5d34: eaffffdc b 5cac <_Objects_Extend_information+0x228> 0000587c <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 587c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} 5880: e1a04001 mov r4, r1 5884: e24dd004 sub sp, sp, #4 5888: e1a06000 mov r6, r0 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 588c: e1a0100d mov r1, sp 5890: e1a00004 mov r0, r4 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 5894: e1a08002 mov r8, r2 5898: e20370ff and r7, r3, #255 ; 0xff register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 589c: eb000075 bl 5a78 <_POSIX_Mutex_Get> 58a0: e3500000 cmp r0, #0 58a4: 0a00000a beq 58d4 <_POSIX_Condition_variables_Wait_support+0x58> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 58a8: e59f30dc ldr r3, [pc, #220] ; 598c <_POSIX_Condition_variables_Wait_support+0x110> 58ac: e5932000 ldr r2, [r3] 58b0: e2422001 sub r2, r2, #1 58b4: e5832000 str r2, [r3] return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 58b8: e1a0100d mov r1, sp 58bc: e1a00006 mov r0, r6 58c0: ebffff76 bl 56a0 <_POSIX_Condition_variables_Get> switch ( location ) { 58c4: e59d3000 ldr r3, [sp] 58c8: e3530000 cmp r3, #0 return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 58cc: e1a0a000 mov sl, r0 switch ( location ) { 58d0: 0a000003 beq 58e4 <_POSIX_Condition_variables_Wait_support+0x68> /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); if ( mutex_status ) 58d4: e3a05016 mov r5, #22 case OBJECTS_ERROR: break; } return EINVAL; } 58d8: e1a00005 mov r0, r5 58dc: e28dd004 add sp, sp, #4 58e0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 58e4: e5903014 ldr r3, [r0, #20] 58e8: e3530000 cmp r3, #0 58ec: 0a000005 beq 5908 <_POSIX_Condition_variables_Wait_support+0x8c> 58f0: e5942000 ldr r2, [r4] 58f4: e1530002 cmp r3, r2 58f8: 0a000002 beq 5908 <_POSIX_Condition_variables_Wait_support+0x8c> _Thread_Enable_dispatch(); 58fc: eb000c41 bl 8a08 <_Thread_Enable_dispatch> 5900: e3a05016 mov r5, #22 return EINVAL; 5904: eafffff3 b 58d8 <_POSIX_Condition_variables_Wait_support+0x5c> } (void) pthread_mutex_unlock( mutex ); 5908: e1a00004 mov r0, r4 590c: eb0000e3 bl 5ca0 _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 5910: e3570000 cmp r7, #0 5914: 0a000006 beq 5934 <_POSIX_Condition_variables_Wait_support+0xb8> status = _Thread_Executing->Wait.return_code; if ( status && status != ETIMEDOUT ) return status; } else { _Thread_Enable_dispatch(); 5918: eb000c3a bl 8a08 <_Thread_Enable_dispatch> 591c: e3a05074 mov r5, #116 ; 0x74 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 5920: e1a00004 mov r0, r4 5924: eb0000bc bl 5c1c if ( mutex_status ) 5928: e3500000 cmp r0, #0 592c: 0affffe9 beq 58d8 <_POSIX_Condition_variables_Wait_support+0x5c> 5930: eaffffe7 b 58d4 <_POSIX_Condition_variables_Wait_support+0x58> if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 5934: e59f5054 ldr r5, [pc, #84] ; 5990 <_POSIX_Condition_variables_Wait_support+0x114> return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 5938: e5942000 ldr r2, [r4] _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 593c: e5953000 ldr r3, [r5] return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 5940: e58a2014 str r2, [sl, #20] _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 5944: e5837034 str r7, [r3, #52] ; 0x34 _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 5948: e5961000 ldr r1, [r6] if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 594c: e28a2018 add r2, sl, #24 _Thread_Executing->Wait.id = *cond; 5950: e5831020 str r1, [r3, #32] RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 5954: e3a01001 mov r1, #1 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 5958: e5832044 str r2, [r3, #68] ; 0x44 _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 595c: e1a00002 mov r0, r2 5960: e58a1048 str r1, [sl, #72] ; 0x48 5964: e59f2028 ldr r2, [pc, #40] ; 5994 <_POSIX_Condition_variables_Wait_support+0x118> 5968: e1a01008 mov r1, r8 596c: eb000d6b bl 8f20 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 5970: eb000c24 bl 8a08 <_Thread_Enable_dispatch> /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 5974: e5953000 ldr r3, [r5] 5978: e5935034 ldr r5, [r3, #52] ; 0x34 if ( status && status != ETIMEDOUT ) 597c: e3550074 cmp r5, #116 ; 0x74 5980: 13550000 cmpne r5, #0 5984: 0affffe5 beq 5920 <_POSIX_Condition_variables_Wait_support+0xa4> 5988: eaffffd2 b 58d8 <_POSIX_Condition_variables_Wait_support+0x5c> <== NOT EXECUTED 598c: 0001d60c .word 0x0001d60c 5990: 0001d6c0 .word 0x0001d6c0 5994: 00009310 .word 0x00009310 0000d40c <_POSIX_signals_Clear_process_signals>: static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( d40c: e10f2000 mrs r2, CPSR d410: e3823080 orr r3, r2, #128 ; 0x80 d414: e129f003 msr CPSR_fc, r3 mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { d418: e59f1064 ldr r1, [pc, #100] ; d484 <_POSIX_signals_Clear_process_signals+0x78> d41c: e0803080 add r3, r0, r0, lsl #1 d420: e7911103 ldr r1, [r1, r3, lsl #2] d424: e3510002 cmp r1, #2 d428: e1a01103 lsl r1, r3, #2 d42c: 0a00000c beq d464 <_POSIX_signals_Clear_process_signals+0x58> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; d430: e59f3050 ldr r3, [pc, #80] ; d488 <_POSIX_signals_Clear_process_signals+0x7c> d434: e5931000 ldr r1, [r3] d438: e3a0c001 mov ip, #1 d43c: e2400001 sub r0, r0, #1 d440: e1c1001c bic r0, r1, ip, lsl r0 if ( !_POSIX_signals_Pending ) d444: e3500000 cmp r0, #0 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; d448: e5830000 str r0, [r3] if ( !_POSIX_signals_Pending ) _Thread_Do_post_task_switch_extension--; d44c: 059f3038 ldreq r3, [pc, #56] ; d48c <_POSIX_signals_Clear_process_signals+0x80> d450: 05931000 ldreq r1, [r3] d454: 02411001 subeq r1, r1, #1 d458: 05831000 streq r1, [r3] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( d45c: e129f002 msr CPSR_fc, r2 } _ISR_Enable( level ); } d460: e12fff1e bx lr ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) d464: e59fc024 ldr ip, [pc, #36] ; d490 <_POSIX_signals_Clear_process_signals+0x84> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; d468: e79c3103 ldr r3, [ip, r3, lsl #2] d46c: e08c1001 add r1, ip, r1 d470: e2811004 add r1, r1, #4 d474: e1530001 cmp r3, r1 d478: 0affffec beq d430 <_POSIX_signals_Clear_process_signals+0x24> d47c: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED _POSIX_signals_Pending &= ~mask; if ( !_POSIX_signals_Pending ) _Thread_Do_post_task_switch_extension--; } _ISR_Enable( level ); } d480: e12fff1e bx lr <== NOT EXECUTED d484: 0001af58 .word 0x0001af58 d488: 0001b124 .word 0x0001b124 d48c: 0001aae4 .word 0x0001aae4 d490: 0001b128 .word 0x0001b128 00006d3c <_Thread_queue_Enqueue_priority>: Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 6d3c: 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 ) { 6d40: 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 ]; 6d44: e1a0c323 lsr ip, r3, #6 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 6d48: e281503c add r5, r1, #60 ; 0x3c 6d4c: e08cc08c add ip, ip, ip, lsl #1 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 6d50: e3130020 tst r3, #32 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 6d54: e2814038 add r4, r1, #56 ; 0x38 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 6d58: e5815038 str r5, [r1, #56] ; 0x38 the_chain->permanent_null = NULL; 6d5c: e3a05000 mov r5, #0 6d60: e581503c str r5, [r1, #60] ; 0x3c the_chain->last = _Chain_Head(the_chain); 6d64: 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 ]; 6d68: e080c10c add ip, r0, ip, lsl #2 block_state = the_thread_queue->state; 6d6c: e5906038 ldr r6, [r0, #56] ; 0x38 6d70: 159fa178 ldrne sl, [pc, #376] ; 6ef0 <_Thread_queue_Enqueue_priority+0x1b4> if ( _Thread_queue_Is_reverse_search( priority ) ) 6d74: 1a00001c bne 6dec <_Thread_queue_Enqueue_priority+0xb0> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 6d78: e28ca004 add sl, ip, #4 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 6d7c: e10f8000 mrs r8, CPSR 6d80: e3884080 orr r4, r8, #128 ; 0x80 6d84: 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; 6d88: e59c4000 ldr r4, [ip] while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 6d8c: e154000a cmp r4, sl 6d90: 1a000009 bne 6dbc <_Thread_queue_Enqueue_priority+0x80> 6d94: ea000052 b 6ee4 <_Thread_queue_Enqueue_priority+0x1a8> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 6d98: e10f7000 mrs r7, CPSR 6d9c: e129f008 msr CPSR_fc, r8 6da0: 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) ) { 6da4: e5947010 ldr r7, [r4, #16] 6da8: e1160007 tst r6, r7 6dac: 0a000033 beq 6e80 <_Thread_queue_Enqueue_priority+0x144> _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 6db0: 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 ) ) { 6db4: e154000a cmp r4, sl 6db8: 0a000002 beq 6dc8 <_Thread_queue_Enqueue_priority+0x8c> search_priority = search_thread->current_priority; 6dbc: e5945014 ldr r5, [r4, #20] if ( priority <= search_priority ) 6dc0: e1530005 cmp r3, r5 6dc4: 8afffff3 bhi 6d98 <_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 ) ) { 6dc8: e1a06008 mov r6, r8 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 6dcc: e590c030 ldr ip, [r0, #48] ; 0x30 6dd0: e35c0001 cmp ip, #1 6dd4: 0a00002b beq 6e88 <_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; 6dd8: e5826000 str r6, [r2] return the_thread_queue->sync_state; 6ddc: e1a0000c mov r0, ip } 6de0: e8bd05f0 pop {r4, r5, r6, r7, r8, sl} 6de4: e12fff1e bx lr static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 6de8: 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; 6dec: e5da5000 ldrb r5, [sl] 6df0: e2855001 add r5, r5, #1 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 6df4: e10f8000 mrs r8, CPSR 6df8: e3884080 orr r4, r8, #128 ; 0x80 6dfc: e129f004 msr CPSR_fc, r4 _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; 6e00: e59c4008 ldr r4, [ip, #8] while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 6e04: e154000c cmp r4, ip 6e08: 1a000009 bne 6e34 <_Thread_queue_Enqueue_priority+0xf8> 6e0c: ea00000b b 6e40 <_Thread_queue_Enqueue_priority+0x104> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 6e10: e10f7000 mrs r7, CPSR 6e14: e129f008 msr CPSR_fc, r8 6e18: 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) ) { 6e1c: e5947010 ldr r7, [r4, #16] 6e20: e1160007 tst r6, r7 6e24: 0affffef beq 6de8 <_Thread_queue_Enqueue_priority+0xac> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 6e28: 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 ) ) { 6e2c: e154000c cmp r4, ip 6e30: 0a000002 beq 6e40 <_Thread_queue_Enqueue_priority+0x104> search_priority = search_thread->current_priority; 6e34: e5945014 ldr r5, [r4, #20] if ( priority >= search_priority ) 6e38: e1530005 cmp r3, r5 6e3c: 3afffff3 bcc 6e10 <_Thread_queue_Enqueue_priority+0xd4> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 6e40: e590c030 ldr ip, [r0, #48] ; 0x30 6e44: 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 ) ) { 6e48: e1a06008 mov r6, r8 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 6e4c: 1affffe1 bne 6dd8 <_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 ) 6e50: 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; 6e54: e3a03000 mov r3, #0 6e58: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 6e5c: 0a000016 beq 6ebc <_Thread_queue_Enqueue_priority+0x180> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 6e60: e5943000 ldr r3, [r4] the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 6e64: e8810018 stm r1, {r3, r4} search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 6e68: 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; 6e6c: e5841000 str r1, [r4] next_node->previous = the_node; 6e70: e5831004 str r1, [r3, #4] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 6e74: e129f008 msr CPSR_fc, r8 6e78: e3a00001 mov r0, #1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 6e7c: eaffffd7 b 6de0 <_Thread_queue_Enqueue_priority+0xa4> 6e80: e129f008 msr CPSR_fc, r8 <== NOT EXECUTED 6e84: eaffffbc b 6d7c <_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 ) 6e88: 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; 6e8c: e3a03000 mov r3, #0 6e90: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 6e94: 0a000008 beq 6ebc <_Thread_queue_Enqueue_priority+0x180> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 6e98: e5943004 ldr r3, [r4, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 6e9c: e5814000 str r4, [r1] the_node->previous = previous_node; 6ea0: e5813004 str r3, [r1, #4] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 6ea4: 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; 6ea8: e5831000 str r1, [r3] search_node->previous = the_node; 6eac: e5841004 str r1, [r4, #4] 6eb0: e129f008 msr CPSR_fc, r8 6eb4: e3a00001 mov r0, #1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 6eb8: eaffffc8 b 6de0 <_Thread_queue_Enqueue_priority+0xa4> 6ebc: 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; 6ec0: e5943004 ldr r3, [r4, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 6ec4: e5814000 str r4, [r1] the_node->previous = previous_node; 6ec8: e5813004 str r3, [r1, #4] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 6ecc: 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; 6ed0: e5831000 str r1, [r3] search_node->previous = the_node; 6ed4: e5841004 str r1, [r4, #4] 6ed8: e129f006 msr CPSR_fc, r6 6edc: e3a00001 mov r0, #1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 6ee0: eaffffbe b 6de0 <_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 ) ) { 6ee4: e1a06008 mov r6, r8 6ee8: e3e05000 mvn r5, #0 6eec: eaffffb6 b 6dcc <_Thread_queue_Enqueue_priority+0x90> 6ef0: 00019140 .word 0x00019140 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: eb0010fd bl 19950 <_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: eb00025c bl 15eec <_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: eb00111a bl 19a0c <_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: eb000250 bl 15eec <_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: eb0010ac bl 19894 <_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: eb001106 bl 19a0c <_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: eb0010d2 bl 19950 <_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: eb000e03 bl 18ea4 <_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: eb000b40 bl 183ac <_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: eb001137 bl 19b98 <_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: eb001135 bl 19b98 <_Watchdog_Remove> 156c0: eaffff9b b 15534 <_Timer_server_Body+0x60> 156c4: 0003b8e4 .word 0x0003b8e4 156c8: 0003b814 .word 0x0003b814 156cc: 0003b78c .word 0x0003b78c 00009808 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 9808: e92d41f0 push {r4, r5, r6, r7, r8, lr} 980c: e1a04000 mov r4, r0 9810: e1a05002 mov r5, r2 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 9814: e10f3000 mrs r3, CPSR 9818: e3832080 orr r2, r3, #128 ; 0x80 981c: e129f002 msr CPSR_fc, r2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 9820: e1a07000 mov r7, r0 9824: 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 ) ) { 9828: e1520007 cmp r2, r7 982c: 0a000018 beq 9894 <_Watchdog_Adjust+0x8c> switch ( direction ) { 9830: e3510000 cmp r1, #0 9834: 1a000018 bne 989c <_Watchdog_Adjust+0x94> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 9838: e3550000 cmp r5, #0 983c: 0a000014 beq 9894 <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) { 9840: e5926010 ldr r6, [r2, #16] 9844: e1550006 cmp r5, r6 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 9848: 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 ) { 984c: 2a000005 bcs 9868 <_Watchdog_Adjust+0x60> 9850: ea000018 b 98b8 <_Watchdog_Adjust+0xb0> <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 9854: e0555006 subs r5, r5, r6 9858: 0a00000d beq 9894 <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) { 985c: e5926010 ldr r6, [r2, #16] 9860: e1560005 cmp r6, r5 9864: 8a000013 bhi 98b8 <_Watchdog_Adjust+0xb0> _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 9868: e5828010 str r8, [r2, #16] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 986c: e129f003 msr CPSR_fc, r3 _ISR_Enable( level ); _Watchdog_Tickle( header ); 9870: e1a00004 mov r0, r4 9874: eb0000a0 bl 9afc <_Watchdog_Tickle> static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 9878: e10f3000 mrs r3, CPSR 987c: e3832080 orr r2, r3, #128 ; 0x80 9880: e129f002 msr CPSR_fc, r2 9884: e5941000 ldr r1, [r4] _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 9888: e1570001 cmp r7, r1 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 988c: e1a02001 mov r2, r1 9890: 1affffef bne 9854 <_Watchdog_Adjust+0x4c> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 9894: e129f003 msr CPSR_fc, r3 } } _ISR_Enable( level ); } 9898: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { 989c: e3510001 cmp r1, #1 98a0: 1afffffb bne 9894 <_Watchdog_Adjust+0x8c> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 98a4: e5921010 ldr r1, [r2, #16] 98a8: e0815005 add r5, r1, r5 98ac: e5825010 str r5, [r2, #16] 98b0: e129f003 msr CPSR_fc, r3 } } _ISR_Enable( level ); } 98b4: 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; 98b8: e0655006 rsb r5, r5, r6 98bc: e5825010 str r5, [r2, #16] break; 98c0: eafffff3 b 9894 <_Watchdog_Adjust+0x8c> 0000d130 : int killinfo( pid_t pid, int sig, const union sigval *value ) { d130: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} d134: e24dd00c sub sp, sp, #12 d138: e1a04000 mov r4, r0 d13c: e1a05001 mov r5, r1 d140: e1a08002 mov r8, r2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) d144: ebfffbf2 bl c114 d148: e1500004 cmp r0, r4 d14c: 1a000095 bne d3a8 rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) d150: e3550000 cmp r5, #0 d154: 0a000098 beq d3bc static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); d158: e2453001 sub r3, r5, #1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) d15c: e353001f cmp r3, #31 d160: 8a000095 bhi d3bc rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) d164: e59f627c ldr r6, [pc, #636] ; d3e8 d168: e1a07085 lsl r7, r5, #1 d16c: e0872005 add r2, r7, r5 d170: e0862102 add r2, r6, r2, lsl #2 d174: e5922008 ldr r2, [r2, #8] d178: e3520001 cmp r2, #1 d17c: 0a000039 beq d268 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) d180: e3550008 cmp r5, #8 d184: 13550004 cmpne r5, #4 d188: 0a000039 beq d274 d18c: e355000b cmp r5, #11 d190: 0a000037 beq d274 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); d194: e3a04001 mov r4, #1 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; d198: e58d4004 str r4, [sp, #4] /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; d19c: e58d5000 str r5, [sp] siginfo->si_code = SI_USER; if ( !value ) { d1a0: e3580000 cmp r8, #0 d1a4: e1a04314 lsl r4, r4, r3 siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; d1a8: 15983000 ldrne r3, [r8] d1ac: 158d3008 strne r3, [sp, #8] d1b0: e59f3234 ldr r3, [pc, #564] ; d3ec d1b4: e5932000 ldr r2, [r3] d1b8: e2822001 add r2, r2, #1 */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; if ( !value ) { siginfo->si_value.sival_int = 0; d1bc: 058d8008 streq r8, [sp, #8] d1c0: e5832000 str r2, [r3] /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; d1c4: e59f3224 ldr r3, [pc, #548] ; d3f0 d1c8: e5930000 ldr r0, [r3] api = the_thread->API_Extensions[ THREAD_API_POSIX ]; d1cc: e5903108 ldr r3, [r0, #264] ; 0x108 d1d0: e59330c4 ldr r3, [r3, #196] ; 0xc4 d1d4: e1d43003 bics r3, r4, r3 d1d8: 1a000014 bne d230 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; d1dc: e59f1210 ldr r1, [pc, #528] ; d3f4 d1e0: e4913004 ldr r3, [r1], #4 d1e4: e1530001 cmp r3, r1 d1e8: 0a000036 beq d2c8 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) d1ec: e5932030 ldr r2, [r3, #48] ; 0x30 d1f0: e1140002 tst r4, r2 for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; d1f4: e1a00003 mov r0, r3 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; d1f8: e5932108 ldr r2, [r3, #264] ; 0x108 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) d1fc: 0a000008 beq d224 d200: ea00000a b d230 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { d204: e5933000 ldr r3, [r3] /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; d208: e1530001 cmp r3, r1 d20c: 0a00002d beq d2c8 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) d210: e5932030 ldr r2, [r3, #48] ; 0x30 <== NOT EXECUTED d214: e1140002 tst r4, r2 <== NOT EXECUTED for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; d218: e1a00003 mov r0, r3 <== NOT EXECUTED api = the_thread->API_Extensions[ THREAD_API_POSIX ]; d21c: e5932108 ldr r2, [r3, #264] ; 0x108 <== NOT EXECUTED #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) d220: 1a000002 bne d230 <== NOT EXECUTED /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) d224: e59220c4 ldr r2, [r2, #196] ; 0xc4 d228: e1d42002 bics r2, r4, r2 d22c: 0afffff4 beq d204 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; d230: e3a03001 mov r3, #1 d234: e5c03074 strb r3, [r0, #116] ; 0x74 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { d238: e1a01005 mov r1, r5 d23c: e1a0200d mov r2, sp d240: eb0000a5 bl d4dc <_POSIX_signals_Unblock_thread> d244: e3500000 cmp r0, #0 d248: 1a00001b bne d2bc * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { d24c: e0875005 add r5, r7, r5 /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); d250: e1a00004 mov r0, r4 d254: eb00008e bl d494 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { d258: e7963105 ldr r3, [r6, r5, lsl #2] d25c: e3530002 cmp r3, #2 d260: 0a000007 beq d284 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); d264: ebffe543 bl 6778 <_Thread_Enable_dispatch> d268: e3a00000 mov r0, #0 return 0; } d26c: e28dd00c add sp, sp, #12 d270: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) return pthread_kill( pthread_self(), sig ); d274: eb000123 bl d708 d278: e1a01005 mov r1, r5 d27c: eb0000e3 bl d610 d280: eafffff9 b d26c */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) d284: e59f016c ldr r0, [pc, #364] ; d3f8 d288: ebfff4cd bl a5c4 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { d28c: e250c000 subs ip, r0, #0 d290: 0a00004e beq d3d0 _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; d294: e1a0300d mov r3, sp d298: e8930007 ldm r3, {r0, r1, r2} d29c: e28c3008 add r3, ip, #8 d2a0: e8830007 stm r3, {r0, r1, r2} _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); d2a4: e59f0150 ldr r0, [pc, #336] ; d3fc d2a8: e1a0100c mov r1, ip d2ac: e0800105 add r0, r0, r5, lsl #2 d2b0: ebffdf96 bl 5110 <_Chain_Append> } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); d2b4: ebffe52f bl 6778 <_Thread_Enable_dispatch> d2b8: eaffffea b d268 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { _Thread_Enable_dispatch(); d2bc: ebffe52d bl 6778 <_Thread_Enable_dispatch> d2c0: e3a00000 mov r0, #0 return 0; d2c4: eaffffe8 b d26c * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; d2c8: e59f3130 ldr r3, [pc, #304] ; d400 d2cc: e5d3c000 ldrb ip, [r3] d2d0: e59f812c ldr r8, [pc, #300] ; d404 d2d4: e28cc001 add ip, ip, #1 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( d2d8: e3a0a000 mov sl, #0 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and ITRON is not configured. */ if ( !_Objects_Information_table[ the_api ] ) d2dc: e5983008 ldr r3, [r8, #8] d2e0: e3530000 cmp r3, #0 d2e4: 0a000020 beq d36c continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; d2e8: e5933004 ldr r3, [r3, #4] */ if ( !the_info ) continue; #endif maximum = the_info->maximum; d2ec: e1d301b0 ldrh r0, [r3, #16] object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { d2f0: e3500000 cmp r0, #0 if ( !the_info ) continue; #endif maximum = the_info->maximum; object_table = the_info->local_table; d2f4: e593e01c ldr lr, [r3, #28] for ( index = 1 ; index <= maximum ; index++ ) { d2f8: 0a00001b beq d36c d2fc: e3a03001 mov r3, #1 the_thread = (Thread_Control *) object_table[ index ]; d300: e79e2103 ldr r2, [lr, r3, lsl #2] if ( !the_thread ) d304: e3520000 cmp r2, #0 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { d308: e2833001 add r3, r3, #1 the_thread = (Thread_Control *) object_table[ index ]; if ( !the_thread ) d30c: 0a000014 beq d364 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) d310: e5921014 ldr r1, [r2, #20] d314: e151000c cmp r1, ip d318: 8a000011 bhi d364 DEBUG_STEP("2"); /* * If this thread is not interested, then go on to the next thread. */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; d31c: e5929108 ldr r9, [r2, #264] ; 0x108 d320: e59990c4 ldr r9, [r9, #196] ; 0xc4 d324: e1d49009 bics r9, r4, r9 d328: 0a00000d beq d364 * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { d32c: e151000c cmp r1, ip d330: 3a000009 bcc d35c * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { d334: e59a9010 ldr r9, [sl, #16] d338: e3590000 cmp r9, #0 d33c: 0a000008 beq d364 /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { d340: e592b010 ldr fp, [r2, #16] d344: e35b0000 cmp fp, #0 d348: 0a000003 beq d35c continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { d34c: e3190201 tst r9, #268435456 ; 0x10000000 d350: 1a000003 bne d364 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { d354: e31b0201 tst fp, #268435456 ; 0x10000000 d358: 0a000001 beq d364 d35c: e1a0c001 mov ip, r1 d360: e1a0a002 mov sl, r2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { d364: e1500003 cmp r0, r3 d368: 2affffe4 bcs d300 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { d36c: e59f3094 ldr r3, [pc, #148] ; d408 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { d370: e2888004 add r8, r8, #4 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { d374: e1580003 cmp r8, r3 d378: 1affffd7 bne d2dc } } } } if ( interested ) { d37c: e35a0000 cmp sl, #0 d380: 0affffb1 beq d24c d384: e1a0000a mov r0, sl * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; d388: e3a03001 mov r3, #1 d38c: e5c03074 strb r3, [r0, #116] ; 0x74 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { d390: e1a01005 mov r1, r5 d394: e1a0200d mov r2, sp d398: eb00004f bl d4dc <_POSIX_signals_Unblock_thread> d39c: e3500000 cmp r0, #0 d3a0: 0affffa9 beq d24c d3a4: eaffffc4 b d2bc <== NOT EXECUTED /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); d3a8: eb000105 bl d7c4 <__errno> d3ac: e3a03003 mov r3, #3 d3b0: e5803000 str r3, [r0] d3b4: e3e00000 mvn r0, #0 d3b8: eaffffab b d26c */ if ( !sig ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); d3bc: eb000100 bl d7c4 <__errno> d3c0: e3a03016 mov r3, #22 d3c4: e5803000 str r3, [r0] d3c8: e3e00000 mvn r0, #0 d3cc: eaffffa6 b d26c if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { _Thread_Enable_dispatch(); d3d0: ebffe4e8 bl 6778 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); d3d4: eb0000fa bl d7c4 <__errno> d3d8: e3a0300b mov r3, #11 d3dc: e5803000 str r3, [r0] d3e0: e3e00000 mvn r0, #0 d3e4: eaffffa0 b d26c d3e8: 0001af58 .word 0x0001af58 d3ec: 0001aa4c .word 0x0001aa4c d3f0: 0001ab00 .word 0x0001ab00 d3f4: 0001b0e4 .word 0x0001b0e4 d3f8: 0001b0d8 .word 0x0001b0d8 d3fc: 0001b128 .word 0x0001b128 d400: 00019140 .word 0x00019140 d404: 0001aa08 .word 0x0001aa08 d408: 0001aa14 .word 0x0001aa14 00005aac : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 5aac: e92d4030 push {r4, r5, lr} Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 5ab0: e2505000 subs r5, r0, #0 int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 5ab4: e24dd00c sub sp, sp, #12 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 5ab8: 0a00001d beq 5b34 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 5abc: e1a00001 mov r0, r1 5ac0: e28d1004 add r1, sp, #4 5ac4: eb0019ca bl c1f4 <_POSIX_Absolute_timeout_to_ticks> 5ac8: e5951000 ldr r1, [r5] 5acc: e1a04000 mov r4, r0 5ad0: e28d2008 add r2, sp, #8 5ad4: e59f0090 ldr r0, [pc, #144] ; 5b6c 5ad8: eb000a78 bl 84c0 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 5adc: e59dc008 ldr ip, [sp, #8] 5ae0: e35c0000 cmp ip, #0 5ae4: 1a000012 bne 5b34 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 5ae8: e5951000 ldr r1, [r5] int _EXFUN(pthread_rwlock_init, (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedrdlock, 5aec: e3540003 cmp r4, #3 5af0: 13a05000 movne r5, #0 5af4: 03a05001 moveq r5, #1 5af8: e2800010 add r0, r0, #16 5afc: e59d3004 ldr r3, [sp, #4] 5b00: e1a02005 mov r2, r5 5b04: e58dc000 str ip, [sp] 5b08: eb000719 bl 7774 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 5b0c: eb000c84 bl 8d24 <_Thread_Enable_dispatch> if ( !do_wait ) { 5b10: e3550000 cmp r5, #0 5b14: 1a00000f bne 5b58 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 5b18: e59f3050 ldr r3, [pc, #80] ; 5b70 5b1c: e5933000 ldr r3, [r3] 5b20: e5930034 ldr r0, [r3, #52] ; 0x34 5b24: e3500002 cmp r0, #2 5b28: 0a000004 beq 5b40 break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 5b2c: eb000042 bl 5c3c <_POSIX_RWLock_Translate_core_RWLock_return_code> 5b30: ea000000 b 5b38 5b34: e3a00016 mov r0, #22 case OBJECTS_ERROR: break; } return EINVAL; } 5b38: e28dd00c add sp, sp, #12 5b3c: e8bd8030 pop {r4, r5, pc} ); _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { switch (status) { 5b40: e3540000 cmp r4, #0 5b44: 0afffffa beq 5b34 5b48: e3540002 cmp r4, #2 5b4c: 93a00074 movls r0, #116 ; 0x74 5b50: 9afffff8 bls 5b38 5b54: eafffff4 b 5b2c <== NOT EXECUTED 5b58: e59f3010 ldr r3, [pc, #16] ; 5b70 5b5c: e5933000 ldr r3, [r3] 5b60: e5930034 ldr r0, [r3, #52] ; 0x34 break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 5b64: eb000034 bl 5c3c <_POSIX_RWLock_Translate_core_RWLock_return_code> 5b68: eafffff2 b 5b38 5b6c: 0001ddb4 .word 0x0001ddb4 5b70: 0001dca0 .word 0x0001dca0 00005b74 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 5b74: e92d4030 push {r4, r5, lr} Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 5b78: e2505000 subs r5, r0, #0 int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 5b7c: e24dd00c sub sp, sp, #12 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 5b80: 0a00001d beq 5bfc * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 5b84: e1a00001 mov r0, r1 5b88: e28d1004 add r1, sp, #4 5b8c: eb001998 bl c1f4 <_POSIX_Absolute_timeout_to_ticks> 5b90: e5951000 ldr r1, [r5] 5b94: e1a04000 mov r4, r0 5b98: e28d2008 add r2, sp, #8 5b9c: e59f0090 ldr r0, [pc, #144] ; 5c34 5ba0: eb000a46 bl 84c0 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 5ba4: e59dc008 ldr ip, [sp, #8] 5ba8: e35c0000 cmp ip, #0 5bac: 1a000012 bne 5bfc case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 5bb0: e5951000 ldr r1, [r5] (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedwrlock, 5bb4: e3540003 cmp r4, #3 5bb8: 13a05000 movne r5, #0 5bbc: 03a05001 moveq r5, #1 5bc0: e2800010 add r0, r0, #16 5bc4: e59d3004 ldr r3, [sp, #4] 5bc8: e1a02005 mov r2, r5 5bcc: e58dc000 str ip, [sp] 5bd0: eb00071e bl 7850 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 5bd4: eb000c52 bl 8d24 <_Thread_Enable_dispatch> if ( !do_wait && 5bd8: e3550000 cmp r5, #0 5bdc: 1a00000f bne 5c20 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 5be0: e59f3050 ldr r3, [pc, #80] ; 5c38 5be4: e5933000 ldr r3, [r3] 5be8: e5930034 ldr r0, [r3, #52] ; 0x34 ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 5bec: e3500002 cmp r0, #2 5bf0: 0a000004 beq 5c08 case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 5bf4: eb000010 bl 5c3c <_POSIX_RWLock_Translate_core_RWLock_return_code> 5bf8: ea000000 b 5c00 5bfc: e3a00016 mov r0, #22 case OBJECTS_ERROR: break; } return EINVAL; } 5c00: e28dd00c add sp, sp, #12 5c04: e8bd8030 pop {r4, r5, pc} ); _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { switch (status) { 5c08: e3540000 cmp r4, #0 5c0c: 0afffffa beq 5bfc 5c10: e3540002 cmp r4, #2 5c14: 93a00074 movls r0, #116 ; 0x74 5c18: 9afffff8 bls 5c00 5c1c: eafffff4 b 5bf4 <== NOT EXECUTED 5c20: e59f3010 ldr r3, [pc, #16] ; 5c38 5c24: e5933000 ldr r3, [r3] 5c28: e5930034 ldr r0, [r3, #52] ; 0x34 case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 5c2c: eb000002 bl 5c3c <_POSIX_RWLock_Translate_core_RWLock_return_code> 5c30: eafffff2 b 5c00 5c34: 0001ddb4 .word 0x0001ddb4 5c38: 0001dca0 .word 0x0001dca0 000069a4 : rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 69a4: e59f3144 ldr r3, [pc, #324] ; 6af0 69a8: 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; 69ac: e59f3140 ldr r3, [pc, #320] ; 6af4 if ( rtems_interrupt_is_in_progress() ) 69b0: 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 ) { 69b4: e92d4010 push {r4, lr} 69b8: e1a04000 mov r4, r0 rtems_device_major_number major_limit = _IO_Number_of_drivers; 69bc: e5930000 ldr r0, [r3] if ( rtems_interrupt_is_in_progress() ) 69c0: 13a00012 movne r0, #18 69c4: 18bd8010 popne {r4, pc} return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 69c8: e3520000 cmp r2, #0 69cc: 0a00003c beq 6ac4 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; if ( driver_table == NULL ) 69d0: e3510000 cmp r1, #0 if ( registered_major == NULL ) return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 69d4: e5820000 str r0, [r2] if ( driver_table == NULL ) 69d8: 0a000039 beq 6ac4 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 69dc: e591c000 ldr ip, [r1] 69e0: e35c0000 cmp ip, #0 69e4: 0a000033 beq 6ab8 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 69e8: e1500004 cmp r0, r4 69ec: 93a0000a movls r0, #10 69f0: 98bd8010 popls {r4, pc} rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 69f4: e59f00fc ldr r0, [pc, #252] ; 6af8 69f8: e590c000 ldr ip, [r0] 69fc: e28cc001 add ip, ip, #1 6a00: e580c000 str ip, [r0] return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 6a04: e3540000 cmp r4, #0 6a08: 1a000020 bne 6a90 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 6a0c: e593e000 ldr lr, [r3] rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 6a10: e35e0000 cmp lr, #0 6a14: 0a00002c beq 6acc 6a18: e59f30dc ldr r3, [pc, #220] ; 6afc 6a1c: e593c000 ldr ip, [r3] 6a20: e1a0300c mov r3, ip 6a24: ea000003 b 6a38 6a28: e2844001 add r4, r4, #1 6a2c: e15e0004 cmp lr, r4 6a30: e2833018 add r3, r3, #24 6a34: 9a000005 bls 6a50 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 6a38: e5930000 ldr r0, [r3] 6a3c: e3500000 cmp r0, #0 6a40: 1afffff8 bne 6a28 6a44: e5930004 ldr r0, [r3, #4] 6a48: e3500000 cmp r0, #0 6a4c: 1afffff5 bne 6a28 } /* Assigns invalid value in case of failure */ *major = m; if ( m != n ) 6a50: e15e0004 cmp lr, r4 6a54: 10843084 addne r3, r4, r4, lsl #1 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 6a58: e5824000 str r4, [r2] if ( m != n ) 6a5c: 108cc183 addne ip, ip, r3, lsl #3 6a60: 0a00001a beq 6ad0 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 6a64: e1a0e001 mov lr, r1 6a68: e8be000f ldm lr!, {r0, r1, r2, r3} 6a6c: e8ac000f stmia ip!, {r0, r1, r2, r3} 6a70: e89e0003 ldm lr, {r0, r1} 6a74: e88c0003 stm ip, {r0, r1} _Thread_Enable_dispatch(); 6a78: eb00069b bl 84ec <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 6a7c: e3a01000 mov r1, #0 6a80: e1a00004 mov r0, r4 6a84: e1a02001 mov r2, r1 } 6a88: e8bd4010 pop {r4, lr} _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 6a8c: ea0023f4 b fa64 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 6a90: e59f3064 ldr r3, [pc, #100] ; 6afc 6a94: e5933000 ldr r3, [r3] 6a98: 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; 6a9c: e793018c ldr r0, [r3, ip, lsl #3] 6aa0: e3500000 cmp r0, #0 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 6aa4: 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; 6aa8: 0a00000b beq 6adc 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(); 6aac: eb00068e bl 84ec <_Thread_Enable_dispatch> 6ab0: e3a0000c mov r0, #12 return RTEMS_RESOURCE_IN_USE; 6ab4: 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; 6ab8: e591c004 ldr ip, [r1, #4] 6abc: e35c0000 cmp ip, #0 6ac0: 1affffc8 bne 69e8 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 6ac4: e3a00009 mov r0, #9 } 6ac8: e8bd8010 pop {r4, pc} if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 6acc: 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(); 6ad0: eb000685 bl 84ec <_Thread_Enable_dispatch> 6ad4: e3a00005 mov r0, #5 return sc; 6ad8: 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; 6adc: e59c3004 ldr r3, [ip, #4] 6ae0: e3530000 cmp r3, #0 6ae4: 1afffff0 bne 6aac if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 6ae8: e5824000 str r4, [r2] 6aec: eaffffdc b 6a64 6af0: 0002099c .word 0x0002099c 6af4: 00021208 .word 0x00021208 6af8: 0002090c .word 0x0002090c 6afc: 0002120c .word 0x0002120c 0000770c : int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 770c: e92d4010 push {r4, lr} 7710: e24dd004 sub sp, sp, #4 7714: e1a04000 mov r4, r0 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 7718: e1a00001 mov r0, r1 771c: e1a0100d mov r1, sp 7720: eb001635 bl cffc <_POSIX_Absolute_timeout_to_ticks> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 7724: e3500003 cmp r0, #3 7728: 0a000005 beq 7744 do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 772c: e1a00004 mov r0, r4 <== NOT EXECUTED 7730: e3a01000 mov r1, #0 <== NOT EXECUTED 7734: e59d2000 ldr r2, [sp] <== NOT EXECUTED 7738: eb0018f1 bl db04 <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED break; } } return lock_status; } 773c: e28dd004 add sp, sp, #4 7740: e8bd8010 pop {r4, pc} */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 7744: e1a00004 mov r0, r4 7748: e3a01001 mov r1, #1 774c: e59d2000 ldr r2, [sp] 7750: eb0018eb bl db04 <_POSIX_Semaphore_Wait_support> 7754: eafffff8 b 773c