080149ec <_CORE_message_queue_Broadcast>: Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 80149ec: 37 9c ff e4 addi sp,sp,-28 80149f0: 5b 8b 00 1c sw (sp+28),r11 80149f4: 5b 8c 00 18 sw (sp+24),r12 80149f8: 5b 8d 00 14 sw (sp+20),r13 80149fc: 5b 8e 00 10 sw (sp+16),r14 8014a00: 5b 8f 00 0c sw (sp+12),r15 8014a04: 5b 90 00 08 sw (sp+8),r16 8014a08: 5b 9d 00 04 sw (sp+4),ra 8014a0c: b8 20 58 00 mv r11,r1 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 8014a10: 28 21 00 4c lw r1,(r1+76) Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 8014a14: b8 60 70 00 mv r14,r3 8014a18: b8 40 80 00 mv r16,r2 8014a1c: b8 c0 78 00 mv r15,r6 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 8014a20: 50 23 00 03 bgeu r1,r3,8014a2c <_CORE_message_queue_Broadcast+0x40> 8014a24: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8014a28: e0 00 00 13 bi 8014a74 <_CORE_message_queue_Broadcast+0x88> <== NOT EXECUTED * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 8014a2c: 29 63 00 48 lw r3,(r11+72) 8014a30: 34 01 00 00 mvi r1,0 * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 8014a34: b8 60 68 00 mv r13,r3 * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 8014a38: 44 61 00 08 be r3,r1,8014a58 <_CORE_message_queue_Broadcast+0x6c> *count = 0; 8014a3c: 58 c1 00 00 sw (r6+0),r1 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 8014a40: e0 00 00 0d bi 8014a74 <_CORE_message_queue_Broadcast+0x88> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 8014a44: 29 81 00 2c lw r1,(r12+44) */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 8014a48: 35 ad 00 01 addi r13,r13,1 8014a4c: f8 00 2d 08 calli 801fe6c buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 8014a50: 29 81 00 28 lw r1,(r12+40) 8014a54: 58 2e 00 00 sw (r1+0),r14 * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 8014a58: b9 60 08 00 mv r1,r11 8014a5c: f8 00 0c 28 calli 8017afc <_Thread_queue_Dequeue> 8014a60: b8 20 60 00 mv r12,r1 8014a64: ba 00 10 00 mv r2,r16 8014a68: b9 c0 18 00 mv r3,r14 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 8014a6c: 5c 20 ff f6 bne r1,r0,8014a44 <_CORE_message_queue_Broadcast+0x58> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 8014a70: 59 ed 00 00 sw (r15+0),r13 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 8014a74: 2b 9d 00 04 lw ra,(sp+4) 8014a78: 2b 8b 00 1c lw r11,(sp+28) 8014a7c: 2b 8c 00 18 lw r12,(sp+24) 8014a80: 2b 8d 00 14 lw r13,(sp+20) 8014a84: 2b 8e 00 10 lw r14,(sp+16) 8014a88: 2b 8f 00 0c lw r15,(sp+12) 8014a8c: 2b 90 00 08 lw r16,(sp+8) 8014a90: 37 9c 00 1c addi sp,sp,28 8014a94: c3 a0 00 00 ret 08008cc8 <_CORE_semaphore_Surrender>: CORE_semaphore_Status _CORE_semaphore_Surrender( CORE_semaphore_Control *the_semaphore, Objects_Id id, CORE_semaphore_API_mp_support_callout api_semaphore_mp_support ) { 8008cc8: 37 9c ff f8 addi sp,sp,-8 8008ccc: 5b 8b 00 08 sw (sp+8),r11 8008cd0: 5b 9d 00 04 sw (sp+4),ra 8008cd4: b8 20 58 00 mv r11,r1 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8008cd8: fb ff ee 91 calli 800471c <_Thread_queue_Dequeue> 8008cdc: 34 02 00 00 mvi r2,0 8008ce0: 5c 22 00 0e bne r1,r2,8008d18 <_CORE_semaphore_Surrender+0x50> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 8008ce4: 90 00 08 00 rcsr r1,IE 8008ce8: 34 02 ff fe mvi r2,-2 8008cec: a0 22 10 00 and r2,r1,r2 8008cf0: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8008cf4: 29 62 00 48 lw r2,(r11+72) 8008cf8: 29 63 00 40 lw r3,(r11+64) 8008cfc: 54 62 00 03 bgu r3,r2,8008d08 <_CORE_semaphore_Surrender+0x40> 8008d00: 34 02 00 04 mvi r2,4 <== NOT EXECUTED 8008d04: e0 00 00 04 bi 8008d14 <_CORE_semaphore_Surrender+0x4c> <== NOT EXECUTED the_semaphore->count += 1; 8008d08: 34 42 00 01 addi r2,r2,1 8008d0c: 59 62 00 48 sw (r11+72),r2 8008d10: 34 02 00 00 mvi r2,0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 8008d14: d0 01 00 00 wcsr IE,r1 } return status; } 8008d18: b8 40 08 00 mv r1,r2 8008d1c: 2b 9d 00 04 lw ra,(sp+4) 8008d20: 2b 8b 00 08 lw r11,(sp+8) 8008d24: 37 9c 00 08 addi sp,sp,8 8008d28: c3 a0 00 00 ret 0800e4c4 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 800e4c4: 37 9c ff f8 addi sp,sp,-8 800e4c8: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 800e4cc: 37 82 00 08 addi r2,sp,8 800e4d0: fb ff e0 c3 calli 80067dc <_Thread_Get> switch ( location ) { 800e4d4: 2b 82 00 08 lw r2,(sp+8) 800e4d8: 5c 40 00 1d bne r2,r0,800e54c <_Event_Timeout+0x88> * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 800e4dc: 90 00 18 00 rcsr r3,IE 800e4e0: 34 02 ff fe mvi r2,-2 800e4e4: a0 62 10 00 and r2,r3,r2 800e4e8: d0 02 00 00 wcsr IE,r2 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800e4ec: 78 02 08 02 mvhi r2,0x802 800e4f0: 38 42 5a 00 ori r2,r2,0x5a00 800e4f4: 28 42 00 00 lw r2,(r2+0) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800e4f8: 34 04 00 00 mvi r4,0 800e4fc: 58 24 00 24 sw (r1+36),r4 if ( _Thread_Is_executing( the_thread ) ) { 800e500: 5c 22 00 08 bne r1,r2,800e520 <_Event_Timeout+0x5c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800e504: 78 02 08 02 mvhi r2,0x802 800e508: 38 42 62 ec ori r2,r2,0x62ec 800e50c: 28 45 00 00 lw r5,(r2+0) 800e510: 34 04 00 01 mvi r4,1 800e514: 5c a4 00 03 bne r5,r4,800e520 <_Event_Timeout+0x5c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800e518: 34 04 00 02 mvi r4,2 <== NOT EXECUTED 800e51c: 58 44 00 00 sw (r2+0),r4 <== NOT EXECUTED } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800e520: 34 02 00 06 mvi r2,6 800e524: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800e528: d0 03 00 00 wcsr IE,r3 800e52c: 78 02 10 03 mvhi r2,0x1003 800e530: 38 42 ff f8 ori r2,r2,0xfff8 800e534: f8 00 05 3d calli 800fa28 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800e538: 78 01 08 02 mvhi r1,0x802 800e53c: 38 21 59 44 ori r1,r1,0x5944 800e540: 28 22 00 00 lw r2,(r1+0) 800e544: 34 42 ff ff addi r2,r2,-1 800e548: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800e54c: 2b 9d 00 04 lw ra,(sp+4) 800e550: 37 9c 00 08 addi sp,sp,8 800e554: c3 a0 00 00 ret 0800ed80 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800ed80: 37 9c ff e8 addi sp,sp,-24 800ed84: 5b 8b 00 18 sw (sp+24),r11 800ed88: 5b 8c 00 14 sw (sp+20),r12 800ed8c: 5b 8d 00 10 sw (sp+16),r13 800ed90: 5b 8e 00 0c sw (sp+12),r14 800ed94: 5b 8f 00 08 sw (sp+8),r15 800ed98: 5b 9d 00 04 sw (sp+4),ra Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 800ed9c: 28 2d 00 18 lw r13,(r1+24) uintptr_t const heap_area_end = heap->area_end; 800eda0: 28 25 00 1c lw r5,(r1+28) Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800eda4: b8 20 58 00 mv r11,r1 Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 800eda8: f0 4d 68 00 cmpgeu r13,r2,r13 * 5. non-contiguous higher address (NOT SUPPORTED) * * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { 800edac: f4 a2 08 00 cmpgu r1,r5,r2 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800edb0: b8 80 78 00 mv r15,r4 Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 800edb4: a0 2d 68 00 and r13,r1,r13 uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; uintptr_t extend_size = 0; Heap_Block *const last_block = heap->last_block; 800edb8: 29 6c 00 24 lw r12,(r11+36) uintptr_t *amount_extended ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 800edbc: 34 01 00 01 mvi r1,1 800edc0: 5d a0 00 26 bne r13,r0,800ee58 <_Heap_Extend+0xd8> * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 800edc4: 34 01 00 02 mvi r1,2 800edc8: 5c 45 00 24 bne r2,r5,800ee58 <_Heap_Extend+0xd8> { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; 800edcc: b4 62 18 00 add r3,r3,r2 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 800edd0: c8 6c 70 00 sub r14,r3,r12 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800edd4: 29 62 00 10 lw r2,(r11+16) 800edd8: 35 ce ff f8 addi r14,r14,-8 * Currently only case 4 should make it to this point. * The basic trick is to make the extend area look like a used * block and free it. */ heap->area_end = new_heap_area_end; 800eddc: 59 63 00 1c sw (r11+28),r3 800ede0: b9 c0 08 00 mv r1,r14 800ede4: fb ff d5 55 calli 8004338 <__umodsi3> 800ede8: c9 c1 08 00 sub r1,r14,r1 extend_size = new_heap_area_end - (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE; extend_size = _Heap_Align_down( extend_size, heap->page_size ); *amount_extended = extend_size; 800edec: 59 e1 00 00 sw (r15+0),r1 if( extend_size >= heap->min_block_size ) { 800edf0: 29 62 00 14 lw r2,(r11+20) 800edf4: 50 22 00 02 bgeu r1,r2,800edfc <_Heap_Extend+0x7c> 800edf8: e0 00 00 17 bi 800ee54 <_Heap_Extend+0xd4> <== NOT EXECUTED uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 800edfc: 29 84 00 04 lw r4,(r12+4) Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 800ee00: 29 63 00 20 lw r3,(r11+32) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800ee04: b4 2c 10 00 add r2,r1,r12 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 800ee08: 20 84 00 01 andi r4,r4,0x1 800ee0c: b8 24 20 00 or r4,r1,r4 800ee10: c8 62 18 00 sub r3,r3,r2 800ee14: 59 84 00 04 sw (r12+4),r4 800ee18: 38 63 00 01 ori r3,r3,0x1 800ee1c: 58 43 00 04 sw (r2+4),r3 | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 800ee20: 29 65 00 2c lw r5,(r11+44) ++stats->used_blocks; 800ee24: 29 64 00 40 lw r4,(r11+64) --stats->frees; /* Do not count subsequent call as actual free() */ 800ee28: 29 63 00 50 lw r3,(r11+80) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 800ee2c: b4 a1 08 00 add r1,r5,r1 ++stats->used_blocks; 800ee30: 34 84 00 01 addi r4,r4,1 --stats->frees; /* Do not count subsequent call as actual free() */ 800ee34: 34 63 ff ff addi r3,r3,-1 new_last_block->size_and_flag = ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 800ee38: 59 62 00 24 sw (r11+36),r2 /* Statistics */ stats->size += extend_size; 800ee3c: 59 61 00 2c sw (r11+44),r1 ++stats->used_blocks; 800ee40: 59 64 00 40 sw (r11+64),r4 --stats->frees; /* Do not count subsequent call as actual free() */ 800ee44: 59 63 00 50 sw (r11+80),r3 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 800ee48: b9 60 08 00 mv r1,r11 800ee4c: 35 82 00 08 addi r2,r12,8 800ee50: fb ff e5 2d calli 8008304 <_Heap_Free> 800ee54: b9 a0 08 00 mv r1,r13 } return HEAP_EXTEND_SUCCESSFUL; } 800ee58: 2b 9d 00 04 lw ra,(sp+4) 800ee5c: 2b 8b 00 18 lw r11,(sp+24) 800ee60: 2b 8c 00 14 lw r12,(sp+20) 800ee64: 2b 8d 00 10 lw r13,(sp+16) 800ee68: 2b 8e 00 0c lw r14,(sp+12) 800ee6c: 2b 8f 00 08 lw r15,(sp+8) 800ee70: 37 9c 00 18 addi sp,sp,24 800ee74: c3 a0 00 00 ret 08009074 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 8009074: 37 9c ff f4 addi sp,sp,-12 8009078: 5b 8b 00 0c sw (sp+12),r11 800907c: 5b 8c 00 08 sw (sp+8),r12 8009080: 5b 9d 00 04 sw (sp+4),ra 8009084: b8 40 18 00 mv r3,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 8009088: 28 22 00 10 lw r2,(r1+16) 800908c: b8 20 58 00 mv r11,r1 8009090: b8 60 08 00 mv r1,r3 8009094: 34 6c ff f8 addi r12,r3,-8 8009098: f8 00 46 26 calli 801a930 <__umodsi3> 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; 800909c: 29 66 00 20 lw r6,(r11+32) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 80090a0: c9 81 08 00 sub r1,r12,r1 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 80090a4: 50 26 00 03 bgeu r1,r6,80090b0 <_Heap_Free+0x3c> 80090a8: 34 02 00 00 mvi r2,0 80090ac: e0 00 00 03 bi 80090b8 <_Heap_Free+0x44> 80090b0: 29 62 00 24 lw r2,(r11+36) 80090b4: f0 41 10 00 cmpgeu r2,r2,r1 Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 80090b8: 44 40 00 66 be r2,r0,8009250 <_Heap_Free+0x1dc> - 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; 80090bc: 28 25 00 04 lw r5,(r1+4) 80090c0: 34 02 ff fe mvi r2,-2 80090c4: a0 a2 10 00 and r2,r5,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 80090c8: b4 22 18 00 add r3,r1,r2 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 80090cc: 50 66 00 03 bgeu r3,r6,80090d8 <_Heap_Free+0x64> 80090d0: 34 04 00 00 mvi r4,0 <== NOT EXECUTED 80090d4: e0 00 00 03 bi 80090e0 <_Heap_Free+0x6c> <== NOT EXECUTED 80090d8: 29 64 00 24 lw r4,(r11+36) 80090dc: f0 83 20 00 cmpgeu r4,r4,r3 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 80090e0: 44 80 00 5c be r4,r0,8009250 <_Heap_Free+0x1dc> 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; 80090e4: 28 64 00 04 lw r4,(r3+4) _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 80090e8: 20 87 00 01 andi r7,r4,0x1 80090ec: 44 e0 00 59 be r7,r0,8009250 <_Heap_Free+0x1dc> return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 80090f0: 29 68 00 24 lw r8,(r11+36) - 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; 80090f4: 34 07 ff fe mvi r7,-2 80090f8: a0 87 20 00 and r4,r4,r7 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 80090fc: 34 07 00 00 mvi r7,0 8009100: 45 03 00 05 be r8,r3,8009114 <_Heap_Free+0xa0> 8009104: b4 64 38 00 add r7,r3,r4 8009108: 28 e7 00 04 lw r7,(r7+4) 800910c: 20 e7 00 01 andi r7,r7,0x1 8009110: 18 e7 00 01 xori r7,r7,0x1 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 8009114: 20 a5 00 01 andi r5,r5,0x1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 8009118: 20 e7 00 ff andi r7,r7,0xff && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 800911c: 5c a0 00 23 bne r5,r0,80091a8 <_Heap_Free+0x134> uintptr_t const prev_size = block->prev_size; 8009120: 28 25 00 00 lw r5,(r1+0) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8009124: c8 25 08 00 sub r1,r1,r5 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 8009128: f0 26 30 00 cmpgeu r6,r1,r6 800912c: f1 01 40 00 cmpgeu r8,r8,r1 8009130: c8 06 30 00 sub r6,r0,r6 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 8009134: a1 06 40 00 and r8,r8,r6 8009138: 45 00 00 46 be r8,r0,8009250 <_Heap_Free+0x1dc> return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 800913c: 28 26 00 04 lw r6,(r1+4) 8009140: 20 c6 00 01 andi r6,r6,0x1 8009144: 44 c0 00 43 be r6,r0,8009250 <_Heap_Free+0x1dc> _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 8009148: 44 e0 00 0f be r7,r0,8009184 <_Heap_Free+0x110> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 800914c: 29 68 00 38 lw r8,(r11+56) } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 8009150: 28 66 00 0c lw r6,(r3+12) return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 8009154: 28 67 00 08 lw r7,(r3+8) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 8009158: b4 44 20 00 add r4,r2,r4 800915c: b4 85 28 00 add r5,r4,r5 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 8009160: 35 03 ff ff addi r3,r8,-1 8009164: 59 63 00 38 sw (r11+56),r3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 8009168: b4 25 20 00 add r4,r1,r5 if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800916c: 38 a3 00 01 ori r3,r5,0x1 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 8009170: 58 e6 00 0c sw (r7+12),r6 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 8009174: 58 85 00 00 sw (r4+0),r5 if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8009178: 58 23 00 04 sw (r1+4),r3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 800917c: 58 c7 00 08 sw (r6+8),r7 8009180: e0 00 00 29 bi 8009224 <_Heap_Free+0x1b0> next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 8009184: b4 45 28 00 add r5,r2,r5 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8009188: 38 a4 00 01 ori r4,r5,0x1 800918c: 58 24 00 04 sw (r1+4),r4 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8009190: 28 64 00 04 lw r4,(r3+4) 8009194: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 8009198: 58 65 00 00 sw (r3+0),r5 _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800919c: a0 81 08 00 and r1,r4,r1 80091a0: 58 61 00 04 sw (r3+4),r1 80091a4: e0 00 00 20 bi 8009224 <_Heap_Free+0x1b0> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 80091a8: 44 e0 00 0d be r7,r0,80091dc <_Heap_Free+0x168> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 80091ac: 28 65 00 0c lw r5,(r3+12) RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 80091b0: 28 66 00 08 lw r6,(r3+8) uintptr_t const size = block_size + next_block_size; 80091b4: b4 82 18 00 add r3,r4,r2 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; 80091b8: 58 25 00 0c sw (r1+12),r5 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 80091bc: 58 26 00 08 sw (r1+8),r6 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 80091c0: b4 23 38 00 add r7,r1,r3 next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 80091c4: 38 64 00 01 ori r4,r3,0x1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 80091c8: 58 e3 00 00 sw (r7+0),r3 new_block->prev = prev; next->prev = new_block; 80091cc: 58 c1 00 0c sw (r6+12),r1 prev->next = new_block; 80091d0: 58 a1 00 08 sw (r5+8),r1 next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 80091d4: 58 24 00 04 sw (r1+4),r4 80091d8: e0 00 00 13 bi 8009224 <_Heap_Free+0x1b0> next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 80091dc: 38 44 00 01 ori r4,r2,0x1 80091e0: 58 24 00 04 sw (r1+4),r4 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 80091e4: 28 65 00 04 lw r5,(r3+4) 80091e8: 34 04 ff fe mvi r4,-2 next_block->prev_size = block_size; 80091ec: 58 62 00 00 sw (r3+0),r2 } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 80091f0: a0 a4 20 00 and r4,r5,r4 80091f4: 58 64 00 04 sw (r3+4),r4 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 80091f8: 29 63 00 38 lw r3,(r11+56) RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 80091fc: 29 64 00 08 lw r4,(r11+8) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 8009200: 29 65 00 3c lw r5,(r11+60) new_block->next = next; new_block->prev = block_before; 8009204: 58 2b 00 0c sw (r1+12),r11 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 8009208: 58 24 00 08 sw (r1+8),r4 block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 800920c: 34 63 00 01 addi r3,r3,1 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 8009210: 58 81 00 0c sw (r4+12),r1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 8009214: 59 61 00 08 sw (r11+8),r1 8009218: 59 63 00 38 sw (r11+56),r3 #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 800921c: 50 a3 00 02 bgeu r5,r3,8009224 <_Heap_Free+0x1b0> next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; 8009220: 59 63 00 3c sw (r11+60),r3 } } /* Statistics */ --stats->used_blocks; 8009224: 29 63 00 40 lw r3,(r11+64) ++stats->frees; 8009228: 29 61 00 50 lw r1,(r11+80) stats->free_size += block_size; 800922c: 29 64 00 30 lw r4,(r11+48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 8009230: 34 63 ff ff addi r3,r3,-1 ++stats->frees; 8009234: 34 21 00 01 addi r1,r1,1 stats->free_size += block_size; 8009238: b4 82 10 00 add r2,r4,r2 } } /* Statistics */ --stats->used_blocks; ++stats->frees; 800923c: 59 61 00 50 sw (r11+80),r1 stats->free_size += block_size; 8009240: 59 62 00 30 sw (r11+48),r2 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 8009244: 59 63 00 40 sw (r11+64),r3 ++stats->frees; stats->free_size += block_size; 8009248: 34 01 00 01 mvi r1,1 return( true ); 800924c: e0 00 00 02 bi 8009254 <_Heap_Free+0x1e0> 8009250: 34 01 00 00 mvi r1,0 } 8009254: 2b 9d 00 04 lw ra,(sp+4) 8009258: 2b 8b 00 0c lw r11,(sp+12) 800925c: 2b 8c 00 08 lw r12,(sp+8) 8009260: 37 9c 00 0c addi sp,sp,12 8009264: c3 a0 00 00 ret 0801b4cc <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 801b4cc: 37 9c ff f0 addi sp,sp,-16 801b4d0: 5b 8b 00 10 sw (sp+16),r11 801b4d4: 5b 8c 00 0c sw (sp+12),r12 801b4d8: 5b 8d 00 08 sw (sp+8),r13 801b4dc: 5b 9d 00 04 sw (sp+4),ra 801b4e0: b8 40 60 00 mv r12,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 801b4e4: 28 22 00 10 lw r2,(r1+16) 801b4e8: b8 20 58 00 mv r11,r1 801b4ec: b9 80 08 00 mv r1,r12 801b4f0: b8 60 68 00 mv r13,r3 801b4f4: fb ff fd 0f calli 801a930 <__umodsi3> 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; 801b4f8: 29 62 00 20 lw r2,(r11+32) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 801b4fc: 35 84 ff f8 addi r4,r12,-8 801b500: c8 81 20 00 sub r4,r4,r1 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 801b504: 50 82 00 03 bgeu r4,r2,801b510 <_Heap_Size_of_alloc_area+0x44> 801b508: 34 01 00 00 mvi r1,0 801b50c: e0 00 00 03 bi 801b518 <_Heap_Size_of_alloc_area+0x4c> 801b510: 29 61 00 24 lw r1,(r11+36) 801b514: f0 24 08 00 cmpgeu r1,r1,r4 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 801b518: 44 20 00 13 be r1,r0,801b564 <_Heap_Size_of_alloc_area+0x98> RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 801b51c: 28 83 00 04 lw r3,(r4+4) 801b520: 34 01 ff fe mvi r1,-2 801b524: a0 61 08 00 and r1,r3,r1 801b528: b4 81 20 00 add r4,r4,r1 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 801b52c: 50 82 00 03 bgeu r4,r2,801b538 <_Heap_Size_of_alloc_area+0x6c> 801b530: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 801b534: e0 00 00 03 bi 801b540 <_Heap_Size_of_alloc_area+0x74> <== NOT EXECUTED 801b538: 29 61 00 24 lw r1,(r11+36) 801b53c: f0 24 08 00 cmpgeu r1,r1,r4 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 801b540: 44 20 00 09 be r1,r0,801b564 <_Heap_Size_of_alloc_area+0x98> 801b544: 28 81 00 04 lw r1,(r4+4) 801b548: 20 21 00 01 andi r1,r1,0x1 801b54c: 44 20 00 06 be r1,r0,801b564 <_Heap_Size_of_alloc_area+0x98> || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 801b550: c8 8c 20 00 sub r4,r4,r12 801b554: 34 84 00 04 addi r4,r4,4 801b558: 59 a4 00 00 sw (r13+0),r4 801b55c: 34 01 00 01 mvi r1,1 return true; 801b560: e0 00 00 02 bi 801b568 <_Heap_Size_of_alloc_area+0x9c> 801b564: 34 01 00 00 mvi r1,0 } 801b568: 2b 9d 00 04 lw ra,(sp+4) 801b56c: 2b 8b 00 10 lw r11,(sp+16) 801b570: 2b 8c 00 0c lw r12,(sp+12) 801b574: 2b 8d 00 08 lw r13,(sp+8) 801b578: 37 9c 00 10 addi sp,sp,16 801b57c: c3 a0 00 00 ret 08003c00 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8003c00: 37 9c ff ac addi sp,sp,-84 8003c04: 5b 8b 00 50 sw (sp+80),r11 8003c08: 5b 8c 00 4c sw (sp+76),r12 8003c0c: 5b 8d 00 48 sw (sp+72),r13 8003c10: 5b 8e 00 44 sw (sp+68),r14 8003c14: 5b 8f 00 40 sw (sp+64),r15 8003c18: 5b 90 00 3c sw (sp+60),r16 8003c1c: 5b 91 00 38 sw (sp+56),r17 8003c20: 5b 92 00 34 sw (sp+52),r18 8003c24: 5b 93 00 30 sw (sp+48),r19 8003c28: 5b 94 00 2c sw (sp+44),r20 8003c2c: 5b 95 00 28 sw (sp+40),r21 8003c30: 5b 96 00 24 sw (sp+36),r22 8003c34: 5b 97 00 20 sw (sp+32),r23 8003c38: 5b 98 00 1c sw (sp+28),r24 8003c3c: 5b 99 00 18 sw (sp+24),r25 8003c40: 5b 9b 00 14 sw (sp+20),fp 8003c44: 5b 9d 00 10 sw (sp+16),ra 8003c48: 20 63 00 ff andi r3,r3,0xff 8003c4c: b8 20 68 00 mv r13,r1 8003c50: b8 40 70 00 mv r14,r2 uintptr_t const page_size = heap->page_size; 8003c54: 28 2f 00 10 lw r15,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8003c58: 28 33 00 14 lw r19,(r1+20) Heap_Block *const last_block = heap->last_block; 8003c5c: 28 32 00 24 lw r18,(r1+36) Heap_Block *block = heap->first_block; 8003c60: 28 2b 00 20 lw r11,(r1+32) Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8003c64: 5c 60 00 04 bne r3,r0,8003c74 <_Heap_Walk+0x74> 8003c68: 78 0c 08 00 mvhi r12,0x800 8003c6c: 39 8c 3b dc ori r12,r12,0x3bdc 8003c70: e0 00 00 03 bi 8003c7c <_Heap_Walk+0x7c> 8003c74: 78 0c 08 00 mvhi r12,0x800 8003c78: 39 8c 41 2c ori r12,r12,0x412c if ( !_System_state_Is_up( _System_state_Get() ) ) { 8003c7c: 78 02 08 02 mvhi r2,0x802 8003c80: 38 42 0a 88 ori r2,r2,0xa88 8003c84: 28 42 00 00 lw r2,(r2+0) 8003c88: 34 01 00 03 mvi r1,3 8003c8c: 5c 41 01 0c bne r2,r1,80040bc <_Heap_Walk+0x4bc> 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)( 8003c90: 29 a1 00 08 lw r1,(r13+8) 8003c94: 29 a6 00 18 lw r6,(r13+24) 8003c98: 29 a7 00 1c lw r7,(r13+28) 8003c9c: 5b 81 00 08 sw (sp+8),r1 8003ca0: 29 a1 00 0c lw r1,(r13+12) 8003ca4: 78 03 08 01 mvhi r3,0x801 8003ca8: 5b 92 00 04 sw (sp+4),r18 8003cac: 5b 81 00 0c sw (sp+12),r1 8003cb0: 38 63 ce c4 ori r3,r3,0xcec4 8003cb4: b9 c0 08 00 mv r1,r14 8003cb8: 34 02 00 00 mvi r2,0 8003cbc: b9 e0 20 00 mv r4,r15 8003cc0: ba 60 28 00 mv r5,r19 8003cc4: b9 60 40 00 mv r8,r11 8003cc8: d9 80 00 00 call r12 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 8003ccc: 5d e0 00 05 bne r15,r0,8003ce0 <_Heap_Walk+0xe0> (*printer)( source, true, "page size is zero\n" ); 8003cd0: 78 03 08 01 mvhi r3,0x801 8003cd4: b9 c0 08 00 mv r1,r14 8003cd8: 38 63 cf 58 ori r3,r3,0xcf58 8003cdc: e0 00 00 3b bi 8003dc8 <_Heap_Walk+0x1c8> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 8003ce0: 21 f0 00 07 andi r16,r15,0x7 8003ce4: 46 00 00 06 be r16,r0,8003cfc <_Heap_Walk+0xfc> (*printer)( 8003ce8: 78 03 08 01 mvhi r3,0x801 8003cec: b9 c0 08 00 mv r1,r14 8003cf0: 38 63 cf 6c ori r3,r3,0xcf6c 8003cf4: b9 e0 20 00 mv r4,r15 8003cf8: e0 00 01 09 bi 800411c <_Heap_Walk+0x51c> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 8003cfc: ba 60 08 00 mv r1,r19 8003d00: b9 e0 10 00 mv r2,r15 8003d04: fb ff f3 ef calli 8000cc0 <__umodsi3> 8003d08: b8 20 88 00 mv r17,r1 8003d0c: 44 30 00 08 be r1,r16,8003d2c <_Heap_Walk+0x12c> (*printer)( 8003d10: 78 03 08 01 mvhi r3,0x801 8003d14: b9 c0 08 00 mv r1,r14 8003d18: 38 63 cf 8c ori r3,r3,0xcf8c 8003d1c: ba 60 20 00 mv r4,r19 8003d20: 34 02 00 01 mvi r2,1 8003d24: d9 80 00 00 call r12 8003d28: e0 00 00 5a bi 8003e90 <_Heap_Walk+0x290> ); return false; } if ( 8003d2c: 35 61 00 08 addi r1,r11,8 8003d30: b9 e0 10 00 mv r2,r15 8003d34: fb ff f3 e3 calli 8000cc0 <__umodsi3> 8003d38: b8 20 80 00 mv r16,r1 8003d3c: 44 31 00 08 be r1,r17,8003d5c <_Heap_Walk+0x15c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8003d40: 78 03 08 01 mvhi r3,0x801 8003d44: b9 c0 08 00 mv r1,r14 8003d48: 38 63 cf b0 ori r3,r3,0xcfb0 8003d4c: b9 60 20 00 mv r4,r11 8003d50: 34 02 00 01 mvi r2,1 8003d54: d9 80 00 00 call r12 8003d58: e0 00 00 92 bi 8003fa0 <_Heap_Walk+0x3a0> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8003d5c: 29 71 00 04 lw r17,(r11+4) 8003d60: 22 31 00 01 andi r17,r17,0x1 8003d64: 5e 21 00 07 bne r17,r1,8003d80 <_Heap_Walk+0x180> (*printer)( 8003d68: 78 03 08 01 mvhi r3,0x801 8003d6c: b9 c0 08 00 mv r1,r14 8003d70: 38 63 cf e4 ori r3,r3,0xcfe4 8003d74: 34 02 00 01 mvi r2,1 8003d78: d9 80 00 00 call r12 8003d7c: e0 00 00 89 bi 8003fa0 <_Heap_Walk+0x3a0> ); return false; } if ( first_block->prev_size != page_size ) { 8003d80: 29 79 00 00 lw r25,(r11+0) 8003d84: 47 2f 00 07 be r25,r15,8003da0 <_Heap_Walk+0x1a0> (*printer)( 8003d88: 78 03 08 01 mvhi r3,0x801 8003d8c: b9 c0 08 00 mv r1,r14 8003d90: 38 63 d0 14 ori r3,r3,0xd014 8003d94: bb 20 20 00 mv r4,r25 8003d98: b9 e0 28 00 mv r5,r15 8003d9c: e0 00 00 3b bi 8003e88 <_Heap_Walk+0x288> ); return false; } if ( _Heap_Is_free( last_block ) ) { 8003da0: 2a 41 00 04 lw r1,(r18+4) 8003da4: 34 02 ff fe mvi r2,-2 8003da8: a0 22 08 00 and r1,r1,r2 8003dac: b6 41 08 00 add r1,r18,r1 8003db0: 28 2f 00 04 lw r15,(r1+4) 8003db4: 21 ef 00 01 andi r15,r15,0x1 8003db8: 5d f0 00 07 bne r15,r16,8003dd4 <_Heap_Walk+0x1d4> (*printer)( 8003dbc: 78 03 08 01 mvhi r3,0x801 8003dc0: b9 c0 08 00 mv r1,r14 8003dc4: 38 63 d0 40 ori r3,r3,0xd040 8003dc8: 34 02 00 01 mvi r2,1 8003dcc: d9 80 00 00 call r12 8003dd0: e0 00 00 a5 bi 8004064 <_Heap_Walk+0x464> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8003dd4: 29 a4 00 08 lw r4,(r13+8) ); return false; } if ( _Heap_Is_used( free_block ) ) { 8003dd8: b8 40 a8 00 mv r21,r2 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8003ddc: 29 b4 00 10 lw r20,(r13+16) 8003de0: b9 a0 88 00 mv r17,r13 8003de4: b8 80 b0 00 mv r22,r4 8003de8: e0 00 00 2e bi 8003ea0 <_Heap_Walk+0x2a0> 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 8003dec: 29 a1 00 20 lw r1,(r13+32) 8003df0: 34 0f 00 00 mvi r15,0 8003df4: 52 c1 00 02 bgeu r22,r1,8003dfc <_Heap_Walk+0x1fc> 8003df8: e0 00 00 03 bi 8003e04 <_Heap_Walk+0x204> 8003dfc: 29 af 00 24 lw r15,(r13+36) 8003e00: f1 f6 78 00 cmpgeu r15,r15,r22 ); return false; } if ( 8003e04: 36 c1 00 08 addi r1,r22,8 8003e08: ba 80 10 00 mv r2,r20 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 ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 8003e0c: 5d e0 00 06 bne r15,r0,8003e24 <_Heap_Walk+0x224> (*printer)( 8003e10: 78 03 08 01 mvhi r3,0x801 8003e14: ba c0 20 00 mv r4,r22 8003e18: b9 c0 08 00 mv r1,r14 8003e1c: 38 63 d0 58 ori r3,r3,0xd058 8003e20: e0 00 00 8f bi 800405c <_Heap_Walk+0x45c> ); return false; } if ( 8003e24: fb ff f3 a7 calli 8000cc0 <__umodsi3> 8003e28: 44 20 00 06 be r1,r0,8003e40 <_Heap_Walk+0x240> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8003e2c: 78 03 08 01 mvhi r3,0x801 8003e30: ba c0 20 00 mv r4,r22 8003e34: b9 c0 08 00 mv r1,r14 8003e38: 38 63 d0 78 ori r3,r3,0xd078 8003e3c: e0 00 00 b8 bi 800411c <_Heap_Walk+0x51c> ); return false; } if ( _Heap_Is_used( free_block ) ) { 8003e40: 2a c3 00 04 lw r3,(r22+4) 8003e44: a0 75 18 00 and r3,r3,r21 8003e48: b6 c3 18 00 add r3,r22,r3 8003e4c: 28 70 00 04 lw r16,(r3+4) 8003e50: 22 10 00 01 andi r16,r16,0x1 8003e54: 46 01 00 07 be r16,r1,8003e70 <_Heap_Walk+0x270> (*printer)( 8003e58: 78 03 08 01 mvhi r3,0x801 8003e5c: b8 20 78 00 mv r15,r1 8003e60: ba c0 20 00 mv r4,r22 8003e64: b9 c0 08 00 mv r1,r14 8003e68: 38 63 d0 a8 ori r3,r3,0xd0a8 8003e6c: e0 00 00 7c bi 800405c <_Heap_Walk+0x45c> ); return false; } if ( free_block->prev != prev_block ) { 8003e70: 2a c5 00 0c lw r5,(r22+12) 8003e74: 44 b1 00 09 be r5,r17,8003e98 <_Heap_Walk+0x298> (*printer)( 8003e78: 78 03 08 01 mvhi r3,0x801 8003e7c: ba c0 20 00 mv r4,r22 8003e80: b9 c0 08 00 mv r1,r14 8003e84: 38 63 d0 c4 ori r3,r3,0xd0c4 8003e88: 34 02 00 01 mvi r2,1 8003e8c: d9 80 00 00 call r12 8003e90: ba 00 08 00 mv r1,r16 8003e94: e0 00 00 8b bi 80040c0 <_Heap_Walk+0x4c0> return false; } prev_block = free_block; free_block = free_block->next; 8003e98: ba c0 88 00 mv r17,r22 8003e9c: 2a d6 00 08 lw r22,(r22+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 ) { 8003ea0: 5e cd ff d3 bne r22,r13,8003dec <_Heap_Walk+0x1ec> 8003ea4: e0 00 00 7a bi 800408c <_Heap_Walk+0x48c> - 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; 8003ea8: 29 6f 00 04 lw r15,(r11+4) 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 ) { 8003eac: 21 e2 00 01 andi r2,r15,0x1 8003eb0: a1 fb 78 00 and r15,r15,fp RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8003eb4: b5 6f 80 00 add r16,r11,r15 8003eb8: 44 40 00 09 be r2,r0,8003edc <_Heap_Walk+0x2dc> (*printer)( 8003ebc: 78 03 08 01 mvhi r3,0x801 8003ec0: b9 c0 08 00 mv r1,r14 8003ec4: 34 02 00 00 mvi r2,0 8003ec8: 38 63 d0 f8 ori r3,r3,0xd0f8 8003ecc: b9 60 20 00 mv r4,r11 8003ed0: b9 e0 28 00 mv r5,r15 8003ed4: d9 80 00 00 call r12 8003ed8: e0 00 00 08 bi 8003ef8 <_Heap_Walk+0x2f8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8003edc: 29 66 00 00 lw r6,(r11+0) 8003ee0: 78 03 08 01 mvhi r3,0x801 8003ee4: b9 c0 08 00 mv r1,r14 8003ee8: 38 63 d1 10 ori r3,r3,0xd110 8003eec: b9 60 20 00 mv r4,r11 8003ef0: b9 e0 28 00 mv r5,r15 8003ef4: d9 80 00 00 call r12 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 8003ef8: 29 a1 00 20 lw r1,(r13+32) 8003efc: 52 01 00 03 bgeu r16,r1,8003f08 <_Heap_Walk+0x308> 8003f00: 34 11 00 00 mvi r17,0 <== NOT EXECUTED 8003f04: e0 00 00 03 bi 8003f10 <_Heap_Walk+0x310> <== NOT EXECUTED 8003f08: 29 b1 00 24 lw r17,(r13+36) 8003f0c: f2 30 88 00 cmpgeu r17,r17,r16 block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 8003f10: 5e 20 00 05 bne r17,r0,8003f24 <_Heap_Walk+0x324> (*printer)( 8003f14: 78 03 08 01 mvhi r3,0x801 8003f18: b9 c0 08 00 mv r1,r14 8003f1c: 38 63 d1 38 ori r3,r3,0xd138 8003f20: e0 00 00 1c bi 8003f90 <_Heap_Walk+0x390> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 8003f24: b9 e0 08 00 mv r1,r15 8003f28: bb 20 10 00 mv r2,r25 8003f2c: fb ff f3 65 calli 8000cc0 <__umodsi3> 8003f30: b8 20 88 00 mv r17,r1 8003f34: 44 20 00 09 be r1,r0,8003f58 <_Heap_Walk+0x358> (*printer)( 8003f38: 78 03 08 01 mvhi r3,0x801 8003f3c: b9 c0 08 00 mv r1,r14 8003f40: 38 63 d1 68 ori r3,r3,0xd168 8003f44: b9 60 20 00 mv r4,r11 8003f48: b9 e0 28 00 mv r5,r15 8003f4c: 34 02 00 01 mvi r2,1 8003f50: d9 80 00 00 call r12 8003f54: e0 00 00 74 bi 8004124 <_Heap_Walk+0x524> ); return false; } if ( block_size < min_block_size ) { 8003f58: 51 f3 00 0a bgeu r15,r19,8003f80 <_Heap_Walk+0x380> (*printer)( 8003f5c: 78 03 08 01 mvhi r3,0x801 8003f60: b9 c0 08 00 mv r1,r14 8003f64: 38 63 d1 98 ori r3,r3,0xd198 8003f68: b9 60 20 00 mv r4,r11 8003f6c: b9 e0 28 00 mv r5,r15 8003f70: ba 60 30 00 mv r6,r19 8003f74: 34 02 00 01 mvi r2,1 8003f78: d9 80 00 00 call r12 8003f7c: e0 00 00 09 bi 8003fa0 <_Heap_Walk+0x3a0> ); return false; } if ( next_block_begin <= block_begin ) { 8003f80: 56 0b 00 0a bgu r16,r11,8003fa8 <_Heap_Walk+0x3a8> (*printer)( 8003f84: 78 03 08 01 mvhi r3,0x801 8003f88: b9 c0 08 00 mv r1,r14 8003f8c: 38 63 d1 c4 ori r3,r3,0xd1c4 8003f90: b9 60 20 00 mv r4,r11 8003f94: ba 00 28 00 mv r5,r16 8003f98: 34 02 00 01 mvi r2,1 8003f9c: d9 80 00 00 call r12 8003fa0: ba 20 08 00 mv r1,r17 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 8003fa4: e0 00 00 47 bi 80040c0 <_Heap_Walk+0x4c0> } if ( !_Heap_Is_prev_used( next_block ) ) { 8003fa8: 2a 03 00 04 lw r3,(r16+4) 8003fac: 20 63 00 01 andi r3,r3,0x1 8003fb0: 5c 60 00 35 bne r3,r0,8004084 <_Heap_Walk+0x484> 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; 8003fb4: 29 6f 00 04 lw r15,(r11+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)( 8003fb8: 29 65 00 0c lw r5,(r11+12) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8003fbc: 29 a1 00 08 lw r1,(r13+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; 8003fc0: a1 fb 88 00 and r17,r15,fp return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 8003fc4: 29 a3 00 0c lw r3,(r13+12) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8003fc8: b5 71 50 00 add r10,r11,r17 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8003fcc: ba a0 30 00 mv r6,r21 8003fd0: 44 a1 00 04 be r5,r1,8003fe0 <_Heap_Walk+0x3e0> "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)" : ""), 8003fd4: ba 80 30 00 mv r6,r20 8003fd8: 5c ad 00 02 bne r5,r13,8003fe0 <_Heap_Walk+0x3e0> 8003fdc: ba c0 30 00 mv r6,r22 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)( 8003fe0: 29 67 00 08 lw r7,(r11+8) 8003fe4: ba e0 40 00 mv r8,r23 8003fe8: 44 e3 00 04 be r7,r3,8003ff8 <_Heap_Walk+0x3f8> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 8003fec: ba 80 40 00 mv r8,r20 8003ff0: 5c ed 00 02 bne r7,r13,8003ff8 <_Heap_Walk+0x3f8> 8003ff4: bb 00 40 00 mv r8,r24 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)( 8003ff8: 78 03 08 01 mvhi r3,0x801 8003ffc: 5b 8a 00 54 sw (sp+84),r10 8004000: b9 c0 08 00 mv r1,r14 8004004: 34 02 00 00 mvi r2,0 8004008: 38 63 d2 28 ori r3,r3,0xd228 800400c: b9 60 20 00 mv r4,r11 8004010: d9 80 00 00 call r12 block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 8004014: 2b 8a 00 54 lw r10,(sp+84) 8004018: 29 46 00 00 lw r6,(r10+0) 800401c: 46 26 00 0a be r17,r6,8004044 <_Heap_Walk+0x444> (*printer)( 8004020: 78 03 08 01 mvhi r3,0x801 8004024: b9 c0 08 00 mv r1,r14 8004028: 38 63 d2 54 ori r3,r3,0xd254 800402c: b9 60 20 00 mv r4,r11 8004030: ba 20 28 00 mv r5,r17 8004034: b9 40 38 00 mv r7,r10 8004038: 34 02 00 01 mvi r2,1 800403c: d9 80 00 00 call r12 8004040: e0 00 00 39 bi 8004124 <_Heap_Walk+0x524> ); return false; } if ( !prev_used ) { 8004044: 21 ef 00 01 andi r15,r15,0x1 8004048: 5d e0 00 09 bne r15,r0,800406c <_Heap_Walk+0x46c> (*printer)( 800404c: 78 03 08 01 mvhi r3,0x801 8004050: b9 c0 08 00 mv r1,r14 8004054: 38 63 d2 90 ori r3,r3,0xd290 8004058: b9 60 20 00 mv r4,r11 800405c: 34 02 00 01 mvi r2,1 8004060: d9 80 00 00 call r12 8004064: b9 e0 08 00 mv r1,r15 8004068: e0 00 00 16 bi 80040c0 <_Heap_Walk+0x4c0> 800406c: 29 a3 00 08 lw r3,(r13+8) 8004070: e0 00 00 03 bi 800407c <_Heap_Walk+0x47c> { 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 ) { if ( free_block == block ) { 8004074: 44 6b 00 04 be r3,r11,8004084 <_Heap_Walk+0x484> return true; } free_block = free_block->next; 8004078: 28 63 00 08 lw 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 ) { 800407c: 5c 6d ff fe bne r3,r13,8004074 <_Heap_Walk+0x474> 8004080: e0 00 00 23 bi 800410c <_Heap_Walk+0x50c> 8004084: ba 00 58 00 mv r11,r16 8004088: e0 00 00 0c bi 80040b8 <_Heap_Walk+0x4b8> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 800408c: 78 18 08 01 mvhi r24,0x801 8004090: 78 14 08 01 mvhi r20,0x801 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)( 8004094: 78 17 08 01 mvhi r23,0x801 "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)" : ""), 8004098: 78 16 08 01 mvhi r22,0x801 800409c: 78 15 08 01 mvhi r21,0x801 block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 80040a0: 3b 18 d2 1c ori r24,r24,0xd21c 80040a4: 3a 94 d2 8c ori r20,r20,0xd28c 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)( 80040a8: 3a f7 d2 10 ori r23,r23,0xd210 "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)" : ""), 80040ac: 3a d6 d2 04 ori r22,r22,0xd204 80040b0: 3a b5 d1 f8 ori r21,r21,0xd1f8 - 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; 80040b4: 34 1b ff fe mvi fp,-2 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 80040b8: 5d 72 ff 7c bne r11,r18,8003ea8 <_Heap_Walk+0x2a8> 80040bc: 34 01 00 01 mvi r1,1 block = next_block; } return true; } 80040c0: 2b 9d 00 10 lw ra,(sp+16) 80040c4: 2b 8b 00 50 lw r11,(sp+80) 80040c8: 2b 8c 00 4c lw r12,(sp+76) 80040cc: 2b 8d 00 48 lw r13,(sp+72) 80040d0: 2b 8e 00 44 lw r14,(sp+68) 80040d4: 2b 8f 00 40 lw r15,(sp+64) 80040d8: 2b 90 00 3c lw r16,(sp+60) 80040dc: 2b 91 00 38 lw r17,(sp+56) 80040e0: 2b 92 00 34 lw r18,(sp+52) 80040e4: 2b 93 00 30 lw r19,(sp+48) 80040e8: 2b 94 00 2c lw r20,(sp+44) 80040ec: 2b 95 00 28 lw r21,(sp+40) 80040f0: 2b 96 00 24 lw r22,(sp+36) 80040f4: 2b 97 00 20 lw r23,(sp+32) 80040f8: 2b 98 00 1c lw r24,(sp+28) 80040fc: 2b 99 00 18 lw r25,(sp+24) 8004100: 2b 9b 00 14 lw fp,(sp+20) 8004104: 37 9c 00 54 addi sp,sp,84 8004108: c3 a0 00 00 ret return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 800410c: 78 03 08 01 mvhi r3,0x801 8004110: b9 c0 08 00 mv r1,r14 8004114: 38 63 d2 c0 ori r3,r3,0xd2c0 8004118: b9 60 20 00 mv r4,r11 800411c: 34 02 00 01 mvi r2,1 8004120: d9 80 00 00 call r12 8004124: 34 01 00 00 mvi r1,0 8004128: e3 ff ff e6 bi 80040c0 <_Heap_Walk+0x4c0> 080033ec <_ISR_Handler_initialization>: * * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { 80033ec: 37 9c ff f4 addi sp,sp,-12 80033f0: 5b 8b 00 0c sw (sp+12),r11 80033f4: 5b 8c 00 08 sw (sp+8),r12 80033f8: 5b 9d 00 04 sw (sp+4),ra _ISR_Signals_to_thread_executing = false; 80033fc: 78 03 08 01 mvhi r3,0x801 _ISR_Nest_level = 0; 8003400: 78 02 08 01 mvhi r2,0x801 * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; 8003404: 34 04 00 00 mvi r4,0 8003408: 38 63 d9 f8 ori r3,r3,0xd9f8 _ISR_Nest_level = 0; 800340c: 38 42 d9 3c ori r2,r2,0xd93c * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; 8003410: 30 64 00 00 sb (r3+0),r4 _ISR_Nest_level = 0; 8003414: 58 44 00 00 sw (r2+0),r4 #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( 8003418: 34 01 00 80 mvi r1,128 void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; _ISR_Nest_level = 0; 800341c: b8 80 60 00 mv r12,r4 #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( 8003420: f8 00 09 4a calli 8005948 <_Workspace_Allocate_or_fatal_error> _CPU_Initialize_vectors(); #if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE ) if ( !_Stack_Is_enough(Configuration.interrupt_stack_size) ) 8003424: 78 0b 08 01 mvhi r11,0x801 8003428: 78 02 08 01 mvhi r2,0x801 800342c: 38 42 d0 bc ori r2,r2,0xd0bc 8003430: 39 6b d0 c4 ori r11,r11,0xd0c4 8003434: 28 44 00 00 lw r4,(r2+0) 8003438: 29 63 00 1c lw r3,(r11+28) _ISR_Signals_to_thread_executing = false; _ISR_Nest_level = 0; #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( 800343c: 78 02 08 01 mvhi r2,0x801 8003440: 38 42 d9 20 ori r2,r2,0xd920 8003444: 58 41 00 00 sw (r2+0),r1 _CPU_Initialize_vectors(); #if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE ) if ( !_Stack_Is_enough(Configuration.interrupt_stack_size) ) 8003448: 50 64 00 05 bgeu r3,r4,800345c <_ISR_Handler_initialization+0x70> _Internal_error_Occurred( 800344c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8003450: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8003454: 34 03 00 05 mvi r3,5 <== NOT EXECUTED 8003458: fb ff ff d6 calli 80033b0 <_Internal_error_Occurred> <== NOT EXECUTED INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL ); _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( 800345c: b8 60 08 00 mv r1,r3 8003460: f8 00 09 3a calli 8005948 <_Workspace_Allocate_or_fatal_error> Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 8003464: 29 64 00 1c lw r4,(r11+28) INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL ); _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( 8003468: 78 02 08 01 mvhi r2,0x801 Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 800346c: 78 03 08 01 mvhi r3,0x801 8003470: b4 24 20 00 add r4,r1,r4 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL ); _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( 8003474: 38 42 d8 b4 ori r2,r2,0xd8b4 Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 8003478: 38 63 d8 38 ori r3,r3,0xd838 800347c: 58 64 00 00 sw (r3+0),r4 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL ); _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( 8003480: 58 41 00 00 sw (r2+0),r1 #if ( CPU_HAS_HARDWARE_INTERRUPT_STACK == TRUE ) _CPU_Install_interrupt_stack(); #endif } 8003484: 2b 9d 00 04 lw ra,(sp+4) 8003488: 2b 8b 00 0c lw r11,(sp+12) 800348c: 2b 8c 00 08 lw r12,(sp+8) 8003490: 37 9c 00 0c addi sp,sp,12 8003494: c3 a0 00 00 ret 0800395c <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 800395c: 37 9c ff e0 addi sp,sp,-32 8003960: 5b 8b 00 1c sw (sp+28),r11 8003964: 5b 8c 00 18 sw (sp+24),r12 8003968: 5b 8d 00 14 sw (sp+20),r13 800396c: 5b 8e 00 10 sw (sp+16),r14 8003970: 5b 8f 00 0c sw (sp+12),r15 8003974: 5b 90 00 08 sw (sp+8),r16 8003978: 5b 9d 00 04 sw (sp+4),ra 800397c: b8 40 60 00 mv r12,r2 8003980: b8 20 78 00 mv r15,r1 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 8003984: 37 82 00 20 addi r2,sp,32 8003988: b9 80 08 00 mv r1,r12 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 800398c: b8 60 80 00 mv r16,r3 8003990: 20 8e 00 ff andi r14,r4,0xff register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 8003994: f8 00 00 84 calli 8003ba4 <_POSIX_Mutex_Get> 8003998: 44 20 00 33 be r1,r0,8003a64 <_POSIX_Condition_variables_Wait_support+0x108> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800399c: 78 05 08 02 mvhi r5,0x802 80039a0: 38 a5 08 74 ori r5,r5,0x874 80039a4: 28 a3 00 00 lw r3,(r5+0) return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 80039a8: b9 e0 08 00 mv r1,r15 80039ac: 37 82 00 20 addi r2,sp,32 80039b0: 34 63 ff ff addi r3,r3,-1 80039b4: 58 a3 00 00 sw (r5+0),r3 80039b8: fb ff ff 49 calli 80036dc <_POSIX_Condition_variables_Get> switch ( location ) { 80039bc: 2b 84 00 20 lw r4,(sp+32) return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 80039c0: b8 20 68 00 mv r13,r1 switch ( location ) { 80039c4: 5c 80 00 28 bne r4,r0,8003a64 <_POSIX_Condition_variables_Wait_support+0x108> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 80039c8: 28 21 00 14 lw r1,(r1+20) 80039cc: 44 24 00 05 be r1,r4,80039e0 <_POSIX_Condition_variables_Wait_support+0x84> 80039d0: 29 82 00 00 lw r2,(r12+0) 80039d4: 44 22 00 03 be r1,r2,80039e0 <_POSIX_Condition_variables_Wait_support+0x84> _Thread_Enable_dispatch(); 80039d8: f8 00 0b eb calli 8006984 <_Thread_Enable_dispatch> 80039dc: e0 00 00 22 bi 8003a64 <_POSIX_Condition_variables_Wait_support+0x108> return EINVAL; } (void) pthread_mutex_unlock( mutex ); 80039e0: b9 80 08 00 mv r1,r12 80039e4: f8 00 01 1e calli 8003e5c _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 80039e8: 5d c0 00 1a bne r14,r0,8003a50 <_POSIX_Condition_variables_Wait_support+0xf4> the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 80039ec: 78 0b 08 02 mvhi r11,0x802 return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 80039f0: 29 81 00 00 lw r1,(r12+0) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 80039f4: 39 6b 09 30 ori r11,r11,0x930 80039f8: 29 64 00 00 lw r4,(r11+0) return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 80039fc: 59 a1 00 14 sw (r13+20),r1 _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 8003a00: 35 a5 00 18 addi r5,r13,24 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 8003a04: 58 8e 00 34 sw (r4+52),r14 _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 8003a08: 29 ef 00 00 lw r15,(r15+0) 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; 8003a0c: 34 01 00 01 mvi r1,1 _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 8003a10: 78 03 08 00 mvhi r3,0x800 8003a14: ba 00 10 00 mv r2,r16 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; _Thread_Executing->Wait.id = *cond; 8003a18: 58 8f 00 20 sw (r4+32),r15 8003a1c: 59 a1 00 48 sw (r13+72),r1 _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 8003a20: 38 63 73 50 ori r3,r3,0x7350 8003a24: b8 a0 08 00 mv r1,r5 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; 8003a28: 58 85 00 44 sw (r4+68),r5 _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 8003a2c: f8 00 0d 22 calli 8006eb4 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 8003a30: f8 00 0b d5 calli 8006984 <_Thread_Enable_dispatch> /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 8003a34: 29 61 00 00 lw r1,(r11+0) 8003a38: 28 2b 00 34 lw r11,(r1+52) if ( status && status != ETIMEDOUT ) 8003a3c: 7d 62 00 74 cmpnei r2,r11,116 8003a40: 7d 61 00 00 cmpnei r1,r11,0 8003a44: a0 41 08 00 and r1,r2,r1 8003a48: 44 2e 00 04 be r1,r14,8003a58 <_POSIX_Condition_variables_Wait_support+0xfc> 8003a4c: e0 00 00 07 bi 8003a68 <_POSIX_Condition_variables_Wait_support+0x10c> <== NOT EXECUTED return status; } else { _Thread_Enable_dispatch(); 8003a50: f8 00 0b cd calli 8006984 <_Thread_Enable_dispatch> 8003a54: 34 0b 00 74 mvi r11,116 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 8003a58: b9 80 08 00 mv r1,r12 8003a5c: f8 00 00 ce calli 8003d94 if ( mutex_status ) 8003a60: 44 20 00 02 be r1,r0,8003a68 <_POSIX_Condition_variables_Wait_support+0x10c> 8003a64: 34 0b 00 16 mvi r11,22 case OBJECTS_ERROR: break; } return EINVAL; } 8003a68: b9 60 08 00 mv r1,r11 8003a6c: 2b 9d 00 04 lw ra,(sp+4) 8003a70: 2b 8b 00 1c lw r11,(sp+28) 8003a74: 2b 8c 00 18 lw r12,(sp+24) 8003a78: 2b 8d 00 14 lw r13,(sp+20) 8003a7c: 2b 8e 00 10 lw r14,(sp+16) 8003a80: 2b 8f 00 0c lw r15,(sp+12) 8003a84: 2b 90 00 08 lw r16,(sp+8) 8003a88: 37 9c 00 20 addi sp,sp,32 8003a8c: c3 a0 00 00 ret 080028b0 <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 80028b0: 37 9c ff f8 addi sp,sp,-8 80028b4: 5b 8b 00 08 sw (sp+8),r11 80028b8: 5b 9d 00 04 sw (sp+4),ra 80028bc: b8 40 58 00 mv r11,r2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 80028c0: 28 42 00 68 lw r2,(r2+104) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 80028c4: 29 61 00 54 lw r1,(r11+84) bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 80028c8: 34 42 00 01 addi r2,r2,1 80028cc: 59 62 00 68 sw (r11+104),r2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 80028d0: 5c 20 00 03 bne r1,r0,80028dc <_POSIX_Timer_TSR+0x2c> ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 80028d4: 29 62 00 58 lw r2,(r11+88) 80028d8: 44 41 00 0d be r2,r1,800290c <_POSIX_Timer_TSR+0x5c> activated = _POSIX_Timer_Insert_helper( 80028dc: 29 62 00 64 lw r2,(r11+100) 80028e0: 29 63 00 08 lw r3,(r11+8) 80028e4: 78 04 08 00 mvhi r4,0x800 80028e8: 38 84 28 b0 ori r4,r4,0x28b0 80028ec: 35 61 00 10 addi r1,r11,16 80028f0: b9 60 28 00 mv r5,r11 80028f4: f8 00 15 7b calli 8007ee0 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 80028f8: 44 20 00 0c be r1,r0,8002928 <_POSIX_Timer_TSR+0x78> return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 80028fc: 35 61 00 6c addi r1,r11,108 8002900: f8 00 03 1e calli 8003578 <_TOD_Get> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 8002904: 34 01 00 03 mvi r1,3 8002908: e0 00 00 02 bi 8002910 <_POSIX_Timer_TSR+0x60> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 800290c: 34 01 00 04 mvi r1,4 <== NOT EXECUTED 8002910: 31 61 00 3c sb (r11+60),r1 /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 8002914: 29 62 00 44 lw r2,(r11+68) 8002918: 29 61 00 38 lw r1,(r11+56) 800291c: f8 00 14 1b calli 8007988 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 8002920: 34 01 00 00 mvi r1,0 8002924: 59 61 00 68 sw (r11+104),r1 } 8002928: 2b 9d 00 04 lw ra,(sp+4) 800292c: 2b 8b 00 08 lw r11,(sp+8) 8002930: 37 9c 00 08 addi sp,sp,8 8002934: c3 a0 00 00 ret 08008d2c <_TOD_Get>: */ void _TOD_Get( struct timespec *time ) { 8008d2c: 37 9c ff e4 addi sp,sp,-28 8008d30: 5b 8b 00 0c sw (sp+12),r11 8008d34: 5b 8c 00 08 sw (sp+8),r12 8008d38: 5b 9d 00 04 sw (sp+4),ra 8008d3c: b8 20 58 00 mv r11,r1 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); 8008d40: 90 00 60 00 rcsr r12,IE 8008d44: 34 01 ff fe mvi r1,-2 8008d48: a1 81 08 00 and r1,r12,r1 8008d4c: d0 01 00 00 wcsr IE,r1 now = _TOD_Now; 8008d50: 78 02 08 01 mvhi r2,0x801 8008d54: 38 42 d9 34 ori r2,r2,0xd934 if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008d58: 78 03 08 01 mvhi r3,0x801 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 8008d5c: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008d60: 38 63 da 44 ori r3,r3,0xda44 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 8008d64: 28 42 00 00 lw r2,(r2+0) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008d68: 28 63 00 00 lw r3,(r3+0) /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 8008d6c: 5b 81 00 14 sw (sp+20),r1 8008d70: 5b 82 00 10 sw (sp+16),r2 if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008d74: b8 60 20 00 mv r4,r3 8008d78: 44 60 00 03 be r3,r0,8008d84 <_TOD_Get+0x58> nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 8008d7c: d8 60 00 00 call r3 <== NOT EXECUTED 8008d80: b8 20 20 00 mv r4,r1 <== NOT EXECUTED _ISR_Enable( level ); 8008d84: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 8008d88: 34 03 00 00 mvi r3,0 _Timestamp_Add_to( &now, &offset ); 8008d8c: 37 81 00 10 addi r1,sp,16 8008d90: 37 82 00 18 addi r2,sp,24 now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 8008d94: 5b 83 00 18 sw (sp+24),r3 8008d98: 5b 84 00 1c sw (sp+28),r4 _Timestamp_Add_to( &now, &offset ); 8008d9c: fb ff f1 13 calli 80051e8 <_Timespec_Add_to> _Timestamp_To_timespec( &now, time ); 8008da0: 2b 81 00 14 lw r1,(sp+20) 8008da4: 59 61 00 04 sw (r11+4),r1 8008da8: 2b 81 00 10 lw r1,(sp+16) 8008dac: 59 61 00 00 sw (r11+0),r1 } 8008db0: 2b 9d 00 04 lw ra,(sp+4) 8008db4: 2b 8b 00 0c lw r11,(sp+12) 8008db8: 2b 8c 00 08 lw r12,(sp+8) 8008dbc: 37 9c 00 1c addi sp,sp,28 8008dc0: c3 a0 00 00 ret 08008dc4 <_TOD_Get_uptime>: */ void _TOD_Get_uptime( Timestamp_Control *uptime ) { 8008dc4: 37 9c ff e4 addi sp,sp,-28 8008dc8: 5b 8b 00 0c sw (sp+12),r11 8008dcc: 5b 8c 00 08 sw (sp+8),r12 8008dd0: 5b 9d 00 04 sw (sp+4),ra 8008dd4: b8 20 58 00 mv r11,r1 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); 8008dd8: 90 00 60 00 rcsr r12,IE 8008ddc: 34 01 ff fe mvi r1,-2 8008de0: a1 81 08 00 and r1,r12,r1 8008de4: d0 01 00 00 wcsr IE,r1 up = _TOD_Uptime; 8008de8: 78 02 08 01 mvhi r2,0x801 8008dec: 38 42 d9 24 ori r2,r2,0xd924 if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008df0: 78 03 08 01 mvhi r3,0x801 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 8008df4: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008df8: 38 63 da 44 ori r3,r3,0xda44 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 8008dfc: 28 42 00 00 lw r2,(r2+0) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008e00: 28 63 00 00 lw r3,(r3+0) /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 8008e04: 5b 81 00 14 sw (sp+20),r1 8008e08: 5b 82 00 10 sw (sp+16),r2 if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008e0c: b8 60 20 00 mv r4,r3 8008e10: 44 60 00 03 be r3,r0,8008e1c <_TOD_Get_uptime+0x58> nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 8008e14: d8 60 00 00 call r3 <== NOT EXECUTED 8008e18: b8 20 20 00 mv r4,r1 <== NOT EXECUTED _ISR_Enable( level ); 8008e1c: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 8008e20: 34 03 00 00 mvi r3,0 _Timestamp_Add_to( &up, &offset ); 8008e24: 37 81 00 10 addi r1,sp,16 8008e28: 37 82 00 18 addi r2,sp,24 up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 8008e2c: 5b 83 00 18 sw (sp+24),r3 8008e30: 5b 84 00 1c sw (sp+28),r4 _Timestamp_Add_to( &up, &offset ); 8008e34: fb ff f0 ed calli 80051e8 <_Timespec_Add_to> *uptime = up; 8008e38: 2b 81 00 14 lw r1,(sp+20) 8008e3c: 59 61 00 04 sw (r11+4),r1 8008e40: 2b 81 00 10 lw r1,(sp+16) 8008e44: 59 61 00 00 sw (r11+0),r1 } 8008e48: 2b 9d 00 04 lw ra,(sp+4) 8008e4c: 2b 8b 00 0c lw r11,(sp+12) 8008e50: 2b 8c 00 08 lw r12,(sp+8) 8008e54: 37 9c 00 1c addi sp,sp,28 8008e58: c3 a0 00 00 ret 080045f8 <_Thread_Handler_initialization>: * * Output parameters: NONE */ void _Thread_Handler_initialization(void) { 80045f8: 37 9c ff f0 addi sp,sp,-16 80045fc: 5b 8b 00 10 sw (sp+16),r11 8004600: 5b 8c 00 0c sw (sp+12),r12 8004604: 5b 8d 00 08 sw (sp+8),r13 8004608: 5b 9d 00 04 sw (sp+4),ra uint32_t maximum_extensions; #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies; #endif ticks_per_timeslice = Configuration.ticks_per_timeslice; 800460c: 78 01 08 01 mvhi r1,0x801 8004610: 38 21 d0 c4 ori r1,r1,0xd0c4 #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 8004614: 28 22 00 20 lw r2,(r1+32) 8004618: 28 29 00 24 lw r9,(r1+36) uint32_t maximum_extensions; #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies; #endif ticks_per_timeslice = Configuration.ticks_per_timeslice; 800461c: 28 2a 00 10 lw r10,(r1+16) #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 8004620: 64 42 00 00 cmpei r2,r2,0 8004624: 65 29 00 00 cmpei r9,r9,0 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies; #endif ticks_per_timeslice = Configuration.ticks_per_timeslice; maximum_extensions = Configuration.maximum_extensions; 8004628: 28 2d 00 08 lw r13,(r1+8) #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 800462c: 99 22 48 00 xor r9,r9,r2 8004630: b9 20 58 00 mv r11,r9 8004634: 45 20 00 05 be r9,r0,8004648 <_Thread_Handler_initialization+0x50> == (!Configuration.stack_free_hook) ) ) _Internal_error_Occurred( 8004638: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 800463c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8004640: 34 03 00 0f mvi r3,15 <== NOT EXECUTED 8004644: fb ff fb 5b calli 80033b0 <_Internal_error_Occurred> <== NOT EXECUTED _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004648: 78 0c 08 01 mvhi r12,0x801 800464c: 39 8c d0 c0 ori r12,r12,0xd0c0 8004650: 41 81 00 00 lbu r1,(r12+0) INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 8004654: 78 08 08 01 mvhi r8,0x801 _Thread_Executing = NULL; 8004658: 78 05 08 01 mvhi r5,0x801 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 800465c: 34 21 00 01 addi r1,r1,1 INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; _Thread_Executing = NULL; _Thread_Heir = NULL; 8004660: 78 04 08 01 mvhi r4,0x801 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; 8004664: 78 03 08 01 mvhi r3,0x801 _Thread_Maximum_extensions = maximum_extensions; 8004668: 78 07 08 01 mvhi r7,0x801 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 800466c: 78 06 08 01 mvhi r6,0x801 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; 8004670: 38 63 d9 44 ori r3,r3,0xd944 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8004674: 38 c6 d8 34 ori r6,r6,0xd834 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 8004678: 39 08 d9 70 ori r8,r8,0xd970 _Thread_Executing = NULL; 800467c: 38 a5 d9 60 ori r5,r5,0xd960 _Thread_Heir = NULL; 8004680: 38 84 d9 30 ori r4,r4,0xd930 _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; 8004684: 38 e7 d9 40 ori r7,r7,0xd940 _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004688: b4 21 10 00 add r2,r1,r1 _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; 800468c: 58 ca 00 00 sw (r6+0),r10 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; 8004690: 58 69 00 00 sw (r3+0),r9 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004694: b4 41 08 00 add r1,r2,r1 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 8004698: 31 09 00 00 sb (r8+0),r9 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 800469c: 34 02 00 02 mvi r2,2 _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; 80046a0: 58 ed 00 00 sw (r7+0),r13 true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; _Thread_Executing = NULL; 80046a4: 58 a9 00 00 sw (r5+0),r9 _Thread_Heir = NULL; 80046a8: 58 89 00 00 sw (r4+0),r9 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 80046ac: fb ff ee d1 calli 80001f0 <__ashlsi3> 80046b0: f8 00 04 a6 calli 8005948 <_Workspace_Allocate_or_fatal_error> 80046b4: 78 02 08 01 mvhi r2,0x801 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 80046b8: 41 83 00 00 lbu r3,(r12+0) _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 80046bc: 38 42 d8 30 ori r2,r2,0xd830 80046c0: 58 41 00 00 sw (r2+0),r1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 80046c4: b9 60 30 00 mv r6,r11 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 80046c8: 34 22 00 04 addi r2,r1,4 80046cc: 58 22 00 00 sw (r1+0),r2 the_chain->permanent_null = NULL; 80046d0: 58 26 00 04 sw (r1+4),r6 the_chain->last = _Chain_Head(the_chain); 80046d4: 58 21 00 08 sw (r1+8),r1 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 80046d8: 35 6b 00 01 addi r11,r11,1 80046dc: 34 21 00 0c addi r1,r1,12 80046e0: 50 6b ff fa bgeu r3,r11,80046c8 <_Thread_Handler_initialization+0xd0> /* * Initialize this class of objects. */ _Objects_Initialize_information( 80046e4: 34 02 00 01 mvi r2,1 80046e8: 78 01 08 01 mvhi r1,0x801 80046ec: 38 21 da 00 ori r1,r1,0xda00 80046f0: b8 40 18 00 mv r3,r2 80046f4: b8 40 20 00 mv r4,r2 80046f8: 34 05 01 3c mvi r5,316 80046fc: 34 07 00 08 mvi r7,8 8004700: fb ff fc c1 calli 8003a04 <_Objects_Initialize_information> false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 8004704: 2b 9d 00 04 lw ra,(sp+4) 8004708: 2b 8b 00 10 lw r11,(sp+16) 800470c: 2b 8c 00 0c lw r12,(sp+12) 8004710: 2b 8d 00 08 lw r13,(sp+8) 8004714: 37 9c 00 10 addi sp,sp,16 8004718: c3 a0 00 00 ret 08005c74 <_Thread_Restart>: bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 8005c74: 37 9c ff f0 addi sp,sp,-16 8005c78: 5b 8b 00 08 sw (sp+8),r11 8005c7c: 5b 9d 00 04 sw (sp+4),ra if ( !_States_Is_dormant( the_thread->current_state ) ) { 8005c80: 28 25 00 10 lw r5,(r1+16) 8005c84: 34 04 00 00 mvi r4,0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 8005c88: b8 20 58 00 mv r11,r1 if ( !_States_Is_dormant( the_thread->current_state ) ) { 8005c8c: 20 a5 00 01 andi r5,r5,0x1 8005c90: 5c a4 00 16 bne r5,r4,8005ce8 <_Thread_Restart+0x74> _Thread_Set_transient( the_thread ); 8005c94: 5b 82 00 10 sw (sp+16),r2 8005c98: 5b 83 00 0c sw (sp+12),r3 8005c9c: f8 00 00 bb calli 8005f88 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 8005ca0: 2b 82 00 10 lw r2,(sp+16) 8005ca4: 2b 83 00 0c lw r3,(sp+12) 8005ca8: b9 60 08 00 mv r1,r11 8005cac: f8 00 14 17 calli 800ad08 <_Thread_Reset> _Thread_Load_environment( the_thread ); 8005cb0: b9 60 08 00 mv r1,r11 8005cb4: f8 00 12 ec calli 800a864 <_Thread_Load_environment> _Thread_Ready( the_thread ); 8005cb8: b9 60 08 00 mv r1,r11 8005cbc: f8 00 13 af calli 800ab78 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 8005cc0: b9 60 08 00 mv r1,r11 8005cc4: f8 00 02 60 calli 8006644 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 8005cc8: 78 01 08 02 mvhi r1,0x802 8005ccc: 38 21 29 b8 ori r1,r1,0x29b8 8005cd0: 28 21 00 00 lw r1,(r1+0) 8005cd4: 34 04 00 01 mvi r4,1 8005cd8: 5d 61 00 04 bne r11,r1,8005ce8 <_Thread_Restart+0x74> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) _Context_Restore_fp( &_Thread_Executing->fp_context ); #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 8005cdc: 35 61 00 d0 addi r1,r11,208 8005ce0: f8 00 03 de calli 8006c58 <_CPU_Context_restore> 8005ce4: 34 04 00 01 mvi r4,1 <== NOT EXECUTED return true; } return false; } 8005ce8: b8 80 08 00 mv r1,r4 8005cec: 2b 9d 00 04 lw ra,(sp+4) 8005cf0: 2b 8b 00 08 lw r11,(sp+8) 8005cf4: 37 9c 00 10 addi sp,sp,16 8005cf8: c3 a0 00 00 ret 0800499c <_Thread_queue_Enqueue_priority>: Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 800499c: 37 9c ff ec addi sp,sp,-20 80049a0: 5b 8b 00 14 sw (sp+20),r11 80049a4: 5b 8c 00 10 sw (sp+16),r12 80049a8: 5b 8d 00 0c sw (sp+12),r13 80049ac: 5b 8e 00 08 sw (sp+8),r14 80049b0: 5b 9d 00 04 sw (sp+4),ra Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 80049b4: 28 4d 00 14 lw r13,(r2+20) Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 80049b8: b8 40 58 00 mv r11,r2 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 80049bc: 34 44 00 3c addi r4,r2,60 80049c0: 59 64 00 38 sw (r11+56),r4 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 80049c4: 34 42 00 38 addi r2,r2,56 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 80049c8: 34 04 00 00 mvi r4,0 80049cc: b8 20 60 00 mv r12,r1 80049d0: 59 64 00 3c sw (r11+60),r4 the_chain->last = _Chain_Head(the_chain); 80049d4: 59 62 00 40 sw (r11+64),r2 _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 ]; 80049d8: b9 a0 08 00 mv r1,r13 80049dc: 34 02 00 06 mvi r2,6 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 80049e0: b8 60 70 00 mv r14,r3 _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 ]; 80049e4: fb ff ee 2b calli 8000290 <__lshrsi3> 80049e8: b4 21 10 00 add r2,r1,r1 80049ec: b4 41 08 00 add r1,r2,r1 80049f0: 34 02 00 02 mvi r2,2 80049f4: fb ff ed ff calli 80001f0 <__ashlsi3> block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 80049f8: 21 a2 00 20 andi r2,r13,0x20 _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 ]; 80049fc: b5 81 08 00 add r1,r12,r1 block_state = the_thread_queue->state; 8004a00: 29 87 00 38 lw r7,(r12+56) if ( _Thread_queue_Is_reverse_search( priority ) ) 8004a04: 5c 40 00 23 bne r2,r0,8004a90 <_Thread_queue_Enqueue_priority+0xf4> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8004a08: 34 28 00 04 addi r8,r1,4 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 8004a0c: 34 03 ff fe mvi r3,-2 8004a10: 90 00 20 00 rcsr r4,IE 8004a14: a0 83 30 00 and r6,r4,r3 8004a18: d0 06 00 00 wcsr IE,r6 search_thread = (Thread_Control *) header->first; 8004a1c: 34 05 ff ff mvi r5,-1 8004a20: 28 22 00 00 lw r2,(r1+0) while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8004a24: e0 00 00 0b bi 8004a50 <_Thread_queue_Enqueue_priority+0xb4> search_priority = search_thread->current_priority; 8004a28: 28 45 00 14 lw r5,(r2+20) if ( priority <= search_priority ) 8004a2c: 50 ad 00 0a bgeu r5,r13,8004a54 <_Thread_queue_Enqueue_priority+0xb8> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 8004a30: d0 04 00 00 wcsr IE,r4 8004a34: d0 06 00 00 wcsr IE,r6 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8004a38: 28 49 00 10 lw r9,(r2+16) 8004a3c: a0 e9 48 00 and r9,r7,r9 8004a40: 5d 20 00 03 bne r9,r0,8004a4c <_Thread_queue_Enqueue_priority+0xb0> _ISR_Enable( level ); 8004a44: d0 04 00 00 wcsr IE,r4 <== NOT EXECUTED goto restart_forward_search; 8004a48: e3 ff ff f2 bi 8004a10 <_Thread_queue_Enqueue_priority+0x74> <== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 8004a4c: 28 42 00 00 lw r2,(r2+0) 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 ) ) { 8004a50: 5c 48 ff f6 bne r2,r8,8004a28 <_Thread_queue_Enqueue_priority+0x8c> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8004a54: 29 83 00 30 lw r3,(r12+48) 8004a58: 34 01 00 01 mvi r1,1 the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8004a5c: b8 80 38 00 mv r7,r4 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8004a60: 5c 61 00 3b bne r3,r1,8004b4c <_Thread_queue_Enqueue_priority+0x1b0> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8004a64: 34 01 00 00 mvi r1,0 8004a68: 59 81 00 30 sw (r12+48),r1 if ( priority == search_priority ) 8004a6c: 45 a5 00 2f be r13,r5,8004b28 <_Thread_queue_Enqueue_priority+0x18c> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 8004a70: 28 41 00 04 lw r1,(r2+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8004a74: 59 62 00 00 sw (r11+0),r2 the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 8004a78: 59 6c 00 44 sw (r11+68),r12 search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; 8004a7c: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 8004a80: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 8004a84: 58 4b 00 04 sw (r2+4),r11 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 8004a88: d0 04 00 00 wcsr IE,r4 8004a8c: e0 00 00 25 bi 8004b20 <_Thread_queue_Enqueue_priority+0x184> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8004a90: 78 04 08 01 mvhi r4,0x801 8004a94: 38 84 d0 c0 ori r4,r4,0xd0c0 _ISR_Disable( level ); 8004a98: 34 03 ff fe mvi r3,-2 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8004a9c: 40 86 00 00 lbu r6,(r4+0) 8004aa0: 34 c6 00 01 addi r6,r6,1 _ISR_Disable( level ); 8004aa4: 90 00 28 00 rcsr r5,IE 8004aa8: a0 a3 40 00 and r8,r5,r3 8004aac: d0 08 00 00 wcsr IE,r8 search_thread = (Thread_Control *) header->last; 8004ab0: 28 22 00 08 lw r2,(r1+8) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8004ab4: e0 00 00 0b bi 8004ae0 <_Thread_queue_Enqueue_priority+0x144> search_priority = search_thread->current_priority; 8004ab8: 28 46 00 14 lw r6,(r2+20) if ( priority >= search_priority ) 8004abc: 51 a6 00 0a bgeu r13,r6,8004ae4 <_Thread_queue_Enqueue_priority+0x148> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 8004ac0: d0 05 00 00 wcsr IE,r5 8004ac4: d0 08 00 00 wcsr IE,r8 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8004ac8: 28 49 00 10 lw r9,(r2+16) 8004acc: a0 e9 48 00 and r9,r7,r9 8004ad0: 5d 20 00 03 bne r9,r0,8004adc <_Thread_queue_Enqueue_priority+0x140> _ISR_Enable( level ); 8004ad4: d0 05 00 00 wcsr IE,r5 <== NOT EXECUTED goto restart_reverse_search; 8004ad8: e3 ff ff f1 bi 8004a9c <_Thread_queue_Enqueue_priority+0x100> <== NOT EXECUTED } search_thread = (Thread_Control *) 8004adc: 28 42 00 04 lw r2,(r2+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 ) ) { 8004ae0: 5c 41 ff f6 bne r2,r1,8004ab8 <_Thread_queue_Enqueue_priority+0x11c> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8004ae4: 29 83 00 30 lw r3,(r12+48) 8004ae8: 34 01 00 01 mvi r1,1 8004aec: b8 a0 38 00 mv r7,r5 8004af0: 5c 61 00 17 bne r3,r1,8004b4c <_Thread_queue_Enqueue_priority+0x1b0> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8004af4: 34 01 00 00 mvi r1,0 8004af8: 59 81 00 30 sw (r12+48),r1 if ( priority == search_priority ) 8004afc: b8 a0 20 00 mv r4,r5 8004b00: 45 a6 00 0a be r13,r6,8004b28 <_Thread_queue_Enqueue_priority+0x18c> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8004b04: 28 41 00 00 lw r1,(r2+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 8004b08: 59 62 00 04 sw (r11+4),r2 search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 8004b0c: 59 6c 00 44 sw (r11+68),r12 search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 8004b10: 59 61 00 00 sw (r11+0),r1 the_node->previous = search_node; search_node->next = the_node; 8004b14: 58 4b 00 00 sw (r2+0),r11 next_node->previous = the_node; 8004b18: 58 2b 00 04 sw (r1+4),r11 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 8004b1c: d0 05 00 00 wcsr IE,r5 8004b20: 34 01 00 01 mvi r1,1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8004b24: e0 00 00 0c bi 8004b54 <_Thread_queue_Enqueue_priority+0x1b8> 8004b28: 34 42 00 3c addi r2,r2,60 equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 8004b2c: 28 41 00 04 lw r1,(r2+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8004b30: 59 62 00 00 sw (r11+0),r2 the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 8004b34: 59 6c 00 44 sw (r11+68),r12 search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; 8004b38: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 8004b3c: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 8004b40: 58 4b 00 04 sw (r2+4),r11 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 8004b44: d0 04 00 00 wcsr IE,r4 8004b48: e3 ff ff f6 bi 8004b20 <_Thread_queue_Enqueue_priority+0x184> * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; 8004b4c: 29 81 00 30 lw r1,(r12+48) * 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; 8004b50: 59 c7 00 00 sw (r14+0),r7 return the_thread_queue->sync_state; } 8004b54: 2b 9d 00 04 lw ra,(sp+4) 8004b58: 2b 8b 00 14 lw r11,(sp+20) 8004b5c: 2b 8c 00 10 lw r12,(sp+16) 8004b60: 2b 8d 00 0c lw r13,(sp+12) 8004b64: 2b 8e 00 08 lw r14,(sp+8) 8004b68: 37 9c 00 14 addi sp,sp,20 8004b6c: c3 a0 00 00 ret 08009934 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 8009934: 37 9c ff fc addi sp,sp,-4 8009938: 5b 9d 00 04 sw (sp+4),ra 800993c: b8 20 10 00 mv r2,r1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 8009940: 28 21 00 44 lw r1,(r1+68) * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 8009944: 28 24 00 30 lw r4,(r1+48) 8009948: 44 80 00 0c be r4,r0,8009978 <_Thread_queue_Process_timeout+0x44> 800994c: 78 03 08 01 mvhi r3,0x801 8009950: 38 63 d9 60 ori r3,r3,0xd960 8009954: 28 63 00 00 lw r3,(r3+0) 8009958: 5c 43 00 08 bne r2,r3,8009978 <_Thread_queue_Process_timeout+0x44> _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 800995c: 34 03 00 03 mvi r3,3 8009960: 44 83 00 0a be r4,r3,8009988 <_Thread_queue_Process_timeout+0x54> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 8009964: 34 03 00 02 mvi r3,2 <== NOT EXECUTED 8009968: 58 23 00 30 sw (r1+48),r3 <== NOT EXECUTED */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800996c: 28 21 00 3c lw r1,(r1+60) <== NOT EXECUTED 8009970: 58 41 00 34 sw (r2+52),r1 <== NOT EXECUTED 8009974: e0 00 00 05 bi 8009988 <_Thread_queue_Process_timeout+0x54> <== NOT EXECUTED the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 8009978: 28 21 00 3c lw r1,(r1+60) 800997c: 58 41 00 34 sw (r2+52),r1 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 8009980: 28 41 00 44 lw r1,(r2+68) 8009984: fb ff ff 93 calli 80097d0 <_Thread_queue_Extract> } } 8009988: 2b 9d 00 04 lw ra,(sp+4) 800998c: 37 9c 00 04 addi sp,sp,4 8009990: c3 a0 00 00 ret 08013c60 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8013c60: 37 9c ff a4 addi sp,sp,-92 8013c64: 5b 8b 00 44 sw (sp+68),r11 8013c68: 5b 8c 00 40 sw (sp+64),r12 8013c6c: 5b 8d 00 3c sw (sp+60),r13 8013c70: 5b 8e 00 38 sw (sp+56),r14 8013c74: 5b 8f 00 34 sw (sp+52),r15 8013c78: 5b 90 00 30 sw (sp+48),r16 8013c7c: 5b 91 00 2c sw (sp+44),r17 8013c80: 5b 92 00 28 sw (sp+40),r18 8013c84: 5b 93 00 24 sw (sp+36),r19 8013c88: 5b 94 00 20 sw (sp+32),r20 8013c8c: 5b 95 00 1c sw (sp+28),r21 8013c90: 5b 96 00 18 sw (sp+24),r22 8013c94: 5b 97 00 14 sw (sp+20),r23 8013c98: 5b 98 00 10 sw (sp+16),r24 8013c9c: 5b 99 00 0c sw (sp+12),r25 8013ca0: 5b 9b 00 08 sw (sp+8),fp 8013ca4: 5b 9d 00 04 sw (sp+4),ra static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8013ca8: 78 11 08 03 mvhi r17,0x803 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8013cac: b8 20 58 00 mv r11,r1 8013cb0: 37 82 00 54 addi r2,sp,84 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 8013cb4: 34 01 00 00 mvi r1,0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8013cb8: 37 96 00 58 addi r22,sp,88 8013cbc: 37 8e 00 48 addi r14,sp,72 8013cc0: 37 92 00 4c addi r18,sp,76 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8013cc4: 78 10 08 03 mvhi r16,0x803 8013cc8: 78 0d 08 03 mvhi r13,0x803 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8013ccc: 5b 96 00 54 sw (sp+84),r22 the_chain->permanent_null = NULL; 8013cd0: 5b 81 00 58 sw (sp+88),r1 the_chain->last = _Chain_Head(the_chain); 8013cd4: 5b 82 00 5c sw (sp+92),r2 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8013cd8: 5b 92 00 48 sw (sp+72),r18 the_chain->permanent_null = NULL; 8013cdc: 5b 81 00 4c sw (sp+76),r1 the_chain->last = _Chain_Head(the_chain); 8013ce0: 5b 8e 00 50 sw (sp+80),r14 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8013ce4: 3a 31 fd fc ori r17,r17,0xfdfc static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8013ce8: 3a 10 fd 3c ori r16,r16,0xfd3c */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 8013cec: b8 20 a8 00 mv r21,r1 8013cf0: 39 ad fc ac ori r13,r13,0xfcac */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8013cf4: 35 74 00 30 addi r20,r11,48 /* * 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 ); 8013cf8: 35 6f 00 68 addi r15,r11,104 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8013cfc: 35 7b 00 08 addi fp,r11,8 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8013d00: 35 79 00 40 addi r25,r11,64 /* * 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 ); 8013d04: 34 18 00 01 mvi r24,1 Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8013d08: 34 17 00 03 mvi r23,3 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 8013d0c: 34 13 ff fe mvi r19,-2 { /* * 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; 8013d10: 37 81 00 54 addi r1,sp,84 8013d14: 59 61 00 78 sw (r11+120),r1 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8013d18: 2a 22 00 00 lw r2,(r17+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 8013d1c: 29 63 00 3c lw r3,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8013d20: ba 80 08 00 mv r1,r20 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 8013d24: 59 62 00 3c sw (r11+60),r2 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8013d28: c8 43 10 00 sub r2,r2,r3 8013d2c: b9 c0 18 00 mv r3,r14 8013d30: f8 00 14 af calli 8018fec <_Watchdog_Adjust_to_chain> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 8013d34: 29 62 00 74 lw r2,(r11+116) static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8013d38: 2a 0c 00 00 lw r12,(r16+0) /* * 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 ) { 8013d3c: 50 4c 00 06 bgeu r2,r12,8013d54 <_Timer_server_Body+0xf4> /* * 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 ); 8013d40: c9 82 10 00 sub r2,r12,r2 8013d44: b9 e0 08 00 mv r1,r15 8013d48: b9 c0 18 00 mv r3,r14 8013d4c: f8 00 14 a8 calli 8018fec <_Watchdog_Adjust_to_chain> 8013d50: e0 00 00 06 bi 8013d68 <_Timer_server_Body+0x108> } else if ( snapshot < last_snapshot ) { 8013d54: 51 82 00 05 bgeu r12,r2,8013d68 <_Timer_server_Body+0x108> /* * 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 ); 8013d58: c8 4c 18 00 sub r3,r2,r12 8013d5c: b9 e0 08 00 mv r1,r15 8013d60: 34 02 00 01 mvi r2,1 8013d64: f8 00 14 6a calli 8018f0c <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; 8013d68: 59 6c 00 74 sw (r11+116),r12 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8013d6c: 29 61 00 78 lw r1,(r11+120) 8013d70: f8 00 03 02 calli 8014978 <_Chain_Get> if ( timer == NULL ) { 8013d74: 44 20 00 0b be r1,r0,8013da0 <_Timer_server_Body+0x140> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8013d78: 28 23 00 38 lw r3,(r1+56) <== NOT EXECUTED 8013d7c: 5c 78 00 04 bne r3,r24,8013d8c <_Timer_server_Body+0x12c> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8013d80: 34 22 00 10 addi r2,r1,16 <== NOT EXECUTED 8013d84: ba 80 08 00 mv r1,r20 <== NOT EXECUTED 8013d88: e0 00 00 04 bi 8013d98 <_Timer_server_Body+0x138> <== NOT EXECUTED } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8013d8c: 5c 77 ff f8 bne r3,r23,8013d6c <_Timer_server_Body+0x10c> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8013d90: 34 22 00 10 addi r2,r1,16 <== NOT EXECUTED 8013d94: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8013d98: f8 00 14 c0 calli 8019098 <_Watchdog_Insert> <== NOT EXECUTED 8013d9c: e3 ff ff f4 bi 8013d6c <_Timer_server_Body+0x10c> <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 8013da0: 90 00 10 00 rcsr r2,IE 8013da4: a0 53 08 00 and r1,r2,r19 8013da8: d0 01 00 00 wcsr IE,r1 if ( _Chain_Is_empty( insert_chain ) ) { 8013dac: 2b 81 00 54 lw r1,(sp+84) 8013db0: 5c 36 00 06 bne r1,r22,8013dc8 <_Timer_server_Body+0x168> ts->insert_chain = NULL; 8013db4: 59 75 00 78 sw (r11+120),r21 _ISR_Enable( level ); 8013db8: d0 02 00 00 wcsr IE,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 ) ) { 8013dbc: 2b 81 00 48 lw r1,(sp+72) 8013dc0: 5c 32 00 04 bne r1,r18,8013dd0 <_Timer_server_Body+0x170> 8013dc4: e0 00 00 17 bi 8013e20 <_Timer_server_Body+0x1c0> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 8013dc8: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED 8013dcc: e3 ff ff d3 bi 8013d18 <_Timer_server_Body+0xb8> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 8013dd0: 90 00 10 00 rcsr r2,IE 8013dd4: a0 53 08 00 and r1,r2,r19 8013dd8: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8013ddc: 2b 84 00 48 lw r4,(sp+72) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 8013de0: 5c 92 00 03 bne r4,r18,8013dec <_Timer_server_Body+0x18c> 8013de4: 34 04 00 00 mvi r4,0 8013de8: e0 00 00 04 bi 8013df8 <_Timer_server_Body+0x198> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 8013dec: 28 83 00 00 lw r3,(r4+0) the_chain->first = new_first; 8013df0: 5b 83 00 48 sw (sp+72),r3 new_first->previous = _Chain_Head(the_chain); 8013df4: 58 6e 00 04 sw (r3+4),r14 watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 8013df8: 44 80 00 08 be r4,r0,8013e18 <_Timer_server_Body+0x1b8> watchdog->state = WATCHDOG_INACTIVE; 8013dfc: 58 95 00 08 sw (r4+8),r21 _ISR_Enable( level ); 8013e00: d0 02 00 00 wcsr IE,r2 /* * 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 ); 8013e04: 28 82 00 24 lw r2,(r4+36) 8013e08: 28 83 00 1c lw r3,(r4+28) 8013e0c: 28 81 00 20 lw r1,(r4+32) 8013e10: d8 60 00 00 call r3 } 8013e14: e3 ff ff ef bi 8013dd0 <_Timer_server_Body+0x170> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 8013e18: d0 02 00 00 wcsr IE,r2 8013e1c: e3 ff ff bd bi 8013d10 <_Timer_server_Body+0xb0> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 8013e20: 34 01 00 00 mvi r1,0 8013e24: 31 61 00 7c sb (r11+124),r1 8013e28: 29 a1 00 00 lw r1,(r13+0) 8013e2c: 34 21 00 01 addi r1,r1,1 8013e30: 59 a1 00 00 sw (r13+0),r1 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 8013e34: 29 61 00 00 lw r1,(r11+0) 8013e38: 34 02 00 08 mvi r2,8 8013e3c: f8 00 11 2e calli 80182f4 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 8013e40: b9 60 08 00 mv r1,r11 8013e44: fb ff ff 4d calli 8013b78 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 8013e48: b9 60 08 00 mv r1,r11 8013e4c: fb ff ff 68 calli 8013bec <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 8013e50: f8 00 0d fd calli 8017644 <_Thread_Enable_dispatch> ts->active = true; 8013e54: 34 01 00 01 mvi r1,1 8013e58: 31 61 00 7c sb (r11+124),r1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8013e5c: bb 60 08 00 mv r1,fp 8013e60: f8 00 14 ed calli 8019214 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8013e64: bb 20 08 00 mv r1,r25 8013e68: f8 00 14 eb calli 8019214 <_Watchdog_Remove> 8013e6c: e3 ff ff a9 bi 8013d10 <_Timer_server_Body+0xb0> 08013e70 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8013e70: 37 9c ff f8 addi sp,sp,-8 8013e74: 5b 8b 00 08 sw (sp+8),r11 8013e78: 5b 9d 00 04 sw (sp+4),ra 8013e7c: b8 20 58 00 mv r11,r1 if ( ts->insert_chain == NULL ) { 8013e80: 28 21 00 78 lw r1,(r1+120) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8013e84: b8 40 20 00 mv r4,r2 if ( ts->insert_chain == NULL ) { 8013e88: 5c 20 00 47 bne r1,r0,8013fa4 <_Timer_server_Schedule_operation_method+0x134> 8013e8c: 78 01 08 03 mvhi r1,0x803 8013e90: 38 21 fc ac ori r1,r1,0xfcac 8013e94: 28 22 00 00 lw r2,(r1+0) 8013e98: 34 42 00 01 addi r2,r2,1 8013e9c: 58 22 00 00 sw (r1+0),r2 * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8013ea0: 28 81 00 38 lw r1,(r4+56) 8013ea4: 34 02 00 01 mvi r2,1 8013ea8: 5c 22 00 1d bne r1,r2,8013f1c <_Timer_server_Schedule_operation_method+0xac> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8013eac: 90 00 18 00 rcsr r3,IE 8013eb0: 34 01 ff fe mvi r1,-2 8013eb4: a0 61 08 00 and r1,r3,r1 8013eb8: d0 01 00 00 wcsr IE,r1 snapshot = _Watchdog_Ticks_since_boot; 8013ebc: 78 02 08 03 mvhi r2,0x803 8013ec0: 38 42 fd fc ori r2,r2,0xfdfc */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8013ec4: 29 61 00 30 lw r1,(r11+48) 8013ec8: 28 45 00 00 lw r5,(r2+0) last_snapshot = ts->Interval_watchdogs.last_snapshot; 8013ecc: 29 62 00 3c lw r2,(r11+60) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8013ed0: 35 66 00 34 addi r6,r11,52 8013ed4: 44 26 00 08 be r1,r6,8013ef4 <_Timer_server_Schedule_operation_method+0x84> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 8013ed8: 28 27 00 10 lw r7,(r1+16) first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 8013edc: c8 a2 10 00 sub r2,r5,r2 delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 8013ee0: f4 e2 30 00 cmpgu r6,r7,r2 delta_interval -= delta; 8013ee4: c8 e2 10 00 sub r2,r7,r2 * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 8013ee8: c8 06 30 00 sub r6,r0,r6 8013eec: a0 46 10 00 and r2,r2,r6 delta_interval -= delta; } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 8013ef0: 58 22 00 10 sw (r1+16),r2 } ts->Interval_watchdogs.last_snapshot = snapshot; 8013ef4: 59 65 00 3c sw (r11+60),r5 _ISR_Enable( level ); 8013ef8: d0 03 00 00 wcsr IE,r3 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8013efc: 35 61 00 30 addi r1,r11,48 8013f00: 34 82 00 10 addi r2,r4,16 8013f04: f8 00 14 65 calli 8019098 <_Watchdog_Insert> if ( !ts->active ) { 8013f08: 41 61 00 7c lbu r1,(r11+124) 8013f0c: 5c 20 00 24 bne r1,r0,8013f9c <_Timer_server_Schedule_operation_method+0x12c> _Timer_server_Reset_interval_system_watchdog( ts ); 8013f10: b9 60 08 00 mv r1,r11 8013f14: fb ff ff 19 calli 8013b78 <_Timer_server_Reset_interval_system_watchdog> 8013f18: e0 00 00 21 bi 8013f9c <_Timer_server_Schedule_operation_method+0x12c> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8013f1c: 34 02 00 03 mvi r2,3 8013f20: 5c 22 00 1f bne r1,r2,8013f9c <_Timer_server_Schedule_operation_method+0x12c> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8013f24: 90 00 38 00 rcsr r7,IE 8013f28: 34 01 ff fe mvi r1,-2 8013f2c: a0 e1 08 00 and r1,r7,r1 8013f30: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8013f34: 29 62 00 68 lw r2,(r11+104) snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8013f38: 78 01 08 03 mvhi r1,0x803 last_snapshot = ts->TOD_watchdogs.last_snapshot; 8013f3c: 29 66 00 74 lw r6,(r11+116) /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8013f40: 38 21 fd 3c ori r1,r1,0xfd3c */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8013f44: 35 63 00 6c addi r3,r11,108 8013f48: 28 21 00 00 lw r1,(r1+0) 8013f4c: 44 43 00 0b be r2,r3,8013f78 <_Timer_server_Schedule_operation_method+0x108> last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 8013f50: 28 45 00 10 lw r5,(r2+16) } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 8013f54: b4 a6 18 00 add r3,r5,r6 delta_interval += delta; 8013f58: c8 61 18 00 sub r3,r3,r1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 8013f5c: 50 c1 00 06 bgeu r6,r1,8013f74 <_Timer_server_Schedule_operation_method+0x104> /* * We advanced in time. */ delta = snapshot - last_snapshot; 8013f60: c8 26 18 00 sub r3,r1,r6 if (delta_interval > delta) { 8013f64: f4 a3 30 00 cmpgu r6,r5,r3 delta_interval -= delta; 8013f68: c8 a3 18 00 sub r3,r5,r3 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 8013f6c: c8 06 28 00 sub r5,r0,r6 8013f70: a0 65 18 00 and r3,r3,r5 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 8013f74: 58 43 00 10 sw (r2+16),r3 } ts->TOD_watchdogs.last_snapshot = snapshot; 8013f78: 59 61 00 74 sw (r11+116),r1 _ISR_Enable( level ); 8013f7c: d0 07 00 00 wcsr IE,r7 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8013f80: 35 61 00 68 addi r1,r11,104 8013f84: 34 82 00 10 addi r2,r4,16 8013f88: f8 00 14 44 calli 8019098 <_Watchdog_Insert> if ( !ts->active ) { 8013f8c: 41 61 00 7c lbu r1,(r11+124) 8013f90: 5c 20 00 03 bne r1,r0,8013f9c <_Timer_server_Schedule_operation_method+0x12c> _Timer_server_Reset_tod_system_watchdog( ts ); 8013f94: b9 60 08 00 mv r1,r11 8013f98: fb ff ff 15 calli 8013bec <_Timer_server_Reset_tod_system_watchdog> } } _Thread_Enable_dispatch(); 8013f9c: f8 00 0d aa calli 8017644 <_Thread_Enable_dispatch> 8013fa0: e0 00 00 03 bi 8013fac <_Timer_server_Schedule_operation_method+0x13c> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 8013fa4: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED 8013fa8: f8 00 02 68 calli 8014948 <_Chain_Append> <== NOT EXECUTED } } 8013fac: 2b 9d 00 04 lw ra,(sp+4) 8013fb0: 2b 8b 00 08 lw r11,(sp+8) 8013fb4: 37 9c 00 08 addi sp,sp,8 8013fb8: c3 a0 00 00 ret 08005948 <_Workspace_Allocate_or_fatal_error>: * _Workspace_Allocate_or_fatal_error */ void *_Workspace_Allocate_or_fatal_error( size_t size ) { 8005948: 37 9c ff fc addi sp,sp,-4 800594c: 5b 9d 00 04 sw (sp+4),ra * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 8005950: 34 03 00 00 mvi r3,0 8005954: b8 20 10 00 mv r2,r1 8005958: 78 01 08 01 mvhi r1,0x801 800595c: 38 21 d8 c8 ori r1,r1,0xd8c8 8005960: b8 60 20 00 mv r4,r3 8005964: f8 00 0d 3e calli 8008e5c <_Heap_Allocate_aligned_with_boundary> __builtin_return_address( 1 ), memory ); #endif if ( memory == NULL ) 8005968: 5c 20 00 04 bne r1,r0,8005978 <_Workspace_Allocate_or_fatal_error+0x30> _Internal_error_Occurred( 800596c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8005970: 34 03 00 04 mvi r3,4 <== NOT EXECUTED 8005974: fb ff f6 8f calli 80033b0 <_Internal_error_Occurred> <== NOT EXECUTED true, INTERNAL_ERROR_WORKSPACE_ALLOCATION ); return memory; } 8005978: 2b 9d 00 04 lw ra,(sp+4) 800597c: 37 9c 00 04 addi sp,sp,4 8005980: c3 a0 00 00 ret 0800b1ac : void pthread_exit( void *value_ptr ) { 800b1ac: 37 9c ff fc addi sp,sp,-4 800b1b0: 5b 9d 00 04 sw (sp+4),ra _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 800b1b4: 78 03 08 01 mvhi r3,0x801 800b1b8: 38 63 d9 60 ori r3,r3,0xd960 } void pthread_exit( void *value_ptr ) { 800b1bc: b8 20 10 00 mv r2,r1 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 800b1c0: 28 61 00 00 lw r1,(r3+0) 800b1c4: fb ff ff d4 calli 800b114 <_POSIX_Thread_Exit> } 800b1c8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800b1cc: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 800b1d0: c3 a0 00 00 ret <== NOT EXECUTED 0800fc5c : * error code - if unsuccessful */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { 800fc5c: b8 20 18 00 mv r3,r1 if ( !routine ) 800fc60: 34 01 00 09 mvi r1,9 800fc64: 44 60 00 05 be r3,r0,800fc78 return RTEMS_INVALID_ADDRESS; _Watchdog_Nanoseconds_since_tick_handler = routine; 800fc68: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED 800fc6c: 38 42 fe 4c ori r2,r2,0xfe4c <== NOT EXECUTED 800fc70: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED 800fc74: 34 01 00 00 mvi r1,0 <== NOT EXECUTED return RTEMS_SUCCESSFUL; } 800fc78: c3 a0 00 00 ret 0803dd98 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 803dd98: 37 9c ff e8 addi sp,sp,-24 803dd9c: 5b 8b 00 14 sw (sp+20),r11 803dda0: 5b 8c 00 10 sw (sp+16),r12 803dda4: 5b 8d 00 0c sw (sp+12),r13 803dda8: 5b 8e 00 08 sw (sp+8),r14 803ddac: 5b 9d 00 04 sw (sp+4),ra 803ddb0: b8 20 70 00 mv r14,r1 803ddb4: 78 01 08 07 mvhi r1,0x807 803ddb8: b8 40 60 00 mv r12,r2 803ddbc: 38 21 1b c0 ori r1,r1,0x1bc0 803ddc0: b9 c0 10 00 mv r2,r14 803ddc4: 37 83 00 18 addi r3,sp,24 803ddc8: fb ff 37 eb calli 800bd74 <_Objects_Get> 803ddcc: b8 20 58 00 mv r11,r1 rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 803ddd0: 2b 81 00 18 lw r1,(sp+24) 803ddd4: 5c 20 00 61 bne r1,r0,803df58 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 803ddd8: 78 03 08 07 mvhi r3,0x807 803dddc: 38 63 11 58 ori r3,r3,0x1158 803dde0: 28 61 00 00 lw r1,(r3+0) 803dde4: 29 62 00 40 lw r2,(r11+64) 803dde8: 44 41 00 04 be r2,r1,803ddf8 _Thread_Enable_dispatch(); 803ddec: fb ff 3a 9a calli 800c854 <_Thread_Enable_dispatch> 803ddf0: 34 0b 00 17 mvi r11,23 return RTEMS_NOT_OWNER_OF_RESOURCE; 803ddf4: e0 00 00 5a bi 803df5c } if ( length == RTEMS_PERIOD_STATUS ) { 803ddf8: 5d 80 00 0d bne r12,r0,803de2c switch ( the_period->state ) { 803ddfc: 29 61 00 38 lw r1,(r11+56) 803de00: 34 02 00 04 mvi r2,4 803de04: 50 41 00 03 bgeu r2,r1,803de10 803de08: b9 80 58 00 mv r11,r12 <== NOT EXECUTED 803de0c: e0 00 00 51 bi 803df50 <== NOT EXECUTED 803de10: 78 0b 08 06 mvhi r11,0x806 803de14: 34 02 00 02 mvi r2,2 803de18: 39 6b a2 40 ori r11,r11,0xa240 803de1c: fb ff 0c c7 calli 8001138 <__ashlsi3> 803de20: b5 61 08 00 add r1,r11,r1 803de24: 28 2b 00 00 lw r11,(r1+0) 803de28: e0 00 00 4a bi 803df50 } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 803de2c: 90 00 68 00 rcsr r13,IE 803de30: 34 01 ff fe mvi r1,-2 803de34: a1 a1 08 00 and r1,r13,r1 803de38: d0 01 00 00 wcsr IE,r1 switch ( the_period->state ) { 803de3c: 29 63 00 38 lw r3,(r11+56) 803de40: 34 01 00 02 mvi r1,2 803de44: 44 61 00 18 be r3,r1,803dea4 803de48: 34 01 00 04 mvi r1,4 803de4c: 44 61 00 35 be r3,r1,803df20 803de50: 5c 60 00 42 bne r3,r0,803df58 case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 803de54: d0 0d 00 00 wcsr IE,r13 /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 803de58: b9 60 08 00 mv r1,r11 803de5c: fb ff ff 31 calli 803db20 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 803de60: 78 03 08 03 mvhi r3,0x803 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 803de64: 34 0d 00 00 mvi r13,0 the_watchdog->routine = routine; 803de68: 38 63 df 7c ori r3,r3,0xdf7c the_period->state = RATE_MONOTONIC_ACTIVE; 803de6c: 34 02 00 02 mvi r2,2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803de70: 78 01 08 07 mvhi r1,0x807 803de74: 59 62 00 38 sw (r11+56),r2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 803de78: 59 63 00 2c sw (r11+44),r3 the_watchdog->id = id; 803de7c: 59 6e 00 30 sw (r11+48),r14 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 803de80: 59 6c 00 1c sw (r11+28),r12 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803de84: 35 62 00 10 addi r2,r11,16 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 803de88: 59 6d 00 18 sw (r11+24),r13 the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 803de8c: 59 6d 00 34 sw (r11+52),r13 _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 803de90: 59 6c 00 3c sw (r11+60),r12 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803de94: 38 21 11 78 ori r1,r1,0x1178 803de98: fb ff 3f 68 calli 800dc38 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 803de9c: b9 a0 58 00 mv r11,r13 803dea0: e0 00 00 2c bi 803df50 case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 803dea4: b9 60 08 00 mv r1,r11 803dea8: fb ff ff 7c calli 803dc98 <_Rate_monotonic_Update_statistics> /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 803deac: 34 01 00 01 mvi r1,1 the_period->next_length = length; 803deb0: 59 6c 00 3c sw (r11+60),r12 /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 803deb4: 59 61 00 38 sw (r11+56),r1 the_period->next_length = length; _ISR_Enable( level ); 803deb8: d0 0d 00 00 wcsr IE,r13 _Thread_Executing->Wait.id = the_period->Object.id; 803debc: 78 01 08 07 mvhi r1,0x807 803dec0: 38 21 11 58 ori r1,r1,0x1158 803dec4: 28 21 00 00 lw r1,(r1+0) 803dec8: 29 63 00 08 lw r3,(r11+8) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 803decc: 34 02 40 00 mvi r2,16384 the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; the_period->next_length = length; _ISR_Enable( level ); _Thread_Executing->Wait.id = the_period->Object.id; 803ded0: 58 23 00 20 sw (r1+32),r3 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 803ded4: fb ff 3d 24 calli 800d364 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 803ded8: 90 00 08 00 rcsr r1,IE 803dedc: 34 02 ff fe mvi r2,-2 803dee0: a0 22 10 00 and r2,r1,r2 803dee4: d0 02 00 00 wcsr IE,r2 local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 803dee8: 34 03 00 02 mvi r3,2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 803deec: 29 62 00 38 lw r2,(r11+56) the_period->state = RATE_MONOTONIC_ACTIVE; 803def0: 59 63 00 38 sw (r11+56),r3 _ISR_Enable( level ); 803def4: d0 01 00 00 wcsr IE,r1 /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) 803def8: 34 01 00 03 mvi r1,3 803defc: 5c 41 00 06 bne r2,r1,803df14 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 803df00: 78 01 08 07 mvhi r1,0x807 803df04: 38 21 11 58 ori r1,r1,0x1158 803df08: 28 21 00 00 lw r1,(r1+0) 803df0c: 34 02 40 00 mvi r2,16384 803df10: fb ff b7 bb calli 802bdfc <_Thread_Clear_state> _Thread_Enable_dispatch(); 803df14: fb ff 3a 50 calli 800c854 <_Thread_Enable_dispatch> 803df18: 34 0b 00 00 mvi r11,0 return RTEMS_SUCCESSFUL; 803df1c: e0 00 00 10 bi 803df5c case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 803df20: b9 60 08 00 mv r1,r11 803df24: fb ff ff 5d calli 803dc98 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 803df28: d0 0d 00 00 wcsr IE,r13 the_period->state = RATE_MONOTONIC_ACTIVE; 803df2c: 34 02 00 02 mvi r2,2 803df30: 78 01 08 07 mvhi r1,0x807 803df34: 59 62 00 38 sw (r11+56),r2 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 803df38: 59 6c 00 1c sw (r11+28),r12 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803df3c: 35 62 00 10 addi r2,r11,16 the_period->next_length = length; 803df40: 59 6c 00 3c sw (r11+60),r12 803df44: 38 21 11 78 ori r1,r1,0x1178 803df48: fb ff 3f 3c calli 800dc38 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 803df4c: 34 0b 00 06 mvi r11,6 803df50: fb ff 3a 41 calli 800c854 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 803df54: e0 00 00 02 bi 803df5c 803df58: 34 0b 00 04 mvi r11,4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 803df5c: b9 60 08 00 mv r1,r11 803df60: 2b 9d 00 04 lw ra,(sp+4) 803df64: 2b 8b 00 14 lw r11,(sp+20) 803df68: 2b 8c 00 10 lw r12,(sp+16) 803df6c: 2b 8d 00 0c lw r13,(sp+12) 803df70: 2b 8e 00 08 lw r14,(sp+8) 803df74: 37 9c 00 18 addi sp,sp,24 803df78: c3 a0 00 00 ret 0800314c : #include int sched_get_priority_min( int policy ) { 800314c: 37 9c ff fc addi sp,sp,-4 8003150: 5b 9d 00 04 sw (sp+4),ra switch ( policy ) { 8003154: 48 01 00 07 bg r0,r1,8003170 8003158: 34 02 00 02 mvi r2,2 800315c: 4c 41 00 03 bge r2,r1,8003168 8003160: 34 02 00 04 mvi r2,4 <== NOT EXECUTED 8003164: 5c 22 00 03 bne r1,r2,8003170 <== NOT EXECUTED 8003168: 34 01 00 01 mvi r1,1 800316c: e0 00 00 05 bi 8003180 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 8003170: f8 00 28 d2 calli 800d4b8 <__errno> 8003174: 34 02 00 16 mvi r2,22 8003178: 58 22 00 00 sw (r1+0),r2 800317c: 34 01 ff ff mvi r1,-1 } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 8003180: 2b 9d 00 04 lw ra,(sp+4) 8003184: 37 9c 00 04 addi sp,sp,4 8003188: c3 a0 00 00 ret 08002598 : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 8002598: 37 9c ff e8 addi sp,sp,-24 800259c: 5b 8b 00 18 sw (sp+24),r11 80025a0: 5b 8c 00 14 sw (sp+20),r12 80025a4: 5b 8d 00 10 sw (sp+16),r13 80025a8: 5b 8e 00 0c sw (sp+12),r14 80025ac: 5b 8f 00 08 sw (sp+8),r15 80025b0: 5b 9d 00 04 sw (sp+4),ra 80025b4: b8 40 60 00 mv r12,r2 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 80025b8: 34 02 00 01 mvi r2,1 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 80025bc: b8 60 68 00 mv r13,r3 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 80025c0: 5c 22 00 0c bne r1,r2,80025f0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 80025c4: 44 60 00 0b be r3,r0,80025f0 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 80025c8: 45 80 00 0d be r12,r0,80025fc /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 80025cc: 29 82 00 00 lw r2,(r12+0) 80025d0: 34 42 ff ff addi r2,r2,-1 80025d4: 50 22 00 02 bgeu r1,r2,80025dc 80025d8: e0 00 00 06 bi 80025f0 <== NOT EXECUTED ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 80025dc: 29 81 00 04 lw r1,(r12+4) 80025e0: 44 20 00 04 be r1,r0,80025f0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 80025e4: 34 21 ff ff addi r1,r1,-1 80025e8: 34 02 00 1f mvi r2,31 80025ec: 50 41 00 04 bgeu r2,r1,80025fc rtems_set_errno_and_return_minus_one( EINVAL ); 80025f0: f8 00 2b 7c calli 800d3e0 <__errno> 80025f4: 34 02 00 16 mvi r2,22 80025f8: e0 00 00 0e bi 8002630 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80025fc: 78 01 08 02 mvhi r1,0x802 8002600: 38 21 28 b4 ori r1,r1,0x28b4 8002604: 28 22 00 00 lw r2,(r1+0) 8002608: 34 42 00 01 addi r2,r2,1 800260c: 58 22 00 00 sw (r1+0),r2 * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void ) { return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ); 8002610: 78 01 08 02 mvhi r1,0x802 8002614: 38 21 2b 74 ori r1,r1,0x2b74 8002618: f8 00 05 8a calli 8003c40 <_Objects_Allocate> 800261c: b8 20 58 00 mv r11,r1 /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 8002620: 5c 20 00 07 bne r1,r0,800263c _Thread_Enable_dispatch(); 8002624: f8 00 08 25 calli 80046b8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 8002628: f8 00 2b 6e calli 800d3e0 <__errno> 800262c: 34 02 00 0b mvi r2,11 8002630: 58 22 00 00 sw (r1+0),r2 8002634: 34 01 ff ff mvi r1,-1 8002638: e0 00 00 26 bi 80026d0 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 800263c: 34 02 00 02 mvi r2,2 ptimer->thread_id = _Thread_Executing->Object.id; 8002640: 78 01 08 02 mvhi r1,0x802 rtems_set_errno_and_return_minus_one( EAGAIN ); } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 8002644: 31 62 00 3c sb (r11+60),r2 ptimer->thread_id = _Thread_Executing->Object.id; 8002648: 38 21 29 70 ori r1,r1,0x2970 800264c: 28 21 00 00 lw r1,(r1+0) 8002650: 28 21 00 08 lw r1,(r1+8) 8002654: 59 61 00 38 sw (r11+56),r1 if ( evp != NULL ) { 8002658: 45 80 00 07 be r12,r0,8002674 ptimer->inf.sigev_notify = evp->sigev_notify; ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; 800265c: 29 81 00 08 lw r1,(r12+8) 8002660: 59 61 00 48 sw (r11+72),r1 ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; 8002664: 29 81 00 00 lw r1,(r12+0) ptimer->inf.sigev_signo = evp->sigev_signo; 8002668: 29 8c 00 04 lw r12,(r12+4) ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; 800266c: 59 61 00 40 sw (r11+64),r1 ptimer->inf.sigev_signo = evp->sigev_signo; 8002670: 59 6c 00 44 sw (r11+68),r12 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8002674: 29 6e 00 08 lw r14,(r11+8) 8002678: 78 01 08 02 mvhi r1,0x802 800267c: 38 21 2b 74 ori r1,r1,0x2b74 ptimer->inf.sigev_value = evp->sigev_value; } ptimer->overrun = 0; 8002680: 34 0c 00 00 mvi r12,0 8002684: 28 2f 00 1c lw r15,(r1+28) 8002688: 34 02 00 02 mvi r2,2 800268c: 59 6c 00 68 sw (r11+104),r12 ptimer->timer_data.it_value.tv_sec = 0; 8002690: 59 6c 00 5c sw (r11+92),r12 ptimer->timer_data.it_value.tv_nsec = 0; 8002694: 59 6c 00 60 sw (r11+96),r12 ptimer->timer_data.it_interval.tv_sec = 0; 8002698: 59 6c 00 54 sw (r11+84),r12 ptimer->timer_data.it_interval.tv_nsec = 0; 800269c: 59 6c 00 58 sw (r11+88),r12 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 80026a0: 59 6c 00 18 sw (r11+24),r12 the_watchdog->routine = routine; 80026a4: 59 6c 00 2c sw (r11+44),r12 the_watchdog->id = id; 80026a8: 59 6c 00 30 sw (r11+48),r12 the_watchdog->user_data = user_data; 80026ac: 59 6c 00 34 sw (r11+52),r12 80026b0: 21 c1 ff ff andi r1,r14,0xffff 80026b4: fb ff f7 c0 calli 80005b4 <__ashlsi3> 80026b8: b5 e1 08 00 add r1,r15,r1 80026bc: 58 2b 00 00 sw (r1+0),r11 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 80026c0: 59 6c 00 0c sw (r11+12),r12 _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 80026c4: 59 ae 00 00 sw (r13+0),r14 _Thread_Enable_dispatch(); 80026c8: f8 00 07 fc calli 80046b8 <_Thread_Enable_dispatch> 80026cc: b9 80 08 00 mv r1,r12 return 0; } 80026d0: 2b 9d 00 04 lw ra,(sp+4) 80026d4: 2b 8b 00 18 lw r11,(sp+24) 80026d8: 2b 8c 00 14 lw r12,(sp+20) 80026dc: 2b 8d 00 10 lw r13,(sp+16) 80026e0: 2b 8e 00 0c lw r14,(sp+12) 80026e4: 2b 8f 00 08 lw r15,(sp+8) 80026e8: 37 9c 00 18 addi sp,sp,24 80026ec: c3 a0 00 00 ret 080026f0 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 80026f0: 37 9c ff cc addi sp,sp,-52 80026f4: 5b 8b 00 18 sw (sp+24),r11 80026f8: 5b 8c 00 14 sw (sp+20),r12 80026fc: 5b 8d 00 10 sw (sp+16),r13 8002700: 5b 8e 00 0c sw (sp+12),r14 8002704: 5b 8f 00 08 sw (sp+8),r15 8002708: 5b 9d 00 04 sw (sp+4),ra 800270c: b8 60 60 00 mv r12,r3 8002710: b8 20 78 00 mv r15,r1 8002714: b8 40 58 00 mv r11,r2 8002718: b8 80 68 00 mv r13,r4 Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 800271c: 44 60 00 59 be r3,r0,8002880 rtems_set_errno_and_return_minus_one( EINVAL ); /* First, it verifies if the structure "value" is correct */ if ( ( value->it_value.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) || 8002720: 28 61 00 0c lw r1,(r3+12) 8002724: 78 03 3b 9a mvhi r3,0x3b9a 8002728: 38 63 c9 ff ori r3,r3,0xc9ff 800272c: 54 23 00 55 bgu r1,r3,8002880 ( value->it_value.tv_nsec < 0 ) || ( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) || 8002730: 29 81 00 04 lw r1,(r12+4) 8002734: 50 61 00 02 bgeu r3,r1,800273c 8002738: e0 00 00 52 bi 8002880 <== NOT EXECUTED ( value->it_interval.tv_nsec < 0 )) { /* The number of nanoseconds is not correct */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 800273c: 7c 42 00 00 cmpnei r2,r2,0 8002740: 7d 61 00 04 cmpnei r1,r11,4 8002744: a0 41 08 00 and r1,r2,r1 8002748: 5c 20 00 4e bne r1,r0,8002880 rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 800274c: 37 81 00 1c addi r1,sp,28 8002750: b9 80 10 00 mv r2,r12 8002754: 34 03 00 10 mvi r3,16 8002758: f8 00 2d e9 calli 800defc /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 800275c: 34 01 00 04 mvi r1,4 8002760: 5d 61 00 0d bne r11,r1,8002794 struct timespec now; _TOD_Get( &now ); 8002764: 37 8b 00 2c addi r11,sp,44 8002768: b9 60 08 00 mv r1,r11 800276c: f8 00 03 83 calli 8003578 <_TOD_Get> /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 8002770: 37 8e 00 24 addi r14,sp,36 8002774: b9 60 08 00 mv r1,r11 8002778: b9 c0 10 00 mv r2,r14 800277c: f8 00 09 c1 calli 8004e80 <_Timespec_Greater_than> 8002780: 5c 20 00 40 bne r1,r0,8002880 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 8002784: b9 c0 10 00 mv r2,r14 8002788: b9 60 08 00 mv r1,r11 800278c: b9 c0 18 00 mv r3,r14 8002790: f8 00 09 c8 calli 8004eb0 <_Timespec_Subtract> RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 8002794: 78 01 08 02 mvhi r1,0x802 8002798: b9 e0 10 00 mv r2,r15 800279c: 38 21 2b 74 ori r1,r1,0x2b74 80027a0: 37 83 00 34 addi r3,sp,52 80027a4: f8 00 06 4f calli 80040e0 <_Objects_Get> * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 80027a8: 2b 82 00 34 lw r2,(sp+52) 80027ac: b8 20 58 00 mv r11,r1 80027b0: 5c 40 00 34 bne r2,r0,8002880 case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { 80027b4: 2b 81 00 24 lw r1,(sp+36) 80027b8: 5c 22 00 11 bne r1,r2,80027fc 80027bc: 2b 8e 00 28 lw r14,(sp+40) 80027c0: 5d c1 00 0f bne r14,r1,80027fc /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 80027c4: 35 61 00 10 addi r1,r11,16 80027c8: f8 00 0b 1f calli 8005444 <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) 80027cc: 45 ae 00 05 be r13,r14,80027e0 *ovalue = ptimer->timer_data; 80027d0: b9 a0 08 00 mv r1,r13 80027d4: 35 62 00 54 addi r2,r11,84 80027d8: 34 03 00 10 mvi r3,16 80027dc: f8 00 2d c8 calli 800defc /* The new data are set */ ptimer->timer_data = normalize; 80027e0: 37 82 00 1c addi r2,sp,28 80027e4: 34 03 00 10 mvi r3,16 80027e8: 35 61 00 54 addi r1,r11,84 80027ec: f8 00 2d c4 calli 800defc /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 80027f0: 34 01 00 04 mvi r1,4 80027f4: 31 61 00 3c sb (r11+60),r1 80027f8: e0 00 00 1f bi 8002874 _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 80027fc: b9 80 08 00 mv r1,r12 8002800: f8 00 09 ba calli 8004ee8 <_Timespec_To_ticks> 8002804: 59 61 00 64 sw (r11+100),r1 initial_period = _Timespec_To_ticks( &normalize.it_value ); 8002808: 37 81 00 24 addi r1,sp,36 800280c: f8 00 09 b7 calli 8004ee8 <_Timespec_To_ticks> activated = _POSIX_Timer_Insert_helper( 8002810: 29 63 00 08 lw r3,(r11+8) 8002814: 78 04 08 00 mvhi r4,0x800 8002818: b8 20 10 00 mv r2,r1 800281c: 38 84 28 b0 ori r4,r4,0x28b0 8002820: 35 61 00 10 addi r1,r11,16 8002824: b9 60 28 00 mv r5,r11 8002828: f8 00 15 ae calli 8007ee0 <_POSIX_Timer_Insert_helper> 800282c: b8 20 60 00 mv r12,r1 initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 8002830: 5c 20 00 04 bne r1,r0,8002840 _Thread_Enable_dispatch(); 8002834: f8 00 07 a1 calli 80046b8 <_Thread_Enable_dispatch> 8002838: b9 80 08 00 mv r1,r12 return 0; 800283c: e0 00 00 15 bi 8002890 /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 8002840: 45 a0 00 05 be r13,r0,8002854 *ovalue = ptimer->timer_data; 8002844: b9 a0 08 00 mv r1,r13 8002848: 35 62 00 54 addi r2,r11,84 800284c: 34 03 00 10 mvi r3,16 8002850: f8 00 2d ab calli 800defc ptimer->timer_data = normalize; 8002854: 37 82 00 1c addi r2,sp,28 8002858: 34 03 00 10 mvi r3,16 800285c: 35 61 00 54 addi r1,r11,84 8002860: f8 00 2d a7 calli 800defc /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 8002864: 34 01 00 03 mvi r1,3 8002868: 31 61 00 3c sb (r11+60),r1 _TOD_Get( &ptimer->time ); 800286c: 35 61 00 6c addi r1,r11,108 8002870: f8 00 03 42 calli 8003578 <_TOD_Get> _Thread_Enable_dispatch(); 8002874: f8 00 07 91 calli 80046b8 <_Thread_Enable_dispatch> 8002878: 34 01 00 00 mvi r1,0 return 0; 800287c: e0 00 00 05 bi 8002890 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 8002880: f8 00 2a d8 calli 800d3e0 <__errno> 8002884: 34 02 00 16 mvi r2,22 8002888: 58 22 00 00 sw (r1+0),r2 800288c: 34 01 ff ff mvi r1,-1 } 8002890: 2b 9d 00 04 lw ra,(sp+4) 8002894: 2b 8b 00 18 lw r11,(sp+24) 8002898: 2b 8c 00 14 lw r12,(sp+20) 800289c: 2b 8d 00 10 lw r13,(sp+16) 80028a0: 2b 8e 00 0c lw r14,(sp+12) 80028a4: 2b 8f 00 08 lw r15,(sp+8) 80028a8: 37 9c 00 34 addi sp,sp,52 80028ac: c3 a0 00 00 ret 08008090 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 8008090: 37 9c ff ec addi sp,sp,-20 8008094: 5b 8b 00 0c sw (sp+12),r11 8008098: 5b 8c 00 08 sw (sp+8),r12 800809c: 5b 9d 00 04 sw (sp+4),ra /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 80080a0: 78 0b 08 01 mvhi r11,0x801 80080a4: 39 6b e1 00 ori r11,r11,0xe100 80080a8: 29 62 00 1c lw r2,(r11+28) useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 80080ac: b8 20 60 00 mv r12,r1 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 80080b0: 5c 40 00 09 bne r2,r0,80080d4 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 80080b4: 78 01 08 00 mvhi r1,0x800 80080b8: 38 21 81 a8 ori r1,r1,0x81a8 80080bc: 59 61 00 1c sw (r11+28),r1 the_watchdog->id = id; the_watchdog->user_data = user_data; 80080c0: 59 62 00 24 sw (r11+36),r2 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 80080c4: 59 62 00 08 sw (r11+8),r2 the_watchdog->routine = routine; the_watchdog->id = id; 80080c8: 59 62 00 20 sw (r11+32),r2 the_watchdog->user_data = user_data; 80080cc: b8 40 58 00 mv r11,r2 80080d0: e0 00 00 18 bi 8008130 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 80080d4: b9 60 08 00 mv r1,r11 80080d8: fb ff f5 bd calli 80057cc <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 80080dc: 34 21 ff fe addi r1,r1,-2 80080e0: 34 02 00 01 mvi r2,1 80080e4: 50 41 00 03 bgeu r2,r1,80080f0 80080e8: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED 80080ec: e0 00 00 11 bi 8008130 <== NOT EXECUTED * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 80080f0: 29 64 00 14 lw r4,(r11+20) 80080f4: 29 61 00 0c lw r1,(r11+12) /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 80080f8: 29 63 00 18 lw r3,(r11+24) 80080fc: 37 82 00 10 addi r2,sp,16 * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 8008100: b4 81 08 00 add r1,r4,r1 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 8008104: c8 23 08 00 sub r1,r1,r3 8008108: f8 00 06 ac calli 8009bb8 <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 800810c: 2b 81 00 10 lw r1,(sp+16) 8008110: 78 02 00 0f mvhi r2,0xf 8008114: 38 42 42 40 ori r2,r2,0x4240 8008118: f8 00 49 77 calli 801a6f4 <__mulsi3> 800811c: b8 20 58 00 mv r11,r1 remaining += tp.tv_nsec / 1000; 8008120: 2b 81 00 14 lw r1,(sp+20) 8008124: 34 02 03 e8 mvi r2,1000 8008128: f8 00 49 93 calli 801a774 <__divsi3> 800812c: b4 2b 58 00 add r11,r1,r11 /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 8008130: 45 80 00 18 be r12,r0,8008190 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 8008134: 78 02 00 0f mvhi r2,0xf 8008138: 38 42 42 40 ori r2,r2,0x4240 800813c: b9 80 08 00 mv r1,r12 8008140: f8 00 49 ec calli 801a8f0 <__udivsi3> tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 8008144: 78 02 00 0f mvhi r2,0xf * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 8008148: 5b 81 00 10 sw (sp+16),r1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 800814c: 38 42 42 40 ori r2,r2,0x4240 8008150: b9 80 08 00 mv r1,r12 8008154: f8 00 49 f7 calli 801a930 <__umodsi3> 8008158: 34 02 03 e8 mvi r2,1000 800815c: f8 00 49 66 calli 801a6f4 <__mulsi3> ticks = _Timespec_To_ticks( &tp ); 8008160: 37 8c 00 10 addi r12,sp,16 */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 8008164: 5b 81 00 14 sw (sp+20),r1 ticks = _Timespec_To_ticks( &tp ); 8008168: b9 80 08 00 mv r1,r12 800816c: f8 00 06 ad calli 8009c20 <_Timespec_To_ticks> if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 8008170: b9 80 08 00 mv r1,r12 8008174: f8 00 06 ab calli 8009c20 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8008178: 78 02 08 01 mvhi r2,0x801 800817c: 38 42 e1 00 ori r2,r2,0xe100 8008180: 58 41 00 0c sw (r2+12),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8008184: 78 01 08 01 mvhi r1,0x801 8008188: 38 21 d9 80 ori r1,r1,0xd980 800818c: fb ff f5 31 calli 8005650 <_Watchdog_Insert> } return remaining; } 8008190: b9 60 08 00 mv r1,r11 8008194: 2b 9d 00 04 lw ra,(sp+4) 8008198: 2b 8b 00 0c lw r11,(sp+12) 800819c: 2b 8c 00 08 lw r12,(sp+8) 80081a0: 37 9c 00 14 addi sp,sp,20 80081a4: c3 a0 00 00 ret