08014994 <_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 ) { 8014994: 37 9c ff e4 addi sp,sp,-28 8014998: 5b 8b 00 1c sw (sp+28),r11 801499c: 5b 8c 00 18 sw (sp+24),r12 80149a0: 5b 8d 00 14 sw (sp+20),r13 80149a4: 5b 8e 00 10 sw (sp+16),r14 80149a8: 5b 8f 00 0c sw (sp+12),r15 80149ac: 5b 90 00 08 sw (sp+8),r16 80149b0: 5b 9d 00 04 sw (sp+4),ra 80149b4: 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 ) { 80149b8: 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 ) { 80149bc: b8 60 70 00 mv r14,r3 80149c0: b8 40 80 00 mv r16,r2 80149c4: 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 ) { 80149c8: 50 23 00 03 bgeu r1,r3,80149d4 <_CORE_message_queue_Broadcast+0x40> 80149cc: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 80149d0: e0 00 00 13 bi 8014a1c <_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 ) { 80149d4: 29 63 00 48 lw r3,(r11+72) 80149d8: 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))) { 80149dc: 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 ) { 80149e0: 44 61 00 08 be r3,r1,8014a00 <_CORE_message_queue_Broadcast+0x6c> *count = 0; 80149e4: 58 c1 00 00 sw (r6+0),r1 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 80149e8: e0 00 00 0d bi 8014a1c <_CORE_message_queue_Broadcast+0x88> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 80149ec: 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; 80149f0: 35 ad 00 01 addi r13,r13,1 80149f4: f8 00 26 9f calli 801e470 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 80149f8: 29 81 00 28 lw r1,(r12+40) 80149fc: 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))) { 8014a00: b9 60 08 00 mv r1,r11 8014a04: f8 00 0b d3 calli 8017950 <_Thread_queue_Dequeue> 8014a08: b8 20 60 00 mv r12,r1 8014a0c: ba 00 10 00 mv r2,r16 8014a10: 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 = 8014a14: 5c 20 ff f6 bne r1,r0,80149ec <_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; 8014a18: 59 ed 00 00 sw (r15+0),r13 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 8014a1c: 2b 9d 00 04 lw ra,(sp+4) 8014a20: 2b 8b 00 1c lw r11,(sp+28) 8014a24: 2b 8c 00 18 lw r12,(sp+24) 8014a28: 2b 8d 00 14 lw r13,(sp+20) 8014a2c: 2b 8e 00 10 lw r14,(sp+16) 8014a30: 2b 8f 00 0c lw r15,(sp+12) 8014a34: 2b 90 00 08 lw r16,(sp+8) 8014a38: 37 9c 00 1c addi sp,sp,28 8014a3c: c3 a0 00 00 ret 08008104 <_CORE_mutex_Seize_interrupt_trylock>: #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { 8008104: 37 9c ff fc addi sp,sp,-4 8008108: 5b 9d 00 04 sw (sp+4),ra { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 800810c: 78 03 08 01 mvhi r3,0x801 8008110: 38 63 c8 e0 ori r3,r3,0xc8e0 8008114: 28 63 00 00 lw r3,(r3+0) executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 8008118: 34 04 00 00 mvi r4,0 800811c: 58 64 00 34 sw (r3+52),r4 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 8008120: 28 25 00 50 lw r5,(r1+80) 8008124: 44 a4 00 34 be r5,r4,80081f4 <_CORE_mutex_Seize_interrupt_trylock+0xf0> the_mutex->lock = CORE_MUTEX_LOCKED; 8008128: 58 24 00 50 sw (r1+80),r4 the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 800812c: 28 65 00 08 lw r5,(r3+8) */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 8008130: 28 24 00 48 lw r4,(r1+72) executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; 8008134: 58 23 00 5c sw (r1+92),r3 the_mutex->holder_id = executing->Object.id; 8008138: 58 25 00 60 sw (r1+96),r5 the_mutex->nest_count = 1; 800813c: 34 05 00 01 mvi r5,1 8008140: 58 25 00 54 sw (r1+84),r5 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 8008144: 34 05 00 02 mvi r5,2 8008148: 44 85 00 03 be r4,r5,8008154 <_CORE_mutex_Seize_interrupt_trylock+0x50> 800814c: 34 05 00 03 mvi r5,3 8008150: 5c 85 00 06 bne r4,r5,8008168 <_CORE_mutex_Seize_interrupt_trylock+0x64> _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 8008154: 28 65 00 1c lw r5,(r3+28) 8008158: 34 a5 00 01 addi r5,r5,1 800815c: 58 65 00 1c sw (r3+28),r5 } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 8008160: 34 05 00 03 mvi r5,3 8008164: 44 85 00 04 be r4,r5,8008174 <_CORE_mutex_Seize_interrupt_trylock+0x70> _ISR_Enable( *level_p ); 8008168: 28 41 00 00 lw r1,(r2+0) 800816c: d0 01 00 00 wcsr IE,r1 8008170: e0 00 00 2d bi 8008224 <_CORE_mutex_Seize_interrupt_trylock+0x120> */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 8008174: 28 25 00 4c lw r5,(r1+76) current = executing->current_priority; 8008178: 28 64 00 14 lw r4,(r3+20) if ( current == ceiling ) { 800817c: 5c 85 00 04 bne r4,r5,800818c <_CORE_mutex_Seize_interrupt_trylock+0x88> _ISR_Enable( *level_p ); 8008180: 28 41 00 00 lw r1,(r2+0) 8008184: d0 01 00 00 wcsr IE,r1 8008188: e0 00 00 27 bi 8008224 <_CORE_mutex_Seize_interrupt_trylock+0x120> return 0; } if ( current > ceiling ) { 800818c: 50 a4 00 0e bgeu r5,r4,80081c4 <_CORE_mutex_Seize_interrupt_trylock+0xc0> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8008190: 78 03 08 01 mvhi r3,0x801 8008194: 38 63 c8 24 ori r3,r3,0xc824 8008198: 28 64 00 00 lw r4,(r3+0) 800819c: 34 84 00 01 addi r4,r4,1 80081a0: 58 64 00 00 sw (r3+0),r4 _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 80081a4: 28 42 00 00 lw r2,(r2+0) 80081a8: d0 02 00 00 wcsr IE,r2 _Thread_Change_priority( 80081ac: 28 22 00 4c lw r2,(r1+76) 80081b0: 28 21 00 5c lw r1,(r1+92) 80081b4: 34 03 00 00 mvi r3,0 80081b8: fb ff ee b6 calli 8003c90 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 80081bc: fb ff f0 26 calli 8004254 <_Thread_Enable_dispatch> 80081c0: e0 00 00 19 bi 8008224 <_CORE_mutex_Seize_interrupt_trylock+0x120> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 80081c4: 34 04 00 06 mvi r4,6 80081c8: 58 64 00 34 sw (r3+52),r4 the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */ 80081cc: 34 04 00 00 mvi r4,0 80081d0: 58 24 00 54 sw (r1+84),r4 _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; the_mutex->lock = CORE_MUTEX_UNLOCKED; 80081d4: 34 04 00 01 mvi r4,1 80081d8: 58 24 00 50 sw (r1+80),r4 the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ 80081dc: 28 61 00 1c lw r1,(r3+28) 80081e0: 34 21 ff ff addi r1,r1,-1 80081e4: 58 61 00 1c sw (r3+28),r1 _ISR_Enable( *level_p ); 80081e8: 28 41 00 00 lw r1,(r2+0) 80081ec: d0 01 00 00 wcsr IE,r1 80081f0: e0 00 00 0d bi 8008224 <_CORE_mutex_Seize_interrupt_trylock+0x120> /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 80081f4: 28 24 00 5c lw r4,(r1+92) 80081f8: 5c 83 00 12 bne r4,r3,8008240 <_CORE_mutex_Seize_interrupt_trylock+0x13c> switch ( the_mutex->Attributes.lock_nesting_behavior ) { 80081fc: 28 23 00 40 lw r3,(r1+64) 8008200: 44 60 00 04 be r3,r0,8008210 <_CORE_mutex_Seize_interrupt_trylock+0x10c> 8008204: 34 01 00 01 mvi r1,1 8008208: 5c 61 00 0e bne r3,r1,8008240 <_CORE_mutex_Seize_interrupt_trylock+0x13c> 800820c: e0 00 00 08 bi 800822c <_CORE_mutex_Seize_interrupt_trylock+0x128> <== NOT EXECUTED case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 8008210: 28 23 00 54 lw r3,(r1+84) 8008214: 34 63 00 01 addi r3,r3,1 8008218: 58 23 00 54 sw (r1+84),r3 _ISR_Enable( *level_p ); 800821c: 28 41 00 00 lw r1,(r2+0) 8008220: d0 01 00 00 wcsr IE,r1 8008224: 34 01 00 00 mvi r1,0 8008228: e0 00 00 07 bi 8008244 <_CORE_mutex_Seize_interrupt_trylock+0x140> return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 800822c: 34 01 00 02 mvi r1,2 <== NOT EXECUTED 8008230: 58 81 00 34 sw (r4+52),r1 <== NOT EXECUTED _ISR_Enable( *level_p ); 8008234: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8008238: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED 800823c: e3 ff ff fa bi 8008224 <_CORE_mutex_Seize_interrupt_trylock+0x120> <== NOT EXECUTED 8008240: 34 01 00 01 mvi r1,1 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 8008244: 2b 9d 00 04 lw ra,(sp+4) 8008248: 37 9c 00 04 addi sp,sp,4 800824c: c3 a0 00 00 ret 08008268 <_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 ) { 8008268: 37 9c ff f8 addi sp,sp,-8 800826c: 5b 8b 00 08 sw (sp+8),r11 8008270: 5b 9d 00 04 sw (sp+4),ra 8008274: 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)) ) { 8008278: fb ff f1 06 calli 8004690 <_Thread_queue_Dequeue> 800827c: 34 02 00 00 mvi r2,0 8008280: 5c 22 00 0e bne r1,r2,80082b8 <_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 ); 8008284: 90 00 08 00 rcsr r1,IE 8008288: 34 02 ff fe mvi r2,-2 800828c: a0 22 10 00 and r2,r1,r2 8008290: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8008294: 29 62 00 48 lw r2,(r11+72) 8008298: 29 63 00 40 lw r3,(r11+64) 800829c: 54 62 00 03 bgu r3,r2,80082a8 <_CORE_semaphore_Surrender+0x40> 80082a0: 34 02 00 04 mvi r2,4 <== NOT EXECUTED 80082a4: e0 00 00 04 bi 80082b4 <_CORE_semaphore_Surrender+0x4c> <== NOT EXECUTED the_semaphore->count += 1; 80082a8: 34 42 00 01 addi r2,r2,1 80082ac: 59 62 00 48 sw (r11+72),r2 80082b0: 34 02 00 00 mvi r2,0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 80082b4: d0 01 00 00 wcsr IE,r1 } return status; } 80082b8: b8 40 08 00 mv r1,r2 80082bc: 2b 9d 00 04 lw ra,(sp+4) 80082c0: 2b 8b 00 08 lw r11,(sp+8) 80082c4: 37 9c 00 08 addi sp,sp,8 80082c8: c3 a0 00 00 ret 0800d988 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 800d988: 37 9c ff f8 addi sp,sp,-8 800d98c: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 800d990: 37 82 00 08 addi r2,sp,8 800d994: fb ff e3 6f calli 8006750 <_Thread_Get> switch ( location ) { 800d998: 2b 82 00 08 lw r2,(sp+8) 800d99c: 5c 40 00 1d bne r2,r0,800da10 <_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 ); 800d9a0: 90 00 18 00 rcsr r3,IE 800d9a4: 34 02 ff fe mvi r2,-2 800d9a8: a0 62 10 00 and r2,r3,r2 800d9ac: d0 02 00 00 wcsr IE,r2 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800d9b0: 78 02 08 02 mvhi r2,0x802 800d9b4: 38 42 39 70 ori r2,r2,0x3970 800d9b8: 28 42 00 00 lw r2,(r2+0) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800d9bc: 34 04 00 00 mvi r4,0 800d9c0: 58 24 00 24 sw (r1+36),r4 if ( _Thread_Is_executing( the_thread ) ) { 800d9c4: 5c 22 00 08 bne r1,r2,800d9e4 <_Event_Timeout+0x5c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800d9c8: 78 02 08 02 mvhi r2,0x802 800d9cc: 38 42 3b b0 ori r2,r2,0x3bb0 800d9d0: 28 45 00 00 lw r5,(r2+0) 800d9d4: 34 04 00 01 mvi r4,1 800d9d8: 5c a4 00 03 bne r5,r4,800d9e4 <_Event_Timeout+0x5c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800d9dc: 34 04 00 02 mvi r4,2 <== NOT EXECUTED 800d9e0: 58 44 00 00 sw (r2+0),r4 <== NOT EXECUTED } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800d9e4: 34 02 00 06 mvi r2,6 800d9e8: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800d9ec: d0 03 00 00 wcsr IE,r3 800d9f0: 78 02 10 03 mvhi r2,0x1003 800d9f4: 38 42 ff f8 ori r2,r2,0xfff8 800d9f8: f8 00 05 3d calli 800eeec <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800d9fc: 78 01 08 02 mvhi r1,0x802 800da00: 38 21 38 b4 ori r1,r1,0x38b4 800da04: 28 22 00 00 lw r2,(r1+0) 800da08: 34 42 ff ff addi r2,r2,-1 800da0c: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800da10: 2b 9d 00 04 lw ra,(sp+4) 800da14: 37 9c 00 08 addi sp,sp,8 800da18: c3 a0 00 00 ret 0800e320 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800e320: 37 9c ff e8 addi sp,sp,-24 800e324: 5b 8b 00 18 sw (sp+24),r11 800e328: 5b 8c 00 14 sw (sp+20),r12 800e32c: 5b 8d 00 10 sw (sp+16),r13 800e330: 5b 8e 00 0c sw (sp+12),r14 800e334: 5b 8f 00 08 sw (sp+8),r15 800e338: 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; 800e33c: 28 2d 00 18 lw r13,(r1+24) uintptr_t const heap_area_end = heap->area_end; 800e340: 28 25 00 1c lw r5,(r1+28) Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800e344: 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; 800e348: 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 ) { 800e34c: f4 a2 08 00 cmpgu r1,r5,r2 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800e350: 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; 800e354: 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; 800e358: 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; 800e35c: 34 01 00 01 mvi r1,1 800e360: 5d a0 00 26 bne r13,r0,800e3f8 <_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 ) { 800e364: 34 01 00 02 mvi r1,2 800e368: 5c 45 00 24 bne r2,r5,800e3f8 <_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; 800e36c: 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 800e370: 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); 800e374: 29 62 00 10 lw r2,(r11+16) 800e378: 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; 800e37c: 59 63 00 1c sw (r11+28),r3 800e380: b9 c0 08 00 mv r1,r14 800e384: fb ff d7 ed calli 8004338 <__umodsi3> 800e388: 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; 800e38c: 59 e1 00 00 sw (r15+0),r1 if( extend_size >= heap->min_block_size ) { 800e390: 29 62 00 14 lw r2,(r11+20) 800e394: 50 22 00 02 bgeu r1,r2,800e39c <_Heap_Extend+0x7c> 800e398: e0 00 00 17 bi 800e3f4 <_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; 800e39c: 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 = 800e3a0: 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); 800e3a4: 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; 800e3a8: 20 84 00 01 andi r4,r4,0x1 800e3ac: b8 24 20 00 or r4,r1,r4 800e3b0: c8 62 18 00 sub r3,r3,r2 800e3b4: 59 84 00 04 sw (r12+4),r4 800e3b8: 38 63 00 01 ori r3,r3,0x1 800e3bc: 58 43 00 04 sw (r2+4),r3 | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 800e3c0: 29 65 00 2c lw r5,(r11+44) ++stats->used_blocks; 800e3c4: 29 64 00 40 lw r4,(r11+64) --stats->frees; /* Do not count subsequent call as actual free() */ 800e3c8: 29 63 00 50 lw r3,(r11+80) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 800e3cc: b4 a1 08 00 add r1,r5,r1 ++stats->used_blocks; 800e3d0: 34 84 00 01 addi r4,r4,1 --stats->frees; /* Do not count subsequent call as actual free() */ 800e3d4: 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; 800e3d8: 59 62 00 24 sw (r11+36),r2 /* Statistics */ stats->size += extend_size; 800e3dc: 59 61 00 2c sw (r11+44),r1 ++stats->used_blocks; 800e3e0: 59 64 00 40 sw (r11+64),r4 --stats->frees; /* Do not count subsequent call as actual free() */ 800e3e4: 59 63 00 50 sw (r11+80),r3 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 800e3e8: b9 60 08 00 mv r1,r11 800e3ec: 35 82 00 08 addi r2,r12,8 800e3f0: fb ff e7 af calli 80082ac <_Heap_Free> 800e3f4: b9 a0 08 00 mv r1,r13 } return HEAP_EXTEND_SUCCESSFUL; } 800e3f8: 2b 9d 00 04 lw ra,(sp+4) 800e3fc: 2b 8b 00 18 lw r11,(sp+24) 800e400: 2b 8c 00 14 lw r12,(sp+20) 800e404: 2b 8d 00 10 lw r13,(sp+16) 800e408: 2b 8e 00 0c lw r14,(sp+12) 800e40c: 2b 8f 00 08 lw r15,(sp+8) 800e410: 37 9c 00 18 addi sp,sp,24 800e414: c3 a0 00 00 ret 08008614 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 8008614: 37 9c ff f4 addi sp,sp,-12 8008618: 5b 8b 00 0c sw (sp+12),r11 800861c: 5b 8c 00 08 sw (sp+8),r12 8008620: 5b 9d 00 04 sw (sp+4),ra 8008624: 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 ) 8008628: 28 22 00 10 lw r2,(r1+16) 800862c: b8 20 58 00 mv r11,r1 8008630: b8 60 08 00 mv r1,r3 8008634: 34 6c ff f8 addi r12,r3,-8 8008638: f8 00 42 a5 calli 80190cc <__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; 800863c: 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 ) 8008640: 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 8008644: 50 26 00 03 bgeu r1,r6,8008650 <_Heap_Free+0x3c> 8008648: 34 02 00 00 mvi r2,0 800864c: e0 00 00 03 bi 8008658 <_Heap_Free+0x44> 8008650: 29 62 00 24 lw r2,(r11+36) 8008654: 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 ) ) { 8008658: 44 40 00 66 be r2,r0,80087f0 <_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; 800865c: 28 25 00 04 lw r5,(r1+4) 8008660: 34 02 ff fe mvi r2,-2 8008664: 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); 8008668: 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 800866c: 50 66 00 03 bgeu r3,r6,8008678 <_Heap_Free+0x64> 8008670: 34 04 00 00 mvi r4,0 <== NOT EXECUTED 8008674: e0 00 00 03 bi 8008680 <_Heap_Free+0x6c> <== NOT EXECUTED 8008678: 29 64 00 24 lw r4,(r11+36) 800867c: 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 ) ) { 8008680: 44 80 00 5c be r4,r0,80087f0 <_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; 8008684: 28 64 00 04 lw r4,(r3+4) _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 8008688: 20 87 00 01 andi r7,r4,0x1 800868c: 44 e0 00 59 be r7,r0,80087f0 <_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 )); 8008690: 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; 8008694: 34 07 ff fe mvi r7,-2 8008698: 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 800869c: 34 07 00 00 mvi r7,0 80086a0: 45 03 00 05 be r8,r3,80086b4 <_Heap_Free+0xa0> 80086a4: b4 64 38 00 add r7,r3,r4 80086a8: 28 e7 00 04 lw r7,(r7+4) 80086ac: 20 e7 00 01 andi r7,r7,0x1 80086b0: 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 ) ) { 80086b4: 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 80086b8: 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 ) ) { 80086bc: 5c a0 00 23 bne r5,r0,8008748 <_Heap_Free+0x134> uintptr_t const prev_size = block->prev_size; 80086c0: 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); 80086c4: 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 80086c8: f0 26 30 00 cmpgeu r6,r1,r6 80086cc: f1 01 40 00 cmpgeu r8,r8,r1 80086d0: 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 ) ) { 80086d4: a1 06 40 00 and r8,r8,r6 80086d8: 45 00 00 46 be r8,r0,80087f0 <_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) ) { 80086dc: 28 26 00 04 lw r6,(r1+4) 80086e0: 20 c6 00 01 andi r6,r6,0x1 80086e4: 44 c0 00 43 be r6,r0,80087f0 <_Heap_Free+0x1dc> _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 80086e8: 44 e0 00 0f be r7,r0,8008724 <_Heap_Free+0x110> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 80086ec: 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; 80086f0: 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; 80086f4: 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; 80086f8: b4 44 20 00 add r4,r2,r4 80086fc: b4 85 28 00 add r5,r4,r5 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 8008700: 35 03 ff ff addi r3,r8,-1 8008704: 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; 8008708: 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; 800870c: 38 a3 00 01 ori r3,r5,0x1 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 8008710: 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; 8008714: 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; 8008718: 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; 800871c: 58 c7 00 08 sw (r6+8),r7 8008720: e0 00 00 29 bi 80087c4 <_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; 8008724: b4 45 28 00 add r5,r2,r5 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8008728: 38 a4 00 01 ori r4,r5,0x1 800872c: 58 24 00 04 sw (r1+4),r4 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8008730: 28 64 00 04 lw r4,(r3+4) 8008734: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 8008738: 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; 800873c: a0 81 08 00 and r1,r4,r1 8008740: 58 61 00 04 sw (r3+4),r1 8008744: e0 00 00 20 bi 80087c4 <_Heap_Free+0x1b0> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 8008748: 44 e0 00 0d be r7,r0,800877c <_Heap_Free+0x168> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 800874c: 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; 8008750: 28 66 00 08 lw r6,(r3+8) uintptr_t const size = block_size + next_block_size; 8008754: b4 82 18 00 add r3,r4,r2 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; 8008758: 58 25 00 0c sw (r1+12),r5 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 800875c: 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; 8008760: 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; 8008764: 38 64 00 01 ori r4,r3,0x1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 8008768: 58 e3 00 00 sw (r7+0),r3 new_block->prev = prev; next->prev = new_block; 800876c: 58 c1 00 0c sw (r6+12),r1 prev->next = new_block; 8008770: 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; 8008774: 58 24 00 04 sw (r1+4),r4 8008778: e0 00 00 13 bi 80087c4 <_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; 800877c: 38 44 00 01 ori r4,r2,0x1 8008780: 58 24 00 04 sw (r1+4),r4 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8008784: 28 65 00 04 lw r5,(r3+4) 8008788: 34 04 ff fe mvi r4,-2 next_block->prev_size = block_size; 800878c: 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; 8008790: a0 a4 20 00 and r4,r5,r4 8008794: 58 64 00 04 sw (r3+4),r4 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 8008798: 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; 800879c: 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; 80087a0: 29 65 00 3c lw r5,(r11+60) new_block->next = next; new_block->prev = block_before; 80087a4: 58 2b 00 0c sw (r1+12),r11 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 80087a8: 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; 80087ac: 34 63 00 01 addi r3,r3,1 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 80087b0: 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; 80087b4: 59 61 00 08 sw (r11+8),r1 80087b8: 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; 80087bc: 50 a3 00 02 bgeu r5,r3,80087c4 <_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; 80087c0: 59 63 00 3c sw (r11+60),r3 } } /* Statistics */ --stats->used_blocks; 80087c4: 29 63 00 40 lw r3,(r11+64) ++stats->frees; 80087c8: 29 61 00 50 lw r1,(r11+80) stats->free_size += block_size; 80087cc: 29 64 00 30 lw r4,(r11+48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 80087d0: 34 63 ff ff addi r3,r3,-1 ++stats->frees; 80087d4: 34 21 00 01 addi r1,r1,1 stats->free_size += block_size; 80087d8: b4 82 10 00 add r2,r4,r2 } } /* Statistics */ --stats->used_blocks; ++stats->frees; 80087dc: 59 61 00 50 sw (r11+80),r1 stats->free_size += block_size; 80087e0: 59 62 00 30 sw (r11+48),r2 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 80087e4: 59 63 00 40 sw (r11+64),r3 ++stats->frees; stats->free_size += block_size; 80087e8: 34 01 00 01 mvi r1,1 return( true ); 80087ec: e0 00 00 02 bi 80087f4 <_Heap_Free+0x1e0> 80087f0: 34 01 00 00 mvi r1,0 } 80087f4: 2b 9d 00 04 lw ra,(sp+4) 80087f8: 2b 8b 00 0c lw r11,(sp+12) 80087fc: 2b 8c 00 08 lw r12,(sp+8) 8008800: 37 9c 00 0c addi sp,sp,12 8008804: c3 a0 00 00 ret 08019c68 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 8019c68: 37 9c ff f0 addi sp,sp,-16 8019c6c: 5b 8b 00 10 sw (sp+16),r11 8019c70: 5b 8c 00 0c sw (sp+12),r12 8019c74: 5b 8d 00 08 sw (sp+8),r13 8019c78: 5b 9d 00 04 sw (sp+4),ra 8019c7c: 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 ) 8019c80: 28 22 00 10 lw r2,(r1+16) 8019c84: b8 20 58 00 mv r11,r1 8019c88: b9 80 08 00 mv r1,r12 8019c8c: b8 60 68 00 mv r13,r3 8019c90: fb ff fd 0f calli 80190cc <__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; 8019c94: 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 ) 8019c98: 35 84 ff f8 addi r4,r12,-8 8019c9c: 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 8019ca0: 50 82 00 03 bgeu r4,r2,8019cac <_Heap_Size_of_alloc_area+0x44> 8019ca4: 34 01 00 00 mvi r1,0 8019ca8: e0 00 00 03 bi 8019cb4 <_Heap_Size_of_alloc_area+0x4c> 8019cac: 29 61 00 24 lw r1,(r11+36) 8019cb0: 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 ) ) { 8019cb4: 44 20 00 13 be r1,r0,8019d00 <_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); 8019cb8: 28 83 00 04 lw r3,(r4+4) 8019cbc: 34 01 ff fe mvi r1,-2 8019cc0: a0 61 08 00 and r1,r3,r1 8019cc4: 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 8019cc8: 50 82 00 03 bgeu r4,r2,8019cd4 <_Heap_Size_of_alloc_area+0x6c> 8019ccc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8019cd0: e0 00 00 03 bi 8019cdc <_Heap_Size_of_alloc_area+0x74> <== NOT EXECUTED 8019cd4: 29 61 00 24 lw r1,(r11+36) 8019cd8: f0 24 08 00 cmpgeu r1,r1,r4 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 8019cdc: 44 20 00 09 be r1,r0,8019d00 <_Heap_Size_of_alloc_area+0x98> 8019ce0: 28 81 00 04 lw r1,(r4+4) 8019ce4: 20 21 00 01 andi r1,r1,0x1 8019ce8: 44 20 00 06 be r1,r0,8019d00 <_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; 8019cec: c8 8c 20 00 sub r4,r4,r12 8019cf0: 34 84 00 04 addi r4,r4,4 8019cf4: 59 a4 00 00 sw (r13+0),r4 8019cf8: 34 01 00 01 mvi r1,1 return true; 8019cfc: e0 00 00 02 bi 8019d04 <_Heap_Size_of_alloc_area+0x9c> 8019d00: 34 01 00 00 mvi r1,0 } 8019d04: 2b 9d 00 04 lw ra,(sp+4) 8019d08: 2b 8b 00 10 lw r11,(sp+16) 8019d0c: 2b 8c 00 0c lw r12,(sp+12) 8019d10: 2b 8d 00 08 lw r13,(sp+8) 8019d14: 37 9c 00 10 addi sp,sp,16 8019d18: c3 a0 00 00 ret 08003ba8 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8003ba8: 37 9c ff ac addi sp,sp,-84 8003bac: 5b 8b 00 50 sw (sp+80),r11 8003bb0: 5b 8c 00 4c sw (sp+76),r12 8003bb4: 5b 8d 00 48 sw (sp+72),r13 8003bb8: 5b 8e 00 44 sw (sp+68),r14 8003bbc: 5b 8f 00 40 sw (sp+64),r15 8003bc0: 5b 90 00 3c sw (sp+60),r16 8003bc4: 5b 91 00 38 sw (sp+56),r17 8003bc8: 5b 92 00 34 sw (sp+52),r18 8003bcc: 5b 93 00 30 sw (sp+48),r19 8003bd0: 5b 94 00 2c sw (sp+44),r20 8003bd4: 5b 95 00 28 sw (sp+40),r21 8003bd8: 5b 96 00 24 sw (sp+36),r22 8003bdc: 5b 97 00 20 sw (sp+32),r23 8003be0: 5b 98 00 1c sw (sp+28),r24 8003be4: 5b 99 00 18 sw (sp+24),r25 8003be8: 5b 9b 00 14 sw (sp+20),fp 8003bec: 5b 9d 00 10 sw (sp+16),ra 8003bf0: 20 63 00 ff andi r3,r3,0xff 8003bf4: b8 20 68 00 mv r13,r1 8003bf8: b8 40 70 00 mv r14,r2 uintptr_t const page_size = heap->page_size; 8003bfc: 28 2f 00 10 lw r15,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8003c00: 28 33 00 14 lw r19,(r1+20) Heap_Block *const last_block = heap->last_block; 8003c04: 28 32 00 24 lw r18,(r1+36) Heap_Block *block = heap->first_block; 8003c08: 28 2b 00 20 lw r11,(r1+32) Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8003c0c: 5c 60 00 04 bne r3,r0,8003c1c <_Heap_Walk+0x74> 8003c10: 78 0c 08 00 mvhi r12,0x800 8003c14: 39 8c 3b 84 ori r12,r12,0x3b84 8003c18: e0 00 00 03 bi 8003c24 <_Heap_Walk+0x7c> 8003c1c: 78 0c 08 00 mvhi r12,0x800 8003c20: 39 8c 40 d4 ori r12,r12,0x40d4 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8003c24: 78 02 08 01 mvhi r2,0x801 8003c28: 38 42 ea 08 ori r2,r2,0xea08 8003c2c: 28 42 00 00 lw r2,(r2+0) 8003c30: 34 01 00 03 mvi r1,3 8003c34: 5c 41 01 0c bne r2,r1,8004064 <_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)( 8003c38: 29 a1 00 08 lw r1,(r13+8) 8003c3c: 29 a6 00 18 lw r6,(r13+24) 8003c40: 29 a7 00 1c lw r7,(r13+28) 8003c44: 5b 81 00 08 sw (sp+8),r1 8003c48: 29 a1 00 0c lw r1,(r13+12) 8003c4c: 78 03 08 01 mvhi r3,0x801 8003c50: 5b 92 00 04 sw (sp+4),r18 8003c54: 5b 81 00 0c sw (sp+12),r1 8003c58: 38 63 b4 e4 ori r3,r3,0xb4e4 8003c5c: b9 c0 08 00 mv r1,r14 8003c60: 34 02 00 00 mvi r2,0 8003c64: b9 e0 20 00 mv r4,r15 8003c68: ba 60 28 00 mv r5,r19 8003c6c: b9 60 40 00 mv r8,r11 8003c70: 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 ) { 8003c74: 5d e0 00 05 bne r15,r0,8003c88 <_Heap_Walk+0xe0> (*printer)( source, true, "page size is zero\n" ); 8003c78: 78 03 08 01 mvhi r3,0x801 8003c7c: b9 c0 08 00 mv r1,r14 8003c80: 38 63 b5 78 ori r3,r3,0xb578 8003c84: e0 00 00 3b bi 8003d70 <_Heap_Walk+0x1c8> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 8003c88: 21 f0 00 07 andi r16,r15,0x7 8003c8c: 46 00 00 06 be r16,r0,8003ca4 <_Heap_Walk+0xfc> (*printer)( 8003c90: 78 03 08 01 mvhi r3,0x801 8003c94: b9 c0 08 00 mv r1,r14 8003c98: 38 63 b5 8c ori r3,r3,0xb58c 8003c9c: b9 e0 20 00 mv r4,r15 8003ca0: e0 00 01 09 bi 80040c4 <_Heap_Walk+0x51c> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 8003ca4: ba 60 08 00 mv r1,r19 8003ca8: b9 e0 10 00 mv r2,r15 8003cac: fb ff f4 05 calli 8000cc0 <__umodsi3> 8003cb0: b8 20 88 00 mv r17,r1 8003cb4: 44 30 00 08 be r1,r16,8003cd4 <_Heap_Walk+0x12c> (*printer)( 8003cb8: 78 03 08 01 mvhi r3,0x801 8003cbc: b9 c0 08 00 mv r1,r14 8003cc0: 38 63 b5 ac ori r3,r3,0xb5ac 8003cc4: ba 60 20 00 mv r4,r19 8003cc8: 34 02 00 01 mvi r2,1 8003ccc: d9 80 00 00 call r12 8003cd0: e0 00 00 5a bi 8003e38 <_Heap_Walk+0x290> ); return false; } if ( 8003cd4: 35 61 00 08 addi r1,r11,8 8003cd8: b9 e0 10 00 mv r2,r15 8003cdc: fb ff f3 f9 calli 8000cc0 <__umodsi3> 8003ce0: b8 20 80 00 mv r16,r1 8003ce4: 44 31 00 08 be r1,r17,8003d04 <_Heap_Walk+0x15c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8003ce8: 78 03 08 01 mvhi r3,0x801 8003cec: b9 c0 08 00 mv r1,r14 8003cf0: 38 63 b5 d0 ori r3,r3,0xb5d0 8003cf4: b9 60 20 00 mv r4,r11 8003cf8: 34 02 00 01 mvi r2,1 8003cfc: d9 80 00 00 call r12 8003d00: e0 00 00 92 bi 8003f48 <_Heap_Walk+0x3a0> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8003d04: 29 71 00 04 lw r17,(r11+4) 8003d08: 22 31 00 01 andi r17,r17,0x1 8003d0c: 5e 21 00 07 bne r17,r1,8003d28 <_Heap_Walk+0x180> (*printer)( 8003d10: 78 03 08 01 mvhi r3,0x801 8003d14: b9 c0 08 00 mv r1,r14 8003d18: 38 63 b6 04 ori r3,r3,0xb604 8003d1c: 34 02 00 01 mvi r2,1 8003d20: d9 80 00 00 call r12 8003d24: e0 00 00 89 bi 8003f48 <_Heap_Walk+0x3a0> ); return false; } if ( first_block->prev_size != page_size ) { 8003d28: 29 79 00 00 lw r25,(r11+0) 8003d2c: 47 2f 00 07 be r25,r15,8003d48 <_Heap_Walk+0x1a0> (*printer)( 8003d30: 78 03 08 01 mvhi r3,0x801 8003d34: b9 c0 08 00 mv r1,r14 8003d38: 38 63 b6 34 ori r3,r3,0xb634 8003d3c: bb 20 20 00 mv r4,r25 8003d40: b9 e0 28 00 mv r5,r15 8003d44: e0 00 00 3b bi 8003e30 <_Heap_Walk+0x288> ); return false; } if ( _Heap_Is_free( last_block ) ) { 8003d48: 2a 41 00 04 lw r1,(r18+4) 8003d4c: 34 02 ff fe mvi r2,-2 8003d50: a0 22 08 00 and r1,r1,r2 8003d54: b6 41 08 00 add r1,r18,r1 8003d58: 28 2f 00 04 lw r15,(r1+4) 8003d5c: 21 ef 00 01 andi r15,r15,0x1 8003d60: 5d f0 00 07 bne r15,r16,8003d7c <_Heap_Walk+0x1d4> (*printer)( 8003d64: 78 03 08 01 mvhi r3,0x801 8003d68: b9 c0 08 00 mv r1,r14 8003d6c: 38 63 b6 60 ori r3,r3,0xb660 8003d70: 34 02 00 01 mvi r2,1 8003d74: d9 80 00 00 call r12 8003d78: e0 00 00 a5 bi 800400c <_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; 8003d7c: 29 a4 00 08 lw r4,(r13+8) ); return false; } if ( _Heap_Is_used( free_block ) ) { 8003d80: b8 40 a8 00 mv r21,r2 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8003d84: 29 b4 00 10 lw r20,(r13+16) 8003d88: b9 a0 88 00 mv r17,r13 8003d8c: b8 80 b0 00 mv r22,r4 8003d90: e0 00 00 2e bi 8003e48 <_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 8003d94: 29 a1 00 20 lw r1,(r13+32) 8003d98: 34 0f 00 00 mvi r15,0 8003d9c: 52 c1 00 02 bgeu r22,r1,8003da4 <_Heap_Walk+0x1fc> 8003da0: e0 00 00 03 bi 8003dac <_Heap_Walk+0x204> 8003da4: 29 af 00 24 lw r15,(r13+36) 8003da8: f1 f6 78 00 cmpgeu r15,r15,r22 ); return false; } if ( 8003dac: 36 c1 00 08 addi r1,r22,8 8003db0: 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 ) ) { 8003db4: 5d e0 00 06 bne r15,r0,8003dcc <_Heap_Walk+0x224> (*printer)( 8003db8: 78 03 08 01 mvhi r3,0x801 8003dbc: ba c0 20 00 mv r4,r22 8003dc0: b9 c0 08 00 mv r1,r14 8003dc4: 38 63 b6 78 ori r3,r3,0xb678 8003dc8: e0 00 00 8f bi 8004004 <_Heap_Walk+0x45c> ); return false; } if ( 8003dcc: fb ff f3 bd calli 8000cc0 <__umodsi3> 8003dd0: 44 20 00 06 be r1,r0,8003de8 <_Heap_Walk+0x240> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8003dd4: 78 03 08 01 mvhi r3,0x801 8003dd8: ba c0 20 00 mv r4,r22 8003ddc: b9 c0 08 00 mv r1,r14 8003de0: 38 63 b6 98 ori r3,r3,0xb698 8003de4: e0 00 00 b8 bi 80040c4 <_Heap_Walk+0x51c> ); return false; } if ( _Heap_Is_used( free_block ) ) { 8003de8: 2a c3 00 04 lw r3,(r22+4) 8003dec: a0 75 18 00 and r3,r3,r21 8003df0: b6 c3 18 00 add r3,r22,r3 8003df4: 28 70 00 04 lw r16,(r3+4) 8003df8: 22 10 00 01 andi r16,r16,0x1 8003dfc: 46 01 00 07 be r16,r1,8003e18 <_Heap_Walk+0x270> (*printer)( 8003e00: 78 03 08 01 mvhi r3,0x801 8003e04: b8 20 78 00 mv r15,r1 8003e08: ba c0 20 00 mv r4,r22 8003e0c: b9 c0 08 00 mv r1,r14 8003e10: 38 63 b6 c8 ori r3,r3,0xb6c8 8003e14: e0 00 00 7c bi 8004004 <_Heap_Walk+0x45c> ); return false; } if ( free_block->prev != prev_block ) { 8003e18: 2a c5 00 0c lw r5,(r22+12) 8003e1c: 44 b1 00 09 be r5,r17,8003e40 <_Heap_Walk+0x298> (*printer)( 8003e20: 78 03 08 01 mvhi r3,0x801 8003e24: ba c0 20 00 mv r4,r22 8003e28: b9 c0 08 00 mv r1,r14 8003e2c: 38 63 b6 e4 ori r3,r3,0xb6e4 8003e30: 34 02 00 01 mvi r2,1 8003e34: d9 80 00 00 call r12 8003e38: ba 00 08 00 mv r1,r16 8003e3c: e0 00 00 8b bi 8004068 <_Heap_Walk+0x4c0> return false; } prev_block = free_block; free_block = free_block->next; 8003e40: ba c0 88 00 mv r17,r22 8003e44: 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 ) { 8003e48: 5e cd ff d3 bne r22,r13,8003d94 <_Heap_Walk+0x1ec> 8003e4c: e0 00 00 7a bi 8004034 <_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; 8003e50: 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 ) { 8003e54: 21 e2 00 01 andi r2,r15,0x1 8003e58: 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); 8003e5c: b5 6f 80 00 add r16,r11,r15 8003e60: 44 40 00 09 be r2,r0,8003e84 <_Heap_Walk+0x2dc> (*printer)( 8003e64: 78 03 08 01 mvhi r3,0x801 8003e68: b9 c0 08 00 mv r1,r14 8003e6c: 34 02 00 00 mvi r2,0 8003e70: 38 63 b7 18 ori r3,r3,0xb718 8003e74: b9 60 20 00 mv r4,r11 8003e78: b9 e0 28 00 mv r5,r15 8003e7c: d9 80 00 00 call r12 8003e80: e0 00 00 08 bi 8003ea0 <_Heap_Walk+0x2f8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8003e84: 29 66 00 00 lw r6,(r11+0) 8003e88: 78 03 08 01 mvhi r3,0x801 8003e8c: b9 c0 08 00 mv r1,r14 8003e90: 38 63 b7 30 ori r3,r3,0xb730 8003e94: b9 60 20 00 mv r4,r11 8003e98: b9 e0 28 00 mv r5,r15 8003e9c: 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 8003ea0: 29 a1 00 20 lw r1,(r13+32) 8003ea4: 52 01 00 03 bgeu r16,r1,8003eb0 <_Heap_Walk+0x308> 8003ea8: 34 11 00 00 mvi r17,0 <== NOT EXECUTED 8003eac: e0 00 00 03 bi 8003eb8 <_Heap_Walk+0x310> <== NOT EXECUTED 8003eb0: 29 b1 00 24 lw r17,(r13+36) 8003eb4: f2 30 88 00 cmpgeu r17,r17,r16 block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 8003eb8: 5e 20 00 05 bne r17,r0,8003ecc <_Heap_Walk+0x324> (*printer)( 8003ebc: 78 03 08 01 mvhi r3,0x801 8003ec0: b9 c0 08 00 mv r1,r14 8003ec4: 38 63 b7 58 ori r3,r3,0xb758 8003ec8: e0 00 00 1c bi 8003f38 <_Heap_Walk+0x390> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 8003ecc: b9 e0 08 00 mv r1,r15 8003ed0: bb 20 10 00 mv r2,r25 8003ed4: fb ff f3 7b calli 8000cc0 <__umodsi3> 8003ed8: b8 20 88 00 mv r17,r1 8003edc: 44 20 00 09 be r1,r0,8003f00 <_Heap_Walk+0x358> (*printer)( 8003ee0: 78 03 08 01 mvhi r3,0x801 8003ee4: b9 c0 08 00 mv r1,r14 8003ee8: 38 63 b7 88 ori r3,r3,0xb788 8003eec: b9 60 20 00 mv r4,r11 8003ef0: b9 e0 28 00 mv r5,r15 8003ef4: 34 02 00 01 mvi r2,1 8003ef8: d9 80 00 00 call r12 8003efc: e0 00 00 74 bi 80040cc <_Heap_Walk+0x524> ); return false; } if ( block_size < min_block_size ) { 8003f00: 51 f3 00 0a bgeu r15,r19,8003f28 <_Heap_Walk+0x380> (*printer)( 8003f04: 78 03 08 01 mvhi r3,0x801 8003f08: b9 c0 08 00 mv r1,r14 8003f0c: 38 63 b7 b8 ori r3,r3,0xb7b8 8003f10: b9 60 20 00 mv r4,r11 8003f14: b9 e0 28 00 mv r5,r15 8003f18: ba 60 30 00 mv r6,r19 8003f1c: 34 02 00 01 mvi r2,1 8003f20: d9 80 00 00 call r12 8003f24: e0 00 00 09 bi 8003f48 <_Heap_Walk+0x3a0> ); return false; } if ( next_block_begin <= block_begin ) { 8003f28: 56 0b 00 0a bgu r16,r11,8003f50 <_Heap_Walk+0x3a8> (*printer)( 8003f2c: 78 03 08 01 mvhi r3,0x801 8003f30: b9 c0 08 00 mv r1,r14 8003f34: 38 63 b7 e4 ori r3,r3,0xb7e4 8003f38: b9 60 20 00 mv r4,r11 8003f3c: ba 00 28 00 mv r5,r16 8003f40: 34 02 00 01 mvi r2,1 8003f44: d9 80 00 00 call r12 8003f48: ba 20 08 00 mv r1,r17 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 8003f4c: e0 00 00 47 bi 8004068 <_Heap_Walk+0x4c0> } if ( !_Heap_Is_prev_used( next_block ) ) { 8003f50: 2a 03 00 04 lw r3,(r16+4) 8003f54: 20 63 00 01 andi r3,r3,0x1 8003f58: 5c 60 00 35 bne r3,r0,800402c <_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; 8003f5c: 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)( 8003f60: 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; 8003f64: 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; 8003f68: 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; 8003f6c: 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); 8003f70: 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; 8003f74: ba a0 30 00 mv r6,r21 8003f78: 44 a1 00 04 be r5,r1,8003f88 <_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)" : ""), 8003f7c: ba 80 30 00 mv r6,r20 8003f80: 5c ad 00 02 bne r5,r13,8003f88 <_Heap_Walk+0x3e0> 8003f84: 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)( 8003f88: 29 67 00 08 lw r7,(r11+8) 8003f8c: ba e0 40 00 mv r8,r23 8003f90: 44 e3 00 04 be r7,r3,8003fa0 <_Heap_Walk+0x3f8> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 8003f94: ba 80 40 00 mv r8,r20 8003f98: 5c ed 00 02 bne r7,r13,8003fa0 <_Heap_Walk+0x3f8> 8003f9c: 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)( 8003fa0: 78 03 08 01 mvhi r3,0x801 8003fa4: 5b 8a 00 54 sw (sp+84),r10 8003fa8: b9 c0 08 00 mv r1,r14 8003fac: 34 02 00 00 mvi r2,0 8003fb0: 38 63 b8 48 ori r3,r3,0xb848 8003fb4: b9 60 20 00 mv r4,r11 8003fb8: 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 ) { 8003fbc: 2b 8a 00 54 lw r10,(sp+84) 8003fc0: 29 46 00 00 lw r6,(r10+0) 8003fc4: 46 26 00 0a be r17,r6,8003fec <_Heap_Walk+0x444> (*printer)( 8003fc8: 78 03 08 01 mvhi r3,0x801 8003fcc: b9 c0 08 00 mv r1,r14 8003fd0: 38 63 b8 74 ori r3,r3,0xb874 8003fd4: b9 60 20 00 mv r4,r11 8003fd8: ba 20 28 00 mv r5,r17 8003fdc: b9 40 38 00 mv r7,r10 8003fe0: 34 02 00 01 mvi r2,1 8003fe4: d9 80 00 00 call r12 8003fe8: e0 00 00 39 bi 80040cc <_Heap_Walk+0x524> ); return false; } if ( !prev_used ) { 8003fec: 21 ef 00 01 andi r15,r15,0x1 8003ff0: 5d e0 00 09 bne r15,r0,8004014 <_Heap_Walk+0x46c> (*printer)( 8003ff4: 78 03 08 01 mvhi r3,0x801 8003ff8: b9 c0 08 00 mv r1,r14 8003ffc: 38 63 b8 b0 ori r3,r3,0xb8b0 8004000: b9 60 20 00 mv r4,r11 8004004: 34 02 00 01 mvi r2,1 8004008: d9 80 00 00 call r12 800400c: b9 e0 08 00 mv r1,r15 8004010: e0 00 00 16 bi 8004068 <_Heap_Walk+0x4c0> 8004014: 29 a3 00 08 lw r3,(r13+8) 8004018: e0 00 00 03 bi 8004024 <_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 ) { 800401c: 44 6b 00 04 be r3,r11,800402c <_Heap_Walk+0x484> return true; } free_block = free_block->next; 8004020: 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 ) { 8004024: 5c 6d ff fe bne r3,r13,800401c <_Heap_Walk+0x474> 8004028: e0 00 00 23 bi 80040b4 <_Heap_Walk+0x50c> 800402c: ba 00 58 00 mv r11,r16 8004030: e0 00 00 0c bi 8004060 <_Heap_Walk+0x4b8> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 8004034: 78 18 08 01 mvhi r24,0x801 8004038: 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)( 800403c: 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)" : ""), 8004040: 78 16 08 01 mvhi r22,0x801 8004044: 78 15 08 01 mvhi r21,0x801 block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 8004048: 3b 18 b8 3c ori r24,r24,0xb83c 800404c: 3a 94 b8 ac ori r20,r20,0xb8ac 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)( 8004050: 3a f7 b8 30 ori r23,r23,0xb830 "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)" : ""), 8004054: 3a d6 b8 24 ori r22,r22,0xb824 8004058: 3a b5 b8 18 ori r21,r21,0xb818 - 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; 800405c: 34 1b ff fe mvi fp,-2 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 8004060: 5d 72 ff 7c bne r11,r18,8003e50 <_Heap_Walk+0x2a8> 8004064: 34 01 00 01 mvi r1,1 block = next_block; } return true; } 8004068: 2b 9d 00 10 lw ra,(sp+16) 800406c: 2b 8b 00 50 lw r11,(sp+80) 8004070: 2b 8c 00 4c lw r12,(sp+76) 8004074: 2b 8d 00 48 lw r13,(sp+72) 8004078: 2b 8e 00 44 lw r14,(sp+68) 800407c: 2b 8f 00 40 lw r15,(sp+64) 8004080: 2b 90 00 3c lw r16,(sp+60) 8004084: 2b 91 00 38 lw r17,(sp+56) 8004088: 2b 92 00 34 lw r18,(sp+52) 800408c: 2b 93 00 30 lw r19,(sp+48) 8004090: 2b 94 00 2c lw r20,(sp+44) 8004094: 2b 95 00 28 lw r21,(sp+40) 8004098: 2b 96 00 24 lw r22,(sp+36) 800409c: 2b 97 00 20 lw r23,(sp+32) 80040a0: 2b 98 00 1c lw r24,(sp+28) 80040a4: 2b 99 00 18 lw r25,(sp+24) 80040a8: 2b 9b 00 14 lw fp,(sp+20) 80040ac: 37 9c 00 54 addi sp,sp,84 80040b0: c3 a0 00 00 ret return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 80040b4: 78 03 08 01 mvhi r3,0x801 80040b8: b9 c0 08 00 mv r1,r14 80040bc: 38 63 b8 e0 ori r3,r3,0xb8e0 80040c0: b9 60 20 00 mv r4,r11 80040c4: 34 02 00 01 mvi r2,1 80040c8: d9 80 00 00 call r12 80040cc: 34 01 00 00 mvi r1,0 80040d0: e3 ff ff e6 bi 8004068 <_Heap_Walk+0x4c0> 08003394 <_ISR_Handler_initialization>: * * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { 8003394: 37 9c ff f4 addi sp,sp,-12 8003398: 5b 8b 00 0c sw (sp+12),r11 800339c: 5b 8c 00 08 sw (sp+8),r12 80033a0: 5b 9d 00 04 sw (sp+4),ra _ISR_Signals_to_thread_executing = false; 80033a4: 78 03 08 01 mvhi r3,0x801 _ISR_Nest_level = 0; 80033a8: 78 02 08 01 mvhi r2,0x801 * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; 80033ac: 34 04 00 00 mvi r4,0 80033b0: 38 63 c9 78 ori r3,r3,0xc978 _ISR_Nest_level = 0; 80033b4: 38 42 c8 bc ori r2,r2,0xc8bc * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; 80033b8: 30 64 00 00 sb (r3+0),r4 _ISR_Nest_level = 0; 80033bc: 58 44 00 00 sw (r2+0),r4 #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( 80033c0: 34 01 00 80 mvi r1,128 void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; _ISR_Nest_level = 0; 80033c4: b8 80 60 00 mv r12,r4 #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( 80033c8: f8 00 09 2f calli 8005884 <_Workspace_Allocate_or_fatal_error> _CPU_Initialize_vectors(); #if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE ) if ( !_Stack_Is_enough(Configuration.interrupt_stack_size) ) 80033cc: 78 0b 08 01 mvhi r11,0x801 80033d0: 78 02 08 01 mvhi r2,0x801 80033d4: 38 42 c0 bc ori r2,r2,0xc0bc 80033d8: 39 6b c0 c4 ori r11,r11,0xc0c4 80033dc: 28 44 00 00 lw r4,(r2+0) 80033e0: 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( 80033e4: 78 02 08 01 mvhi r2,0x801 80033e8: 38 42 c8 a0 ori r2,r2,0xc8a0 80033ec: 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) ) 80033f0: 50 64 00 05 bgeu r3,r4,8003404 <_ISR_Handler_initialization+0x70> _Internal_error_Occurred( 80033f4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80033f8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80033fc: 34 03 00 05 mvi r3,5 <== NOT EXECUTED 8003400: fb ff ff d6 calli 8003358 <_Internal_error_Occurred> <== NOT EXECUTED INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL ); _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( 8003404: b8 60 08 00 mv r1,r3 8003408: f8 00 09 1f calli 8005884 <_Workspace_Allocate_or_fatal_error> Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 800340c: 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( 8003410: 78 02 08 01 mvhi r2,0x801 Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 8003414: 78 03 08 01 mvhi r3,0x801 8003418: 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( 800341c: 38 42 c8 34 ori r2,r2,0xc834 Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 8003420: 38 63 c7 b8 ori r3,r3,0xc7b8 8003424: 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( 8003428: 58 41 00 00 sw (r2+0),r1 #if ( CPU_HAS_HARDWARE_INTERRUPT_STACK == TRUE ) _CPU_Install_interrupt_stack(); #endif } 800342c: 2b 9d 00 04 lw ra,(sp+4) 8003430: 2b 8b 00 0c lw r11,(sp+12) 8003434: 2b 8c 00 08 lw r12,(sp+8) 8003438: 37 9c 00 0c addi sp,sp,12 800343c: c3 a0 00 00 ret 080039ac <_Objects_Initialize_information>: , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 80039ac: 37 9c ff e4 addi sp,sp,-28 80039b0: 5b 8b 00 1c sw (sp+28),r11 80039b4: 5b 8c 00 18 sw (sp+24),r12 80039b8: 5b 8d 00 14 sw (sp+20),r13 80039bc: 5b 8e 00 10 sw (sp+16),r14 80039c0: 5b 8f 00 0c sw (sp+12),r15 80039c4: 5b 90 00 08 sw (sp+8),r16 80039c8: 5b 9d 00 04 sw (sp+4),ra #endif information->the_api = the_api; information->the_class = the_class; information->size = size; information->local_table = 0; 80039cc: 34 06 00 00 mvi r6,0 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 80039d0: b8 20 58 00 mv r11,r1 80039d4: 20 a5 ff ff andi r5,r5,0xffff 80039d8: b8 40 78 00 mv r15,r2 uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; information->size = size; 80039dc: 58 25 00 18 sw (r1+24),r5 /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 80039e0: 0c 26 00 10 sh (r1+16),r6 #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; 80039e4: 0d 63 00 04 sh (r11+4),r3 information->size = size; information->local_table = 0; 80039e8: 58 26 00 1c sw (r1+28),r6 information->inactive_per_block = 0; 80039ec: 58 26 00 30 sw (r1+48),r6 information->object_blocks = 0; 80039f0: 58 26 00 34 sw (r1+52),r6 information->inactive = 0; 80039f4: 0c 26 00 2c sh (r1+44),r6 uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 80039f8: 59 62 00 00 sw (r11+0),r2 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 80039fc: 78 10 08 01 mvhi r16,0x801 8003a00: 34 02 00 02 mvi r2,2 8003a04: b9 e0 08 00 mv r1,r15 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8003a08: b8 60 70 00 mv r14,r3 8003a0c: b8 80 60 00 mv r12,r4 8003a10: b8 e0 68 00 mv r13,r7 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 8003a14: 3a 10 c7 bc ori r16,r16,0xc7bc 8003a18: fb ff f1 f6 calli 80001f0 <__ashlsi3> 8003a1c: b6 01 08 00 add r1,r16,r1 8003a20: 28 30 00 00 lw r16,(r1+0) 8003a24: 34 02 00 02 mvi r2,2 8003a28: b9 c0 08 00 mv r1,r14 8003a2c: fb ff f1 f1 calli 80001f0 <__ashlsi3> 8003a30: b6 01 08 00 add r1,r16,r1 8003a34: 58 2b 00 00 sw (r1+0),r11 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 8003a38: 34 02 00 1f mvi r2,31 8003a3c: b9 80 08 00 mv r1,r12 8003a40: fb ff f2 14 calli 8000290 <__lshrsi3> 8003a44: 20 23 00 ff andi r3,r1,0xff maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8003a48: 78 02 7f ff mvhi r2,0x7fff 8003a4c: 38 42 ff ff ori r2,r2,0xffff _Objects_Information_table[ the_api ][ the_class ] = information; /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = 8003a50: 31 63 00 12 sb (r11+18),r3 (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8003a54: a1 82 60 00 and r12,r12,r2 /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 8003a58: 44 60 00 06 be r3,r0,8003a70 <_Objects_Initialize_information+0xc4> 8003a5c: 5d 80 00 05 bne r12,r0,8003a70 <_Objects_Initialize_information+0xc4> _Internal_error_Occurred( 8003a60: b9 80 08 00 mv r1,r12 8003a64: 34 02 00 01 mvi r2,1 8003a68: 34 03 00 14 mvi r3,20 8003a6c: fb ff fe 3b calli 8003358 <_Internal_error_Occurred> information->allocation_size = maximum_per_allocation; /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 8003a70: 78 01 08 01 mvhi r1,0x801 8003a74: 38 21 c6 20 ori r1,r1,0xc620 8003a78: 59 61 00 1c sw (r11+28),r1 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 8003a7c: 34 02 00 18 mvi r2,24 8003a80: b9 e0 08 00 mv r1,r15 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 8003a84: 0d 6c 00 14 sh (r11+20),r12 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 8003a88: fb ff f1 da calli 80001f0 <__ashlsi3> 8003a8c: 78 02 00 01 mvhi r2,0x1 8003a90: 38 42 00 00 ori r2,r2,0x0 8003a94: b8 22 78 00 or r15,r1,r2 8003a98: 34 02 00 1b mvi r2,27 8003a9c: b9 c0 08 00 mv r1,r14 8003aa0: fb ff f1 d4 calli 80001f0 <__ashlsi3> 8003aa4: 7d 83 00 00 cmpnei r3,r12,0 8003aa8: b9 e1 08 00 or r1,r15,r1 8003aac: b8 23 08 00 or r1,r1,r3 8003ab0: 59 61 00 08 sw (r11+8),r1 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 8003ab4: 21 a2 00 03 andi r2,r13,0x3 8003ab8: b9 a0 08 00 mv r1,r13 8003abc: 44 40 00 04 be r2,r0,8003acc <_Objects_Initialize_information+0x120> name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 8003ac0: 35 ad 00 04 addi r13,r13,4 <== NOT EXECUTED 8003ac4: 34 01 ff fc mvi r1,-4 <== NOT EXECUTED 8003ac8: a1 a1 08 00 and r1,r13,r1 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8003acc: 35 63 00 24 addi r3,r11,36 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 8003ad0: 35 62 00 20 addi r2,r11,32 ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 8003ad4: 0d 61 00 38 sh (r11+56),r1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 8003ad8: 34 01 00 00 mvi r1,0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8003adc: 59 63 00 20 sw (r11+32),r3 the_chain->permanent_null = NULL; 8003ae0: 59 61 00 24 sw (r11+36),r1 the_chain->last = _Chain_Head(the_chain); 8003ae4: 59 62 00 28 sw (r11+40),r2 _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 8003ae8: 45 81 00 03 be r12,r1,8003af4 <_Objects_Initialize_information+0x148> /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 8003aec: b9 60 08 00 mv r1,r11 8003af0: fb ff fe 85 calli 8003504 <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 8003af4: 2b 9d 00 04 lw ra,(sp+4) 8003af8: 2b 8b 00 1c lw r11,(sp+28) 8003afc: 2b 8c 00 18 lw r12,(sp+24) 8003b00: 2b 8d 00 14 lw r13,(sp+20) 8003b04: 2b 8e 00 10 lw r14,(sp+16) 8003b08: 2b 8f 00 0c lw r15,(sp+12) 8003b0c: 2b 90 00 08 lw r16,(sp+8) 8003b10: 37 9c 00 1c addi sp,sp,28 8003b14: c3 a0 00 00 ret 080082cc <_TOD_Get>: */ void _TOD_Get( struct timespec *time ) { 80082cc: 37 9c ff e4 addi sp,sp,-28 80082d0: 5b 8b 00 0c sw (sp+12),r11 80082d4: 5b 8c 00 08 sw (sp+8),r12 80082d8: 5b 9d 00 04 sw (sp+4),ra 80082dc: 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 ); 80082e0: 90 00 60 00 rcsr r12,IE 80082e4: 34 01 ff fe mvi r1,-2 80082e8: a1 81 08 00 and r1,r12,r1 80082ec: d0 01 00 00 wcsr IE,r1 now = _TOD_Now; 80082f0: 78 02 08 01 mvhi r2,0x801 80082f4: 38 42 c8 b4 ori r2,r2,0xc8b4 if ( _Watchdog_Nanoseconds_since_tick_handler ) 80082f8: 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; 80082fc: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008300: 38 63 c9 c4 ori r3,r3,0xc9c4 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 8008304: 28 42 00 00 lw r2,(r2+0) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008308: 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; 800830c: 5b 81 00 14 sw (sp+20),r1 8008310: 5b 82 00 10 sw (sp+16),r2 if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008314: b8 60 20 00 mv r4,r3 8008318: 44 60 00 03 be r3,r0,8008324 <_TOD_Get+0x58> nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 800831c: d8 60 00 00 call r3 <== NOT EXECUTED 8008320: b8 20 20 00 mv r4,r1 <== NOT EXECUTED _ISR_Enable( level ); 8008324: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 8008328: 34 03 00 00 mvi r3,0 _Timestamp_Add_to( &now, &offset ); 800832c: 37 81 00 10 addi r1,sp,16 8008330: 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 ); 8008334: 5b 83 00 18 sw (sp+24),r3 8008338: 5b 84 00 1c sw (sp+28),r4 _Timestamp_Add_to( &now, &offset ); 800833c: fb ff f3 7a calli 8005124 <_Timespec_Add_to> _Timestamp_To_timespec( &now, time ); 8008340: 2b 81 00 14 lw r1,(sp+20) 8008344: 59 61 00 04 sw (r11+4),r1 8008348: 2b 81 00 10 lw r1,(sp+16) 800834c: 59 61 00 00 sw (r11+0),r1 } 8008350: 2b 9d 00 04 lw ra,(sp+4) 8008354: 2b 8b 00 0c lw r11,(sp+12) 8008358: 2b 8c 00 08 lw r12,(sp+8) 800835c: 37 9c 00 1c addi sp,sp,28 8008360: c3 a0 00 00 ret 08008364 <_TOD_Get_uptime>: */ void _TOD_Get_uptime( Timestamp_Control *uptime ) { 8008364: 37 9c ff e4 addi sp,sp,-28 8008368: 5b 8b 00 0c sw (sp+12),r11 800836c: 5b 8c 00 08 sw (sp+8),r12 8008370: 5b 9d 00 04 sw (sp+4),ra 8008374: 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 ); 8008378: 90 00 60 00 rcsr r12,IE 800837c: 34 01 ff fe mvi r1,-2 8008380: a1 81 08 00 and r1,r12,r1 8008384: d0 01 00 00 wcsr IE,r1 up = _TOD_Uptime; 8008388: 78 02 08 01 mvhi r2,0x801 800838c: 38 42 c8 a4 ori r2,r2,0xc8a4 if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008390: 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; 8008394: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008398: 38 63 c9 c4 ori r3,r3,0xc9c4 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 800839c: 28 42 00 00 lw r2,(r2+0) if ( _Watchdog_Nanoseconds_since_tick_handler ) 80083a0: 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; 80083a4: 5b 81 00 14 sw (sp+20),r1 80083a8: 5b 82 00 10 sw (sp+16),r2 if ( _Watchdog_Nanoseconds_since_tick_handler ) 80083ac: b8 60 20 00 mv r4,r3 80083b0: 44 60 00 03 be r3,r0,80083bc <_TOD_Get_uptime+0x58> nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 80083b4: d8 60 00 00 call r3 <== NOT EXECUTED 80083b8: b8 20 20 00 mv r4,r1 <== NOT EXECUTED _ISR_Enable( level ); 80083bc: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 80083c0: 34 03 00 00 mvi r3,0 _Timestamp_Add_to( &up, &offset ); 80083c4: 37 81 00 10 addi r1,sp,16 80083c8: 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 ); 80083cc: 5b 83 00 18 sw (sp+24),r3 80083d0: 5b 84 00 1c sw (sp+28),r4 _Timestamp_Add_to( &up, &offset ); 80083d4: fb ff f3 54 calli 8005124 <_Timespec_Add_to> *uptime = up; 80083d8: 2b 81 00 14 lw r1,(sp+20) 80083dc: 59 61 00 04 sw (r11+4),r1 80083e0: 2b 81 00 10 lw r1,(sp+16) 80083e4: 59 61 00 00 sw (r11+0),r1 } 80083e8: 2b 9d 00 04 lw ra,(sp+4) 80083ec: 2b 8b 00 0c lw r11,(sp+12) 80083f0: 2b 8c 00 08 lw r12,(sp+8) 80083f4: 37 9c 00 1c addi sp,sp,28 80083f8: c3 a0 00 00 ret 0800456c <_Thread_Handler_initialization>: * * Output parameters: NONE */ void _Thread_Handler_initialization(void) { 800456c: 37 9c ff f0 addi sp,sp,-16 8004570: 5b 8b 00 10 sw (sp+16),r11 8004574: 5b 8c 00 0c sw (sp+12),r12 8004578: 5b 8d 00 08 sw (sp+8),r13 800457c: 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; 8004580: 78 01 08 01 mvhi r1,0x801 8004584: 38 21 c0 c4 ori r1,r1,0xc0c4 #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 8004588: 28 22 00 20 lw r2,(r1+32) 800458c: 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; 8004590: 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) 8004594: 64 42 00 00 cmpei r2,r2,0 8004598: 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; 800459c: 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) 80045a0: 99 22 48 00 xor r9,r9,r2 80045a4: b9 20 58 00 mv r11,r9 80045a8: 45 20 00 05 be r9,r0,80045bc <_Thread_Handler_initialization+0x50> == (!Configuration.stack_free_hook) ) ) _Internal_error_Occurred( 80045ac: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 80045b0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80045b4: 34 03 00 0f mvi r3,15 <== NOT EXECUTED 80045b8: fb ff fb 68 calli 8003358 <_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( 80045bc: 78 0c 08 01 mvhi r12,0x801 80045c0: 39 8c c0 c0 ori r12,r12,0xc0c0 80045c4: 41 81 00 00 lbu r1,(r12+0) INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 80045c8: 78 08 08 01 mvhi r8,0x801 _Thread_Executing = NULL; 80045cc: 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( 80045d0: 34 21 00 01 addi r1,r1,1 INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; _Thread_Executing = NULL; _Thread_Heir = NULL; 80045d4: 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; 80045d8: 78 03 08 01 mvhi r3,0x801 _Thread_Maximum_extensions = maximum_extensions; 80045dc: 78 07 08 01 mvhi r7,0x801 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 80045e0: 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; 80045e4: 38 63 c8 c4 ori r3,r3,0xc8c4 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; 80045e8: 38 c6 c7 b4 ori r6,r6,0xc7b4 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 80045ec: 39 08 c8 f0 ori r8,r8,0xc8f0 _Thread_Executing = NULL; 80045f0: 38 a5 c8 e0 ori r5,r5,0xc8e0 _Thread_Heir = NULL; 80045f4: 38 84 c8 b0 ori r4,r4,0xc8b0 _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; 80045f8: 38 e7 c8 c0 ori r7,r7,0xc8c0 _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 80045fc: 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; 8004600: 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; 8004604: 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( 8004608: b4 41 08 00 add r1,r2,r1 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 800460c: 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( 8004610: 34 02 00 02 mvi r2,2 _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; 8004614: 58 ed 00 00 sw (r7+0),r13 true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; _Thread_Executing = NULL; 8004618: 58 a9 00 00 sw (r5+0),r9 _Thread_Heir = NULL; 800461c: 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( 8004620: fb ff ee f4 calli 80001f0 <__ashlsi3> 8004624: f8 00 04 98 calli 8005884 <_Workspace_Allocate_or_fatal_error> 8004628: 78 02 08 01 mvhi r2,0x801 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 800462c: 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( 8004630: 38 42 c7 b0 ori r2,r2,0xc7b0 8004634: 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; 8004638: 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); 800463c: 34 22 00 04 addi r2,r1,4 8004640: 58 22 00 00 sw (r1+0),r2 the_chain->permanent_null = NULL; 8004644: 58 26 00 04 sw (r1+4),r6 the_chain->last = _Chain_Head(the_chain); 8004648: 58 21 00 08 sw (r1+8),r1 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 800464c: 35 6b 00 01 addi r11,r11,1 8004650: 34 21 00 0c addi r1,r1,12 8004654: 50 6b ff fa bgeu r3,r11,800463c <_Thread_Handler_initialization+0xd0> /* * Initialize this class of objects. */ _Objects_Initialize_information( 8004658: 34 02 00 01 mvi r2,1 800465c: 78 01 08 01 mvhi r1,0x801 8004660: 38 21 c9 80 ori r1,r1,0xc980 8004664: b8 40 18 00 mv r3,r2 8004668: b8 40 20 00 mv r4,r2 800466c: 34 05 01 38 mvi r5,312 8004670: 34 07 00 08 mvi r7,8 8004674: fb ff fc ce calli 80039ac <_Objects_Initialize_information> false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 8004678: 2b 9d 00 04 lw ra,(sp+4) 800467c: 2b 8b 00 10 lw r11,(sp+16) 8004680: 2b 8c 00 0c lw r12,(sp+12) 8004684: 2b 8d 00 08 lw r13,(sp+8) 8004688: 37 9c 00 10 addi sp,sp,16 800468c: c3 a0 00 00 ret 08005be8 <_Thread_Restart>: bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 8005be8: 37 9c ff f0 addi sp,sp,-16 8005bec: 5b 8b 00 08 sw (sp+8),r11 8005bf0: 5b 9d 00 04 sw (sp+4),ra if ( !_States_Is_dormant( the_thread->current_state ) ) { 8005bf4: 28 25 00 10 lw r5,(r1+16) 8005bf8: 34 04 00 00 mvi r4,0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 8005bfc: b8 20 58 00 mv r11,r1 if ( !_States_Is_dormant( the_thread->current_state ) ) { 8005c00: 20 a5 00 01 andi r5,r5,0x1 8005c04: 5c a4 00 16 bne r5,r4,8005c5c <_Thread_Restart+0x74> _Thread_Set_transient( the_thread ); 8005c08: 5b 82 00 10 sw (sp+16),r2 8005c0c: 5b 83 00 0c sw (sp+12),r3 8005c10: f8 00 00 bb calli 8005efc <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 8005c14: 2b 82 00 10 lw r2,(sp+16) 8005c18: 2b 83 00 0c lw r3,(sp+12) 8005c1c: b9 60 08 00 mv r1,r11 8005c20: f8 00 11 96 calli 800a278 <_Thread_Reset> _Thread_Load_environment( the_thread ); 8005c24: b9 60 08 00 mv r1,r11 8005c28: f8 00 10 6b calli 8009dd4 <_Thread_Load_environment> _Thread_Ready( the_thread ); 8005c2c: b9 60 08 00 mv r1,r11 8005c30: f8 00 11 2e calli 800a0e8 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 8005c34: b9 60 08 00 mv r1,r11 8005c38: f8 00 02 52 calli 8006580 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 8005c3c: 78 01 08 02 mvhi r1,0x802 8005c40: 38 21 09 40 ori r1,r1,0x940 8005c44: 28 21 00 00 lw r1,(r1+0) 8005c48: 34 04 00 01 mvi r4,1 8005c4c: 5d 61 00 04 bne r11,r1,8005c5c <_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 ); 8005c50: 35 61 00 cc addi r1,r11,204 8005c54: f8 00 03 d0 calli 8006b94 <_CPU_Context_restore> 8005c58: 34 04 00 01 mvi r4,1 <== NOT EXECUTED return true; } return false; } 8005c5c: b8 80 08 00 mv r1,r4 8005c60: 2b 9d 00 04 lw ra,(sp+4) 8005c64: 2b 8b 00 08 lw r11,(sp+8) 8005c68: 37 9c 00 10 addi sp,sp,16 8005c6c: c3 a0 00 00 ret 08004910 <_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 ) { 8004910: 37 9c ff ec addi sp,sp,-20 8004914: 5b 8b 00 14 sw (sp+20),r11 8004918: 5b 8c 00 10 sw (sp+16),r12 800491c: 5b 8d 00 0c sw (sp+12),r13 8004920: 5b 8e 00 08 sw (sp+8),r14 8004924: 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; 8004928: 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 ) { 800492c: 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); 8004930: 34 44 00 3c addi r4,r2,60 8004934: 59 64 00 38 sw (r11+56),r4 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 8004938: 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; 800493c: 34 04 00 00 mvi r4,0 8004940: b8 20 60 00 mv r12,r1 8004944: 59 64 00 3c sw (r11+60),r4 the_chain->last = _Chain_Head(the_chain); 8004948: 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 ]; 800494c: b9 a0 08 00 mv r1,r13 8004950: 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 ) { 8004954: 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 ]; 8004958: fb ff ee 4e calli 8000290 <__lshrsi3> 800495c: b4 21 10 00 add r2,r1,r1 8004960: b4 41 08 00 add r1,r2,r1 8004964: 34 02 00 02 mvi r2,2 8004968: fb ff ee 22 calli 80001f0 <__ashlsi3> block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 800496c: 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 ]; 8004970: b5 81 08 00 add r1,r12,r1 block_state = the_thread_queue->state; 8004974: 29 87 00 38 lw r7,(r12+56) if ( _Thread_queue_Is_reverse_search( priority ) ) 8004978: 5c 40 00 23 bne r2,r0,8004a04 <_Thread_queue_Enqueue_priority+0xf4> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800497c: 34 28 00 04 addi r8,r1,4 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 8004980: 34 03 ff fe mvi r3,-2 8004984: 90 00 20 00 rcsr r4,IE 8004988: a0 83 30 00 and r6,r4,r3 800498c: d0 06 00 00 wcsr IE,r6 search_thread = (Thread_Control *) header->first; 8004990: 34 05 ff ff mvi r5,-1 8004994: 28 22 00 00 lw r2,(r1+0) while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8004998: e0 00 00 0b bi 80049c4 <_Thread_queue_Enqueue_priority+0xb4> search_priority = search_thread->current_priority; 800499c: 28 45 00 14 lw r5,(r2+20) if ( priority <= search_priority ) 80049a0: 50 ad 00 0a bgeu r5,r13,80049c8 <_Thread_queue_Enqueue_priority+0xb8> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 80049a4: d0 04 00 00 wcsr IE,r4 80049a8: d0 06 00 00 wcsr IE,r6 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 80049ac: 28 49 00 10 lw r9,(r2+16) 80049b0: a0 e9 48 00 and r9,r7,r9 80049b4: 5d 20 00 03 bne r9,r0,80049c0 <_Thread_queue_Enqueue_priority+0xb0> _ISR_Enable( level ); 80049b8: d0 04 00 00 wcsr IE,r4 <== NOT EXECUTED goto restart_forward_search; 80049bc: e3 ff ff f2 bi 8004984 <_Thread_queue_Enqueue_priority+0x74> <== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 80049c0: 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 ) ) { 80049c4: 5c 48 ff f6 bne r2,r8,800499c <_Thread_queue_Enqueue_priority+0x8c> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 80049c8: 29 83 00 30 lw r3,(r12+48) 80049cc: 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; 80049d0: b8 80 38 00 mv r7,r4 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 80049d4: 5c 61 00 3b bne r3,r1,8004ac0 <_Thread_queue_Enqueue_priority+0x1b0> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 80049d8: 34 01 00 00 mvi r1,0 80049dc: 59 81 00 30 sw (r12+48),r1 if ( priority == search_priority ) 80049e0: 45 a5 00 2f be r13,r5,8004a9c <_Thread_queue_Enqueue_priority+0x18c> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 80049e4: 28 41 00 04 lw r1,(r2+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 80049e8: 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; 80049ec: 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; 80049f0: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 80049f4: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 80049f8: 58 4b 00 04 sw (r2+4),r11 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 80049fc: d0 04 00 00 wcsr IE,r4 8004a00: e0 00 00 25 bi 8004a94 <_Thread_queue_Enqueue_priority+0x184> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8004a04: 78 04 08 01 mvhi r4,0x801 8004a08: 38 84 c0 c0 ori r4,r4,0xc0c0 _ISR_Disable( level ); 8004a0c: 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; 8004a10: 40 86 00 00 lbu r6,(r4+0) 8004a14: 34 c6 00 01 addi r6,r6,1 _ISR_Disable( level ); 8004a18: 90 00 28 00 rcsr r5,IE 8004a1c: a0 a3 40 00 and r8,r5,r3 8004a20: d0 08 00 00 wcsr IE,r8 search_thread = (Thread_Control *) header->last; 8004a24: 28 22 00 08 lw r2,(r1+8) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8004a28: e0 00 00 0b bi 8004a54 <_Thread_queue_Enqueue_priority+0x144> search_priority = search_thread->current_priority; 8004a2c: 28 46 00 14 lw r6,(r2+20) if ( priority >= search_priority ) 8004a30: 51 a6 00 0a bgeu r13,r6,8004a58 <_Thread_queue_Enqueue_priority+0x148> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 8004a34: d0 05 00 00 wcsr IE,r5 8004a38: d0 08 00 00 wcsr IE,r8 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8004a3c: 28 49 00 10 lw r9,(r2+16) 8004a40: a0 e9 48 00 and r9,r7,r9 8004a44: 5d 20 00 03 bne r9,r0,8004a50 <_Thread_queue_Enqueue_priority+0x140> _ISR_Enable( level ); 8004a48: d0 05 00 00 wcsr IE,r5 goto restart_reverse_search; 8004a4c: e3 ff ff f1 bi 8004a10 <_Thread_queue_Enqueue_priority+0x100> } search_thread = (Thread_Control *) 8004a50: 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 ) ) { 8004a54: 5c 41 ff f6 bne r2,r1,8004a2c <_Thread_queue_Enqueue_priority+0x11c> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8004a58: 29 83 00 30 lw r3,(r12+48) 8004a5c: 34 01 00 01 mvi r1,1 8004a60: b8 a0 38 00 mv r7,r5 8004a64: 5c 61 00 17 bne r3,r1,8004ac0 <_Thread_queue_Enqueue_priority+0x1b0> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8004a68: 34 01 00 00 mvi r1,0 8004a6c: 59 81 00 30 sw (r12+48),r1 if ( priority == search_priority ) 8004a70: b8 a0 20 00 mv r4,r5 8004a74: 45 a6 00 0a be r13,r6,8004a9c <_Thread_queue_Enqueue_priority+0x18c> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8004a78: 28 41 00 00 lw r1,(r2+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 8004a7c: 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; 8004a80: 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; 8004a84: 59 61 00 00 sw (r11+0),r1 the_node->previous = search_node; search_node->next = the_node; 8004a88: 58 4b 00 00 sw (r2+0),r11 next_node->previous = the_node; 8004a8c: 58 2b 00 04 sw (r1+4),r11 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 8004a90: d0 05 00 00 wcsr IE,r5 8004a94: 34 01 00 01 mvi r1,1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8004a98: e0 00 00 0c bi 8004ac8 <_Thread_queue_Enqueue_priority+0x1b8> 8004a9c: 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; 8004aa0: 28 41 00 04 lw r1,(r2+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8004aa4: 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; 8004aa8: 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; 8004aac: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 8004ab0: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 8004ab4: 58 4b 00 04 sw (r2+4),r11 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 8004ab8: d0 04 00 00 wcsr IE,r4 8004abc: e3 ff ff f6 bi 8004a94 <_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; 8004ac0: 29 81 00 30 lw r1,(r12+48) <== NOT EXECUTED * 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; 8004ac4: 59 c7 00 00 sw (r14+0),r7 <== NOT EXECUTED return the_thread_queue->sync_state; } 8004ac8: 2b 9d 00 04 lw ra,(sp+4) 8004acc: 2b 8b 00 14 lw r11,(sp+20) 8004ad0: 2b 8c 00 10 lw r12,(sp+16) 8004ad4: 2b 8d 00 0c lw r13,(sp+12) 8004ad8: 2b 8e 00 08 lw r14,(sp+8) 8004adc: 37 9c 00 14 addi sp,sp,20 8004ae0: c3 a0 00 00 ret 08008ea4 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 8008ea4: 37 9c ff fc addi sp,sp,-4 8008ea8: 5b 9d 00 04 sw (sp+4),ra 8008eac: b8 20 10 00 mv r2,r1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 8008eb0: 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 && 8008eb4: 28 24 00 30 lw r4,(r1+48) 8008eb8: 44 80 00 0c be r4,r0,8008ee8 <_Thread_queue_Process_timeout+0x44> 8008ebc: 78 03 08 01 mvhi r3,0x801 8008ec0: 38 63 c8 e0 ori r3,r3,0xc8e0 8008ec4: 28 63 00 00 lw r3,(r3+0) 8008ec8: 5c 43 00 08 bne r2,r3,8008ee8 <_Thread_queue_Process_timeout+0x44> _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 8008ecc: 34 03 00 03 mvi r3,3 8008ed0: 44 83 00 0a be r4,r3,8008ef8 <_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; 8008ed4: 34 03 00 02 mvi r3,2 <== NOT EXECUTED 8008ed8: 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; 8008edc: 28 21 00 3c lw r1,(r1+60) <== NOT EXECUTED 8008ee0: 58 41 00 34 sw (r2+52),r1 <== NOT EXECUTED 8008ee4: e0 00 00 05 bi 8008ef8 <_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; 8008ee8: 28 21 00 3c lw r1,(r1+60) 8008eec: 58 41 00 34 sw (r2+52),r1 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 8008ef0: 28 41 00 44 lw r1,(r2+68) 8008ef4: fb ff ff 93 calli 8008d40 <_Thread_queue_Extract> } } 8008ef8: 2b 9d 00 04 lw ra,(sp+4) 8008efc: 37 9c 00 04 addi sp,sp,4 8008f00: 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 dd 7c ori r17,r17,0xdd7c 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 dc bc ori r16,r16,0xdcbc */ _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 dc 2c ori r13,r13,0xdc2c */ 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 36 calli 8018e08 <_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 2f calli 8018e08 <_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 13 f1 calli 8018d28 <_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 02 ec calli 8014920 <_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) 8013d7c: 5c 78 00 04 bne r3,r24,8013d8c <_Timer_server_Body+0x12c> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8013d80: 34 22 00 10 addi r2,r1,16 8013d84: ba 80 08 00 mv r1,r20 8013d88: e0 00 00 04 bi 8013d98 <_Timer_server_Body+0x138> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8013d8c: 5c 77 ff f8 bne r3,r23,8013d6c <_Timer_server_Body+0x10c> _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8013d90: 34 22 00 10 addi r2,r1,16 8013d94: b9 e0 08 00 mv r1,r15 8013d98: f8 00 14 47 calli 8018eb4 <_Watchdog_Insert> 8013d9c: e3 ff ff f4 bi 8013d6c <_Timer_server_Body+0x10c> * 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 10 c3 calli 8018148 <_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 9e calli 80174c8 <_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 74 calli 8019030 <_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 72 calli 8019030 <_Watchdog_Remove> 8013e6c: e3 ff ff a9 bi 8013d10 <_Timer_server_Body+0xb0> 0803d16c <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) 803d16c: 28 24 00 00 lw r4,(r1+0) 803d170: 28 43 00 00 lw r3,(r2+0) 803d174: 4c 64 00 03 bge r3,r4,803d180 <_Timespec_Greater_than+0x14> 803d178: 34 01 00 01 mvi r1,1 803d17c: c3 a0 00 00 ret return true; if ( lhs->tv_sec < rhs->tv_sec ) 803d180: 4c 83 00 03 bge r4,r3,803d18c <_Timespec_Greater_than+0x20> 803d184: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 803d188: c3 a0 00 00 ret <== NOT EXECUTED #include #include #include bool _Timespec_Greater_than( 803d18c: 28 23 00 04 lw r3,(r1+4) 803d190: 28 41 00 04 lw r1,(r2+4) 803d194: e8 61 08 00 cmpg r1,r3,r1 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 803d198: c3 a0 00 00 ret 08005884 <_Workspace_Allocate_or_fatal_error>: * _Workspace_Allocate_or_fatal_error */ void *_Workspace_Allocate_or_fatal_error( size_t size ) { 8005884: 37 9c ff fc addi sp,sp,-4 8005888: 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 ); 800588c: 34 03 00 00 mvi r3,0 8005890: b8 20 10 00 mv r2,r1 8005894: 78 01 08 01 mvhi r1,0x801 8005898: 38 21 c8 48 ori r1,r1,0xc848 800589c: b8 60 20 00 mv r4,r3 80058a0: f8 00 0a d7 calli 80083fc <_Heap_Allocate_aligned_with_boundary> __builtin_return_address( 1 ), memory ); #endif if ( memory == NULL ) 80058a4: 5c 20 00 04 bne r1,r0,80058b4 <_Workspace_Allocate_or_fatal_error+0x30> _Internal_error_Occurred( 80058a8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80058ac: 34 03 00 04 mvi r3,4 <== NOT EXECUTED 80058b0: fb ff f6 aa calli 8003358 <_Internal_error_Occurred> <== NOT EXECUTED true, INTERNAL_ERROR_WORKSPACE_ALLOCATION ); return memory; } 80058b4: 2b 9d 00 04 lw ra,(sp+4) 80058b8: 37 9c 00 04 addi sp,sp,4 80058bc: c3 a0 00 00 ret 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 dd cc ori r2,r2,0xddcc <== 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 0803c6f4 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 803c6f4: 37 9c ff e8 addi sp,sp,-24 803c6f8: 5b 8b 00 14 sw (sp+20),r11 803c6fc: 5b 8c 00 10 sw (sp+16),r12 803c700: 5b 8d 00 0c sw (sp+12),r13 803c704: 5b 8e 00 08 sw (sp+8),r14 803c708: 5b 9d 00 04 sw (sp+4),ra 803c70c: b8 20 70 00 mv r14,r1 803c710: 78 01 08 06 mvhi r1,0x806 803c714: b8 40 60 00 mv r12,r2 803c718: 38 21 f4 9c ori r1,r1,0xf49c 803c71c: b9 c0 10 00 mv r2,r14 803c720: 37 83 00 18 addi r3,sp,24 803c724: fb ff 3d 77 calli 800bd00 <_Objects_Get> 803c728: 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 ) { 803c72c: 2b 81 00 18 lw r1,(sp+24) 803c730: 5c 20 00 61 bne r1,r0,803c8b4 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 803c734: 78 03 08 06 mvhi r3,0x806 803c738: 38 63 f0 e0 ori r3,r3,0xf0e0 803c73c: 28 61 00 00 lw r1,(r3+0) 803c740: 29 62 00 40 lw r2,(r11+64) 803c744: 44 41 00 04 be r2,r1,803c754 _Thread_Enable_dispatch(); 803c748: fb ff 40 19 calli 800c7ac <_Thread_Enable_dispatch> 803c74c: 34 0b 00 17 mvi r11,23 return RTEMS_NOT_OWNER_OF_RESOURCE; 803c750: e0 00 00 5a bi 803c8b8 } if ( length == RTEMS_PERIOD_STATUS ) { 803c754: 5d 80 00 0d bne r12,r0,803c788 switch ( the_period->state ) { 803c758: 29 61 00 38 lw r1,(r11+56) 803c75c: 34 02 00 04 mvi r2,4 803c760: 50 41 00 03 bgeu r2,r1,803c76c 803c764: b9 80 58 00 mv r11,r12 <== NOT EXECUTED 803c768: e0 00 00 51 bi 803c8ac <== NOT EXECUTED 803c76c: 78 0b 08 06 mvhi r11,0x806 803c770: 34 02 00 02 mvi r2,2 803c774: 39 6b 87 04 ori r11,r11,0x8704 803c778: fb ff 12 70 calli 8001138 <__ashlsi3> 803c77c: b5 61 08 00 add r1,r11,r1 803c780: 28 2b 00 00 lw r11,(r1+0) 803c784: e0 00 00 4a bi 803c8ac } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 803c788: 90 00 68 00 rcsr r13,IE 803c78c: 34 01 ff fe mvi r1,-2 803c790: a1 a1 08 00 and r1,r13,r1 803c794: d0 01 00 00 wcsr IE,r1 switch ( the_period->state ) { 803c798: 29 63 00 38 lw r3,(r11+56) 803c79c: 34 01 00 02 mvi r1,2 803c7a0: 44 61 00 18 be r3,r1,803c800 803c7a4: 34 01 00 04 mvi r1,4 803c7a8: 44 61 00 35 be r3,r1,803c87c 803c7ac: 5c 60 00 42 bne r3,r0,803c8b4 case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 803c7b0: d0 0d 00 00 wcsr IE,r13 /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 803c7b4: b9 60 08 00 mv r1,r11 803c7b8: fb ff ff 31 calli 803c47c <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 803c7bc: 78 03 08 03 mvhi r3,0x803 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 803c7c0: 34 0d 00 00 mvi r13,0 the_watchdog->routine = routine; 803c7c4: 38 63 c8 d8 ori r3,r3,0xc8d8 the_period->state = RATE_MONOTONIC_ACTIVE; 803c7c8: 34 02 00 02 mvi r2,2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803c7cc: 78 01 08 06 mvhi r1,0x806 803c7d0: 59 62 00 38 sw (r11+56),r2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 803c7d4: 59 63 00 2c sw (r11+44),r3 the_watchdog->id = id; 803c7d8: 59 6e 00 30 sw (r11+48),r14 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 803c7dc: 59 6c 00 1c sw (r11+28),r12 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803c7e0: 35 62 00 10 addi r2,r11,16 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 803c7e4: 59 6d 00 18 sw (r11+24),r13 the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 803c7e8: 59 6d 00 34 sw (r11+52),r13 _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 803c7ec: 59 6c 00 3c sw (r11+60),r12 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803c7f0: 38 21 f1 00 ori r1,r1,0xf100 803c7f4: fb ff 44 cd calli 800db28 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 803c7f8: b9 a0 58 00 mv r11,r13 803c7fc: e0 00 00 2c bi 803c8ac case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 803c800: b9 60 08 00 mv r1,r11 803c804: fb ff ff 7c calli 803c5f4 <_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; 803c808: 34 01 00 01 mvi r1,1 the_period->next_length = length; 803c80c: 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; 803c810: 59 61 00 38 sw (r11+56),r1 the_period->next_length = length; _ISR_Enable( level ); 803c814: d0 0d 00 00 wcsr IE,r13 _Thread_Executing->Wait.id = the_period->Object.id; 803c818: 78 01 08 06 mvhi r1,0x806 803c81c: 38 21 f0 e0 ori r1,r1,0xf0e0 803c820: 28 21 00 00 lw r1,(r1+0) 803c824: 29 63 00 08 lw r3,(r11+8) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 803c828: 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; 803c82c: 58 23 00 20 sw (r1+32),r3 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 803c830: fb ff 42 97 calli 800d28c <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 803c834: 90 00 08 00 rcsr r1,IE 803c838: 34 02 ff fe mvi r2,-2 803c83c: a0 22 10 00 and r2,r1,r2 803c840: d0 02 00 00 wcsr IE,r2 local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 803c844: 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; 803c848: 29 62 00 38 lw r2,(r11+56) the_period->state = RATE_MONOTONIC_ACTIVE; 803c84c: 59 63 00 38 sw (r11+56),r3 _ISR_Enable( level ); 803c850: 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 ) 803c854: 34 01 00 03 mvi r1,3 803c858: 5c 41 00 06 bne r2,r1,803c870 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 803c85c: 78 01 08 06 mvhi r1,0x806 803c860: 38 21 f0 e0 ori r1,r1,0xf0e0 803c864: 28 21 00 00 lw r1,(r1+0) 803c868: 34 02 40 00 mvi r2,16384 803c86c: fb ff ba 87 calli 802b288 <_Thread_Clear_state> _Thread_Enable_dispatch(); 803c870: fb ff 3f cf calli 800c7ac <_Thread_Enable_dispatch> 803c874: 34 0b 00 00 mvi r11,0 return RTEMS_SUCCESSFUL; 803c878: e0 00 00 10 bi 803c8b8 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 803c87c: b9 60 08 00 mv r1,r11 803c880: fb ff ff 5d calli 803c5f4 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 803c884: d0 0d 00 00 wcsr IE,r13 the_period->state = RATE_MONOTONIC_ACTIVE; 803c888: 34 02 00 02 mvi r2,2 803c88c: 78 01 08 06 mvhi r1,0x806 803c890: 59 62 00 38 sw (r11+56),r2 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 803c894: 59 6c 00 1c sw (r11+28),r12 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803c898: 35 62 00 10 addi r2,r11,16 the_period->next_length = length; 803c89c: 59 6c 00 3c sw (r11+60),r12 803c8a0: 38 21 f1 00 ori r1,r1,0xf100 803c8a4: fb ff 44 a1 calli 800db28 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 803c8a8: 34 0b 00 06 mvi r11,6 803c8ac: fb ff 3f c0 calli 800c7ac <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 803c8b0: e0 00 00 02 bi 803c8b8 803c8b4: 34 0b 00 04 mvi r11,4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 803c8b8: b9 60 08 00 mv r1,r11 803c8bc: 2b 9d 00 04 lw ra,(sp+4) 803c8c0: 2b 8b 00 14 lw r11,(sp+20) 803c8c4: 2b 8c 00 10 lw r12,(sp+16) 803c8c8: 2b 8d 00 0c lw r13,(sp+12) 803c8cc: 2b 8e 00 08 lw r14,(sp+8) 803c8d0: 37 9c 00 18 addi sp,sp,24 803c8d4: c3 a0 00 00 ret