=============================================================================== 080046e4 <_API_extensions_Add_post_switch>: */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 80046e4: 28 22 00 00 lw r2,(r1+0) 80046e8: 44 40 00 02 be r2,r0,80046f0 <_API_extensions_Add_post_switch+0xc> 80046ec: c3 a0 00 00 ret 80046f0: 28 23 00 04 lw r3,(r1+4) 80046f4: 5c 62 ff fe bne r3,r2,80046ec <_API_extensions_Add_post_switch+0x8><== NEVER TAKEN Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 80046f8: 78 02 08 01 mvhi r2,0x801 80046fc: 38 42 e9 50 ori r2,r2,0xe950 8004700: 28 44 00 08 lw r4,(r2+8) the_node->next = tail; 8004704: 78 03 08 01 mvhi r3,0x801 8004708: 38 63 e9 54 ori r3,r3,0xe954 800470c: 58 23 00 00 sw (r1+0),r3 tail->previous = the_node; 8004710: 58 41 00 08 sw (r2+8),r1 old_last->next = the_node; 8004714: 58 81 00 00 sw (r4+0),r1 the_node->previous = old_last; 8004718: 58 24 00 04 sw (r1+4),r4 800471c: c3 a0 00 00 ret =============================================================================== 08004720 <_API_extensions_Run_postdriver>: } } #endif void _API_extensions_Run_postdriver( void ) { 8004720: 37 9c ff f4 addi sp,sp,-12 8004724: 5b 8b 00 0c sw (sp+12),r11 8004728: 5b 8c 00 08 sw (sp+8),r12 800472c: 5b 9d 00 04 sw (sp+4),ra #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 8004730: 78 01 08 01 mvhi r1,0x801 8004734: 38 21 ea 10 ori r1,r1,0xea10 8004738: 28 2b 00 00 lw r11,(r1+0) void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 800473c: 78 0c 08 01 mvhi r12,0x801 8004740: 39 8c ea 14 ori r12,r12,0xea14 8004744: 45 6c 00 05 be r11,r12,8004758 <_API_extensions_Run_postdriver+0x38><== NEVER TAKEN * Currently all APIs configure this hook so it is always non-NULL. */ #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); 8004748: 29 61 00 08 lw r1,(r11+8) 800474c: d8 20 00 00 call r1 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 8004750: 29 6b 00 00 lw r11,(r11+0) void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 8004754: 5d 6c ff fd bne r11,r12,8004748 <_API_extensions_Run_postdriver+0x28><== NEVER TAKEN #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 8004758: 2b 9d 00 04 lw ra,(sp+4) 800475c: 2b 8b 00 0c lw r11,(sp+12) 8004760: 2b 8c 00 08 lw r12,(sp+8) 8004764: 37 9c 00 0c addi sp,sp,12 8004768: c3 a0 00 00 ret =============================================================================== 0800f638 <_CORE_message_queue_Initialize>: CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 800f638: 37 9c ff e8 addi sp,sp,-24 800f63c: 5b 8b 00 18 sw (sp+24),r11 800f640: 5b 8c 00 14 sw (sp+20),r12 800f644: 5b 8d 00 10 sw (sp+16),r13 800f648: 5b 8e 00 0c sw (sp+12),r14 800f64c: 5b 8f 00 08 sw (sp+8),r15 800f650: 5b 9d 00 04 sw (sp+4),ra 800f654: b8 20 58 00 mv r11,r1 size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; the_message_queue->number_of_pending_messages = 0; 800f658: 58 20 00 48 sw (r1+72),r0 the_message_queue->maximum_message_size = maximum_message_size; 800f65c: 58 24 00 4c sw (r1+76),r4 ) { size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 800f660: 59 63 00 44 sw (r11+68),r3 /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 800f664: 20 81 00 03 andi r1,r4,0x3 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 800f668: b8 60 60 00 mv r12,r3 800f66c: b8 40 78 00 mv r15,r2 /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 800f670: b8 80 28 00 mv r5,r4 800f674: 44 20 00 06 be r1,r0,800f68c <_CORE_message_queue_Initialize+0x54> allocated_message_size += sizeof(uintptr_t); 800f678: 34 85 00 04 addi r5,r4,4 allocated_message_size &= ~(sizeof(uintptr_t) - 1); 800f67c: 34 01 ff fc mvi r1,-4 800f680: a0 a1 28 00 and r5,r5,r1 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) return false; 800f684: 34 0d 00 00 mvi r13,0 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) 800f688: 54 85 00 1f bgu r4,r5,800f704 <_CORE_message_queue_Initialize+0xcc> /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( 800f68c: 34 ae 00 10 addi r14,r5,16 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 800f690: 34 01 00 00 mvi r1,0 800f694: b9 c0 10 00 mv r2,r14 800f698: 34 03 00 00 mvi r3,0 800f69c: b9 80 20 00 mv r4,r12 800f6a0: f8 00 42 f8 calli 8020280 <__muldi3> */ if ( !size_t_mult32_with_overflow( (size_t) maximum_pending_messages, allocated_message_size + sizeof(CORE_message_queue_Buffer_control), &message_buffering_required ) ) return false; 800f6a4: 34 0d 00 00 mvi r13,0 size_t *c ) { long long x = (long long)a*b; if ( x > SIZE_MAX ) 800f6a8: 48 20 00 17 bg r1,r0,800f704 <_CORE_message_queue_Initialize+0xcc> /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 800f6ac: b8 40 08 00 mv r1,r2 800f6b0: f8 00 0e 98 calli 8013110 <_Workspace_Allocate> return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 800f6b4: 59 61 00 5c sw (r11+92),r1 _Workspace_Allocate( message_buffering_required ); 800f6b8: b8 20 18 00 mv r3,r1 if (the_message_queue->message_buffers == 0) 800f6bc: 44 20 00 12 be r1,r0,800f704 <_CORE_message_queue_Initialize+0xcc><== NEVER TAKEN /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 800f6c0: b8 60 10 00 mv r2,r3 800f6c4: 35 61 00 60 addi r1,r11,96 800f6c8: b9 80 18 00 mv r3,r12 800f6cc: b9 c0 20 00 mv r4,r14 800f6d0: fb ff ff b9 calli 800f5b4 <_Chain_Initialize> RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 800f6d4: 35 62 00 54 addi r2,r11,84 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 800f6d8: 35 61 00 50 addi r1,r11,80 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 800f6dc: 59 61 00 58 sw (r11+88),r1 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 800f6e0: 59 62 00 50 sw (r11+80),r2 head->previous = NULL; 800f6e4: 59 60 00 54 sw (r11+84),r0 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 800f6e8: 29 e2 00 00 lw r2,(r15+0) 800f6ec: b9 60 08 00 mv r1,r11 800f6f0: 34 03 00 80 mvi r3,128 800f6f4: 64 42 00 01 cmpei r2,r2,1 800f6f8: 34 04 00 06 mvi r4,6 800f6fc: f8 00 0b da calli 8012664 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 800f700: 34 0d 00 01 mvi r13,1 } 800f704: b9 a0 08 00 mv r1,r13 800f708: 2b 9d 00 04 lw ra,(sp+4) 800f70c: 2b 8b 00 18 lw r11,(sp+24) 800f710: 2b 8c 00 14 lw r12,(sp+20) 800f714: 2b 8d 00 10 lw r13,(sp+16) 800f718: 2b 8e 00 0c lw r14,(sp+12) 800f71c: 2b 8f 00 08 lw r15,(sp+8) 800f720: 37 9c 00 18 addi sp,sp,24 800f724: c3 a0 00 00 ret =============================================================================== 08004d78 <_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 ) { 8004d78: 37 9c ff f8 addi sp,sp,-8 8004d7c: 5b 8b 00 08 sw (sp+8),r11 8004d80: 5b 9d 00 04 sw (sp+4),ra 8004d84: 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)) ) { 8004d88: f8 00 08 94 calli 8006fd8 <_Thread_queue_Dequeue> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8004d8c: 34 02 00 00 mvi r2,0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8004d90: 44 20 00 06 be r1,r0,8004da8 <_CORE_semaphore_Surrender+0x30> status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 8004d94: b8 40 08 00 mv r1,r2 8004d98: 2b 9d 00 04 lw ra,(sp+4) 8004d9c: 2b 8b 00 08 lw r11,(sp+8) 8004da0: 37 9c 00 08 addi sp,sp,8 8004da4: c3 a0 00 00 ret if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 8004da8: 90 00 08 00 rcsr r1,IE 8004dac: 34 02 ff fe mvi r2,-2 8004db0: a0 22 10 00 and r2,r1,r2 8004db4: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8004db8: 29 63 00 48 lw r3,(r11+72) 8004dbc: 29 64 00 40 lw r4,(r11+64) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 8004dc0: 34 02 00 04 mvi r2,4 (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8004dc4: 50 64 00 04 bgeu r3,r4,8004dd4 <_CORE_semaphore_Surrender+0x5c><== NEVER TAKEN the_semaphore->count += 1; 8004dc8: 34 63 00 01 addi r3,r3,1 8004dcc: 59 63 00 48 sw (r11+72),r3 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8004dd0: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 8004dd4: d0 01 00 00 wcsr IE,r1 } return status; } 8004dd8: b8 40 08 00 mv r1,r2 8004ddc: 2b 9d 00 04 lw ra,(sp+4) 8004de0: 2b 8b 00 08 lw r11,(sp+8) 8004de4: 37 9c 00 08 addi sp,sp,8 8004de8: c3 a0 00 00 ret =============================================================================== 08004918 <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 8004918: 37 9c ff f0 addi sp,sp,-16 800491c: 5b 8b 00 10 sw (sp+16),r11 8004920: 5b 8c 00 0c sw (sp+12),r12 8004924: 5b 8d 00 08 sw (sp+8),r13 8004928: 5b 9d 00 04 sw (sp+4),ra Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; 800492c: 58 20 00 04 sw (r1+4),r0 Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 8004930: b8 20 58 00 mv r11,r1 8004934: b8 40 60 00 mv r12,r2 size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8004938: 34 2d 00 04 addi r13,r1,4 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 800493c: 44 60 00 10 be r3,r0,800497c <_Chain_Initialize+0x64> <== NEVER TAKEN 8004940: 34 63 ff ff addi r3,r3,-1 8004944: b8 60 10 00 mv r2,r3 { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; 8004948: b9 80 28 00 mv r5,r12 ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; 800494c: b9 60 30 00 mv r6,r11 8004950: e0 00 00 04 bi 8004960 <_Chain_Initialize+0x48> Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 8004954: b8 a0 30 00 mv r6,r5 8004958: 34 63 ff ff addi r3,r3,-1 current->next = next; next->previous = current; current = next; next = (Chain_Node *) 800495c: b8 e0 28 00 mv r5,r7 Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { current->next = next; 8004960: 58 c5 00 00 sw (r6+0),r5 next->previous = current; 8004964: 58 a6 00 04 sw (r5+4),r6 #include #include #include #include void _Chain_Initialize( 8004968: b4 a4 38 00 add r7,r5,r4 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 800496c: 5c 60 ff fa bne r3,r0,8004954 <_Chain_Initialize+0x3c> #include #include #include #include void _Chain_Initialize( 8004970: b8 80 08 00 mv r1,r4 8004974: f8 00 58 8c calli 801aba4 <__mulsi3> Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 8004978: b5 81 08 00 add r1,r12,r1 current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = tail; 800497c: 58 2d 00 00 sw (r1+0),r13 tail->previous = current; 8004980: 59 61 00 08 sw (r11+8),r1 } 8004984: 2b 9d 00 04 lw ra,(sp+4) 8004988: 2b 8b 00 10 lw r11,(sp+16) 800498c: 2b 8c 00 0c lw r12,(sp+12) 8004990: 2b 8d 00 08 lw r13,(sp+8) 8004994: 37 9c 00 10 addi sp,sp,16 8004998: c3 a0 00 00 ret =============================================================================== 080098b0 <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 80098b0: 37 9c ff f4 addi sp,sp,-12 80098b4: 5b 8b 00 0c sw (sp+12),r11 80098b8: 5b 8c 00 08 sw (sp+8),r12 80098bc: 5b 9d 00 04 sw (sp+4),ra rtems_event_set pending_events; rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; 80098c0: 28 2a 00 30 lw r10,(r1+48) rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 80098c4: b8 20 58 00 mv r11,r1 rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 80098c8: 90 00 08 00 rcsr r1,IE 80098cc: 34 09 ff fe mvi r9,-2 80098d0: a0 29 48 00 and r9,r1,r9 80098d4: d0 09 00 00 wcsr IE,r9 RTEMS_INLINE_ROUTINE void _Event_sets_Post( rtems_event_set the_new_events, rtems_event_set *the_event_set ) { *the_event_set |= the_new_events; 80098d8: 28 66 00 00 lw r6,(r3+0) _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; 80098dc: 29 68 00 24 lw r8,(r11+36) 80098e0: b8 46 10 00 or r2,r2,r6 80098e4: 58 62 00 00 sw (r3+0),r2 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 80098e8: a0 48 30 00 and r6,r2,r8 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 80098ec: 44 c0 00 32 be r6,r0,80099b4 <_Event_Surrender+0x104> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 80098f0: 78 07 08 01 mvhi r7,0x801 80098f4: 38 e7 ea 60 ori r7,r7,0xea60 80098f8: 28 ec 00 08 lw r12,(r7+8) 80098fc: 45 80 00 03 be r12,r0,8009908 <_Event_Surrender+0x58> 8009900: 28 e7 00 10 lw r7,(r7+16) 8009904: 45 67 00 1d be r11,r7,8009978 <_Event_Surrender+0xc8> RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 8009908: 29 64 00 10 lw r4,(r11+16) 800990c: a0 a4 28 00 and r5,r5,r4 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 8009910: 44 a0 00 29 be r5,r0,80099b4 <_Event_Surrender+0x104> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 8009914: 45 06 00 03 be r8,r6,8009920 <_Event_Surrender+0x70> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 8009918: 21 4a 00 02 andi r10,r10,0x2 800991c: 45 40 00 26 be r10,r0,80099b4 <_Event_Surrender+0x104> <== NEVER TAKEN RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 8009920: a4 c0 20 00 not r4,r6 event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 8009924: 29 65 00 28 lw r5,(r11+40) 8009928: a0 82 10 00 and r2,r4,r2 /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( 800992c: 58 62 00 00 sw (r3+0),r2 pending_events, seized_events ); the_thread->Wait.count = 0; 8009930: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 8009934: 58 a6 00 00 sw (r5+0),r6 _ISR_Flash( level ); 8009938: d0 01 00 00 wcsr IE,r1 800993c: d0 09 00 00 wcsr IE,r9 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 8009940: 29 63 00 50 lw r3,(r11+80) 8009944: 34 02 00 02 mvi r2,2 8009948: 44 62 00 21 be r3,r2,80099cc <_Event_Surrender+0x11c> _ISR_Enable( level ); 800994c: d0 01 00 00 wcsr IE,r1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 8009950: 78 01 08 01 mvhi r1,0x801 8009954: 38 21 c3 38 ori r1,r1,0xc338 8009958: 28 22 00 00 lw r2,(r1+0) 800995c: b9 60 08 00 mv r1,r11 8009960: f8 00 02 c9 calli 800a484 <_Thread_Clear_state> } return; } } _ISR_Enable( level ); } 8009964: 2b 9d 00 04 lw ra,(sp+4) 8009968: 2b 8b 00 0c lw r11,(sp+12) 800996c: 2b 8c 00 08 lw r12,(sp+8) 8009970: 37 9c 00 0c addi sp,sp,12 8009974: c3 a0 00 00 ret * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 8009978: 28 8c 00 00 lw r12,(r4+0) /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 800997c: 34 07 00 01 mvi r7,1 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 8009980: 35 8c ff ff addi r12,r12,-1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 8009984: 55 87 ff e1 bgu r12,r7,8009908 <_Event_Surrender+0x58> <== NEVER TAKEN ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 8009988: 45 06 00 03 be r8,r6,8009994 <_Event_Surrender+0xe4> <== ALWAYS TAKEN 800998c: 21 4a 00 02 andi r10,r10,0x2 <== NOT EXECUTED 8009990: 45 40 00 09 be r10,r0,80099b4 <_Event_Surrender+0x104> <== NOT EXECUTED 8009994: a4 c0 38 00 not r7,r6 event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 8009998: 29 65 00 28 lw r5,(r11+40) 800999c: a0 e2 10 00 and r2,r7,r2 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( 80099a0: 58 62 00 00 sw (r3+0),r2 pending_events, seized_events ); the_thread->Wait.count = 0; 80099a4: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 80099a8: 58 a6 00 00 sw (r5+0),r6 *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 80099ac: 34 02 00 03 mvi r2,3 80099b0: 58 82 00 00 sw (r4+0),r2 _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 80099b4: d0 01 00 00 wcsr IE,r1 } 80099b8: 2b 9d 00 04 lw ra,(sp+4) 80099bc: 2b 8b 00 0c lw r11,(sp+12) 80099c0: 2b 8c 00 08 lw r12,(sp+8) 80099c4: 37 9c 00 0c addi sp,sp,12 80099c8: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 80099cc: 34 02 00 03 mvi r2,3 80099d0: 59 62 00 50 sw (r11+80),r2 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 80099d4: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 80099d8: 35 61 00 48 addi r1,r11,72 80099dc: fb ff f8 95 calli 8007c30 <_Watchdog_Remove> 80099e0: 78 03 08 01 mvhi r3,0x801 80099e4: 38 63 c3 38 ori r3,r3,0xc338 80099e8: 28 62 00 00 lw r2,(r3+0) 80099ec: b9 60 08 00 mv r1,r11 80099f0: f8 00 02 a5 calli 800a484 <_Thread_Clear_state> 80099f4: e3 ff ff f1 bi 80099b8 <_Event_Surrender+0x108> =============================================================================== 0800e420 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 800e420: 37 9c ff f4 addi sp,sp,-12 800e424: 5b 8b 00 08 sw (sp+8),r11 800e428: 5b 9d 00 04 sw (sp+4),ra 800e42c: b8 40 58 00 mv r11,r2 ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); 800e430: 37 82 00 0c addi r2,sp,12 800e434: fb ff e6 4d calli 8007d68 <_Thread_Get> switch ( location ) { 800e438: 2b 82 00 0c lw r2,(sp+12) 800e43c: 44 40 00 05 be r2,r0,800e450 <_Event_Timeout+0x30> <== ALWAYS TAKEN case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800e440: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800e444: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 800e448: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 800e44c: c3 a0 00 00 ret <== NOT EXECUTED * * 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 ); 800e450: 90 00 20 00 rcsr r4,IE 800e454: 34 03 ff fe mvi r3,-2 800e458: a0 83 18 00 and r3,r4,r3 800e45c: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800e460: 78 03 08 01 mvhi r3,0x801 800e464: 38 63 9a 80 ori r3,r3,0x9a80 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800e468: 28 63 00 10 lw r3,(r3+16) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800e46c: 58 20 00 24 sw (r1+36),r0 if ( _Thread_Is_executing( the_thread ) ) { 800e470: 44 23 00 11 be r1,r3,800e4b4 <_Event_Timeout+0x94> <== NEVER TAKEN if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800e474: 34 02 00 06 mvi r2,6 800e478: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800e47c: d0 04 00 00 wcsr IE,r4 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800e480: 78 03 08 01 mvhi r3,0x801 800e484: 38 63 83 bc ori r3,r3,0x83bc 800e488: 28 62 00 00 lw r2,(r3+0) 800e48c: f8 00 04 9d calli 800f700 <_Thread_Clear_state> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 800e490: 78 01 08 01 mvhi r1,0x801 800e494: 38 21 99 00 ori r1,r1,0x9900 800e498: 28 22 00 00 lw r2,(r1+0) --level; 800e49c: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 800e4a0: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800e4a4: 2b 9d 00 04 lw ra,(sp+4) 800e4a8: 2b 8b 00 08 lw r11,(sp+8) 800e4ac: 37 9c 00 0c addi sp,sp,12 800e4b0: c3 a0 00 00 ret } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800e4b4: 29 63 00 00 lw r3,(r11+0) <== NOT EXECUTED 800e4b8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 800e4bc: 5c 62 ff ee bne r3,r2,800e474 <_Event_Timeout+0x54> <== NOT EXECUTED *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800e4c0: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 800e4c4: 59 62 00 00 sw (r11+0),r2 <== NOT EXECUTED 800e4c8: e3 ff ff eb bi 800e474 <_Event_Timeout+0x54> <== NOT EXECUTED =============================================================================== 08009fc0 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 8009fc0: 37 9c ff bc addi sp,sp,-68 8009fc4: 5b 8b 00 44 sw (sp+68),r11 8009fc8: 5b 8c 00 40 sw (sp+64),r12 8009fcc: 5b 8d 00 3c sw (sp+60),r13 8009fd0: 5b 8e 00 38 sw (sp+56),r14 8009fd4: 5b 8f 00 34 sw (sp+52),r15 8009fd8: 5b 90 00 30 sw (sp+48),r16 8009fdc: 5b 91 00 2c sw (sp+44),r17 8009fe0: 5b 92 00 28 sw (sp+40),r18 8009fe4: 5b 93 00 24 sw (sp+36),r19 8009fe8: 5b 94 00 20 sw (sp+32),r20 8009fec: 5b 95 00 1c sw (sp+28),r21 8009ff0: 5b 96 00 18 sw (sp+24),r22 8009ff4: 5b 97 00 14 sw (sp+20),r23 8009ff8: 5b 98 00 10 sw (sp+16),r24 8009ffc: 5b 99 00 0c sw (sp+12),r25 800a000: 5b 9b 00 08 sw (sp+8),fp 800a004: 5b 9d 00 04 sw (sp+4),ra Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE 800a008: 34 54 00 04 addi r20,r2,4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800a00c: b8 20 78 00 mv r15,r1 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; 800a010: 28 37 00 10 lw r23,(r1+16) Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800a014: b8 40 70 00 mv r14,r2 800a018: b8 60 80 00 mv r16,r3 800a01c: b8 80 90 00 mv r18,r4 uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { /* Integer overflow occured */ return NULL; 800a020: 34 01 00 00 mvi r1,0 Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { 800a024: 54 54 00 5b bgu r2,r20,800a190 <_Heap_Allocate_aligned_with_boundary+0x1d0> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 800a028: 5c 80 00 6f bne r4,r0,800a1e4 <_Heap_Allocate_aligned_with_boundary+0x224> if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 800a02c: 29 ec 00 08 lw r12,(r15+8) do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800a030: 34 01 00 00 mvi r1,0 800a034: 45 ec 00 57 be r15,r12,800a190 <_Heap_Allocate_aligned_with_boundary+0x1d0> uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 800a038: 34 18 00 04 mvi r24,4 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800a03c: 34 11 00 01 mvi r17,1 - 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; 800a040: 34 1b ff fe mvi fp,-2 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 800a044: 36 f9 00 07 addi r25,r23,7 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 800a048: cb 0e c0 00 sub r24,r24,r14 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 800a04c: 29 81 00 04 lw r1,(r12+4) 800a050: 52 81 00 3b bgeu r20,r1,800a13c <_Heap_Allocate_aligned_with_boundary+0x17c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 800a054: 35 8b 00 08 addi r11,r12,8 if ( alignment == 0 ) { 800a058: 46 00 00 3e be r16,r0,800a150 <_Heap_Allocate_aligned_with_boundary+0x190> - 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; 800a05c: a0 3b 68 00 and r13,r1,fp if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 800a060: 29 f5 00 14 lw r21,(r15+20) uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 800a064: b5 8d 68 00 add r13,r12,r13 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; 800a068: b7 0d 58 00 add r11,r24,r13 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 800a06c: cb 35 18 00 sub r3,r25,r21 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800a070: b9 60 08 00 mv r1,r11 800a074: ba 00 10 00 mv r2,r16 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 800a078: b4 6d 68 00 add r13,r3,r13 800a07c: f8 00 43 3f calli 801ad78 <__umodsi3> 800a080: c9 61 58 00 sub r11,r11,r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 800a084: 35 96 00 08 addi r22,r12,8 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 800a088: 51 ab 00 05 bgeu r13,r11,800a09c <_Heap_Allocate_aligned_with_boundary+0xdc> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800a08c: b9 a0 08 00 mv r1,r13 800a090: ba 00 10 00 mv r2,r16 800a094: f8 00 43 39 calli 801ad78 <__umodsi3> 800a098: c9 a1 58 00 sub r11,r13,r1 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 800a09c: 46 40 00 1c be r18,r0,800a10c <_Heap_Allocate_aligned_with_boundary+0x14c> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 800a0a0: b5 6e 68 00 add r13,r11,r14 800a0a4: b9 a0 08 00 mv r1,r13 800a0a8: ba 40 10 00 mv r2,r18 800a0ac: f8 00 43 33 calli 801ad78 <__umodsi3> 800a0b0: c9 a1 28 00 sub r5,r13,r1 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 800a0b4: f5 a5 68 00 cmpgu r13,r13,r5 800a0b8: f4 ab 08 00 cmpgu r1,r5,r11 800a0bc: a1 a1 68 00 and r13,r13,r1 800a0c0: 45 a0 00 13 be r13,r0,800a10c <_Heap_Allocate_aligned_with_boundary+0x14c> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 800a0c4: b6 ce 98 00 add r19,r22,r14 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 800a0c8: 56 65 00 1d bgu r19,r5,800a13c <_Heap_Allocate_aligned_with_boundary+0x17c> 800a0cc: e0 00 00 02 bi 800a0d4 <_Heap_Allocate_aligned_with_boundary+0x114> 800a0d0: 56 65 00 1b bgu r19,r5,800a13c <_Heap_Allocate_aligned_with_boundary+0x17c><== NEVER TAKEN return 0; } alloc_begin = boundary_line - alloc_size; 800a0d4: c8 ae 58 00 sub r11,r5,r14 800a0d8: ba 00 10 00 mv r2,r16 800a0dc: b9 60 08 00 mv r1,r11 800a0e0: f8 00 43 26 calli 801ad78 <__umodsi3> 800a0e4: c9 61 58 00 sub r11,r11,r1 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 800a0e8: b5 6e 68 00 add r13,r11,r14 800a0ec: b9 a0 08 00 mv r1,r13 800a0f0: ba 40 10 00 mv r2,r18 800a0f4: f8 00 43 21 calli 801ad78 <__umodsi3> 800a0f8: c9 a1 28 00 sub r5,r13,r1 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 800a0fc: f5 a5 68 00 cmpgu r13,r13,r5 800a100: f4 ab 08 00 cmpgu r1,r5,r11 800a104: a1 a1 68 00 and r13,r13,r1 800a108: 5d a0 ff f2 bne r13,r0,800a0d0 <_Heap_Allocate_aligned_with_boundary+0x110> boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 800a10c: 56 cb 00 0c bgu r22,r11,800a13c <_Heap_Allocate_aligned_with_boundary+0x17c> 800a110: 34 01 ff f8 mvi r1,-8 800a114: c8 2c 68 00 sub r13,r1,r12 800a118: ba e0 10 00 mv r2,r23 800a11c: b9 60 08 00 mv r1,r11 800a120: f8 00 43 16 calli 801ad78 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800a124: b5 ab 68 00 add r13,r13,r11 uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 800a128: c9 a1 08 00 sub r1,r13,r1 if ( free_size >= min_block_size || free_size == 0 ) { 800a12c: 64 22 00 00 cmpei r2,r1,0 800a130: f0 35 a8 00 cmpgeu r21,r1,r21 800a134: b8 55 08 00 or r1,r2,r21 800a138: 5c 20 00 06 bne r1,r0,800a150 <_Heap_Allocate_aligned_with_boundary+0x190> if ( alloc_begin != 0 ) { break; } block = block->next; 800a13c: 29 8c 00 08 lw r12,(r12+8) 800a140: 36 21 00 01 addi r1,r17,1 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800a144: 45 ec 00 26 be r15,r12,800a1dc <_Heap_Allocate_aligned_with_boundary+0x21c> 800a148: b8 20 88 00 mv r17,r1 800a14c: e3 ff ff c0 bi 800a04c <_Heap_Allocate_aligned_with_boundary+0x8c> } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { 800a150: 45 60 ff fb be r11,r0,800a13c <_Heap_Allocate_aligned_with_boundary+0x17c><== NEVER TAKEN search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 800a154: 29 e3 00 48 lw r3,(r15+72) stats->searches += search_count; 800a158: 29 e2 00 4c lw r2,(r15+76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 800a15c: b9 e0 08 00 mv r1,r15 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 800a160: 34 63 00 01 addi r3,r3,1 stats->searches += search_count; 800a164: b4 51 10 00 add r2,r2,r17 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 800a168: 59 e3 00 48 sw (r15+72),r3 stats->searches += search_count; 800a16c: 59 e2 00 4c sw (r15+76),r2 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 800a170: b9 60 18 00 mv r3,r11 800a174: b9 80 10 00 mv r2,r12 800a178: b9 c0 20 00 mv r4,r14 800a17c: fb ff ec 56 calli 80052d4 <_Heap_Block_allocate> 800a180: b9 60 08 00 mv r1,r11 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 800a184: 29 e2 00 44 lw r2,(r15+68) 800a188: 50 51 00 02 bgeu r2,r17,800a190 <_Heap_Allocate_aligned_with_boundary+0x1d0> stats->max_search = search_count; 800a18c: 59 f1 00 44 sw (r15+68),r17 } return (void *) alloc_begin; } 800a190: 2b 9d 00 04 lw ra,(sp+4) 800a194: 2b 8b 00 44 lw r11,(sp+68) 800a198: 2b 8c 00 40 lw r12,(sp+64) 800a19c: 2b 8d 00 3c lw r13,(sp+60) 800a1a0: 2b 8e 00 38 lw r14,(sp+56) 800a1a4: 2b 8f 00 34 lw r15,(sp+52) 800a1a8: 2b 90 00 30 lw r16,(sp+48) 800a1ac: 2b 91 00 2c lw r17,(sp+44) 800a1b0: 2b 92 00 28 lw r18,(sp+40) 800a1b4: 2b 93 00 24 lw r19,(sp+36) 800a1b8: 2b 94 00 20 lw r20,(sp+32) 800a1bc: 2b 95 00 1c lw r21,(sp+28) 800a1c0: 2b 96 00 18 lw r22,(sp+24) 800a1c4: 2b 97 00 14 lw r23,(sp+20) 800a1c8: 2b 98 00 10 lw r24,(sp+16) 800a1cc: 2b 99 00 0c lw r25,(sp+12) 800a1d0: 2b 9b 00 08 lw fp,(sp+8) 800a1d4: 37 9c 00 44 addi sp,sp,68 800a1d8: c3 a0 00 00 ret do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800a1dc: 34 01 00 00 mvi r1,0 800a1e0: e3 ff ff e9 bi 800a184 <_Heap_Allocate_aligned_with_boundary+0x1c4> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 800a1e4: 54 44 ff eb bgu r2,r4,800a190 <_Heap_Allocate_aligned_with_boundary+0x1d0> return NULL; } if ( alignment == 0 ) { 800a1e8: 5c 60 ff 91 bne r3,r0,800a02c <_Heap_Allocate_aligned_with_boundary+0x6c> alignment = page_size; 800a1ec: ba e0 80 00 mv r16,r23 800a1f0: e3 ff ff 8f bi 800a02c <_Heap_Allocate_aligned_with_boundary+0x6c> =============================================================================== 08009c74 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { 8009c74: 37 9c ff bc addi sp,sp,-68 8009c78: 5b 8b 00 3c sw (sp+60),r11 8009c7c: 5b 8c 00 38 sw (sp+56),r12 8009c80: 5b 8d 00 34 sw (sp+52),r13 8009c84: 5b 8e 00 30 sw (sp+48),r14 8009c88: 5b 8f 00 2c sw (sp+44),r15 8009c8c: 5b 90 00 28 sw (sp+40),r16 8009c90: 5b 91 00 24 sw (sp+36),r17 8009c94: 5b 92 00 20 sw (sp+32),r18 8009c98: 5b 93 00 1c sw (sp+28),r19 8009c9c: 5b 94 00 18 sw (sp+24),r20 8009ca0: 5b 95 00 14 sw (sp+20),r21 8009ca4: 5b 96 00 10 sw (sp+16),r22 8009ca8: 5b 97 00 0c sw (sp+12),r23 8009cac: 5b 98 00 08 sw (sp+8),r24 8009cb0: 5b 9d 00 04 sw (sp+4),ra Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 8009cb4: 5b 80 00 44 sw (sp+68),r0 Heap_Block *extend_last_block = NULL; 8009cb8: 5b 80 00 40 sw (sp+64),r0 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 8009cbc: b4 43 70 00 add r14,r2,r3 Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { 8009cc0: b8 40 68 00 mv r13,r2 8009cc4: b8 20 58 00 mv r11,r1 Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 8009cc8: 28 30 00 20 lw r16,(r1+32) Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 8009ccc: 28 32 00 10 lw r18,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8009cd0: 28 24 00 14 lw r4,(r1+20) uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 8009cd4: 28 37 00 30 lw r23,(r1+48) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { return 0; 8009cd8: 34 0c 00 00 mvi r12,0 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 8009cdc: 54 4e 00 72 bgu r2,r14,8009ea4 <_Heap_Extend+0x230> return 0; } extend_area_ok = _Heap_Get_first_and_last_block( 8009ce0: b8 40 08 00 mv r1,r2 8009ce4: 37 85 00 44 addi r5,sp,68 8009ce8: b8 60 10 00 mv r2,r3 8009cec: 37 86 00 40 addi r6,sp,64 8009cf0: ba 40 18 00 mv r3,r18 8009cf4: fb ff ec 01 calli 8004cf8 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 8009cf8: 44 20 00 6b be r1,r0,8009ea4 <_Heap_Extend+0x230> 8009cfc: ba 00 60 00 mv r12,r16 8009d00: 34 16 00 00 mvi r22,0 8009d04: 34 18 00 00 mvi r24,0 8009d08: 34 11 00 00 mvi r17,0 8009d0c: 34 14 00 00 mvi r20,0 - 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; 8009d10: 34 15 ff fe mvi r21,-2 8009d14: e0 00 00 0d bi 8009d48 <_Heap_Extend+0xd4> return 0; } if ( extend_area_end == sub_area_begin ) { merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 8009d18: 55 ee 00 77 bgu r15,r14,8009ef4 <_Heap_Extend+0x280> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009d1c: b9 e0 08 00 mv r1,r15 8009d20: ba 40 10 00 mv r2,r18 8009d24: 35 f3 ff f8 addi r19,r15,-8 8009d28: f8 00 1f f3 calli 8011cf4 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8009d2c: ca 61 08 00 sub r1,r19,r1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 8009d30: 45 af 00 15 be r13,r15,8009d84 <_Heap_Extend+0x110> start_block->prev_size = extend_area_end; merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 8009d34: 55 af 00 6e bgu r13,r15,8009eec <_Heap_Extend+0x278> } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8009d38: 28 2c 00 04 lw r12,(r1+4) 8009d3c: a2 ac 60 00 and r12,r21,r12 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8009d40: b4 2c 60 00 add r12,r1,r12 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 8009d44: 46 0c 00 16 be r16,r12,8009d9c <_Heap_Extend+0x128> return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 8009d48: b9 80 08 00 mv r1,r12 8009d4c: 45 90 00 6c be r12,r16,8009efc <_Heap_Extend+0x288> uintptr_t const sub_area_end = start_block->prev_size; 8009d50: 29 8f 00 00 lw r15,(r12+0) Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin 8009d54: f5 c1 28 00 cmpgu r5,r14,r1 8009d58: f5 ed 20 00 cmpgu r4,r15,r13 (uintptr_t) start_block : heap->area_begin; uintptr_t const sub_area_end = start_block->prev_size; Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 8009d5c: a0 a4 20 00 and r4,r5,r4 8009d60: 5c 80 00 71 bne r4,r0,8009f24 <_Heap_Extend+0x2b0> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return 0; } if ( extend_area_end == sub_area_begin ) { 8009d64: 5c 2e ff ed bne r1,r14,8009d18 <_Heap_Extend+0xa4> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009d68: b9 e0 08 00 mv r1,r15 8009d6c: ba 40 10 00 mv r2,r18 8009d70: 35 f3 ff f8 addi r19,r15,-8 8009d74: f8 00 1f e0 calli 8011cf4 <__umodsi3> 8009d78: b9 80 a0 00 mv r20,r12 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8009d7c: ca 61 08 00 sub r1,r19,r1 merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 8009d80: 5d af ff ed bne r13,r15,8009d34 <_Heap_Extend+0xc0> <== ALWAYS TAKEN start_block->prev_size = extend_area_end; 8009d84: 59 8e 00 00 sw (r12+0),r14 } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8009d88: 28 2c 00 04 lw r12,(r1+4) 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 ) 8009d8c: b8 20 88 00 mv r17,r1 - 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; 8009d90: a2 ac 60 00 and r12,r21,r12 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8009d94: b4 2c 60 00 add r12,r1,r12 } else if ( sub_area_end < extend_area_begin ) { link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 8009d98: 5e 0c ff ec bne r16,r12,8009d48 <_Heap_Extend+0xd4> <== NEVER TAKEN if ( extend_area_begin < heap->area_begin ) { 8009d9c: 29 61 00 18 lw r1,(r11+24) 8009da0: 51 a1 00 5d bgeu r13,r1,8009f14 <_Heap_Extend+0x2a0> heap->area_begin = extend_area_begin; 8009da4: 59 6d 00 18 sw (r11+24),r13 } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 8009da8: 2b 81 00 40 lw r1,(sp+64) 8009dac: 2b 82 00 44 lw r2,(sp+68) extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 8009db0: 29 65 00 20 lw r5,(r11+32) heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 8009db4: c8 22 18 00 sub r3,r1,r2 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 8009db8: 38 64 00 01 ori r4,r3,0x1 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 8009dbc: 58 4e 00 00 sw (r2+0),r14 extend_first_block->size_and_flag = 8009dc0: 58 44 00 04 sw (r2+4),r4 extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 8009dc4: 58 23 00 00 sw (r1+0),r3 extend_last_block->size_and_flag = 0; 8009dc8: 58 20 00 04 sw (r1+4),r0 _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 8009dcc: 50 45 00 4e bgeu r2,r5,8009f04 <_Heap_Extend+0x290> heap->first_block = extend_first_block; 8009dd0: 59 62 00 20 sw (r11+32),r2 } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 8009dd4: 46 80 00 66 be r20,r0,8009f6c <_Heap_Extend+0x2f8> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 8009dd8: 29 6c 00 10 lw r12,(r11+16) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 8009ddc: 35 ad 00 08 addi r13,r13,8 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 8009de0: b9 a0 08 00 mv r1,r13 8009de4: b9 80 10 00 mv r2,r12 8009de8: f8 00 1f c3 calli 8011cf4 <__umodsi3> if ( remainder != 0 ) { 8009dec: 44 20 00 03 be r1,r0,8009df8 <_Heap_Extend+0x184> return value - remainder + alignment; 8009df0: b5 ac 68 00 add r13,r13,r12 8009df4: c9 a1 68 00 sub r13,r13,r1 uintptr_t const new_first_block_begin = 8009df8: 35 a2 ff f8 addi r2,r13,-8 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 8009dfc: 2a 83 00 00 lw r3,(r20+0) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 8009e00: ca 82 08 00 sub r1,r20,r2 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 8009e04: 38 21 00 01 ori r1,r1,0x1 8009e08: 58 41 00 04 sw (r2+4),r1 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 8009e0c: 59 a3 ff f8 sw (r13+-8),r3 new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Free_block( heap, new_first_block ); 8009e10: b9 60 08 00 mv r1,r11 8009e14: fb ff ff 7e calli 8009c0c <_Heap_Free_block> link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 8009e18: 46 20 00 45 be r17,r0,8009f2c <_Heap_Extend+0x2b8> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009e1c: 29 62 00 10 lw r2,(r11+16) ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, 8009e20: 35 ce ff f8 addi r14,r14,-8 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 8009e24: c9 d1 70 00 sub r14,r14,r17 8009e28: b9 c0 08 00 mv r1,r14 8009e2c: f8 00 1f b2 calli 8011cf4 <__umodsi3> ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 8009e30: 2a 22 00 04 lw r2,(r17+4) 8009e34: c9 c1 70 00 sub r14,r14,r1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 8009e38: b5 d1 08 00 add r1,r14,r17 (last_block->size_and_flag - last_block_new_size) 8009e3c: c8 4e 10 00 sub r2,r2,r14 | HEAP_PREV_BLOCK_USED; 8009e40: 38 42 00 01 ori r2,r2,0x1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 8009e44: 58 22 00 04 sw (r1+4),r2 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009e48: 2a 23 00 04 lw r3,(r17+4) (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 8009e4c: b9 60 08 00 mv r1,r11 8009e50: ba 20 10 00 mv r2,r17 8009e54: 20 63 00 01 andi r3,r3,0x1 block->size_and_flag = size | flag; 8009e58: b9 c3 70 00 or r14,r14,r3 8009e5c: 5a 2e 00 04 sw (r17+4),r14 8009e60: fb ff ff 6b calli 8009c0c <_Heap_Free_block> extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 8009e64: 66 31 00 00 cmpei r17,r17,0 8009e68: 66 94 00 00 cmpei r20,r20,0 8009e6c: a2 34 88 00 and r17,r17,r20 8009e70: 5e 20 00 3b bne r17,r0,8009f5c <_Heap_Extend+0x2e8> /* Statistics */ stats->size += extended_size; return extended_size; } 8009e74: 29 61 00 24 lw r1,(r11+36) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 8009e78: 29 63 00 20 lw r3,(r11+32) _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 8009e7c: 29 6c 00 30 lw r12,(r11+48) RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009e80: 28 22 00 04 lw r2,(r1+4) /* Statistics */ stats->size += extended_size; 8009e84: 29 64 00 2c lw r4,(r11+44) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 8009e88: c8 61 18 00 sub r3,r3,r1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009e8c: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 8009e90: b8 62 10 00 or r2,r3,r2 _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 8009e94: c9 97 60 00 sub r12,r12,r23 8009e98: 58 22 00 04 sw (r1+4),r2 /* Statistics */ stats->size += extended_size; 8009e9c: b4 8c 08 00 add r1,r4,r12 8009ea0: 59 61 00 2c sw (r11+44),r1 return extended_size; } 8009ea4: b9 80 08 00 mv r1,r12 8009ea8: 2b 9d 00 04 lw ra,(sp+4) 8009eac: 2b 8b 00 3c lw r11,(sp+60) 8009eb0: 2b 8c 00 38 lw r12,(sp+56) 8009eb4: 2b 8d 00 34 lw r13,(sp+52) 8009eb8: 2b 8e 00 30 lw r14,(sp+48) 8009ebc: 2b 8f 00 2c lw r15,(sp+44) 8009ec0: 2b 90 00 28 lw r16,(sp+40) 8009ec4: 2b 91 00 24 lw r17,(sp+36) 8009ec8: 2b 92 00 20 lw r18,(sp+32) 8009ecc: 2b 93 00 1c lw r19,(sp+28) 8009ed0: 2b 94 00 18 lw r20,(sp+24) 8009ed4: 2b 95 00 14 lw r21,(sp+20) 8009ed8: 2b 96 00 10 lw r22,(sp+16) 8009edc: 2b 97 00 0c lw r23,(sp+12) 8009ee0: 2b 98 00 08 lw r24,(sp+8) 8009ee4: 37 9c 00 44 addi sp,sp,68 8009ee8: c3 a0 00 00 ret 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 ) 8009eec: b8 20 b0 00 mv r22,r1 8009ef0: e3 ff ff 92 bi 8009d38 <_Heap_Extend+0xc4> return 0; } if ( extend_area_end == sub_area_begin ) { merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 8009ef4: b9 80 c0 00 mv r24,r12 8009ef8: e3 ff ff 89 bi 8009d1c <_Heap_Extend+0xa8> return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 8009efc: 29 61 00 18 lw r1,(r11+24) 8009f00: e3 ff ff 94 bi 8009d50 <_Heap_Extend+0xdc> extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { heap->first_block = extend_first_block; } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 8009f04: 29 62 00 24 lw r2,(r11+36) 8009f08: 50 41 ff b3 bgeu r2,r1,8009dd4 <_Heap_Extend+0x160> heap->last_block = extend_last_block; 8009f0c: 59 61 00 24 sw (r11+36),r1 8009f10: e3 ff ff b1 bi 8009dd4 <_Heap_Extend+0x160> start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); if ( extend_area_begin < heap->area_begin ) { heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { 8009f14: 29 61 00 1c lw r1,(r11+28) 8009f18: 50 2e ff a4 bgeu r1,r14,8009da8 <_Heap_Extend+0x134> heap->area_end = extend_area_end; 8009f1c: 59 6e 00 1c sw (r11+28),r14 8009f20: e3 ff ff a2 bi 8009da8 <_Heap_Extend+0x134> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return 0; 8009f24: 34 0c 00 00 mvi r12,0 8009f28: e3 ff ff df bi 8009ea4 <_Heap_Extend+0x230> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 8009f2c: 46 d1 ff ce be r22,r17,8009e64 <_Heap_Extend+0x1f0> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009f30: 2a c3 00 04 lw r3,(r22+4) ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 8009f34: 2b 82 00 44 lw r2,(sp+68) } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( 8009f38: 2b 81 00 40 lw r1,(sp+64) 8009f3c: 20 63 00 01 andi r3,r3,0x1 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 8009f40: c8 56 10 00 sub r2,r2,r22 block->size_and_flag = size | flag; 8009f44: b8 43 10 00 or r2,r2,r3 8009f48: 5a c2 00 04 sw (r22+4),r2 last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 8009f4c: 28 22 00 04 lw r2,(r1+4) 8009f50: 38 42 00 01 ori r2,r2,0x1 8009f54: 58 22 00 04 sw (r1+4),r2 8009f58: e3 ff ff c3 bi 8009e64 <_Heap_Extend+0x1f0> extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { _Heap_Free_block( heap, extend_first_block ); 8009f5c: 2b 82 00 44 lw r2,(sp+68) 8009f60: b9 60 08 00 mv r1,r11 8009f64: fb ff ff 2a calli 8009c0c <_Heap_Free_block> 8009f68: e3 ff ff c3 bi 8009e74 <_Heap_Extend+0x200> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 8009f6c: 47 14 ff ab be r24,r20,8009e18 <_Heap_Extend+0x1a4> { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 8009f70: cb 01 c0 00 sub r24,r24,r1 8009f74: 3b 18 00 01 ori r24,r24,0x1 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = 8009f78: 58 38 00 04 sw (r1+4),r24 8009f7c: e3 ff ff a7 bi 8009e18 <_Heap_Extend+0x1a4> =============================================================================== 0800a1f4 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 800a1f4: 37 9c ff f4 addi sp,sp,-12 800a1f8: 5b 8b 00 0c sw (sp+12),r11 800a1fc: 5b 8c 00 08 sw (sp+8),r12 800a200: 5b 9d 00 04 sw (sp+4),ra 800a204: b8 20 58 00 mv r11,r1 800a208: b8 40 18 00 mv r3,r2 * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; 800a20c: 34 01 00 01 mvi r1,1 /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { 800a210: 44 40 00 4b be r2,r0,800a33c <_Heap_Free+0x148> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800a214: 29 62 00 10 lw r2,(r11+16) 800a218: b8 60 08 00 mv r1,r3 800a21c: 34 6c ff f8 addi r12,r3,-8 800a220: f8 00 42 d6 calli 801ad78 <__umodsi3> 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 800a224: 29 64 00 20 lw r4,(r11+32) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800a228: c9 81 10 00 sub r2,r12,r1 alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; 800a22c: 34 01 00 00 mvi r1,0 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; 800a230: 54 82 00 43 bgu r4,r2,800a33c <_Heap_Free+0x148> 800a234: 29 65 00 24 lw r5,(r11+36) 800a238: 54 45 00 41 bgu r2,r5,800a33c <_Heap_Free+0x148> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800a23c: 28 48 00 04 lw r8,(r2+4) - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800a240: 34 07 ff fe mvi r7,-2 800a244: a1 07 30 00 and r6,r8,r7 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800a248: b4 46 18 00 add r3,r2,r6 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 800a24c: 54 83 00 3c bgu r4,r3,800a33c <_Heap_Free+0x148> <== NEVER TAKEN 800a250: 54 65 00 3b bgu r3,r5,800a33c <_Heap_Free+0x148> <== NEVER TAKEN 800a254: 28 69 00 04 lw r9,(r3+4) 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; 800a258: 21 2a 00 01 andi r10,r9,0x1 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 800a25c: 45 40 00 38 be r10,r0,800a33c <_Heap_Free+0x148> - 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; 800a260: a1 27 48 00 and r9,r9,r7 return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 800a264: 34 07 00 00 mvi r7,0 800a268: 44 a3 00 05 be r5,r3,800a27c <_Heap_Free+0x88> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800a26c: b4 69 08 00 add r1,r3,r9 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; 800a270: 28 27 00 04 lw r7,(r1+4) 800a274: 20 e7 00 01 andi r7,r7,0x1 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 800a278: 18 e7 00 01 xori r7,r7,0x1 800a27c: 21 08 00 01 andi r8,r8,0x1 next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 800a280: 5d 00 00 19 bne r8,r0,800a2e4 <_Heap_Free+0xf0> uintptr_t const prev_size = block->prev_size; 800a284: 28 4a 00 00 lw r10,(r2+0) Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { _HAssert( false ); return( false ); 800a288: 34 01 00 00 mvi r1,0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800a28c: c8 4a 10 00 sub r2,r2,r10 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; 800a290: 54 82 00 2b bgu r4,r2,800a33c <_Heap_Free+0x148> <== NEVER TAKEN 800a294: b9 00 08 00 mv r1,r8 800a298: 54 45 00 29 bgu r2,r5,800a33c <_Heap_Free+0x148> <== NEVER TAKEN 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; 800a29c: 28 44 00 04 lw r4,(r2+4) 800a2a0: 20 84 00 01 andi r4,r4,0x1 } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 800a2a4: 44 80 00 26 be r4,r0,800a33c <_Heap_Free+0x148> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 800a2a8: 44 e0 00 3d be r7,r0,800a39c <_Heap_Free+0x1a8> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 800a2ac: 29 64 00 38 lw r4,(r11+56) --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800a2b0: 28 61 00 08 lw r1,(r3+8) 800a2b4: 28 63 00 0c lw r3,(r3+12) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 800a2b8: b4 c9 48 00 add r9,r6,r9 800a2bc: b5 2a 50 00 add r10,r9,r10 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 800a2c0: 58 61 00 08 sw (r3+8),r1 next->prev = prev; 800a2c4: 58 23 00 0c sw (r1+12),r3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 800a2c8: 34 81 ff ff addi r1,r4,-1 800a2cc: 59 61 00 38 sw (r11+56),r1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800a2d0: 39 43 00 01 ori r3,r10,0x1 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 800a2d4: b4 4a 08 00 add r1,r2,r10 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; 800a2d8: 58 43 00 04 sw (r2+4),r3 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 800a2dc: 58 2a 00 00 sw (r1+0),r10 800a2e0: e0 00 00 0d bi 800a314 <_Heap_Free+0x120> uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 800a2e4: 44 e0 00 1b be r7,r0,800a350 <_Heap_Free+0x15c> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800a2e8: 28 64 00 08 lw r4,(r3+8) 800a2ec: 28 61 00 0c lw r1,(r3+12) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; 800a2f0: b5 26 48 00 add r9,r9,r6 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 800a2f4: 58 44 00 08 sw (r2+8),r4 new_block->prev = prev; 800a2f8: 58 41 00 0c sw (r2+12),r1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800a2fc: 39 25 00 01 ori r5,r9,0x1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800a300: b4 49 18 00 add r3,r2,r9 next->prev = new_block; 800a304: 58 82 00 0c sw (r4+12),r2 prev->next = new_block; 800a308: 58 22 00 08 sw (r1+8),r2 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; 800a30c: 58 45 00 04 sw (r2+4),r5 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800a310: 58 69 00 00 sw (r3+0),r9 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 800a314: 29 62 00 40 lw r2,(r11+64) ++stats->frees; 800a318: 29 61 00 50 lw r1,(r11+80) stats->free_size += block_size; 800a31c: 29 63 00 30 lw r3,(r11+48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 800a320: 34 42 ff ff addi r2,r2,-1 ++stats->frees; 800a324: 34 21 00 01 addi r1,r1,1 stats->free_size += block_size; 800a328: b4 66 30 00 add r6,r3,r6 } } /* Statistics */ --stats->used_blocks; ++stats->frees; 800a32c: 59 61 00 50 sw (r11+80),r1 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 800a330: 59 62 00 40 sw (r11+64),r2 ++stats->frees; stats->free_size += block_size; 800a334: 59 66 00 30 sw (r11+48),r6 return( true ); 800a338: 34 01 00 01 mvi r1,1 } 800a33c: 2b 9d 00 04 lw ra,(sp+4) 800a340: 2b 8b 00 0c lw r11,(sp+12) 800a344: 2b 8c 00 08 lw r12,(sp+8) 800a348: 37 9c 00 0c addi sp,sp,12 800a34c: c3 a0 00 00 ret 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; 800a350: 38 c1 00 01 ori r1,r6,0x1 800a354: 58 41 00 04 sw (r2+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800a358: 28 67 00 04 lw r7,(r3+4) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 800a35c: 29 61 00 38 lw r1,(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; 800a360: 29 64 00 08 lw r4,(r11+8) } 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; 800a364: 34 05 ff fe mvi r5,-2 new_block->next = next; new_block->prev = block_before; 800a368: 58 4b 00 0c sw (r2+12),r11 800a36c: a0 e5 28 00 and r5,r7,r5 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { 800a370: 29 67 00 3c lw r7,(r11+60) 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; 800a374: 34 21 00 01 addi r1,r1,1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 800a378: 58 44 00 08 sw (r2+8),r4 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 800a37c: 58 82 00 0c sw (r4+12),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; 800a380: 58 65 00 04 sw (r3+4),r5 next_block->prev_size = block_size; 800a384: 58 66 00 00 sw (r3+0),r6 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 800a388: 59 62 00 08 sw (r11+8),r2 /* Statistics */ ++stats->free_blocks; 800a38c: 59 61 00 38 sw (r11+56),r1 if ( stats->max_free_blocks < stats->free_blocks ) { 800a390: 50 e1 ff e1 bgeu r7,r1,800a314 <_Heap_Free+0x120> stats->max_free_blocks = stats->free_blocks; 800a394: 59 61 00 3c sw (r11+60),r1 800a398: e3 ff ff df bi 800a314 <_Heap_Free+0x120> prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 800a39c: b4 ca 50 00 add r10,r6,r10 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800a3a0: 39 41 00 01 ori r1,r10,0x1 800a3a4: 58 41 00 04 sw (r2+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800a3a8: 28 62 00 04 lw r2,(r3+4) 800a3ac: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 800a3b0: 58 6a 00 00 sw (r3+0),r10 _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; 800a3b4: a0 41 08 00 and r1,r2,r1 800a3b8: 58 61 00 04 sw (r3+4),r1 800a3bc: e3 ff ff d6 bi 800a314 <_Heap_Free+0x120> =============================================================================== 08010660 <_Heap_Get_free_information>: info->number++; info->total += the_size; if ( info->largest < the_size ) info->largest = the_size; } } 8010660: 28 23 00 08 lw r3,(r1+8) ) { Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; 8010664: 58 40 00 00 sw (r2+0),r0 info->largest = 0; 8010668: 58 40 00 04 sw (r2+4),r0 info->total = 0; 801066c: 58 40 00 08 sw (r2+8),r0 for(the_block = _Heap_Free_list_first(the_heap); 8010670: 44 23 00 12 be r1,r3,80106b8 <_Heap_Get_free_information+0x58><== NEVER TAKEN 8010674: 34 06 00 01 mvi r6,1 8010678: 34 07 00 00 mvi r7,0 801067c: 34 05 00 00 mvi r5,0 - 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; 8010680: 34 09 ff fe mvi r9,-2 8010684: e0 00 00 03 bi 8010690 <_Heap_Get_free_information+0x30> 8010688: 28 47 00 04 lw r7,(r2+4) 801068c: b9 00 30 00 mv r6,r8 8010690: 28 64 00 04 lw r4,(r3+4) the_block != tail; the_block = the_block->next) 8010694: 34 c8 00 01 addi r8,r6,1 8010698: a1 24 20 00 and r4,r9,r4 /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; info->total += the_size; 801069c: b4 a4 28 00 add r5,r5,r4 if ( info->largest < the_size ) 80106a0: 50 e4 00 02 bgeu r7,r4,80106a8 <_Heap_Get_free_information+0x48> info->largest = the_size; 80106a4: 58 44 00 04 sw (r2+4),r4 info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) 80106a8: 28 63 00 08 lw r3,(r3+8) info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); 80106ac: 5c 23 ff f7 bne r1,r3,8010688 <_Heap_Get_free_information+0x28> 80106b0: 58 46 00 00 sw (r2+0),r6 80106b4: 58 45 00 08 sw (r2+8),r5 80106b8: c3 a0 00 00 ret =============================================================================== 080071d0 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 80071d0: 37 9c ff e4 addi sp,sp,-28 80071d4: 5b 8b 00 1c sw (sp+28),r11 80071d8: 5b 8c 00 18 sw (sp+24),r12 80071dc: 5b 8d 00 14 sw (sp+20),r13 80071e0: 5b 8e 00 10 sw (sp+16),r14 80071e4: 5b 8f 00 0c sw (sp+12),r15 80071e8: 5b 90 00 08 sw (sp+8),r16 80071ec: 5b 9d 00 04 sw (sp+4),ra Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; 80071f0: 34 0d 00 00 mvi r13,0 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 80071f4: b8 60 80 00 mv r16,r3 80071f8: b8 20 60 00 mv r12,r1 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 80071fc: 44 60 00 12 be r3,r0,8007244 <_Heap_Greedy_allocate+0x74> 8007200: b8 40 70 00 mv r14,r2 8007204: 34 0b 00 00 mvi r11,0 * @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 ); 8007208: 29 c2 00 00 lw r2,(r14+0) 800720c: 34 03 00 00 mvi r3,0 8007210: 34 04 00 00 mvi r4,0 8007214: b9 80 08 00 mv r1,r12 8007218: f8 00 21 8f calli 800f854 <_Heap_Allocate_aligned_with_boundary> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800721c: 34 2f ff f8 addi r15,r1,-8 8007220: 35 6b 00 01 addi r11,r11,1 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 8007224: 44 20 00 06 be r1,r0,800723c <_Heap_Greedy_allocate+0x6c> <== NEVER TAKEN 8007228: 29 82 00 10 lw r2,(r12+16) 800722c: f8 00 42 d6 calli 8017d84 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8007230: c9 e1 08 00 sub r1,r15,r1 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 8007234: 58 2d 00 08 sw (r1+8),r13 8007238: b8 20 68 00 mv r13,r1 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 800723c: 35 ce 00 04 addi r14,r14,4 8007240: 56 0b ff f2 bgu r16,r11,8007208 <_Heap_Greedy_allocate+0x38> Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 8007244: 29 8b 00 08 lw r11,(r12+8) next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 8007248: 34 0e 00 00 mvi r14,0 } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800724c: 34 0f ff fe mvi r15,-2 8007250: 5d 8b 00 03 bne r12,r11,800725c <_Heap_Greedy_allocate+0x8c><== ALWAYS TAKEN 8007254: e0 00 00 0d bi 8007288 <_Heap_Greedy_allocate+0xb8> <== NOT EXECUTED Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 8007258: b8 20 58 00 mv r11,r1 800725c: 29 64 00 04 lw r4,(r11+4) allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 8007260: b9 60 10 00 mv r2,r11 8007264: 35 63 00 08 addi r3,r11,8 8007268: a1 e4 20 00 and r4,r15,r4 800726c: b9 80 08 00 mv r1,r12 8007270: 34 84 ff f8 addi r4,r4,-8 8007274: f8 00 01 0b calli 80076a0 <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 8007278: 59 6e 00 08 sw (r11+8),r14 Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 800727c: 29 81 00 08 lw r1,(r12+8) next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 8007280: b9 60 70 00 mv r14,r11 8007284: 5d 81 ff f5 bne r12,r1,8007258 <_Heap_Greedy_allocate+0x88> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 8007288: 5d a0 00 03 bne r13,r0,8007294 <_Heap_Greedy_allocate+0xc4> 800728c: e0 00 00 07 bi 80072a8 <_Heap_Greedy_allocate+0xd8> current = allocated_blocks; allocated_blocks = allocated_blocks->next; 8007290: b9 60 68 00 mv r13,r11 8007294: 29 ab 00 08 lw r11,(r13+8) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 8007298: 35 a2 00 08 addi r2,r13,8 800729c: b9 80 08 00 mv r1,r12 80072a0: f8 00 21 fa calli 800fa88 <_Heap_Free> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 80072a4: 5d 60 ff fb bne r11,r0,8007290 <_Heap_Greedy_allocate+0xc0> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 80072a8: b9 c0 08 00 mv r1,r14 80072ac: 2b 9d 00 04 lw ra,(sp+4) 80072b0: 2b 8b 00 1c lw r11,(sp+28) 80072b4: 2b 8c 00 18 lw r12,(sp+24) 80072b8: 2b 8d 00 14 lw r13,(sp+20) 80072bc: 2b 8e 00 10 lw r14,(sp+16) 80072c0: 2b 8f 00 0c lw r15,(sp+12) 80072c4: 2b 90 00 08 lw r16,(sp+8) 80072c8: 37 9c 00 1c addi sp,sp,28 80072cc: c3 a0 00 00 ret =============================================================================== 080072d0 <_Heap_Greedy_free>: void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { 80072d0: 37 9c ff f4 addi sp,sp,-12 80072d4: 5b 8b 00 0c sw (sp+12),r11 80072d8: 5b 8c 00 08 sw (sp+8),r12 80072dc: 5b 9d 00 04 sw (sp+4),ra 80072e0: b8 20 60 00 mv r12,r1 while ( blocks != NULL ) { 80072e4: 5c 40 00 03 bne r2,r0,80072f0 <_Heap_Greedy_free+0x20> <== ALWAYS TAKEN 80072e8: e0 00 00 07 bi 8007304 <_Heap_Greedy_free+0x34> <== NOT EXECUTED Heap_Block *current = blocks; blocks = blocks->next; 80072ec: b9 60 10 00 mv r2,r11 80072f0: 28 4b 00 08 lw r11,(r2+8) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 80072f4: b9 80 08 00 mv r1,r12 80072f8: 34 42 00 08 addi r2,r2,8 80072fc: f8 00 21 e3 calli 800fa88 <_Heap_Free> void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { while ( blocks != NULL ) { 8007300: 5d 60 ff fb bne r11,r0,80072ec <_Heap_Greedy_free+0x1c> Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 8007304: 2b 9d 00 04 lw ra,(sp+4) 8007308: 2b 8b 00 0c lw r11,(sp+12) 800730c: 2b 8c 00 08 lw r12,(sp+8) 8007310: 37 9c 00 0c addi sp,sp,12 8007314: c3 a0 00 00 ret =============================================================================== 08010730 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 8010730: 37 9c ff e8 addi sp,sp,-24 8010734: 5b 8b 00 18 sw (sp+24),r11 8010738: 5b 8c 00 14 sw (sp+20),r12 801073c: 5b 8d 00 10 sw (sp+16),r13 8010740: 5b 8e 00 0c sw (sp+12),r14 8010744: 5b 8f 00 08 sw (sp+8),r15 8010748: 5b 9d 00 04 sw (sp+4),ra Heap_Block *current = heap->first_block; 801074c: 28 25 00 20 lw r5,(r1+32) Heap_Block *end = heap->last_block; 8010750: 28 2c 00 24 lw r12,(r1+36) void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 8010754: b8 40 68 00 mv r13,r2 8010758: b8 60 70 00 mv r14,r3 801075c: 34 0f ff fe mvi r15,-2 Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 8010760: 5c ac 00 04 bne r5,r12,8010770 <_Heap_Iterate+0x40> <== ALWAYS TAKEN 8010764: e0 00 00 0c bi 8010794 <_Heap_Iterate+0x64> <== NOT EXECUTED 8010768: 45 8b 00 0b be r12,r11,8010794 <_Heap_Iterate+0x64> 801076c: b9 60 28 00 mv r5,r11 8010770: 28 a2 00 04 lw r2,(r5+4) uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 8010774: b8 a0 08 00 mv r1,r5 8010778: b9 c0 20 00 mv r4,r14 801077c: a1 e2 10 00 and r2,r15,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8010780: b4 a2 58 00 add r11,r5,r2 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8010784: 29 63 00 04 lw r3,(r11+4) 8010788: 20 63 00 01 andi r3,r3,0x1 801078c: d9 a0 00 00 call r13 { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 8010790: 44 20 ff f6 be r1,r0,8010768 <_Heap_Iterate+0x38> <== ALWAYS TAKEN stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } 8010794: 2b 9d 00 04 lw ra,(sp+4) 8010798: 2b 8b 00 18 lw r11,(sp+24) 801079c: 2b 8c 00 14 lw r12,(sp+20) 80107a0: 2b 8d 00 10 lw r13,(sp+16) 80107a4: 2b 8e 00 0c lw r14,(sp+12) 80107a8: 2b 8f 00 08 lw r15,(sp+8) 80107ac: 37 9c 00 18 addi sp,sp,24 80107b0: c3 a0 00 00 ret =============================================================================== 0801b6a8 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 801b6a8: 37 9c ff f0 addi sp,sp,-16 801b6ac: 5b 8b 00 10 sw (sp+16),r11 801b6b0: 5b 8c 00 0c sw (sp+12),r12 801b6b4: 5b 8d 00 08 sw (sp+8),r13 801b6b8: 5b 9d 00 04 sw (sp+4),ra 801b6bc: b8 40 60 00 mv r12,r2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 801b6c0: 28 22 00 10 lw r2,(r1+16) 801b6c4: b8 20 58 00 mv r11,r1 801b6c8: b9 80 08 00 mv r1,r12 801b6cc: b8 60 68 00 mv r13,r3 801b6d0: fb ff fd aa calli 801ad78 <__umodsi3> 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 801b6d4: 29 62 00 20 lw r2,(r11+32) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 801b6d8: 35 84 ff f8 addi r4,r12,-8 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 801b6dc: c8 81 20 00 sub r4,r4,r1 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 ) ) { return false; 801b6e0: 34 01 00 00 mvi r1,0 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; 801b6e4: 54 44 00 10 bgu r2,r4,801b724 <_Heap_Size_of_alloc_area+0x7c> 801b6e8: 29 65 00 24 lw r5,(r11+36) 801b6ec: 54 85 00 0e bgu r4,r5,801b724 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN - 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; 801b6f0: 28 86 00 04 lw r6,(r4+4) 801b6f4: 34 03 ff fe mvi r3,-2 801b6f8: a0 66 18 00 and r3,r3,r6 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 801b6fc: b4 83 20 00 add r4,r4,r3 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; 801b700: 54 44 00 09 bgu r2,r4,801b724 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN 801b704: 54 85 00 08 bgu r4,r5,801b724 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN 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; 801b708: 28 82 00 04 lw r2,(r4+4) 801b70c: 20 42 00 01 andi r2,r2,0x1 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 801b710: 44 40 00 05 be r2,r0,801b724 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 801b714: c8 8c 20 00 sub r4,r4,r12 801b718: 34 84 00 04 addi r4,r4,4 801b71c: 59 a4 00 00 sw (r13+0),r4 return true; 801b720: 34 01 00 01 mvi r1,1 } 801b724: 2b 9d 00 04 lw ra,(sp+4) 801b728: 2b 8b 00 10 lw r11,(sp+16) 801b72c: 2b 8c 00 0c lw r12,(sp+12) 801b730: 2b 8d 00 08 lw r13,(sp+8) 801b734: 37 9c 00 10 addi sp,sp,16 801b738: c3 a0 00 00 ret =============================================================================== 080058c0 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 80058c0: 37 9c ff 9c addi sp,sp,-100 80058c4: 5b 8b 00 50 sw (sp+80),r11 80058c8: 5b 8c 00 4c sw (sp+76),r12 80058cc: 5b 8d 00 48 sw (sp+72),r13 80058d0: 5b 8e 00 44 sw (sp+68),r14 80058d4: 5b 8f 00 40 sw (sp+64),r15 80058d8: 5b 90 00 3c sw (sp+60),r16 80058dc: 5b 91 00 38 sw (sp+56),r17 80058e0: 5b 92 00 34 sw (sp+52),r18 80058e4: 5b 93 00 30 sw (sp+48),r19 80058e8: 5b 94 00 2c sw (sp+44),r20 80058ec: 5b 95 00 28 sw (sp+40),r21 80058f0: 5b 96 00 24 sw (sp+36),r22 80058f4: 5b 97 00 20 sw (sp+32),r23 80058f8: 5b 98 00 1c sw (sp+28),r24 80058fc: 5b 99 00 18 sw (sp+24),r25 8005900: 5b 9b 00 14 sw (sp+20),fp 8005904: 5b 9d 00 10 sw (sp+16),ra uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8005908: 78 0f 08 00 mvhi r15,0x800 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 800590c: 20 63 00 ff andi r3,r3,0xff 8005910: b8 20 68 00 mv r13,r1 8005914: b8 40 98 00 mv r19,r2 uintptr_t const page_size = heap->page_size; 8005918: 28 35 00 10 lw r21,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 800591c: 28 36 00 14 lw r22,(r1+20) Heap_Block *const first_block = heap->first_block; 8005920: 28 34 00 20 lw r20,(r1+32) Heap_Block *const last_block = heap->last_block; 8005924: 28 37 00 24 lw r23,(r1+36) Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8005928: 39 ef 58 18 ori r15,r15,0x5818 800592c: 44 60 00 03 be r3,r0,8005938 <_Heap_Walk+0x78> 8005930: 78 0f 08 00 mvhi r15,0x800 8005934: 39 ef 58 3c ori r15,r15,0x583c if ( !_System_state_Is_up( _System_state_Get() ) ) { 8005938: 78 03 08 01 mvhi r3,0x801 800593c: 38 63 6a 74 ori r3,r3,0x6a74 8005940: 28 69 00 00 lw r9,(r3+0) 8005944: 34 07 00 03 mvi r7,3 return true; 8005948: 34 03 00 01 mvi r3,1 Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 800594c: 45 27 00 15 be r9,r7,80059a0 <_Heap_Walk+0xe0> block = next_block; } while ( block != first_block ); return true; } 8005950: b8 60 08 00 mv r1,r3 8005954: 2b 9d 00 10 lw ra,(sp+16) 8005958: 2b 8b 00 50 lw r11,(sp+80) 800595c: 2b 8c 00 4c lw r12,(sp+76) 8005960: 2b 8d 00 48 lw r13,(sp+72) 8005964: 2b 8e 00 44 lw r14,(sp+68) 8005968: 2b 8f 00 40 lw r15,(sp+64) 800596c: 2b 90 00 3c lw r16,(sp+60) 8005970: 2b 91 00 38 lw r17,(sp+56) 8005974: 2b 92 00 34 lw r18,(sp+52) 8005978: 2b 93 00 30 lw r19,(sp+48) 800597c: 2b 94 00 2c lw r20,(sp+44) 8005980: 2b 95 00 28 lw r21,(sp+40) 8005984: 2b 96 00 24 lw r22,(sp+36) 8005988: 2b 97 00 20 lw r23,(sp+32) 800598c: 2b 98 00 1c lw r24,(sp+28) 8005990: 2b 99 00 18 lw r25,(sp+24) 8005994: 2b 9b 00 14 lw fp,(sp+20) 8005998: 37 9c 00 64 addi sp,sp,100 800599c: c3 a0 00 00 ret 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)( 80059a0: 29 a2 00 08 lw r2,(r13+8) 80059a4: 29 a1 00 0c lw r1,(r13+12) 80059a8: 29 a6 00 18 lw r6,(r13+24) 80059ac: 29 a7 00 1c lw r7,(r13+28) 80059b0: 78 03 08 01 mvhi r3,0x801 80059b4: 5b 82 00 08 sw (sp+8),r2 80059b8: 5b 81 00 0c sw (sp+12),r1 80059bc: 5b 97 00 04 sw (sp+4),r23 80059c0: ba 60 08 00 mv r1,r19 80059c4: 34 02 00 00 mvi r2,0 80059c8: 38 63 3c a4 ori r3,r3,0x3ca4 80059cc: ba a0 20 00 mv r4,r21 80059d0: ba c0 28 00 mv r5,r22 80059d4: ba 80 40 00 mv r8,r20 80059d8: d9 e0 00 00 call r15 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 80059dc: 46 a0 00 26 be r21,r0,8005a74 <_Heap_Walk+0x1b4> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 80059e0: 22 ab 00 03 andi r11,r21,0x3 (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 80059e4: 5d 60 00 2b bne r11,r0,8005a90 <_Heap_Walk+0x1d0> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 80059e8: ba c0 08 00 mv r1,r22 80059ec: ba a0 10 00 mv r2,r21 80059f0: fb ff ec 0c calli 8000a20 <__umodsi3> 80059f4: b8 20 60 00 mv r12,r1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 80059f8: 5c 2b 00 2e bne r1,r11,8005ab0 <_Heap_Walk+0x1f0> 80059fc: 36 81 00 08 addi r1,r20,8 8005a00: ba a0 10 00 mv r2,r21 8005a04: fb ff ec 07 calli 8000a20 <__umodsi3> 8005a08: b8 20 18 00 mv r3,r1 ); return false; } if ( 8005a0c: 5c 2c 00 31 bne r1,r12,8005ad0 <_Heap_Walk+0x210> block = next_block; } while ( block != first_block ); return true; } 8005a10: 2a 8c 00 04 lw r12,(r20+4) 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; 8005a14: 21 81 00 01 andi r1,r12,0x1 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8005a18: 44 23 00 fe be r1,r3,8005e10 <_Heap_Walk+0x550> - 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; 8005a1c: 2a e2 00 04 lw r2,(r23+4) 8005a20: 34 01 ff fe mvi r1,-2 8005a24: a0 22 08 00 and r1,r1,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8005a28: b6 e1 08 00 add r1,r23,r1 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; 8005a2c: 28 22 00 04 lw r2,(r1+4) 8005a30: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 8005a34: 44 43 00 09 be r2,r3,8005a58 <_Heap_Walk+0x198> ); return false; } if ( 8005a38: 46 81 00 2e be r20,r1,8005af0 <_Heap_Walk+0x230> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 8005a3c: 78 03 08 01 mvhi r3,0x801 8005a40: 38 63 3e 0c ori r3,r3,0x3e0c 8005a44: ba 60 08 00 mv r1,r19 8005a48: 34 02 00 01 mvi r2,1 8005a4c: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005a50: 34 03 00 00 mvi r3,0 8005a54: e3 ff ff bf bi 8005950 <_Heap_Walk+0x90> return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 8005a58: 78 03 08 01 mvhi r3,0x801 8005a5c: 38 63 3d f4 ori r3,r3,0x3df4 8005a60: ba 60 08 00 mv r1,r19 8005a64: 34 02 00 01 mvi r2,1 8005a68: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005a6c: 34 03 00 00 mvi r3,0 8005a70: e3 ff ff b8 bi 8005950 <_Heap_Walk+0x90> first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 8005a74: 78 03 08 01 mvhi r3,0x801 8005a78: 38 63 3d 38 ori r3,r3,0x3d38 8005a7c: ba 60 08 00 mv r1,r19 8005a80: 34 02 00 01 mvi r2,1 8005a84: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005a88: 34 03 00 00 mvi r3,0 8005a8c: e3 ff ff b1 bi 8005950 <_Heap_Walk+0x90> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 8005a90: 78 03 08 01 mvhi r3,0x801 8005a94: 38 63 3d 4c ori r3,r3,0x3d4c 8005a98: ba 60 08 00 mv r1,r19 8005a9c: 34 02 00 01 mvi r2,1 8005aa0: ba a0 20 00 mv r4,r21 8005aa4: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005aa8: 34 03 00 00 mvi r3,0 8005aac: e3 ff ff a9 bi 8005950 <_Heap_Walk+0x90> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 8005ab0: 78 03 08 01 mvhi r3,0x801 8005ab4: 38 63 3d 6c ori r3,r3,0x3d6c 8005ab8: ba 60 08 00 mv r1,r19 8005abc: 34 02 00 01 mvi r2,1 8005ac0: ba c0 20 00 mv r4,r22 8005ac4: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005ac8: 34 03 00 00 mvi r3,0 8005acc: e3 ff ff a1 bi 8005950 <_Heap_Walk+0x90> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8005ad0: 78 03 08 01 mvhi r3,0x801 8005ad4: 38 63 3d 90 ori r3,r3,0x3d90 8005ad8: ba 60 08 00 mv r1,r19 8005adc: 34 02 00 01 mvi r2,1 8005ae0: ba 80 20 00 mv r4,r20 8005ae4: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005ae8: 34 03 00 00 mvi r3,0 8005aec: e3 ff ff 99 bi 8005950 <_Heap_Walk+0x90> block = next_block; } while ( block != first_block ); return true; } 8005af0: 29 ab 00 08 lw r11,(r13+8) int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8005af4: 29 b2 00 10 lw r18,(r13+16) const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 8005af8: 45 ab 00 2f be r13,r11,8005bb4 <_Heap_Walk+0x2f4> block = next_block; } while ( block != first_block ); return true; } 8005afc: 29 ae 00 20 lw r14,(r13+32) const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 8005b00: 55 cb 00 dd bgu r14,r11,8005e74 <_Heap_Walk+0x5b4> <== NEVER TAKEN 8005b04: 29 b8 00 24 lw r24,(r13+36) 8005b08: 55 78 00 db bgu r11,r24,8005e74 <_Heap_Walk+0x5b4> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005b0c: 35 61 00 08 addi r1,r11,8 8005b10: ba 40 10 00 mv r2,r18 8005b14: fb ff eb c3 calli 8000a20 <__umodsi3> ); return false; } if ( 8005b18: 5c 20 00 df bne r1,r0,8005e94 <_Heap_Walk+0x5d4> <== NEVER TAKEN - 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; 8005b1c: 29 63 00 04 lw r3,(r11+4) 8005b20: 34 02 ff fe mvi r2,-2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005b24: b9 60 80 00 mv r16,r11 8005b28: a0 43 10 00 and r2,r2,r3 block = next_block; } while ( block != first_block ); return true; } 8005b2c: b5 62 10 00 add r2,r11,r2 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005b30: 28 42 00 04 lw r2,(r2+4) ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005b34: b9 a0 18 00 mv r3,r13 - 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; 8005b38: 34 11 ff fe mvi r17,-2 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; 8005b3c: 20 42 00 01 andi r2,r2,0x1 8005b40: 44 41 00 12 be r2,r1,8005b88 <_Heap_Walk+0x2c8> <== ALWAYS TAKEN 8005b44: e0 00 00 dc bi 8005eb4 <_Heap_Walk+0x5f4> <== NOT EXECUTED return false; } prev_block = free_block; free_block = free_block->next; 8005b48: 29 6b 00 08 lw r11,(r11+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 ) { 8005b4c: 45 ab 00 1b be r13,r11,8005bb8 <_Heap_Walk+0x2f8> 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; 8005b50: 55 cb 00 c9 bgu r14,r11,8005e74 <_Heap_Walk+0x5b4> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005b54: 35 61 00 08 addi r1,r11,8 8005b58: ba 40 10 00 mv r2,r18 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; 8005b5c: 55 78 00 c6 bgu r11,r24,8005e74 <_Heap_Walk+0x5b4> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005b60: fb ff eb b0 calli 8000a20 <__umodsi3> ); return false; } if ( 8005b64: 5c 20 00 cc bne r1,r0,8005e94 <_Heap_Walk+0x5d4> - 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; 8005b68: 29 64 00 04 lw r4,(r11+4) ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005b6c: ba 00 18 00 mv r3,r16 8005b70: b9 60 80 00 mv r16,r11 8005b74: a2 24 20 00 and r4,r17,r4 block = next_block; } while ( block != first_block ); return true; } 8005b78: b4 8b 20 00 add r4,r4,r11 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; 8005b7c: 28 84 00 04 lw r4,(r4+4) 8005b80: 20 84 00 01 andi r4,r4,0x1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005b84: 5c 81 00 cc bne r4,r1,8005eb4 <_Heap_Walk+0x5f4> ); return false; } if ( free_block->prev != prev_block ) { 8005b88: 29 67 00 0c lw r7,(r11+12) 8005b8c: 44 e3 ff ef be r7,r3,8005b48 <_Heap_Walk+0x288> (*printer)( 8005b90: 78 03 08 01 mvhi r3,0x801 8005b94: 38 63 3e a8 ori r3,r3,0x3ea8 8005b98: ba 60 08 00 mv r1,r19 8005b9c: 34 02 00 01 mvi r2,1 8005ba0: b9 60 20 00 mv r4,r11 8005ba4: b8 e0 28 00 mv r5,r7 8005ba8: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005bac: 34 03 00 00 mvi r3,0 8005bb0: e3 ff ff 68 bi 8005950 <_Heap_Walk+0x90> 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 ) { 8005bb4: 29 ae 00 20 lw r14,(r13+32) 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)( 8005bb8: 78 01 08 01 mvhi r1,0x801 8005bbc: 5b 81 00 54 sw (sp+84),r1 8005bc0: 78 01 08 01 mvhi r1,0x801 8005bc4: 5b 81 00 58 sw (sp+88),r1 8005bc8: 78 01 08 01 mvhi r1,0x801 8005bcc: 5b 81 00 5c sw (sp+92),r1 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005bd0: 78 01 08 01 mvhi r1,0x801 8005bd4: 5b 81 00 60 sw (sp+96),r1 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005bd8: 78 01 08 01 mvhi r1,0x801 8005bdc: 5b 81 00 64 sw (sp+100),r1 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)( 8005be0: 2b 81 00 54 lw r1,(sp+84) "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005be4: 78 1b 08 01 mvhi fp,0x801 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 8005be8: 78 19 08 01 mvhi r25,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)( 8005bec: 38 21 3c 6c ori r1,r1,0x3c6c 8005bf0: 5b 81 00 54 sw (sp+84),r1 8005bf4: 2b 81 00 58 lw r1,(sp+88) " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005bf8: 78 18 08 01 mvhi r24,0x801 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005bfc: ba 80 88 00 mv r17,r20 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)( 8005c00: 38 21 3c 88 ori r1,r1,0x3c88 8005c04: 5b 81 00 58 sw (sp+88),r1 8005c08: 2b 81 00 5c lw r1,(sp+92) "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005c0c: 3b 7b 40 58 ori fp,fp,0x4058 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 8005c10: 3b 39 40 40 ori r25,r25,0x4040 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)( 8005c14: 38 21 3f 9c ori r1,r1,0x3f9c 8005c18: 5b 81 00 5c sw (sp+92),r1 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005c1c: 2b 81 00 60 lw r1,(sp+96) 8005c20: 3b 18 40 0c ori r24,r24,0x400c 8005c24: 38 21 3c 98 ori r1,r1,0x3c98 8005c28: 5b 81 00 60 sw (sp+96),r1 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005c2c: 2b 81 00 64 lw r1,(sp+100) 8005c30: 38 21 3c 7c ori r1,r1,0x3c7c 8005c34: 5b 81 00 64 sw (sp+100),r1 - 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; 8005c38: 34 01 ff fe mvi r1,-2 8005c3c: a1 81 90 00 and r18,r12,r1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8005c40: b6 51 80 00 add r16,r18,r17 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; 8005c44: 55 d0 00 7a bgu r14,r16,8005e2c <_Heap_Walk+0x56c> <== NEVER TAKEN 8005c48: 29 a4 00 24 lw r4,(r13+36) 8005c4c: 56 04 00 78 bgu r16,r4,8005e2c <_Heap_Walk+0x56c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005c50: ba 40 08 00 mv r1,r18 8005c54: ba a0 10 00 mv r2,r21 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 8005c58: fe 37 58 00 cmpne r11,r17,r23 8005c5c: fb ff eb 71 calli 8000a20 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 8005c60: 44 20 00 02 be r1,r0,8005c68 <_Heap_Walk+0x3a8> 8005c64: 5d 60 00 15 bne r11,r0,8005cb8 <_Heap_Walk+0x3f8> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 8005c68: 52 56 00 02 bgeu r18,r22,8005c70 <_Heap_Walk+0x3b0> 8005c6c: 5d 60 00 1c bne r11,r0,8005cdc <_Heap_Walk+0x41c> <== ALWAYS TAKEN ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 8005c70: 56 11 00 02 bgu r16,r17,8005c78 <_Heap_Walk+0x3b8> 8005c74: 5d 60 00 77 bne r11,r0,8005e50 <_Heap_Walk+0x590> 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; 8005c78: 2a 06 00 04 lw r6,(r16+4) 8005c7c: 21 8c 00 01 andi r12,r12,0x1 8005c80: 20 c6 00 01 andi r6,r6,0x1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 8005c84: 44 c0 00 28 be r6,r0,8005d24 <_Heap_Walk+0x464> if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 8005c88: 45 80 00 1f be r12,r0,8005d04 <_Heap_Walk+0x444> (*printer)( 8005c8c: ba 60 08 00 mv r1,r19 8005c90: 34 02 00 00 mvi r2,0 8005c94: bb 20 18 00 mv r3,r25 8005c98: ba 20 20 00 mv r4,r17 8005c9c: ba 40 28 00 mv r5,r18 8005ca0: d9 e0 00 00 call r15 block->prev_size ); } block = next_block; } while ( block != first_block ); 8005ca4: 46 90 00 43 be r20,r16,8005db0 <_Heap_Walk+0x4f0> 8005ca8: 2a 0c 00 04 lw r12,(r16+4) 8005cac: 29 ae 00 20 lw r14,(r13+32) 8005cb0: ba 00 88 00 mv r17,r16 8005cb4: e3 ff ff e1 bi 8005c38 <_Heap_Walk+0x378> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 8005cb8: 78 03 08 01 mvhi r3,0x801 8005cbc: 38 63 3f 0c ori r3,r3,0x3f0c 8005cc0: ba 60 08 00 mv r1,r19 8005cc4: 34 02 00 01 mvi r2,1 8005cc8: ba 20 20 00 mv r4,r17 8005ccc: ba 40 28 00 mv r5,r18 8005cd0: d9 e0 00 00 call r15 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 8005cd4: 34 03 00 00 mvi r3,0 8005cd8: e3 ff ff 1e bi 8005950 <_Heap_Walk+0x90> } if ( block_size < min_block_size && is_not_last_block ) { (*printer)( 8005cdc: 78 03 08 01 mvhi r3,0x801 8005ce0: 38 63 3f 3c ori r3,r3,0x3f3c 8005ce4: ba 60 08 00 mv r1,r19 8005ce8: 34 02 00 01 mvi r2,1 8005cec: ba 20 20 00 mv r4,r17 8005cf0: ba 40 28 00 mv r5,r18 8005cf4: ba c0 30 00 mv r6,r22 8005cf8: d9 e0 00 00 call r15 block, block_size, min_block_size ); return false; 8005cfc: 34 03 00 00 mvi r3,0 8005d00: e3 ff ff 14 bi 8005950 <_Heap_Walk+0x90> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005d04: 2a 26 00 00 lw r6,(r17+0) 8005d08: ba 20 20 00 mv r4,r17 8005d0c: ba 60 08 00 mv r1,r19 8005d10: 34 02 00 00 mvi r2,0 8005d14: bb 60 18 00 mv r3,fp 8005d18: ba 40 28 00 mv r5,r18 8005d1c: d9 e0 00 00 call r15 8005d20: e3 ff ff e1 bi 8005ca4 <_Heap_Walk+0x3e4> false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 8005d24: 2a 26 00 0c lw r6,(r17+12) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005d28: 29 a4 00 08 lw r4,(r13+8) block = next_block; } while ( block != first_block ); return true; } 8005d2c: 29 a5 00 0c lw r5,(r13+12) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005d30: 2b 87 00 54 lw r7,(sp+84) 8005d34: 44 86 00 03 be r4,r6,8005d40 <_Heap_Walk+0x480> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005d38: bb 00 38 00 mv r7,r24 8005d3c: 45 a6 00 29 be r13,r6,8005de0 <_Heap_Walk+0x520> block->next, block->next == last_free_block ? 8005d40: 2a 28 00 08 lw r8,(r17+8) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005d44: 2b 84 00 58 lw r4,(sp+88) 8005d48: 44 a8 00 03 be r5,r8,8005d54 <_Heap_Walk+0x494> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005d4c: bb 00 20 00 mv r4,r24 8005d50: 45 a8 00 26 be r13,r8,8005de8 <_Heap_Walk+0x528> 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)( 8005d54: 2b 83 00 5c lw r3,(sp+92) 8005d58: 5b 84 00 04 sw (sp+4),r4 8005d5c: ba 60 08 00 mv r1,r19 8005d60: 34 02 00 00 mvi r2,0 8005d64: ba 20 20 00 mv r4,r17 8005d68: ba 40 28 00 mv r5,r18 8005d6c: d9 e0 00 00 call r15 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 8005d70: 2a 06 00 00 lw r6,(r16+0) 8005d74: 5e 46 00 11 bne r18,r6,8005db8 <_Heap_Walk+0x4f8> ); return false; } if ( !prev_used ) { 8005d78: 45 80 00 1e be r12,r0,8005df0 <_Heap_Walk+0x530> block = next_block; } while ( block != first_block ); return true; } 8005d7c: 29 a5 00 08 lw r5,(r13+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 ) { 8005d80: 45 a5 00 04 be r13,r5,8005d90 <_Heap_Walk+0x4d0> <== NEVER TAKEN if ( free_block == block ) { 8005d84: 46 25 ff c8 be r17,r5,8005ca4 <_Heap_Walk+0x3e4> return true; } free_block = free_block->next; 8005d88: 28 a5 00 08 lw r5,(r5+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 ) { 8005d8c: 5d a5 ff fe bne r13,r5,8005d84 <_Heap_Walk+0x4c4> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 8005d90: 78 03 08 01 mvhi r3,0x801 8005d94: 38 63 40 80 ori r3,r3,0x4080 8005d98: ba 60 08 00 mv r1,r19 8005d9c: 34 02 00 01 mvi r2,1 8005da0: ba 20 20 00 mv r4,r17 8005da4: d9 e0 00 00 call r15 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 8005da8: 34 03 00 00 mvi r3,0 8005dac: e3 ff fe e9 bi 8005950 <_Heap_Walk+0x90> } block = next_block; } while ( block != first_block ); return true; 8005db0: 34 03 00 01 mvi r3,1 8005db4: e3 ff fe e7 bi 8005950 <_Heap_Walk+0x90> " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( 8005db8: 78 03 08 01 mvhi r3,0x801 8005dbc: 38 63 3f d4 ori r3,r3,0x3fd4 8005dc0: ba 60 08 00 mv r1,r19 8005dc4: 34 02 00 01 mvi r2,1 8005dc8: ba 20 20 00 mv r4,r17 8005dcc: ba 40 28 00 mv r5,r18 8005dd0: ba 00 38 00 mv r7,r16 8005dd4: d9 e0 00 00 call r15 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 8005dd8: 34 03 00 00 mvi r3,0 8005ddc: e3 ff fe dd bi 8005950 <_Heap_Walk+0x90> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005de0: 2b 87 00 64 lw r7,(sp+100) 8005de4: e3 ff ff d7 bi 8005d40 <_Heap_Walk+0x480> block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005de8: 2b 84 00 60 lw r4,(sp+96) 8005dec: e3 ff ff da bi 8005d54 <_Heap_Walk+0x494> return false; } if ( !prev_used ) { (*printer)( 8005df0: 78 03 08 01 mvhi r3,0x801 8005df4: 38 63 40 10 ori r3,r3,0x4010 8005df8: ba 60 08 00 mv r1,r19 8005dfc: 34 02 00 01 mvi r2,1 8005e00: ba 20 20 00 mv r4,r17 8005e04: d9 e0 00 00 call r15 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 8005e08: 34 03 00 00 mvi r3,0 8005e0c: e3 ff fe d1 bi 8005950 <_Heap_Walk+0x90> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 8005e10: 78 03 08 01 mvhi r3,0x801 8005e14: 38 63 3d c4 ori r3,r3,0x3dc4 8005e18: ba 60 08 00 mv r1,r19 8005e1c: 34 02 00 01 mvi r2,1 8005e20: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005e24: 34 03 00 00 mvi r3,0 8005e28: e3 ff fe ca bi 8005950 <_Heap_Walk+0x90> Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 8005e2c: 78 03 08 01 mvhi r3,0x801 8005e30: 38 63 3e dc ori r3,r3,0x3edc 8005e34: ba 60 08 00 mv r1,r19 8005e38: 34 02 00 01 mvi r2,1 8005e3c: ba 20 20 00 mv r4,r17 8005e40: ba 00 28 00 mv r5,r16 8005e44: d9 e0 00 00 call r15 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 8005e48: 34 03 00 00 mvi r3,0 8005e4c: e3 ff fe c1 bi 8005950 <_Heap_Walk+0x90> return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( 8005e50: 78 03 08 01 mvhi r3,0x801 8005e54: 38 63 3f 68 ori r3,r3,0x3f68 8005e58: ba 60 08 00 mv r1,r19 8005e5c: 34 02 00 01 mvi r2,1 8005e60: ba 20 20 00 mv r4,r17 8005e64: ba 00 28 00 mv r5,r16 8005e68: d9 e0 00 00 call r15 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 8005e6c: 34 03 00 00 mvi r3,0 8005e70: e3 ff fe b8 bi 8005950 <_Heap_Walk+0x90> const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( 8005e74: 78 03 08 01 mvhi r3,0x801 8005e78: 38 63 3e 3c ori r3,r3,0x3e3c 8005e7c: ba 60 08 00 mv r1,r19 8005e80: 34 02 00 01 mvi r2,1 8005e84: b9 60 20 00 mv r4,r11 8005e88: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005e8c: 34 03 00 00 mvi r3,0 8005e90: e3 ff fe b0 bi 8005950 <_Heap_Walk+0x90> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8005e94: 78 03 08 01 mvhi r3,0x801 8005e98: 38 63 3e 5c ori r3,r3,0x3e5c 8005e9c: ba 60 08 00 mv r1,r19 8005ea0: 34 02 00 01 mvi r2,1 8005ea4: b9 60 20 00 mv r4,r11 8005ea8: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005eac: 34 03 00 00 mvi r3,0 8005eb0: e3 ff fe a8 bi 8005950 <_Heap_Walk+0x90> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 8005eb4: 78 03 08 01 mvhi r3,0x801 8005eb8: 38 63 3e 8c ori r3,r3,0x3e8c 8005ebc: ba 60 08 00 mv r1,r19 8005ec0: 34 02 00 01 mvi r2,1 8005ec4: b9 60 20 00 mv r4,r11 8005ec8: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005ecc: 34 03 00 00 mvi r3,0 8005ed0: e3 ff fe a0 bi 8005950 <_Heap_Walk+0x90> =============================================================================== 080045dc <_IO_Initialize_all_drivers>: void _IO_Initialize_all_drivers( void ) { 80045dc: 37 9c ff f4 addi sp,sp,-12 80045e0: 5b 8b 00 0c sw (sp+12),r11 80045e4: 5b 8c 00 08 sw (sp+8),r12 80045e8: 5b 9d 00 04 sw (sp+4),ra rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 80045ec: 78 0c 08 01 mvhi r12,0x801 80045f0: 39 8c eb 30 ori r12,r12,0xeb30 80045f4: 29 81 00 00 lw r1,(r12+0) 80045f8: 44 20 00 09 be r1,r0,800461c <_IO_Initialize_all_drivers+0x40><== NEVER TAKEN 80045fc: 34 0b 00 00 mvi r11,0 (void) rtems_io_initialize( major, 0, NULL ); 8004600: b9 60 08 00 mv r1,r11 8004604: 34 02 00 00 mvi r2,0 8004608: 34 03 00 00 mvi r3,0 800460c: f8 00 16 03 calli 8009e18 void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 8004610: 29 81 00 00 lw r1,(r12+0) 8004614: 35 6b 00 01 addi r11,r11,1 8004618: 54 2b ff fa bgu r1,r11,8004600 <_IO_Initialize_all_drivers+0x24> (void) rtems_io_initialize( major, 0, NULL ); } 800461c: 2b 9d 00 04 lw ra,(sp+4) 8004620: 2b 8b 00 0c lw r11,(sp+12) 8004624: 2b 8c 00 08 lw r12,(sp+8) 8004628: 37 9c 00 0c addi sp,sp,12 800462c: c3 a0 00 00 ret =============================================================================== 080044bc <_IO_Manager_initialization>: #include #include void _IO_Manager_initialization(void) { 80044bc: 37 9c ff e8 addi sp,sp,-24 80044c0: 5b 8b 00 18 sw (sp+24),r11 80044c4: 5b 8c 00 14 sw (sp+20),r12 80044c8: 5b 8d 00 10 sw (sp+16),r13 80044cc: 5b 8e 00 0c sw (sp+12),r14 80044d0: 5b 8f 00 08 sw (sp+8),r15 80044d4: 5b 9d 00 04 sw (sp+4),ra uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = rtems_configuration_get_device_driver_table(); 80044d8: 78 01 08 01 mvhi r1,0x801 80044dc: 38 21 b9 9c ori r1,r1,0xb99c drivers_in_table = rtems_configuration_get_number_of_device_drivers(); 80044e0: 28 2b 00 38 lw r11,(r1+56) number_of_drivers = rtems_configuration_get_maximum_drivers(); 80044e4: 28 2e 00 34 lw r14,(r1+52) uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = rtems_configuration_get_device_driver_table(); 80044e8: 28 2d 00 3c lw r13,(r1+60) /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) 80044ec: 51 6e 00 2e bgeu r11,r14,80045a4 <_IO_Manager_initialization+0xe8> * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) 80044f0: b5 ce 60 00 add r12,r14,r14 80044f4: b5 8e 60 00 add r12,r12,r14 80044f8: b5 8c 60 00 add r12,r12,r12 80044fc: b5 8c 60 00 add r12,r12,r12 8004500: b5 8c 60 00 add r12,r12,r12 * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( 8004504: b9 80 08 00 mv r1,r12 8004508: f8 00 0e ab calli 8007fb4 <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 800450c: 78 04 08 01 mvhi r4,0x801 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 8004510: 78 0f 08 01 mvhi r15,0x801 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8004514: 38 84 eb 30 ori r4,r4,0xeb30 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 8004518: 39 ef eb 34 ori r15,r15,0xeb34 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 800451c: 34 02 00 00 mvi r2,0 8004520: b9 80 18 00 mv r3,r12 _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8004524: 58 8e 00 00 sw (r4+0),r14 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 8004528: 59 e1 00 00 sw (r15+0),r1 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 800452c: f8 00 21 d9 calli 800cc90 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8004530: 45 60 00 15 be r11,r0,8004584 <_IO_Manager_initialization+0xc8><== NEVER TAKEN 8004534: 29 e5 00 00 lw r5,(r15+0) 8004538: 34 03 00 00 mvi r3,0 800453c: 34 04 00 00 mvi r4,0 #include #include #include void _IO_Manager_initialization(void) 8004540: b5 a3 08 00 add r1,r13,r3 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 8004544: 28 26 00 00 lw r6,(r1+0) #include #include #include void _IO_Manager_initialization(void) 8004548: b4 a3 10 00 add r2,r5,r3 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 800454c: 34 84 00 01 addi r4,r4,1 _IO_Driver_address_table[index] = driver_table[index]; 8004550: 58 46 00 00 sw (r2+0),r6 8004554: 28 26 00 04 lw r6,(r1+4) memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8004558: 34 63 00 18 addi r3,r3,24 _IO_Driver_address_table[index] = driver_table[index]; 800455c: 58 46 00 04 sw (r2+4),r6 8004560: 28 26 00 08 lw r6,(r1+8) 8004564: 58 46 00 08 sw (r2+8),r6 8004568: 28 26 00 0c lw r6,(r1+12) 800456c: 58 46 00 0c sw (r2+12),r6 8004570: 28 26 00 10 lw r6,(r1+16) 8004574: 58 46 00 10 sw (r2+16),r6 8004578: 28 21 00 14 lw r1,(r1+20) 800457c: 58 41 00 14 sw (r2+20),r1 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8004580: 55 64 ff f0 bgu r11,r4,8004540 <_IO_Manager_initialization+0x84> _IO_Driver_address_table[index] = driver_table[index]; } 8004584: 2b 9d 00 04 lw ra,(sp+4) 8004588: 2b 8b 00 18 lw r11,(sp+24) 800458c: 2b 8c 00 14 lw r12,(sp+20) 8004590: 2b 8d 00 10 lw r13,(sp+16) 8004594: 2b 8e 00 0c lw r14,(sp+12) 8004598: 2b 8f 00 08 lw r15,(sp+8) 800459c: 37 9c 00 18 addi sp,sp,24 80045a0: c3 a0 00 00 ret * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 80045a4: 78 02 08 01 mvhi r2,0x801 _IO_Number_of_drivers = number_of_drivers; 80045a8: 78 01 08 01 mvhi r1,0x801 * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 80045ac: 38 42 eb 34 ori r2,r2,0xeb34 _IO_Number_of_drivers = number_of_drivers; 80045b0: 38 21 eb 30 ori r1,r1,0xeb30 * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 80045b4: 58 4d 00 00 sw (r2+0),r13 _IO_Number_of_drivers = number_of_drivers; 80045b8: 58 2b 00 00 sw (r1+0),r11 sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; } 80045bc: 2b 9d 00 04 lw ra,(sp+4) 80045c0: 2b 8b 00 18 lw r11,(sp+24) 80045c4: 2b 8c 00 14 lw r12,(sp+20) 80045c8: 2b 8d 00 10 lw r13,(sp+16) 80045cc: 2b 8e 00 0c lw r14,(sp+12) 80045d0: 2b 8f 00 08 lw r15,(sp+8) 80045d4: 37 9c 00 18 addi sp,sp,24 80045d8: c3 a0 00 00 ret =============================================================================== 08005534 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 8005534: 37 9c ff ec addi sp,sp,-20 8005538: 5b 8b 00 14 sw (sp+20),r11 800553c: 5b 8c 00 10 sw (sp+16),r12 8005540: 5b 8d 00 0c sw (sp+12),r13 8005544: 5b 8e 00 08 sw (sp+8),r14 8005548: 5b 9d 00 04 sw (sp+4),ra 800554c: b8 20 58 00 mv r11,r1 * If the application is using the optional manager stubs and * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) 8005550: 28 21 00 18 lw r1,(r1+24) return NULL; 8005554: 34 0c 00 00 mvi r12,0 * If the application is using the optional manager stubs and * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) 8005558: 5c 20 00 09 bne r1,r0,800557c <_Objects_Allocate+0x48> <== ALWAYS TAKEN ); } #endif return the_object; } 800555c: b9 80 08 00 mv r1,r12 8005560: 2b 9d 00 04 lw ra,(sp+4) 8005564: 2b 8b 00 14 lw r11,(sp+20) 8005568: 2b 8c 00 10 lw r12,(sp+16) 800556c: 2b 8d 00 0c lw r13,(sp+12) 8005570: 2b 8e 00 08 lw r14,(sp+8) 8005574: 37 9c 00 14 addi sp,sp,20 8005578: c3 a0 00 00 ret /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 800557c: 35 6d 00 20 addi r13,r11,32 8005580: b9 a0 08 00 mv r1,r13 8005584: fb ff fc d4 calli 80048d4 <_Chain_Get> 8005588: b8 20 60 00 mv r12,r1 if ( information->auto_extend ) { 800558c: 41 61 00 12 lbu r1,(r11+18) /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8005590: b9 80 70 00 mv r14,r12 if ( information->auto_extend ) { 8005594: 44 20 ff f2 be r1,r0,800555c <_Objects_Allocate+0x28> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 8005598: 45 80 00 18 be r12,r0,80055f8 <_Objects_Allocate+0xc4> } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 800559c: 2d 83 00 0a lhu r3,(r12+10) 80055a0: 2d 61 00 0a lhu r1,(r11+10) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 80055a4: 2d 62 00 14 lhu r2,(r11+20) 80055a8: c8 61 08 00 sub r1,r3,r1 80055ac: f8 00 55 e3 calli 801ad38 <__udivsi3> information->inactive_per_block[ block ]--; 80055b0: 29 62 00 30 lw r2,(r11+48) 80055b4: b4 21 08 00 add r1,r1,r1 80055b8: b4 21 08 00 add r1,r1,r1 80055bc: b4 41 08 00 add r1,r2,r1 80055c0: 28 22 00 00 lw r2,(r1+0) information->inactive--; 80055c4: 2d 63 00 2c lhu r3,(r11+44) block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 80055c8: 34 42 ff ff addi r2,r2,-1 80055cc: 58 22 00 00 sw (r1+0),r2 information->inactive--; 80055d0: 34 61 ff ff addi r1,r3,-1 80055d4: 0d 61 00 2c sh (r11+44),r1 ); } #endif return the_object; } 80055d8: b9 80 08 00 mv r1,r12 80055dc: 2b 9d 00 04 lw ra,(sp+4) 80055e0: 2b 8b 00 14 lw r11,(sp+20) 80055e4: 2b 8c 00 10 lw r12,(sp+16) 80055e8: 2b 8d 00 0c lw r13,(sp+12) 80055ec: 2b 8e 00 08 lw r14,(sp+8) 80055f0: 37 9c 00 14 addi sp,sp,20 80055f4: c3 a0 00 00 ret * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { _Objects_Extend_information( information ); 80055f8: b9 60 08 00 mv r1,r11 80055fc: f8 00 00 06 calli 8005614 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8005600: b9 a0 08 00 mv r1,r13 8005604: fb ff fc b4 calli 80048d4 <_Chain_Get> 8005608: b8 20 60 00 mv r12,r1 } if ( the_object ) { 800560c: 44 2e ff d4 be r1,r14,800555c <_Objects_Allocate+0x28> 8005610: e3 ff ff e3 bi 800559c <_Objects_Allocate+0x68> =============================================================================== 08005614 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 8005614: 37 9c ff c8 addi sp,sp,-56 8005618: 5b 8b 00 2c sw (sp+44),r11 800561c: 5b 8c 00 28 sw (sp+40),r12 8005620: 5b 8d 00 24 sw (sp+36),r13 8005624: 5b 8e 00 20 sw (sp+32),r14 8005628: 5b 8f 00 1c sw (sp+28),r15 800562c: 5b 90 00 18 sw (sp+24),r16 8005630: 5b 91 00 14 sw (sp+20),r17 8005634: 5b 92 00 10 sw (sp+16),r18 8005638: 5b 93 00 0c sw (sp+12),r19 800563c: 5b 94 00 08 sw (sp+8),r20 8005640: 5b 9d 00 04 sw (sp+4),ra minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 8005644: 28 2c 00 34 lw r12,(r1+52) */ void _Objects_Extend_information( Objects_Information *information ) { 8005648: b8 20 58 00 mv r11,r1 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 800564c: 2c 30 00 0a lhu r16,(r1+10) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 8005650: 45 80 00 9f be r12,r0,80058cc <_Objects_Extend_information+0x2b8> block_count = 0; else { block_count = information->maximum / information->allocation_size; 8005654: 2c 2f 00 14 lhu r15,(r1+20) 8005658: 2c 31 00 10 lhu r17,(r1+16) 800565c: b9 e0 10 00 mv r2,r15 8005660: ba 20 08 00 mv r1,r17 8005664: f8 00 55 b5 calli 801ad38 <__udivsi3> 8005668: 20 2e ff ff andi r14,r1,0xffff for ( ; block < block_count; block++ ) { 800566c: 45 c0 00 b3 be r14,r0,8005938 <_Objects_Extend_information+0x324><== NEVER TAKEN if ( information->object_blocks[ block ] == NULL ) { 8005670: 29 81 00 00 lw r1,(r12+0) 8005674: 44 20 00 b6 be r1,r0,800594c <_Objects_Extend_information+0x338><== NEVER TAKEN 8005678: b9 80 18 00 mv r3,r12 800567c: b9 e0 08 00 mv r1,r15 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 8005680: ba 00 68 00 mv r13,r16 index_base = minimum_index; block = 0; 8005684: 34 0c 00 00 mvi r12,0 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 8005688: 35 8c 00 01 addi r12,r12,1 if ( information->object_blocks[ block ] == NULL ) { do_extend = false; break; } else index_base += information->allocation_size; 800568c: b5 af 68 00 add r13,r13,r15 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 8005690: 55 cc 00 83 bgu r14,r12,800589c <_Objects_Extend_information+0x288> /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 8005694: 34 0f 00 01 mvi r15,1 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 8005698: b6 21 88 00 add r17,r17,r1 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 800569c: 38 02 ff ff mvu r2,0xffff 80056a0: 56 22 00 72 bgu r17,r2,8005868 <_Objects_Extend_information+0x254><== NEVER TAKEN /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 80056a4: 29 62 00 18 lw r2,(r11+24) 80056a8: f8 00 55 3f calli 801aba4 <__mulsi3> if ( information->auto_extend ) { 80056ac: 41 62 00 12 lbu r2,(r11+18) 80056b0: 44 40 00 80 be r2,r0,80058b0 <_Objects_Extend_information+0x29c> new_object_block = _Workspace_Allocate( block_size ); 80056b4: f8 00 0a 2c calli 8007f64 <_Workspace_Allocate> 80056b8: b8 20 90 00 mv r18,r1 if ( !new_object_block ) 80056bc: 44 20 00 6b be r1,r0,8005868 <_Objects_Extend_information+0x254> } /* * Do we need to grow the tables? */ if ( do_extend ) { 80056c0: 45 e0 00 43 be r15,r0,80057cc <_Objects_Extend_information+0x1b8> */ /* * Up the block count and maximum */ block_count++; 80056c4: 35 c1 00 01 addi r1,r14,1 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 80056c8: b4 21 98 00 add r19,r1,r1 80056cc: b6 61 18 00 add r3,r19,r1 ((maximum + minimum_index) * sizeof(Objects_Control *)); 80056d0: b6 23 18 00 add r3,r17,r3 if ( information->auto_extend ) { 80056d4: 41 62 00 12 lbu r2,(r11+18) /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 80056d8: b4 70 18 00 add r3,r3,r16 block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * 80056dc: b4 63 18 00 add r3,r3,r3 80056e0: b4 63 18 00 add r3,r3,r3 (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 80056e4: 44 40 00 76 be r2,r0,80058bc <_Objects_Extend_information+0x2a8> object_blocks = _Workspace_Allocate( block_size ); 80056e8: b8 60 08 00 mv r1,r3 80056ec: f8 00 0a 1e calli 8007f64 <_Workspace_Allocate> 80056f0: b8 20 78 00 mv r15,r1 if ( !object_blocks ) { 80056f4: 44 20 00 8e be r1,r0,800592c <_Objects_Extend_information+0x318> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 80056f8: 2d 61 00 10 lhu r1,(r11+16) /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( object_blocks, block_count * sizeof(void*) ); 80056fc: b6 73 a0 00 add r20,r19,r19 8005700: b5 f4 98 00 add r19,r15,r20 8005704: b6 74 a0 00 add r20,r19,r20 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 8005708: 54 30 00 77 bgu r1,r16,80058e4 <_Objects_Extend_information+0x2d0> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 800570c: ba 80 20 00 mv r4,r20 8005710: 34 03 00 00 mvi r3,0 8005714: 46 00 00 05 be r16,r0,8005728 <_Objects_Extend_information+0x114><== NEVER TAKEN local_table[ index ] = NULL; 8005718: 58 80 00 00 sw (r4+0),r0 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 800571c: 34 63 00 01 addi r3,r3,1 8005720: 34 84 00 04 addi r4,r4,4 8005724: 56 03 ff fd bgu r16,r3,8005718 <_Objects_Extend_information+0x104><== NEVER TAKEN 8005728: b5 ce 70 00 add r14,r14,r14 800572c: b5 ce 70 00 add r14,r14,r14 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 8005730: 2d 65 00 14 lhu r5,(r11+20) } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 8005734: b5 ee 08 00 add r1,r15,r14 8005738: 58 20 00 00 sw (r1+0),r0 inactive_per_block[block_count] = 0; 800573c: b6 6e 70 00 add r14,r19,r14 8005740: 59 c0 00 00 sw (r14+0),r0 for ( index=index_base ; index < ( information->allocation_size + index_base ); 8005744: b5 a5 28 00 add r5,r13,r5 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8005748: 51 a5 00 09 bgeu r13,r5,800576c <_Objects_Extend_information+0x158><== NEVER TAKEN * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 800574c: b5 ad 20 00 add r4,r13,r13 8005750: b4 84 20 00 add r4,r4,r4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8005754: b6 84 20 00 add r4,r20,r4 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 8005758: b9 a0 18 00 mv r3,r13 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 800575c: 58 80 00 00 sw (r4+0),r0 object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 8005760: 34 63 00 01 addi r3,r3,1 8005764: 34 84 00 04 addi r4,r4,4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8005768: 54 a3 ff fd bgu r5,r3,800575c <_Objects_Extend_information+0x148> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 800576c: 90 00 70 00 rcsr r14,IE 8005770: 34 01 ff fe mvi r1,-2 8005774: a1 c1 08 00 and r1,r14,r1 8005778: d0 01 00 00 wcsr IE,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 800577c: 29 61 00 00 lw r1,(r11+0) old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 8005780: 22 31 ff ff andi r17,r17,0xffff 8005784: 0d 71 00 10 sh (r11+16),r17 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 8005788: 29 70 00 34 lw r16,(r11+52) information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 800578c: 59 73 00 30 sw (r11+48),r19 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 8005790: 59 6f 00 34 sw (r11+52),r15 information->inactive_per_block = inactive_per_block; information->local_table = local_table; 8005794: 59 74 00 1c sw (r11+28),r20 8005798: 34 02 00 18 mvi r2,24 800579c: f8 00 54 8d calli 801a9d0 <__ashlsi3> 80057a0: 78 0f 00 01 mvhi r15,0x1 80057a4: b8 2f 78 00 or r15,r1,r15 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 80057a8: 2d 61 00 04 lhu r1,(r11+4) 80057ac: 34 02 00 1b mvi r2,27 80057b0: f8 00 54 88 calli 801a9d0 <__ashlsi3> 80057b4: b9 e1 10 00 or r2,r15,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 80057b8: b8 51 88 00 or r17,r2,r17 information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 80057bc: 59 71 00 0c sw (r11+12),r17 information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 80057c0: d0 0e 00 00 wcsr IE,r14 _Workspace_Free( old_tables ); 80057c4: ba 00 08 00 mv r1,r16 80057c8: f8 00 09 f2 calli 8007f90 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 80057cc: 29 61 00 34 lw r1,(r11+52) 80057d0: b5 8c 60 00 add r12,r12,r12 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 80057d4: 2d 63 00 14 lhu r3,(r11+20) 80057d8: 29 64 00 18 lw r4,(r11+24) } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 80057dc: b5 8c 60 00 add r12,r12,r12 80057e0: b4 2c 08 00 add r1,r1,r12 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 80057e4: 37 90 00 30 addi r16,sp,48 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 80057e8: 58 32 00 00 sw (r1+0),r18 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 80057ec: ba 40 10 00 mv r2,r18 80057f0: ba 00 08 00 mv r1,r16 80057f4: fb ff fc 49 calli 8004918 <_Chain_Initialize> 80057f8: 78 12 00 01 mvhi r18,0x1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 80057fc: 35 71 00 20 addi r17,r11,32 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 8005800: e0 00 00 0e bi 8005838 <_Objects_Extend_information+0x224> 8005804: 29 61 00 00 lw r1,(r11+0) 8005808: f8 00 54 72 calli 801a9d0 <__ashlsi3> 800580c: b8 32 78 00 or r15,r1,r18 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 8005810: 2d 61 00 04 lhu r1,(r11+4) 8005814: 34 02 00 1b mvi r2,27 8005818: f8 00 54 6e calli 801a9d0 <__ashlsi3> 800581c: b9 e1 10 00 or r2,r15,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 8005820: b8 4d 10 00 or r2,r2,r13 the_object->id = _Objects_Build_id( 8005824: 59 c2 00 08 sw (r14+8),r2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 8005828: ba 20 08 00 mv r1,r17 800582c: b9 c0 10 00 mv r2,r14 8005830: fb ff fc 1d calli 80048a4 <_Chain_Append> index++; 8005834: 35 ad 00 01 addi r13,r13,1 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 8005838: ba 00 08 00 mv r1,r16 800583c: fb ff fc 26 calli 80048d4 <_Chain_Get> 8005840: b8 20 70 00 mv r14,r1 8005844: 34 02 00 18 mvi r2,24 8005848: 5c 20 ff ef bne r1,r0,8005804 <_Objects_Extend_information+0x1f0> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 800584c: 29 63 00 30 lw r3,(r11+48) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 8005850: 2d 62 00 2c lhu r2,(r11+44) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 8005854: 2d 61 00 14 lhu r1,(r11+20) 8005858: b4 6c 60 00 add r12,r3,r12 800585c: 59 81 00 00 sw (r12+0),r1 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 8005860: b4 22 08 00 add r1,r1,r2 index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = 8005864: 0d 61 00 2c sh (r11+44),r1 (Objects_Maximum)(information->inactive + information->allocation_size); } 8005868: 2b 9d 00 04 lw ra,(sp+4) 800586c: 2b 8b 00 2c lw r11,(sp+44) 8005870: 2b 8c 00 28 lw r12,(sp+40) 8005874: 2b 8d 00 24 lw r13,(sp+36) 8005878: 2b 8e 00 20 lw r14,(sp+32) 800587c: 2b 8f 00 1c lw r15,(sp+28) 8005880: 2b 90 00 18 lw r16,(sp+24) 8005884: 2b 91 00 14 lw r17,(sp+20) 8005888: 2b 92 00 10 lw r18,(sp+16) 800588c: 2b 93 00 0c lw r19,(sp+12) 8005890: 2b 94 00 08 lw r20,(sp+8) 8005894: 37 9c 00 38 addi sp,sp,56 8005898: c3 a0 00 00 ret block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 800589c: 28 62 00 04 lw r2,(r3+4) 80058a0: 34 63 00 04 addi r3,r3,4 80058a4: 5c 40 ff 79 bne r2,r0,8005688 <_Objects_Extend_information+0x74> do_extend = false; 80058a8: 34 0f 00 00 mvi r15,0 80058ac: e3 ff ff 7b bi 8005698 <_Objects_Extend_information+0x84> if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 80058b0: f8 00 09 c1 calli 8007fb4 <_Workspace_Allocate_or_fatal_error> 80058b4: b8 20 90 00 mv r18,r1 80058b8: e3 ff ff 82 bi 80056c0 <_Objects_Extend_information+0xac> if ( !object_blocks ) { _Workspace_Free( new_object_block ); return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 80058bc: b8 60 08 00 mv r1,r3 80058c0: f8 00 09 bd calli 8007fb4 <_Workspace_Allocate_or_fatal_error> 80058c4: b8 20 78 00 mv r15,r1 80058c8: e3 ff ff 8c bi 80056f8 <_Objects_Extend_information+0xe4> minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 80058cc: 2c 31 00 10 lhu r17,(r1+16) /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 80058d0: ba 00 68 00 mv r13,r16 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 80058d4: 2c 21 00 14 lhu r1,(r1+20) /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 80058d8: 34 0f 00 01 mvi r15,1 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 80058dc: 34 0e 00 00 mvi r14,0 80058e0: e3 ff ff 6e bi 8005698 <_Objects_Extend_information+0x84> /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 80058e4: 29 62 00 34 lw r2,(r11+52) information->object_blocks, block_count * sizeof(void*) ); 80058e8: b5 ce 70 00 add r14,r14,r14 80058ec: b5 ce 70 00 add r14,r14,r14 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 80058f0: b9 c0 18 00 mv r3,r14 80058f4: b9 e0 08 00 mv r1,r15 80058f8: f8 00 1c a5 calli 800cb8c information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 80058fc: 29 62 00 30 lw r2,(r11+48) 8005900: b9 c0 18 00 mv r3,r14 8005904: ba 60 08 00 mv r1,r19 8005908: f8 00 1c a1 calli 800cb8c information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 800590c: 2d 63 00 10 lhu r3,(r11+16) information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 8005910: 29 62 00 1c lw r2,(r11+28) 8005914: ba 80 08 00 mv r1,r20 information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 8005918: b6 03 18 00 add r3,r16,r3 800591c: b4 63 18 00 add r3,r3,r3 8005920: b4 63 18 00 add r3,r3,r3 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 8005924: f8 00 1c 9a calli 800cb8c 8005928: e3 ff ff 82 bi 8005730 <_Objects_Extend_information+0x11c> (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { object_blocks = _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 800592c: ba 40 08 00 mv r1,r18 8005930: f8 00 09 98 calli 8007f90 <_Workspace_Free> return; 8005934: e3 ff ff cd bi 8005868 <_Objects_Extend_information+0x254> if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 8005938: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 800593c: ba 00 68 00 mv r13,r16 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 8005940: 34 0f 00 01 mvi r15,1 <== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 8005944: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 8005948: e3 ff ff 54 bi 8005698 <_Objects_Extend_information+0x84> <== NOT EXECUTED block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 800594c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 8005950: ba 00 68 00 mv r13,r16 <== NOT EXECUTED else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; 8005954: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 8005958: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 800595c: e3 ff ff 4f bi 8005698 <_Objects_Extend_information+0x84> <== NOT EXECUTED =============================================================================== 08005a48 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 8005a48: 37 9c ff f0 addi sp,sp,-16 8005a4c: 5b 8b 00 10 sw (sp+16),r11 8005a50: 5b 8c 00 0c sw (sp+12),r12 8005a54: 5b 8d 00 08 sw (sp+8),r13 8005a58: 5b 9d 00 04 sw (sp+4),ra 8005a5c: 20 4c ff ff andi r12,r2,0xffff 8005a60: b8 20 68 00 mv r13,r1 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 8005a64: 34 0b 00 00 mvi r11,0 ) { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 8005a68: 5d 80 00 08 bne r12,r0,8005a88 <_Objects_Get_information+0x40> if ( info->maximum == 0 ) return NULL; #endif return info; } 8005a6c: b9 60 08 00 mv r1,r11 8005a70: 2b 9d 00 04 lw ra,(sp+4) 8005a74: 2b 8b 00 10 lw r11,(sp+16) 8005a78: 2b 8c 00 0c lw r12,(sp+12) 8005a7c: 2b 8d 00 08 lw r13,(sp+8) 8005a80: 37 9c 00 10 addi sp,sp,16 8005a84: c3 a0 00 00 ret /* * This call implicitly validates the_api so we do not call * _Objects_Is_api_valid above here. */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); 8005a88: f8 00 12 4e calli 800a3c0 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 8005a8c: 44 20 ff f8 be r1,r0,8005a6c <_Objects_Get_information+0x24> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 8005a90: 55 81 ff f7 bgu r12,r1,8005a6c <_Objects_Get_information+0x24> return NULL; if ( !_Objects_Information_table[ the_api ] ) 8005a94: 78 01 08 01 mvhi r1,0x801 8005a98: b5 ad 68 00 add r13,r13,r13 8005a9c: 38 21 e8 7c ori r1,r1,0xe87c 8005aa0: b5 ad 68 00 add r13,r13,r13 8005aa4: b4 2d 08 00 add r1,r1,r13 8005aa8: 28 21 00 00 lw r1,(r1+0) 8005aac: 44 20 ff f0 be r1,r0,8005a6c <_Objects_Get_information+0x24><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 8005ab0: b5 8c 60 00 add r12,r12,r12 8005ab4: b5 8c 60 00 add r12,r12,r12 8005ab8: b4 2c 08 00 add r1,r1,r12 8005abc: 28 2b 00 00 lw r11,(r1+0) if ( !info ) 8005ac0: 45 60 ff eb be r11,r0,8005a6c <_Objects_Get_information+0x24><== NEVER TAKEN * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) 8005ac4: 2d 61 00 10 lhu r1,(r11+16) return NULL; 8005ac8: 7c 21 00 00 cmpnei r1,r1,0 8005acc: c8 01 08 00 sub r1,r0,r1 8005ad0: a1 61 58 00 and r11,r11,r1 8005ad4: e3 ff ff e6 bi 8005a6c <_Objects_Get_information+0x24> =============================================================================== 0801558c <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 801558c: 37 9c ff dc addi sp,sp,-36 8015590: 5b 8b 00 18 sw (sp+24),r11 8015594: 5b 8c 00 14 sw (sp+20),r12 8015598: 5b 8d 00 10 sw (sp+16),r13 801559c: 5b 8e 00 0c sw (sp+12),r14 80155a0: 5b 8f 00 08 sw (sp+8),r15 80155a4: 5b 9d 00 04 sw (sp+4),ra 80155a8: b8 40 60 00 mv r12,r2 80155ac: b8 60 58 00 mv r11,r3 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 80155b0: 5c 40 00 0b bne r2,r0,80155dc <_Objects_Get_name_as_string+0x50> #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* not supported */ #endif case OBJECTS_ERROR: return NULL; 80155b4: 34 0b 00 00 mvi r11,0 _Thread_Enable_dispatch(); return name; } return NULL; /* unreachable path */ } 80155b8: b9 60 08 00 mv r1,r11 80155bc: 2b 9d 00 04 lw ra,(sp+4) 80155c0: 2b 8b 00 18 lw r11,(sp+24) 80155c4: 2b 8c 00 14 lw r12,(sp+20) 80155c8: 2b 8d 00 10 lw r13,(sp+16) 80155cc: 2b 8e 00 0c lw r14,(sp+12) 80155d0: 2b 8f 00 08 lw r15,(sp+8) 80155d4: 37 9c 00 24 addi sp,sp,36 80155d8: c3 a0 00 00 ret Objects_Id tmpId; if ( length == 0 ) return NULL; if ( name == NULL ) 80155dc: 44 60 ff f7 be r3,r0,80155b8 <_Objects_Get_name_as_string+0x2c> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 80155e0: b8 20 68 00 mv r13,r1 80155e4: 5c 20 00 05 bne r1,r0,80155f8 <_Objects_Get_name_as_string+0x6c> 80155e8: 78 01 08 03 mvhi r1,0x803 80155ec: 38 21 33 80 ori r1,r1,0x3380 80155f0: 28 21 00 10 lw r1,(r1+16) 80155f4: 28 2d 00 08 lw r13,(r1+8) information = _Objects_Get_information_id( tmpId ); 80155f8: b9 a0 08 00 mv r1,r13 80155fc: fb ff de 34 calli 800cecc <_Objects_Get_information_id> if ( !information ) 8015600: 44 20 ff ed be r1,r0,80155b4 <_Objects_Get_name_as_string+0x28> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 8015604: b9 a0 10 00 mv r2,r13 8015608: 37 83 00 24 addi r3,sp,36 801560c: fb ff de 82 calli 800d014 <_Objects_Get> switch ( location ) { 8015610: 2b 8f 00 24 lw r15,(sp+36) 8015614: 5d e0 ff e8 bne r15,r0,80155b4 <_Objects_Get_name_as_string+0x28> if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 8015618: 28 2e 00 0c lw r14,(r1+12) lname[ 0 ] = (u32_name >> 24) & 0xff; 801561c: 34 02 00 18 mvi r2,24 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 8015620: 35 8c ff ff addi r12,r12,-1 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 8015624: b9 c0 08 00 mv r1,r14 8015628: f8 00 5d 05 calli 802ca3c <__lshrsi3> 801562c: 20 2d 00 ff andi r13,r1,0xff lname[ 1 ] = (u32_name >> 16) & 0xff; 8015630: 34 02 00 10 mvi r2,16 8015634: b9 c0 08 00 mv r1,r14 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 8015638: 33 8d 00 1c sb (sp+28),r13 lname[ 1 ] = (u32_name >> 16) & 0xff; 801563c: f8 00 5d 00 calli 802ca3c <__lshrsi3> lname[ 2 ] = (u32_name >> 8) & 0xff; 8015640: 01 c3 00 01 srui r3,r14,1 #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 8015644: 33 81 00 1d sb (sp+29),r1 lname[ 2 ] = (u32_name >> 8) & 0xff; 8015648: 00 63 00 01 srui r3,r3,1 lname[ 3 ] = (u32_name >> 0) & 0xff; 801564c: 33 8e 00 1f sb (sp+31),r14 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 8015650: 00 63 00 01 srui r3,r3,1 lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 8015654: 33 80 00 20 sb (sp+32),r0 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 8015658: 00 63 00 01 srui r3,r3,1 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 801565c: b9 60 10 00 mv r2,r11 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 8015660: 00 63 00 01 srui r3,r3,1 8015664: 00 63 00 01 srui r3,r3,1 8015668: 00 63 00 01 srui r3,r3,1 801566c: 00 63 00 01 srui r3,r3,1 8015670: 33 83 00 1e sb (sp+30),r3 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 8015674: 45 8f 00 13 be r12,r15,80156c0 <_Objects_Get_name_as_string+0x134><== NEVER TAKEN 8015678: 45 a0 00 12 be r13,r0,80156c0 <_Objects_Get_name_as_string+0x134> 801567c: 78 03 08 03 mvhi r3,0x803 8015680: 34 01 00 00 mvi r1,0 8015684: 38 63 23 fc ori r3,r3,0x23fc * This method objects the name of an object and returns its name * in the form of a C string. It attempts to be careful about * overflowing the user's string and about returning unprintable characters. */ char *_Objects_Get_name_as_string( 8015688: 37 86 00 1c addi r6,sp,28 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; 801568c: 28 64 00 00 lw r4,(r3+0) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 8015690: 34 21 00 01 addi r1,r1,1 * This method objects the name of an object and returns its name * in the form of a C string. It attempts to be careful about * overflowing the user's string and about returning unprintable characters. */ char *_Objects_Get_name_as_string( 8015694: b4 c1 28 00 add r5,r6,r1 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; 8015698: b4 8d 20 00 add r4,r4,r13 801569c: 40 84 00 01 lbu r4,(r4+1) 80156a0: 20 84 00 97 andi r4,r4,0x97 80156a4: 5c 80 00 02 bne r4,r0,80156ac <_Objects_Get_name_as_string+0x120> 80156a8: 34 0d 00 2a mvi r13,42 80156ac: 30 4d 00 00 sb (r2+0),r13 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 80156b0: 34 42 00 01 addi r2,r2,1 80156b4: 50 2c 00 03 bgeu r1,r12,80156c0 <_Objects_Get_name_as_string+0x134> 80156b8: 40 ad 00 00 lbu r13,(r5+0) 80156bc: 5d a0 ff f4 bne r13,r0,801568c <_Objects_Get_name_as_string+0x100> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 80156c0: 30 40 00 00 sb (r2+0),r0 _Thread_Enable_dispatch(); 80156c4: fb ff e2 f4 calli 800e294 <_Thread_Enable_dispatch> return name; 80156c8: e3 ff ff bc bi 80155b8 <_Objects_Get_name_as_string+0x2c> =============================================================================== 08018b44 <_Objects_Get_no_protection>: /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 8018b44: 28 25 00 08 lw r5,(r1+8) if ( information->maximum >= index ) { 8018b48: 2c 24 00 10 lhu r4,(r1+16) /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 8018b4c: c8 45 10 00 sub r2,r2,r5 8018b50: 34 42 00 01 addi r2,r2,1 if ( information->maximum >= index ) { 8018b54: 54 44 00 09 bgu r2,r4,8018b78 <_Objects_Get_no_protection+0x34> if ( (the_object = information->local_table[ index ]) != NULL ) { 8018b58: 28 24 00 1c lw r4,(r1+28) 8018b5c: b4 42 08 00 add r1,r2,r2 8018b60: b4 21 08 00 add r1,r1,r1 8018b64: b4 81 08 00 add r1,r4,r1 8018b68: 28 21 00 00 lw r1,(r1+0) 8018b6c: 44 20 00 03 be r1,r0,8018b78 <_Objects_Get_no_protection+0x34><== NEVER TAKEN *location = OBJECTS_LOCAL; 8018b70: 58 60 00 00 sw (r3+0),r0 return the_object; 8018b74: c3 a0 00 00 ret /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 8018b78: 34 01 00 01 mvi r1,1 8018b7c: 58 61 00 00 sw (r3+0),r1 return NULL; 8018b80: 34 01 00 00 mvi r1,0 } 8018b84: c3 a0 00 00 ret =============================================================================== 0800d0ac <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 800d0ac: 37 9c ff e8 addi sp,sp,-24 800d0b0: 5b 8b 00 14 sw (sp+20),r11 800d0b4: 5b 8c 00 10 sw (sp+16),r12 800d0b8: 5b 8d 00 0c sw (sp+12),r13 800d0bc: 5b 8e 00 08 sw (sp+8),r14 800d0c0: 5b 9d 00 04 sw (sp+4),ra /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 800d0c4: b8 20 58 00 mv r11,r1 Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 800d0c8: b8 40 70 00 mv r14,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 800d0cc: 5c 20 00 05 bne r1,r0,800d0e0 <_Objects_Id_to_name+0x34> 800d0d0: 78 01 08 03 mvhi r1,0x803 800d0d4: 38 21 33 80 ori r1,r1,0x3380 800d0d8: 28 21 00 10 lw r1,(r1+16) 800d0dc: 28 2b 00 08 lw r11,(r1+8) */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 800d0e0: b9 60 08 00 mv r1,r11 800d0e4: 34 02 00 18 mvi r2,24 800d0e8: f8 00 7e 55 calli 802ca3c <__lshrsi3> 800d0ec: 20 23 00 07 andi r3,r1,0x7 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 800d0f0: 34 64 ff ff addi r4,r3,-1 800d0f4: 34 01 00 02 mvi r1,2 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 800d0f8: 34 0c 00 03 mvi r12,3 800d0fc: 54 81 00 18 bgu r4,r1,800d15c <_Objects_Id_to_name+0xb0> if ( !_Objects_Information_table[ the_api ] ) 800d100: 78 04 08 03 mvhi r4,0x803 800d104: b4 63 18 00 add r3,r3,r3 800d108: 38 84 31 54 ori r4,r4,0x3154 800d10c: b4 63 18 00 add r3,r3,r3 800d110: b4 83 18 00 add r3,r4,r3 800d114: 28 6d 00 00 lw r13,(r3+0) 800d118: 45 a0 00 11 be r13,r0,800d15c <_Objects_Id_to_name+0xb0> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 800d11c: b9 60 08 00 mv r1,r11 800d120: 34 02 00 1b mvi r2,27 800d124: f8 00 7e 46 calli 802ca3c <__lshrsi3> return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 800d128: b4 21 18 00 add r3,r1,r1 800d12c: b4 63 18 00 add r3,r3,r3 800d130: b5 a3 18 00 add r3,r13,r3 800d134: 28 61 00 00 lw r1,(r3+0) if ( !information ) 800d138: 44 20 00 09 be r1,r0,800d15c <_Objects_Id_to_name+0xb0> <== NEVER TAKEN #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 800d13c: b9 60 10 00 mv r2,r11 800d140: 37 83 00 18 addi r3,sp,24 800d144: fb ff ff b4 calli 800d014 <_Objects_Get> if ( !the_object ) 800d148: 44 20 00 05 be r1,r0,800d15c <_Objects_Id_to_name+0xb0> return OBJECTS_INVALID_ID; *name = the_object->name; 800d14c: 28 21 00 0c lw r1,(r1+12) _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 800d150: 34 0c 00 00 mvi r12,0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; 800d154: 59 c1 00 00 sw (r14+0),r1 _Thread_Enable_dispatch(); 800d158: f8 00 04 4f calli 800e294 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 800d15c: b9 80 08 00 mv r1,r12 800d160: 2b 9d 00 04 lw ra,(sp+4) 800d164: 2b 8b 00 14 lw r11,(sp+20) 800d168: 2b 8c 00 10 lw r12,(sp+16) 800d16c: 2b 8d 00 0c lw r13,(sp+12) 800d170: 2b 8e 00 08 lw r14,(sp+8) 800d174: 37 9c 00 18 addi sp,sp,24 800d178: c3 a0 00 00 ret =============================================================================== 08005d88 <_Objects_Shrink_information>: #include void _Objects_Shrink_information( Objects_Information *information ) { 8005d88: 37 9c ff ec addi sp,sp,-20 8005d8c: 5b 8b 00 14 sw (sp+20),r11 8005d90: 5b 8c 00 10 sw (sp+16),r12 8005d94: 5b 8d 00 0c sw (sp+12),r13 8005d98: 5b 8e 00 08 sw (sp+8),r14 8005d9c: 5b 9d 00 04 sw (sp+4),ra /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 8005da0: 2c 2c 00 0a lhu r12,(r1+10) block_count = (information->maximum - index_base) / 8005da4: 2c 2d 00 14 lhu r13,(r1+20) #include void _Objects_Shrink_information( Objects_Information *information ) { 8005da8: b8 20 70 00 mv r14,r1 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / 8005dac: 2c 21 00 10 lhu r1,(r1+16) 8005db0: b9 a0 10 00 mv r2,r13 8005db4: c8 2c 08 00 sub r1,r1,r12 8005db8: f8 00 53 e0 calli 801ad38 <__udivsi3> information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8005dbc: 44 20 00 09 be r1,r0,8005de0 <_Objects_Shrink_information+0x58><== NEVER TAKEN if ( information->inactive_per_block[ block ] == 8005dc0: 29 c5 00 30 lw r5,(r14+48) 8005dc4: 34 0b 00 04 mvi r11,4 8005dc8: 34 03 00 00 mvi r3,0 8005dcc: 28 a2 00 00 lw r2,(r5+0) 8005dd0: 45 a2 00 11 be r13,r2,8005e14 <_Objects_Shrink_information+0x8c><== NEVER TAKEN index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8005dd4: 34 63 00 01 addi r3,r3,1 #include #include #include #include void _Objects_Shrink_information( 8005dd8: b4 ab 10 00 add r2,r5,r11 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8005ddc: 54 23 00 08 bgu r1,r3,8005dfc <_Objects_Shrink_information+0x74> return; } index_base += information->allocation_size; } } 8005de0: 2b 9d 00 04 lw ra,(sp+4) 8005de4: 2b 8b 00 14 lw r11,(sp+20) 8005de8: 2b 8c 00 10 lw r12,(sp+16) 8005dec: 2b 8d 00 0c lw r13,(sp+12) 8005df0: 2b 8e 00 08 lw r14,(sp+8) 8005df4: 37 9c 00 14 addi sp,sp,20 8005df8: c3 a0 00 00 ret index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 8005dfc: 28 42 00 00 lw r2,(r2+0) information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 8005e00: 35 64 00 04 addi r4,r11,4 8005e04: b5 8d 60 00 add r12,r12,r13 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 8005e08: 45 a2 00 04 be r13,r2,8005e18 <_Objects_Shrink_information+0x90> 8005e0c: b8 80 58 00 mv r11,r4 8005e10: e3 ff ff f1 bi 8005dd4 <_Objects_Shrink_information+0x4c> 8005e14: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) _Chain_First( &information->Inactive ); 8005e18: 29 c1 00 20 lw r1,(r14+32) do { index = _Objects_Get_index( the_object->id ); 8005e1c: 2c 22 00 0a lhu r2,(r1+10) /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 8005e20: 28 2d 00 00 lw r13,(r1+0) if ((index >= index_base) && 8005e24: 55 82 00 05 bgu r12,r2,8005e38 <_Objects_Shrink_information+0xb0> (index < (index_base + information->allocation_size))) { 8005e28: 2d c3 00 14 lhu r3,(r14+20) 8005e2c: b5 83 18 00 add r3,r12,r3 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 8005e30: 50 43 00 02 bgeu r2,r3,8005e38 <_Objects_Shrink_information+0xb0> (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 8005e34: f8 00 10 12 calli 8009e7c <_Chain_Extract> } } while ( the_object ); 8005e38: 45 a0 00 03 be r13,r0,8005e44 <_Objects_Shrink_information+0xbc> index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 8005e3c: b9 a0 08 00 mv r1,r13 8005e40: e3 ff ff f7 bi 8005e1c <_Objects_Shrink_information+0x94> while ( the_object ); /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 8005e44: 29 c1 00 34 lw r1,(r14+52) 8005e48: b4 2b 08 00 add r1,r1,r11 8005e4c: 28 21 00 00 lw r1,(r1+0) 8005e50: f8 00 08 50 calli 8007f90 <_Workspace_Free> information->object_blocks[ block ] = NULL; 8005e54: 29 c2 00 34 lw r2,(r14+52) information->inactive_per_block[ block ] = 0; 8005e58: 29 c4 00 30 lw r4,(r14+48) information->inactive -= information->allocation_size; 8005e5c: 2d c3 00 2c lhu r3,(r14+44) 8005e60: 2d c1 00 14 lhu r1,(r14+20) /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 8005e64: b4 4b 10 00 add r2,r2,r11 8005e68: 58 40 00 00 sw (r2+0),r0 information->inactive_per_block[ block ] = 0; 8005e6c: b4 8b 58 00 add r11,r4,r11 8005e70: 59 60 00 00 sw (r11+0),r0 information->inactive -= information->allocation_size; 8005e74: c8 61 08 00 sub r1,r3,r1 8005e78: 0d c1 00 2c sh (r14+44),r1 return; } index_base += information->allocation_size; } } 8005e7c: 2b 9d 00 04 lw ra,(sp+4) 8005e80: 2b 8b 00 14 lw r11,(sp+20) 8005e84: 2b 8c 00 10 lw r12,(sp+16) 8005e88: 2b 8d 00 0c lw r13,(sp+12) 8005e8c: 2b 8e 00 08 lw r14,(sp+8) 8005e90: 37 9c 00 14 addi sp,sp,20 8005e94: c3 a0 00 00 ret =============================================================================== 0800bfd8 <_Protected_heap_Get_information>: bool _Protected_heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 800bfd8: 37 9c ff f0 addi sp,sp,-16 800bfdc: 5b 8b 00 0c sw (sp+12),r11 800bfe0: 5b 8c 00 08 sw (sp+8),r12 800bfe4: 5b 9d 00 04 sw (sp+4),ra if ( !the_heap ) return false; 800bfe8: 34 03 00 00 mvi r3,0 bool _Protected_heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 800bfec: b8 20 60 00 mv r12,r1 if ( !the_heap ) 800bff0: 44 20 00 0d be r1,r0,800c024 <_Protected_heap_Get_information+0x4c><== NEVER TAKEN return false; if ( !the_info ) 800bff4: 44 40 00 0c be r2,r0,800c024 <_Protected_heap_Get_information+0x4c><== NEVER TAKEN return false; _RTEMS_Lock_allocator(); 800bff8: 78 0b 08 02 mvhi r11,0x802 800bffc: 39 6b 62 48 ori r11,r11,0x6248 800c000: 29 61 00 00 lw r1,(r11+0) 800c004: 5b 82 00 10 sw (sp+16),r2 800c008: fb ff f6 3a calli 80098f0 <_API_Mutex_Lock> _Heap_Get_information( the_heap, the_info ); 800c00c: 2b 82 00 10 lw r2,(sp+16) 800c010: b9 80 08 00 mv r1,r12 800c014: f8 00 11 b8 calli 80106f4 <_Heap_Get_information> _RTEMS_Unlock_allocator(); 800c018: 29 61 00 00 lw r1,(r11+0) 800c01c: fb ff f6 51 calli 8009960 <_API_Mutex_Unlock> return true; 800c020: 34 03 00 01 mvi r3,1 } 800c024: b8 60 08 00 mv r1,r3 800c028: 2b 9d 00 04 lw ra,(sp+4) 800c02c: 2b 8b 00 0c lw r11,(sp+12) 800c030: 2b 8c 00 08 lw r12,(sp+8) 800c034: 37 9c 00 10 addi sp,sp,16 800c038: c3 a0 00 00 ret =============================================================================== 080068c0 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 80068c0: 37 9c ff ec addi sp,sp,-20 80068c4: 5b 8b 00 14 sw (sp+20),r11 80068c8: 5b 8c 00 10 sw (sp+16),r12 80068cc: 5b 8d 00 0c sw (sp+12),r13 80068d0: 5b 8e 00 08 sw (sp+8),r14 80068d4: 5b 9d 00 04 sw (sp+4),ra 80068d8: b8 40 60 00 mv r12,r2 80068dc: b8 20 68 00 mv r13,r1 RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 80068e0: 44 40 00 35 be r2,r0,80069b4 <_RBTree_Extract_unprotected+0xf4> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 80068e4: 28 21 00 08 lw r1,(r1+8) 80068e8: 44 22 00 4a be r1,r2,8006a10 <_RBTree_Extract_unprotected+0x150> the_rbtree->first[RBT_LEFT] = next; } /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 80068ec: 29 a1 00 0c lw r1,(r13+12) 80068f0: 44 2c 00 4d be r1,r12,8006a24 <_RBTree_Extract_unprotected+0x164> * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 80068f4: 29 8b 00 04 lw r11,(r12+4) 80068f8: 45 60 00 53 be r11,r0,8006a44 <_RBTree_Extract_unprotected+0x184> 80068fc: 29 81 00 08 lw r1,(r12+8) 8006900: 5c 20 00 03 bne r1,r0,800690c <_RBTree_Extract_unprotected+0x4c> 8006904: e0 00 00 36 bi 80069dc <_RBTree_Extract_unprotected+0x11c> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 8006908: b8 40 58 00 mv r11,r2 800690c: 29 62 00 08 lw r2,(r11+8) 8006910: 5c 40 ff fe bne r2,r0,8006908 <_RBTree_Extract_unprotected+0x48> * target's position (target is the right child of target->parent) * when target vacates it. if there is no child, then target->parent * should become NULL. This may cause the coloring to be violated. * For now we store the color of the node being deleted in victim_color. */ leaf = target->child[RBT_LEFT]; 8006914: 29 6e 00 04 lw r14,(r11+4) if(leaf) { 8006918: 45 c2 00 48 be r14,r2,8006a38 <_RBTree_Extract_unprotected+0x178> leaf->parent = target->parent; 800691c: 29 61 00 00 lw r1,(r11+0) 8006920: 59 c1 00 00 sw (r14+0),r1 } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; 8006924: 29 61 00 00 lw r1,(r11+0) target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 8006928: 29 84 00 00 lw r4,(r12+0) leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; 800692c: 29 63 00 0c lw r3,(r11+12) dir = target != target->parent->child[0]; 8006930: 28 22 00 04 lw r2,(r1+4) 8006934: fc 4b 10 00 cmpne r2,r2,r11 target->parent->child[dir] = leaf; 8006938: b4 42 10 00 add r2,r2,r2 800693c: b4 42 10 00 add r2,r2,r2 8006940: b4 22 10 00 add r2,r1,r2 8006944: 58 4e 00 04 sw (r2+4),r14 /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 8006948: 28 81 00 04 lw r1,(r4+4) 800694c: fc 2c 08 00 cmpne r1,r1,r12 the_node->parent->child[dir] = target; 8006950: b4 21 08 00 add r1,r1,r1 8006954: b4 21 08 00 add r1,r1,r1 8006958: b4 81 08 00 add r1,r4,r1 800695c: 58 2b 00 04 sw (r1+4),r11 /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 8006960: 29 81 00 08 lw r1,(r12+8) 8006964: 59 61 00 08 sw (r11+8),r1 if (the_node->child[RBT_RIGHT]) 8006968: 29 81 00 08 lw r1,(r12+8) 800696c: 44 20 00 02 be r1,r0,8006974 <_RBTree_Extract_unprotected+0xb4><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 8006970: 58 2b 00 00 sw (r1+0),r11 target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 8006974: 29 81 00 04 lw r1,(r12+4) 8006978: 59 61 00 04 sw (r11+4),r1 if (the_node->child[RBT_LEFT]) 800697c: 29 81 00 04 lw r1,(r12+4) 8006980: 44 20 00 02 be r1,r0,8006988 <_RBTree_Extract_unprotected+0xc8> the_node->child[RBT_LEFT]->parent = target; 8006984: 58 2b 00 00 sw (r1+0),r11 /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 8006988: 29 82 00 00 lw r2,(r12+0) target->color = the_node->color; 800698c: 29 81 00 0c lw r1,(r12+12) /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 8006990: 59 62 00 00 sw (r11+0),r2 target->color = the_node->color; 8006994: 59 61 00 0c sw (r11+12),r1 /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 8006998: 44 60 00 0e be r3,r0,80069d0 <_RBTree_Extract_unprotected+0x110> /* Wipe the_node */ _RBTree_Set_off_rbtree(the_node); /* set root to black, if it exists */ if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK; 800699c: 29 a1 00 04 lw r1,(r13+4) */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 80069a0: 59 80 00 08 sw (r12+8),r0 80069a4: 59 80 00 04 sw (r12+4),r0 80069a8: 59 80 00 00 sw (r12+0),r0 80069ac: 44 20 00 02 be r1,r0,80069b4 <_RBTree_Extract_unprotected+0xf4> 80069b0: 58 20 00 0c sw (r1+12),r0 } 80069b4: 2b 9d 00 04 lw ra,(sp+4) 80069b8: 2b 8b 00 14 lw r11,(sp+20) 80069bc: 2b 8c 00 10 lw r12,(sp+16) 80069c0: 2b 8d 00 0c lw r13,(sp+12) 80069c4: 2b 8e 00 08 lw r14,(sp+8) 80069c8: 37 9c 00 14 addi sp,sp,20 80069cc: c3 a0 00 00 ret * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ if (leaf) { 80069d0: 45 c3 ff f3 be r14,r3,800699c <_RBTree_Extract_unprotected+0xdc> leaf->color = RBT_BLACK; /* case 2 */ 80069d4: 59 c0 00 0c sw (r14+12),r0 80069d8: e3 ff ff f1 bi 800699c <_RBTree_Extract_unprotected+0xdc> * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 80069dc: b9 60 70 00 mv r14,r11 * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; 80069e0: 29 81 00 00 lw r1,(r12+0) 80069e4: 59 c1 00 00 sw (r14+0),r1 _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 80069e8: 29 82 00 00 lw r2,(r12+0) leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; 80069ec: 29 83 00 0c lw r3,(r12+12) /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 80069f0: 28 41 00 04 lw r1,(r2+4) 80069f4: fc 2c 08 00 cmpne r1,r1,r12 the_node->parent->child[dir] = leaf; 80069f8: b4 21 08 00 add r1,r1,r1 80069fc: b4 21 08 00 add r1,r1,r1 8006a00: b4 41 08 00 add r1,r2,r1 8006a04: 58 2e 00 04 sw (r1+4),r14 /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 8006a08: 5c 60 ff e5 bne r3,r0,800699c <_RBTree_Extract_unprotected+0xdc> 8006a0c: e3 ff ff f1 bi 80069d0 <_RBTree_Extract_unprotected+0x110> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 8006a10: b8 40 08 00 mv r1,r2 8006a14: 34 02 00 01 mvi r2,1 8006a18: f8 00 01 09 calli 8006e3c <_RBTree_Next_unprotected> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 8006a1c: 59 a1 00 08 sw (r13+8),r1 8006a20: e3 ff ff b3 bi 80068ec <_RBTree_Extract_unprotected+0x2c> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 8006a24: b9 80 08 00 mv r1,r12 8006a28: 34 02 00 00 mvi r2,0 8006a2c: f8 00 01 04 calli 8006e3c <_RBTree_Next_unprotected> /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 8006a30: 59 a1 00 0c sw (r13+12),r1 8006a34: e3 ff ff b0 bi 80068f4 <_RBTree_Extract_unprotected+0x34> leaf = target->child[RBT_LEFT]; if(leaf) { leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 8006a38: b9 60 08 00 mv r1,r11 8006a3c: fb ff fe e2 calli 80065c4 <_RBTree_Extract_validate_unprotected> 8006a40: e3 ff ff b9 bi 8006924 <_RBTree_Extract_unprotected+0x64> * the_node's location in the tree. This may cause the coloring to be * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; 8006a44: 29 8e 00 08 lw r14,(r12+8) if( leaf ) { 8006a48: 5d cb ff e6 bne r14,r11,80069e0 <_RBTree_Extract_unprotected+0x120> leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 8006a4c: b9 80 08 00 mv r1,r12 8006a50: fb ff fe dd calli 80065c4 <_RBTree_Extract_validate_unprotected> 8006a54: e3 ff ff e5 bi 80069e8 <_RBTree_Extract_unprotected+0x128> =============================================================================== 080065c4 <_RBTree_Extract_validate_unprotected>: * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( RBTree_Node *the_node ) { 80065c4: 37 9c ff fc addi sp,sp,-4 80065c8: 5b 8b 00 04 sw (sp+4),r11 RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 80065cc: 28 22 00 00 lw r2,(r1+0) if(!parent->parent) return; 80065d0: 28 43 00 00 lw r3,(r2+0) 80065d4: 44 60 00 23 be r3,r0,8006660 <_RBTree_Extract_validate_unprotected+0x9c> { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 80065d8: 28 43 00 04 lw r3,(r2+4) 80065dc: 44 23 00 af be r1,r3,8006898 <_RBTree_Extract_validate_unprotected+0x2d4> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 80065e0: 34 04 00 01 mvi r4,1 80065e4: e0 00 00 1a bi 800664c <_RBTree_Extract_validate_unprotected+0x88> sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 80065e8: 28 45 00 00 lw r5,(r2+0) 80065ec: 44 a0 00 1a be r5,r0,8006654 <_RBTree_Extract_validate_unprotected+0x90> 80065f0: 44 60 00 03 be r3,r0,80065fc <_RBTree_Extract_validate_unprotected+0x38><== NEVER TAKEN 80065f4: 28 66 00 0c lw r6,(r3+12) 80065f8: 44 c4 00 1d be r6,r4,800666c <_RBTree_Extract_validate_unprotected+0xa8> _RBTree_Rotate(parent, dir); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 80065fc: 28 65 00 08 lw r5,(r3+8) 8006600: 44 a0 00 03 be r5,r0,800660c <_RBTree_Extract_validate_unprotected+0x48> 8006604: 28 a6 00 0c lw r6,(r5+12) 8006608: 44 c4 00 4d be r6,r4,800673c <_RBTree_Extract_validate_unprotected+0x178> !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 800660c: 28 66 00 04 lw r6,(r3+4) 8006610: 44 c0 00 03 be r6,r0,800661c <_RBTree_Extract_validate_unprotected+0x58> 8006614: 28 c6 00 0c lw r6,(r6+12) 8006618: 44 c4 00 49 be r6,r4,800673c <_RBTree_Extract_validate_unprotected+0x178> sibling->color = RBT_RED; 800661c: 58 64 00 0c sw (r3+12),r4 8006620: 28 43 00 0c lw r3,(r2+12) 8006624: 44 64 00 3c be r3,r4,8006714 <_RBTree_Extract_validate_unprotected+0x150> if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; 8006628: 28 45 00 00 lw r5,(r2+0) RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 800662c: 34 03 00 00 mvi r3,0 8006630: 44 a0 00 05 be r5,r0,8006644 <_RBTree_Extract_validate_unprotected+0x80><== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; 8006634: 28 a1 00 00 lw r1,(r5+0) 8006638: 44 20 00 03 be r1,r0,8006644 <_RBTree_Extract_validate_unprotected+0x80> if(the_node == the_node->parent->child[RBT_LEFT]) 800663c: 28 a3 00 04 lw r3,(r5+4) 8006640: 44 43 00 3d be r2,r3,8006734 <_RBTree_Extract_validate_unprotected+0x170> c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; c->parent = the_node->parent; the_node->parent = c; 8006644: b8 40 08 00 mv r1,r2 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 8006648: b8 a0 10 00 mv r2,r5 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 800664c: 28 25 00 0c lw r5,(r1+12) 8006650: 5c a4 ff e6 bne r5,r4,80065e8 <_RBTree_Extract_validate_unprotected+0x24> sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8006654: 28 22 00 00 lw r2,(r1+0) 8006658: 28 42 00 00 lw r2,(r2+0) 800665c: 44 40 00 32 be r2,r0,8006724 <_RBTree_Extract_validate_unprotected+0x160> } 8006660: 2b 8b 00 04 lw r11,(sp+4) 8006664: 37 9c 00 04 addi sp,sp,4 8006668: c3 a0 00 00 ret * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 800666c: 28 46 00 04 lw r6,(r2+4) * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; 8006670: 58 44 00 0c sw (r2+12),r4 sibling->color = RBT_BLACK; 8006674: 58 60 00 0c sw (r3+12),r0 dir = the_node != parent->child[0]; 8006678: fc c1 50 00 cmpne r10,r6,r1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 800667c: 34 03 00 00 mvi r3,0 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 8006680: 19 49 00 01 xori r9,r10,0x1 8006684: b5 29 38 00 add r7,r9,r9 8006688: b4 e7 40 00 add r8,r7,r7 800668c: b4 48 40 00 add r8,r2,r8 8006690: 29 08 00 04 lw r8,(r8+4) 8006694: 45 00 ff da be r8,r0,80065fc <_RBTree_Extract_validate_unprotected+0x38><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006698: 34 08 00 00 mvi r8,0 800669c: 45 20 00 03 be r9,r0,80066a8 <_RBTree_Extract_validate_unprotected+0xe4> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 80066a0: 28 46 00 08 lw r6,(r2+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80066a4: 34 08 00 01 mvi r8,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 80066a8: b5 4a 18 00 add r3,r10,r10 80066ac: b4 63 48 00 add r9,r3,r3 80066b0: b4 c9 48 00 add r9,r6,r9 80066b4: b5 08 40 00 add r8,r8,r8 80066b8: 29 2a 00 04 lw r10,(r9+4) 80066bc: b5 08 40 00 add r8,r8,r8 80066c0: b4 48 40 00 add r8,r2,r8 80066c4: 59 0a 00 04 sw (r8+4),r10 if (c->child[dir]) 80066c8: 29 28 00 04 lw r8,(r9+4) 80066cc: 45 00 00 03 be r8,r0,80066d8 <_RBTree_Extract_validate_unprotected+0x114><== NEVER TAKEN c->child[dir]->parent = the_node; 80066d0: 59 02 00 00 sw (r8+0),r2 80066d4: 28 45 00 00 lw r5,(r2+0) c->child[dir] = the_node; 80066d8: b4 63 18 00 add r3,r3,r3 80066dc: b4 c3 18 00 add r3,r6,r3 80066e0: 58 62 00 04 sw (r3+4),r2 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80066e4: 28 a3 00 04 lw r3,(r5+4) c->parent = the_node->parent; 80066e8: 58 c5 00 00 sw (r6+0),r5 the_node->parent = c; 80066ec: b4 e7 38 00 add r7,r7,r7 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80066f0: fc 43 18 00 cmpne r3,r2,r3 c->parent = the_node->parent; the_node->parent = c; 80066f4: b4 47 38 00 add r7,r2,r7 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80066f8: b4 63 18 00 add r3,r3,r3 80066fc: b4 63 18 00 add r3,r3,r3 8006700: b4 a3 28 00 add r5,r5,r3 8006704: 58 a6 00 04 sw (r5+4),r6 c->parent = the_node->parent; the_node->parent = c; 8006708: 28 e3 00 04 lw r3,(r7+4) 800670c: 58 46 00 00 sw (r2+0),r6 8006710: e3 ff ff bb bi 80065fc <_RBTree_Extract_validate_unprotected+0x38> /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; 8006714: 58 40 00 0c sw (r2+12),r0 sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8006718: 28 22 00 00 lw r2,(r1+0) 800671c: 28 42 00 00 lw r2,(r2+0) 8006720: 5c 40 ff d0 bne r2,r0,8006660 <_RBTree_Extract_validate_unprotected+0x9c><== ALWAYS TAKEN 8006724: 58 20 00 0c sw (r1+12),r0 } 8006728: 2b 8b 00 04 lw r11,(sp+4) 800672c: 37 9c 00 04 addi sp,sp,4 8006730: c3 a0 00 00 ret if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 8006734: 28 a3 00 08 lw r3,(r5+8) 8006738: e3 ff ff c3 bi 8006644 <_RBTree_Extract_validate_unprotected+0x80> * cases, either the_node is to the left or the right of the parent. * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; 800673c: 28 47 00 04 lw r7,(r2+4) 8006740: fc e1 38 00 cmpne r7,r7,r1 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 8006744: 18 e8 00 01 xori r8,r7,0x1 * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { 8006748: b5 08 20 00 add r4,r8,r8 800674c: b4 84 48 00 add r9,r4,r4 8006750: b4 69 30 00 add r6,r3,r9 8006754: 28 c6 00 04 lw r6,(r6+4) */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006758: 44 c0 00 04 be r6,r0,8006768 <_RBTree_Extract_validate_unprotected+0x1a4> 800675c: 28 cb 00 0c lw r11,(r6+12) 8006760: 34 0a 00 01 mvi r10,1 8006764: 45 6a 00 54 be r11,r10,80068b4 <_RBTree_Extract_validate_unprotected+0x2f0> sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 8006768: b4 e7 48 00 add r9,r7,r7 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 800676c: 19 0a 00 01 xori r10,r8,0x1 * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 8006770: b5 29 48 00 add r9,r9,r9 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006774: b5 4a 30 00 add r6,r10,r10 8006778: b4 69 48 00 add r9,r3,r9 800677c: b4 c6 30 00 add r6,r6,r6 8006780: 29 29 00 04 lw r9,(r9+4) 8006784: b4 66 30 00 add r6,r3,r6 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; 8006788: 34 0b 00 01 mvi r11,1 800678c: 28 c6 00 04 lw r6,(r6+4) 8006790: 58 6b 00 0c sw (r3+12),r11 sibling->child[dir]->color = RBT_BLACK; 8006794: 59 20 00 0c sw (r9+12),r0 8006798: 44 c0 00 1a be r6,r0,8006800 <_RBTree_Extract_validate_unprotected+0x23c><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 800679c: 5d 40 00 41 bne r10,r0,80068a0 <_RBTree_Extract_validate_unprotected+0x2dc> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 80067a0: 28 65 00 04 lw r5,(r3+4) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80067a4: 34 06 00 00 mvi r6,0 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 80067a8: b4 84 48 00 add r9,r4,r4 80067ac: b4 a9 48 00 add r9,r5,r9 80067b0: b4 c6 30 00 add r6,r6,r6 80067b4: 29 2a 00 04 lw r10,(r9+4) 80067b8: b4 c6 30 00 add r6,r6,r6 80067bc: b4 66 30 00 add r6,r3,r6 80067c0: 58 ca 00 04 sw (r6+4),r10 if (c->child[dir]) 80067c4: 29 26 00 04 lw r6,(r9+4) 80067c8: 44 c0 00 02 be r6,r0,80067d0 <_RBTree_Extract_validate_unprotected+0x20c> c->child[dir]->parent = the_node; 80067cc: 58 c3 00 00 sw (r6+0),r3 c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80067d0: 28 66 00 00 lw r6,(r3+0) the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 80067d4: b4 84 48 00 add r9,r4,r4 80067d8: b4 a9 48 00 add r9,r5,r9 80067dc: 59 23 00 04 sw (r9+4),r3 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80067e0: 28 c9 00 04 lw r9,(r6+4) c->parent = the_node->parent; 80067e4: 58 a6 00 00 sw (r5+0),r6 the_node->parent = c; 80067e8: 58 65 00 00 sw (r3+0),r5 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80067ec: fc 69 18 00 cmpne r3,r3,r9 80067f0: b4 63 18 00 add r3,r3,r3 80067f4: b4 63 18 00 add r3,r3,r3 80067f8: b4 c3 18 00 add r3,r6,r3 80067fc: 58 65 00 04 sw (r3+4),r5 _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; 8006800: b4 84 20 00 add r4,r4,r4 8006804: b4 44 18 00 add r3,r2,r4 8006808: 28 63 00 04 lw r3,(r3+4) 800680c: b4 64 20 00 add r4,r3,r4 8006810: 28 86 00 04 lw r6,(r4+4) 8006814: b8 60 20 00 mv r4,r3 } sibling->color = parent->color; 8006818: 28 45 00 0c lw r5,(r2+12) 800681c: 58 65 00 0c sw (r3+12),r5 parent->color = RBT_BLACK; 8006820: 58 40 00 0c sw (r2+12),r0 sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 8006824: 58 c0 00 0c sw (r6+12),r0 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006828: 44 80 ff 8b be r4,r0,8006654 <_RBTree_Extract_validate_unprotected+0x90><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 800682c: 45 00 00 1f be r8,r0,80068a8 <_RBTree_Extract_validate_unprotected+0x2e4> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006830: 28 43 00 08 lw r3,(r2+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006834: 34 04 00 01 mvi r4,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006838: b4 e7 38 00 add r7,r7,r7 800683c: b4 e7 28 00 add r5,r7,r7 8006840: b4 65 28 00 add r5,r3,r5 8006844: b4 84 20 00 add r4,r4,r4 8006848: 28 a6 00 04 lw r6,(r5+4) 800684c: b4 84 20 00 add r4,r4,r4 8006850: b4 44 20 00 add r4,r2,r4 8006854: 58 86 00 04 sw (r4+4),r6 if (c->child[dir]) 8006858: 28 a4 00 04 lw r4,(r5+4) 800685c: 44 80 00 02 be r4,r0,8006864 <_RBTree_Extract_validate_unprotected+0x2a0> c->child[dir]->parent = the_node; 8006860: 58 82 00 00 sw (r4+0),r2 c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006864: 28 44 00 00 lw r4,(r2+0) the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 8006868: b4 e7 38 00 add r7,r7,r7 800686c: b4 67 38 00 add r7,r3,r7 8006870: 58 e2 00 04 sw (r7+4),r2 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006874: 28 85 00 04 lw r5,(r4+4) c->parent = the_node->parent; 8006878: 58 64 00 00 sw (r3+0),r4 the_node->parent = c; 800687c: 58 43 00 00 sw (r2+0),r3 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006880: fc 45 10 00 cmpne r2,r2,r5 8006884: b4 42 10 00 add r2,r2,r2 8006888: b4 42 10 00 add r2,r2,r2 800688c: b4 82 10 00 add r2,r4,r2 8006890: 58 43 00 04 sw (r2+4),r3 8006894: e3 ff ff 70 bi 8006654 <_RBTree_Extract_validate_unprotected+0x90> if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 8006898: 28 43 00 08 lw r3,(r2+8) 800689c: e3 ff ff 51 bi 80065e0 <_RBTree_Extract_validate_unprotected+0x1c> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80068a0: 34 06 00 01 mvi r6,1 80068a4: e3 ff ff c1 bi 80067a8 <_RBTree_Extract_validate_unprotected+0x1e4> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 80068a8: 28 43 00 04 lw r3,(r2+4) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80068ac: 34 04 00 00 mvi r4,0 80068b0: e3 ff ff e2 bi 8006838 <_RBTree_Extract_validate_unprotected+0x274> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 80068b4: b4 49 48 00 add r9,r2,r9 80068b8: 29 24 00 04 lw r4,(r9+4) 80068bc: e3 ff ff d7 bi 8006818 <_RBTree_Extract_validate_unprotected+0x254> =============================================================================== 08006ca4 <_RBTree_Find>: RBTree_Node *_RBTree_Find( RBTree_Control *the_rbtree, RBTree_Node *search_node ) { 8006ca4: 37 9c ff e8 addi sp,sp,-24 8006ca8: 5b 8b 00 18 sw (sp+24),r11 8006cac: 5b 8c 00 14 sw (sp+20),r12 8006cb0: 5b 8d 00 10 sw (sp+16),r13 8006cb4: 5b 8e 00 0c sw (sp+12),r14 8006cb8: 5b 8f 00 08 sw (sp+8),r15 8006cbc: 5b 9d 00 04 sw (sp+4),ra 8006cc0: b8 20 60 00 mv r12,r1 8006cc4: b8 40 68 00 mv r13,r2 ISR_Level level; RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); 8006cc8: 90 00 78 00 rcsr r15,IE 8006ccc: 34 01 ff fe mvi r1,-2 8006cd0: a1 e1 08 00 and r1,r15,r1 8006cd4: d0 01 00 00 wcsr IE,r1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 8006cd8: 29 8b 00 04 lw r11,(r12+4) RBTree_Node* found = NULL; 8006cdc: 34 0e 00 00 mvi r14,0 int compare_result; while (iter_node) { 8006ce0: 45 60 00 0f be r11,r0,8006d1c <_RBTree_Find+0x78> <== NEVER TAKEN compare_result = the_rbtree->compare_function(the_node, iter_node); 8006ce4: 29 83 00 10 lw r3,(r12+16) 8006ce8: b9 60 10 00 mv r2,r11 8006cec: b9 a0 08 00 mv r1,r13 8006cf0: d8 60 00 00 call r3 found = iter_node; if ( the_rbtree->is_unique ) break; } RBTree_Direction dir = 8006cf4: 68 23 00 00 cmpgi r3,r1,0 RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { 8006cf8: 5c 20 00 04 bne r1,r0,8006d08 <_RBTree_Find+0x64> found = iter_node; if ( the_rbtree->is_unique ) 8006cfc: 41 82 00 14 lbu r2,(r12+20) 8006d00: b9 60 70 00 mv r14,r11 8006d04: 5c 41 00 10 bne r2,r1,8006d44 <_RBTree_Find+0xa0> break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 8006d08: b4 63 18 00 add r3,r3,r3 8006d0c: b4 63 18 00 add r3,r3,r3 8006d10: b5 63 58 00 add r11,r11,r3 8006d14: 29 6b 00 04 lw r11,(r11+4) ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 8006d18: 5d 60 ff f3 bne r11,r0,8006ce4 <_RBTree_Find+0x40> return_node = _RBTree_Find_unprotected( the_rbtree, search_node ); _ISR_Enable( level ); 8006d1c: d0 0f 00 00 wcsr IE,r15 return return_node; } 8006d20: b9 c0 08 00 mv r1,r14 8006d24: 2b 9d 00 04 lw ra,(sp+4) 8006d28: 2b 8b 00 18 lw r11,(sp+24) 8006d2c: 2b 8c 00 14 lw r12,(sp+20) 8006d30: 2b 8d 00 10 lw r13,(sp+16) 8006d34: 2b 8e 00 0c lw r14,(sp+12) 8006d38: 2b 8f 00 08 lw r15,(sp+8) 8006d3c: 37 9c 00 18 addi sp,sp,24 8006d40: c3 a0 00 00 ret compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { found = iter_node; if ( the_rbtree->is_unique ) 8006d44: b9 60 70 00 mv r14,r11 8006d48: e3 ff ff f5 bi 8006d1c <_RBTree_Find+0x78> =============================================================================== 08007188 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 8007188: 37 9c ff ec addi sp,sp,-20 800718c: 5b 8b 00 14 sw (sp+20),r11 8007190: 5b 8c 00 10 sw (sp+16),r12 8007194: 5b 8d 00 0c sw (sp+12),r13 8007198: 5b 8e 00 08 sw (sp+8),r14 800719c: 5b 9d 00 04 sw (sp+4),ra 80071a0: b8 20 68 00 mv r13,r1 80071a4: b8 80 58 00 mv r11,r4 80071a8: b8 a0 70 00 mv r14,r5 80071ac: 20 c6 00 ff andi r6,r6,0xff size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 80071b0: 44 20 00 0f be r1,r0,80071ec <_RBTree_Initialize+0x64> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 80071b4: 58 20 00 00 sw (r1+0),r0 the_rbtree->root = NULL; 80071b8: 58 20 00 04 sw (r1+4),r0 the_rbtree->first[0] = NULL; 80071bc: 58 20 00 08 sw (r1+8),r0 the_rbtree->first[1] = NULL; 80071c0: 58 20 00 0c sw (r1+12),r0 the_rbtree->compare_function = compare_function; 80071c4: 58 22 00 10 sw (r1+16),r2 the_rbtree->is_unique = is_unique; 80071c8: 30 26 00 14 sb (r1+20),r6 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 80071cc: 44 80 00 08 be r4,r0,80071ec <_RBTree_Initialize+0x64> <== NEVER TAKEN /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; 80071d0: b8 60 60 00 mv r12,r3 while ( count-- ) { _RBTree_Insert_unprotected(the_rbtree, next); 80071d4: b9 80 10 00 mv r2,r12 80071d8: b9 a0 08 00 mv r1,r13 #include #include #include #include void _RBTree_Initialize( 80071dc: 35 6b ff ff addi r11,r11,-1 _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { _RBTree_Insert_unprotected(the_rbtree, next); 80071e0: fb ff fe f1 calli 8006da4 <_RBTree_Insert_unprotected> #include #include #include #include void _RBTree_Initialize( 80071e4: b5 8e 60 00 add r12,r12,r14 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 80071e8: 5d 60 ff fb bne r11,r0,80071d4 <_RBTree_Initialize+0x4c> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 80071ec: 2b 9d 00 04 lw ra,(sp+4) 80071f0: 2b 8b 00 14 lw r11,(sp+20) 80071f4: 2b 8c 00 10 lw r12,(sp+16) 80071f8: 2b 8d 00 0c lw r13,(sp+12) 80071fc: 2b 8e 00 08 lw r14,(sp+8) 8007200: 37 9c 00 14 addi sp,sp,20 8007204: c3 a0 00 00 ret =============================================================================== 08006a8c <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 8006a8c: 37 9c ff e4 addi sp,sp,-28 8006a90: 5b 8b 00 1c sw (sp+28),r11 8006a94: 5b 8c 00 18 sw (sp+24),r12 8006a98: 5b 8d 00 14 sw (sp+20),r13 8006a9c: 5b 8e 00 10 sw (sp+16),r14 8006aa0: 5b 8f 00 0c sw (sp+12),r15 8006aa4: 5b 90 00 08 sw (sp+8),r16 8006aa8: 5b 9d 00 04 sw (sp+4),ra if(!the_node) return (RBTree_Node*)-1; 8006aac: 34 0d ff ff mvi r13,-1 */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 8006ab0: b8 40 58 00 mv r11,r2 8006ab4: b8 20 60 00 mv r12,r1 if(!the_node) return (RBTree_Node*)-1; 8006ab8: 44 40 00 87 be r2,r0,8006cd4 <_RBTree_Insert_unprotected+0x248> RBTree_Node *iter_node = the_rbtree->root; 8006abc: 28 2f 00 04 lw r15,(r1+4) int compare_result; if (!iter_node) { /* special case: first node inserted */ 8006ac0: 5d e0 00 03 bne r15,r0,8006acc <_RBTree_Insert_unprotected+0x40> 8006ac4: e0 00 00 a3 bi 8006d50 <_RBTree_Insert_unprotected+0x2c4> while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { 8006ac8: b9 a0 78 00 mv r15,r13 the_node->parent = (RBTree_Node *) the_rbtree; the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 8006acc: 29 83 00 10 lw r3,(r12+16) 8006ad0: b9 e0 10 00 mv r2,r15 8006ad4: b9 60 08 00 mv r1,r11 8006ad8: d8 60 00 00 call r3 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 8006adc: 41 82 00 14 lbu r2,(r12+20) 8006ae0: 44 40 00 02 be r2,r0,8006ae8 <_RBTree_Insert_unprotected+0x5c> 8006ae4: 44 20 00 99 be r1,r0,8006d48 <_RBTree_Insert_unprotected+0x2bc><== NEVER TAKEN return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 8006ae8: a4 20 08 00 not r1,r1 8006aec: 34 02 00 1f mvi r2,31 8006af0: fb ff e8 96 calli 8000d48 <__lshrsi3> if (!iter_node->child[dir]) { 8006af4: b4 21 18 00 add r3,r1,r1 8006af8: b4 63 18 00 add r3,r3,r3 8006afc: b5 e3 18 00 add r3,r15,r3 8006b00: 28 6d 00 04 lw r13,(r3+4) /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 8006b04: b8 20 70 00 mv r14,r1 if (!iter_node->child[dir]) { 8006b08: 34 63 00 04 addi r3,r3,4 8006b0c: 5d a0 ff ef bne r13,r0,8006ac8 <_RBTree_Insert_unprotected+0x3c> RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 8006b10: 34 30 00 02 addi r16,r1,2 8006b14: b6 10 08 00 add r1,r16,r16 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 8006b18: 59 60 00 08 sw (r11+8),r0 8006b1c: 59 60 00 04 sw (r11+4),r0 8006b20: b4 21 08 00 add r1,r1,r1 the_node->color = RBT_RED; iter_node->child[dir] = the_node; 8006b24: 58 6b 00 00 sw (r3+0),r11 8006b28: b5 81 08 00 add r1,r12,r1 the_node->parent = iter_node; 8006b2c: 59 6f 00 00 sw (r11+0),r15 /* update min/max */ compare_result = the_rbtree->compare_function( 8006b30: 28 22 00 00 lw r2,(r1+0) 8006b34: 29 84 00 10 lw r4,(r12+16) if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 8006b38: 34 03 00 01 mvi r3,1 8006b3c: 59 63 00 0c sw (r11+12),r3 iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( 8006b40: b9 60 08 00 mv r1,r11 8006b44: d8 80 00 00 call r4 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 8006b48: 5d cd 00 6f bne r14,r13,8006d04 <_RBTree_Insert_unprotected+0x278> 8006b4c: 49 a1 00 6f bg r13,r1,8006d08 <_RBTree_Insert_unprotected+0x27c> (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 8006b50: 29 63 00 00 lw r3,(r11+0) */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006b54: 34 06 00 01 mvi r6,1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 8006b58: 28 62 00 00 lw r2,(r3+0) 8006b5c: b8 40 08 00 mv r1,r2 8006b60: 44 40 00 5c be r2,r0,8006cd0 <_RBTree_Insert_unprotected+0x244> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006b64: 28 64 00 0c lw r4,(r3+12) 8006b68: 5c 86 00 5b bne r4,r6,8006cd4 <_RBTree_Insert_unprotected+0x248> ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(!(the_node->parent->parent->parent)) return NULL; 8006b6c: 28 47 00 00 lw r7,(r2+0) 8006b70: 44 e0 00 74 be r7,r0,8006d40 <_RBTree_Insert_unprotected+0x2b4><== NEVER TAKEN { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 8006b74: 28 44 00 04 lw r4,(r2+4) 8006b78: b8 80 28 00 mv r5,r4 8006b7c: 44 64 00 60 be r3,r4,8006cfc <_RBTree_Insert_unprotected+0x270> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006b80: 44 a0 00 03 be r5,r0,8006b8c <_RBTree_Insert_unprotected+0x100> 8006b84: 28 a8 00 0c lw r8,(r5+12) 8006b88: 45 06 00 65 be r8,r6,8006d1c <_RBTree_Insert_unprotected+0x290> the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 8006b8c: 28 65 00 04 lw r5,(r3+4) RBTree_Direction pdir = the_node->parent != g->child[0]; 8006b90: fc 64 20 00 cmpne r4,r3,r4 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 8006b94: fd 65 38 00 cmpne r7,r11,r5 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 8006b98: 44 e4 00 27 be r7,r4,8006c34 <_RBTree_Insert_unprotected+0x1a8> * in an unique @a the_rbtree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ RBTree_Node *_RBTree_Insert_unprotected( 8006b9c: 18 89 00 01 xori r9,r4,0x1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006ba0: b5 29 38 00 add r7,r9,r9 8006ba4: b4 e7 38 00 add r7,r7,r7 8006ba8: b4 67 38 00 add r7,r3,r7 8006bac: 28 e8 00 04 lw r8,(r7+4) 8006bb0: b4 84 38 00 add r7,r4,r4 8006bb4: 45 00 00 1c be r8,r0,8006c24 <_RBTree_Insert_unprotected+0x198><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006bb8: 34 08 00 00 mvi r8,0 8006bbc: 45 20 00 03 be r9,r0,8006bc8 <_RBTree_Insert_unprotected+0x13c> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006bc0: 28 65 00 08 lw r5,(r3+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006bc4: 34 08 00 01 mvi r8,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006bc8: b4 84 38 00 add r7,r4,r4 8006bcc: b4 e7 48 00 add r9,r7,r7 8006bd0: b4 a9 48 00 add r9,r5,r9 8006bd4: b5 08 40 00 add r8,r8,r8 8006bd8: 29 2a 00 04 lw r10,(r9+4) 8006bdc: b5 08 40 00 add r8,r8,r8 8006be0: b4 68 40 00 add r8,r3,r8 8006be4: 59 0a 00 04 sw (r8+4),r10 if (c->child[dir]) 8006be8: 29 28 00 04 lw r8,(r9+4) 8006bec: 45 00 00 03 be r8,r0,8006bf8 <_RBTree_Insert_unprotected+0x16c> c->child[dir]->parent = the_node; 8006bf0: 59 03 00 00 sw (r8+0),r3 8006bf4: 28 62 00 00 lw r2,(r3+0) c->child[dir] = the_node; 8006bf8: b4 e7 40 00 add r8,r7,r7 8006bfc: b4 a8 40 00 add r8,r5,r8 8006c00: 59 03 00 04 sw (r8+4),r3 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006c04: 28 48 00 04 lw r8,(r2+4) c->parent = the_node->parent; 8006c08: 58 a2 00 00 sw (r5+0),r2 the_node->parent = c; 8006c0c: 58 65 00 00 sw (r3+0),r5 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006c10: fc 68 18 00 cmpne r3,r3,r8 8006c14: b4 63 18 00 add r3,r3,r3 8006c18: b4 63 18 00 add r3,r3,r3 8006c1c: b4 43 10 00 add r2,r2,r3 8006c20: 58 45 00 04 sw (r2+4),r5 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; 8006c24: b4 e7 38 00 add r7,r7,r7 8006c28: b5 67 58 00 add r11,r11,r7 8006c2c: 29 6b 00 04 lw r11,(r11+4) 8006c30: 29 63 00 00 lw r3,(r11+0) } the_node->parent->color = RBT_BLACK; g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 8006c34: c8 c4 20 00 sub r4,r6,r4 * in an unique @a the_rbtree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ RBTree_Node *_RBTree_Insert_unprotected( 8006c38: 64 85 00 00 cmpei r5,r4,0 /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; } the_node->parent->color = RBT_BLACK; 8006c3c: 58 60 00 0c sw (r3+12),r0 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006c40: b4 a5 10 00 add r2,r5,r5 8006c44: b4 42 10 00 add r2,r2,r2 8006c48: b4 22 10 00 add r2,r1,r2 8006c4c: 28 42 00 04 lw r2,(r2+4) g->color = RBT_RED; 8006c50: 58 26 00 0c sw (r1+12),r6 8006c54: 44 40 ff c1 be r2,r0,8006b58 <_RBTree_Insert_unprotected+0xcc><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006c58: 44 a0 00 37 be r5,r0,8006d34 <_RBTree_Insert_unprotected+0x2a8> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006c5c: 28 22 00 08 lw r2,(r1+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006c60: 34 03 00 01 mvi r3,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006c64: b4 84 20 00 add r4,r4,r4 8006c68: b4 84 28 00 add r5,r4,r4 8006c6c: b4 45 28 00 add r5,r2,r5 8006c70: b4 63 18 00 add r3,r3,r3 8006c74: 28 a7 00 04 lw r7,(r5+4) 8006c78: b4 63 18 00 add r3,r3,r3 8006c7c: b4 23 18 00 add r3,r1,r3 8006c80: 58 67 00 04 sw (r3+4),r7 if (c->child[dir]) 8006c84: 28 a3 00 04 lw r3,(r5+4) 8006c88: 44 60 00 02 be r3,r0,8006c90 <_RBTree_Insert_unprotected+0x204> c->child[dir]->parent = the_node; 8006c8c: 58 61 00 00 sw (r3+0),r1 c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006c90: 28 25 00 00 lw r5,(r1+0) the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 8006c94: b4 84 20 00 add r4,r4,r4 8006c98: b4 44 20 00 add r4,r2,r4 8006c9c: 58 81 00 04 sw (r4+4),r1 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006ca0: 28 a3 00 04 lw r3,(r5+4) c->parent = the_node->parent; 8006ca4: 58 45 00 00 sw (r2+0),r5 the_node->parent = c; 8006ca8: 58 22 00 00 sw (r1+0),r2 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006cac: fc 23 08 00 cmpne r1,r1,r3 c->parent = the_node->parent; the_node->parent = c; 8006cb0: 29 63 00 00 lw r3,(r11+0) if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006cb4: b4 21 08 00 add r1,r1,r1 8006cb8: b4 21 08 00 add r1,r1,r1 8006cbc: b4 a1 08 00 add r1,r5,r1 8006cc0: 58 22 00 04 sw (r1+4),r2 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 8006cc4: 28 62 00 00 lw r2,(r3+0) 8006cc8: b8 40 08 00 mv r1,r2 8006ccc: 5c 40 ff a6 bne r2,r0,8006b64 <_RBTree_Insert_unprotected+0xd8><== ALWAYS TAKEN /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8006cd0: 59 60 00 0c sw (r11+12),r0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 8006cd4: b9 a0 08 00 mv r1,r13 8006cd8: 2b 9d 00 04 lw ra,(sp+4) 8006cdc: 2b 8b 00 1c lw r11,(sp+28) 8006ce0: 2b 8c 00 18 lw r12,(sp+24) 8006ce4: 2b 8d 00 14 lw r13,(sp+20) 8006ce8: 2b 8e 00 10 lw r14,(sp+16) 8006cec: 2b 8f 00 0c lw r15,(sp+12) 8006cf0: 2b 90 00 08 lw r16,(sp+8) 8006cf4: 37 9c 00 1c addi sp,sp,28 8006cf8: c3 a0 00 00 ret if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 8006cfc: 28 45 00 08 lw r5,(r2+8) 8006d00: e3 ff ff a0 bi 8006b80 <_RBTree_Insert_unprotected+0xf4> compare_result = the_rbtree->compare_function( the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || (dir && _RBTree_Is_greater(compare_result)) ) { 8006d04: 4c 01 ff 93 bge r0,r1,8006b50 <_RBTree_Insert_unprotected+0xc4> the_rbtree->first[dir] = the_node; 8006d08: b6 10 80 00 add r16,r16,r16 8006d0c: b6 10 80 00 add r16,r16,r16 8006d10: b5 90 60 00 add r12,r12,r16 8006d14: 59 8b 00 00 sw (r12+0),r11 8006d18: e3 ff ff 8e bi 8006b50 <_RBTree_Insert_unprotected+0xc4> u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; 8006d1c: 58 60 00 0c sw (r3+12),r0 u->color = RBT_BLACK; 8006d20: 58 a0 00 0c sw (r5+12),r0 g->color = RBT_RED; 8006d24: 58 46 00 0c sw (r2+12),r6 8006d28: b8 e0 18 00 mv r3,r7 8006d2c: b8 40 58 00 mv r11,r2 8006d30: e3 ff ff 8a bi 8006b58 <_RBTree_Insert_unprotected+0xcc> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006d34: 28 22 00 04 lw r2,(r1+4) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006d38: 34 03 00 00 mvi r3,0 8006d3c: e3 ff ff ca bi 8006c64 <_RBTree_Insert_unprotected+0x1d8> /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8006d40: 28 44 00 04 lw r4,(r2+4) <== NOT EXECUTED 8006d44: e3 ff ff 92 bi 8006b8c <_RBTree_Insert_unprotected+0x100> <== NOT EXECUTED the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 8006d48: b9 e0 68 00 mv r13,r15 8006d4c: e3 ff ff e2 bi 8006cd4 <_RBTree_Insert_unprotected+0x248> RBTree_Node *iter_node = the_rbtree->root; int compare_result; if (!iter_node) { /* special case: first node inserted */ the_node->color = RBT_BLACK; 8006d50: 58 40 00 0c sw (r2+12),r0 the_rbtree->root = the_node; 8006d54: 59 82 00 04 sw (r12+4),r2 the_rbtree->first[0] = the_rbtree->first[1] = the_node; 8006d58: 59 82 00 0c sw (r12+12),r2 8006d5c: 59 82 00 08 sw (r12+8),r2 the_node->parent = (RBTree_Node *) the_rbtree; 8006d60: 59 61 00 00 sw (r11+0),r1 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 8006d64: 58 40 00 08 sw (r2+8),r0 8006d68: 58 40 00 04 sw (r2+4),r0 } /* while(iter_node) */ /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; 8006d6c: 34 0d 00 00 mvi r13,0 8006d70: e3 ff ff d9 bi 8006cd4 <_RBTree_Insert_unprotected+0x248> =============================================================================== 08006da8 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 8006da8: 37 9c ff e8 addi sp,sp,-24 8006dac: 5b 8b 00 18 sw (sp+24),r11 8006db0: 5b 8c 00 14 sw (sp+20),r12 8006db4: 5b 8d 00 10 sw (sp+16),r13 8006db8: 5b 8e 00 0c sw (sp+12),r14 8006dbc: 5b 8f 00 08 sw (sp+8),r15 8006dc0: 5b 9d 00 04 sw (sp+4),ra 8006dc4: b8 40 60 00 mv r12,r2 8006dc8: 64 42 00 00 cmpei r2,r2,0 8006dcc: b8 60 78 00 mv r15,r3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 8006dd0: 34 42 00 02 addi r2,r2,2 8006dd4: b4 42 10 00 add r2,r2,r2 8006dd8: b4 42 10 00 add r2,r2,r2 8006ddc: b4 22 08 00 add r1,r1,r2 8006de0: 28 2b 00 00 lw r11,(r1+0) 8006de4: b8 80 70 00 mv r14,r4 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 8006de8: 5d 60 00 03 bne r11,r0,8006df4 <_RBTree_Iterate_unprotected+0x4c><== ALWAYS TAKEN 8006dec: e0 00 00 0c bi 8006e1c <_RBTree_Iterate_unprotected+0x74> <== NOT EXECUTED 8006df0: 44 2d 00 0b be r1,r13,8006e1c <_RBTree_Iterate_unprotected+0x74> stop = (*visitor)( current, dir, visitor_arg ); 8006df4: b9 60 08 00 mv r1,r11 8006df8: b9 c0 18 00 mv r3,r14 8006dfc: b9 80 10 00 mv r2,r12 8006e00: d9 e0 00 00 call r15 8006e04: b8 20 68 00 mv r13,r1 current = _RBTree_Next_unprotected( current, dir ); 8006e08: b9 80 10 00 mv r2,r12 8006e0c: b9 60 08 00 mv r1,r11 8006e10: f8 00 00 0b calli 8006e3c <_RBTree_Next_unprotected> 8006e14: b8 20 58 00 mv r11,r1 { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 8006e18: 45 a0 ff f6 be r13,r0,8006df0 <_RBTree_Iterate_unprotected+0x48><== ALWAYS TAKEN stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } 8006e1c: 2b 9d 00 04 lw ra,(sp+4) 8006e20: 2b 8b 00 18 lw r11,(sp+24) 8006e24: 2b 8c 00 14 lw r12,(sp+20) 8006e28: 2b 8d 00 10 lw r13,(sp+16) 8006e2c: 2b 8e 00 0c lw r14,(sp+12) 8006e30: 2b 8f 00 08 lw r15,(sp+8) 8006e34: 37 9c 00 18 addi sp,sp,24 8006e38: c3 a0 00 00 ret =============================================================================== 08004e40 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 8004e40: 37 9c ff f0 addi sp,sp,-16 8004e44: 5b 8b 00 0c sw (sp+12),r11 8004e48: 5b 8c 00 08 sw (sp+8),r12 8004e4c: 5b 9d 00 04 sw (sp+4),ra RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 8004e50: 28 2b 01 14 lw r11,(r1+276) if ( !api ) 8004e54: 45 60 00 1a be r11,r0,8004ebc <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 8004e58: 90 00 10 00 rcsr r2,IE 8004e5c: 34 01 ff fe mvi r1,-2 8004e60: a0 41 08 00 and r1,r2,r1 8004e64: d0 01 00 00 wcsr IE,r1 signal_set = asr->signals_posted; 8004e68: 29 6c 00 14 lw r12,(r11+20) asr->signals_posted = 0; 8004e6c: 59 60 00 14 sw (r11+20),r0 _ISR_Enable( level ); 8004e70: d0 02 00 00 wcsr IE,r2 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 8004e74: 45 80 00 12 be r12,r0,8004ebc <_RTEMS_signal_Post_switch_hook+0x7c> return; asr->nest_level += 1; 8004e78: 29 64 00 1c lw r4,(r11+28) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004e7c: 29 61 00 10 lw r1,(r11+16) 8004e80: 37 83 00 10 addi r3,sp,16 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 8004e84: 34 84 00 01 addi r4,r4,1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004e88: 38 02 ff ff mvu r2,0xffff if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 8004e8c: 59 64 00 1c sw (r11+28),r4 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004e90: f8 00 01 3d calli 8005384 (*asr->handler)( signal_set ); 8004e94: 29 62 00 0c lw r2,(r11+12) 8004e98: b9 80 08 00 mv r1,r12 8004e9c: d8 40 00 00 call r2 asr->nest_level -= 1; 8004ea0: 29 63 00 1c lw r3,(r11+28) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004ea4: 2b 81 00 10 lw r1,(sp+16) 8004ea8: 38 02 ff ff mvu r2,0xffff asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 8004eac: 34 63 ff ff addi r3,r3,-1 8004eb0: 59 63 00 1c sw (r11+28),r3 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004eb4: 37 83 00 10 addi r3,sp,16 8004eb8: f8 00 01 33 calli 8005384 } 8004ebc: 2b 9d 00 04 lw ra,(sp+4) 8004ec0: 2b 8b 00 0c lw r11,(sp+12) 8004ec4: 2b 8c 00 08 lw r12,(sp+8) 8004ec8: 37 9c 00 10 addi sp,sp,16 8004ecc: c3 a0 00 00 ret =============================================================================== 08004184 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 8004184: 37 9c ff e8 addi sp,sp,-24 8004188: 5b 8b 00 14 sw (sp+20),r11 800418c: 5b 8c 00 10 sw (sp+16),r12 8004190: 5b 8d 00 0c sw (sp+12),r13 8004194: 5b 8e 00 08 sw (sp+8),r14 8004198: 5b 9d 00 04 sw (sp+4),ra rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 800419c: 78 01 08 01 mvhi r1,0x801 80041a0: 38 21 e0 a4 ori r1,r1,0xe0a4 80041a4: 28 2b 00 2c lw r11,(r1+44) maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 80041a8: 28 2e 00 28 lw r14,(r1+40) /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 80041ac: 45 60 00 15 be r11,r0,8004200 <_RTEMS_tasks_Initialize_user_tasks_body+0x7c> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 80041b0: 45 c0 00 14 be r14,r0,8004200 <_RTEMS_tasks_Initialize_user_tasks_body+0x7c><== NEVER TAKEN 80041b4: 34 0c 00 00 mvi r12,0 return_value = rtems_task_create( 80041b8: 29 61 00 00 lw r1,(r11+0) 80041bc: 29 62 00 08 lw r2,(r11+8) 80041c0: 29 63 00 04 lw r3,(r11+4) 80041c4: 29 64 00 14 lw r4,(r11+20) 80041c8: 29 65 00 0c lw r5,(r11+12) 80041cc: 37 86 00 18 addi r6,sp,24 80041d0: fb ff ff 52 calli 8003f18 80041d4: b8 20 68 00 mv r13,r1 user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 80041d8: 5c 20 00 11 bne r1,r0,800421c <_RTEMS_tasks_Initialize_user_tasks_body+0x98> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 80041dc: 29 63 00 18 lw r3,(r11+24) 80041e0: 2b 81 00 18 lw r1,(sp+24) 80041e4: 29 62 00 10 lw r2,(r11+16) 80041e8: f8 00 00 14 calli 8004238 80041ec: b8 20 18 00 mv r3,r1 id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 80041f0: 5c 2d 00 0f bne r1,r13,800422c <_RTEMS_tasks_Initialize_user_tasks_body+0xa8> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 80041f4: 35 8c 00 01 addi r12,r12,1 80041f8: 35 6b 00 1c addi r11,r11,28 80041fc: 55 cc ff ef bgu r14,r12,80041b8 <_RTEMS_tasks_Initialize_user_tasks_body+0x34><== NEVER TAKEN user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 8004200: 2b 9d 00 04 lw ra,(sp+4) 8004204: 2b 8b 00 14 lw r11,(sp+20) 8004208: 2b 8c 00 10 lw r12,(sp+16) 800420c: 2b 8d 00 0c lw r13,(sp+12) 8004210: 2b 8e 00 08 lw r14,(sp+8) 8004214: 37 9c 00 18 addi sp,sp,24 8004218: c3 a0 00 00 ret user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 800421c: 34 01 00 01 mvi r1,1 8004220: 34 02 00 01 mvi r2,1 8004224: b9 a0 18 00 mv r3,r13 8004228: f8 00 04 87 calli 8005444 <_Internal_error_Occurred> id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 800422c: 34 01 00 01 mvi r1,1 8004230: 34 02 00 01 mvi r2,1 8004234: f8 00 04 84 calli 8005444 <_Internal_error_Occurred> =============================================================================== 08009b98 <_RTEMS_tasks_Switch_extension>: /* * Per Task Variables */ tvp = executing->task_variables; 8009b98: 28 21 01 20 lw r1,(r1+288) while (tvp) { 8009b9c: 44 20 00 08 be r1,r0,8009bbc <_RTEMS_tasks_Switch_extension+0x24> tvp->tval = *tvp->ptr; 8009ba0: 28 23 00 04 lw r3,(r1+4) *tvp->ptr = tvp->gval; 8009ba4: 28 24 00 08 lw r4,(r1+8) * Per Task Variables */ tvp = executing->task_variables; while (tvp) { tvp->tval = *tvp->ptr; 8009ba8: 28 65 00 00 lw r5,(r3+0) 8009bac: 58 25 00 0c sw (r1+12),r5 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; 8009bb0: 28 21 00 00 lw r1,(r1+0) */ tvp = executing->task_variables; while (tvp) { tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; 8009bb4: 58 64 00 00 sw (r3+0),r4 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 8009bb8: 5c 20 ff fa bne r1,r0,8009ba0 <_RTEMS_tasks_Switch_extension+0x8><== NEVER TAKEN tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 8009bbc: 28 41 01 20 lw r1,(r2+288) while (tvp) { 8009bc0: 44 20 00 08 be r1,r0,8009be0 <_RTEMS_tasks_Switch_extension+0x48> tvp->gval = *tvp->ptr; 8009bc4: 28 22 00 04 lw r2,(r1+4) *tvp->ptr = tvp->tval; 8009bc8: 28 23 00 0c lw r3,(r1+12) tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { tvp->gval = *tvp->ptr; 8009bcc: 28 44 00 00 lw r4,(r2+0) 8009bd0: 58 24 00 08 sw (r1+8),r4 *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; 8009bd4: 28 21 00 00 lw r1,(r1+0) } tvp = heir->task_variables; while (tvp) { tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; 8009bd8: 58 43 00 00 sw (r2+0),r3 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 8009bdc: 5c 20 ff fa bne r1,r0,8009bc4 <_RTEMS_tasks_Switch_extension+0x2c><== NEVER TAKEN 8009be0: c3 a0 00 00 ret =============================================================================== 0803746c <_Rate_monotonic_Get_status>: bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 803746c: 37 9c ff e4 addi sp,sp,-28 8037470: 5b 8b 00 14 sw (sp+20),r11 8037474: 5b 8c 00 10 sw (sp+16),r12 8037478: 5b 8d 00 0c sw (sp+12),r13 803747c: 5b 8e 00 08 sw (sp+8),r14 8037480: 5b 9d 00 04 sw (sp+4),ra 8037484: b8 40 68 00 mv r13,r2 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 8037488: 78 02 08 06 mvhi r2,0x806 803748c: b8 20 58 00 mv r11,r1 8037490: 38 42 df 48 ori r2,r2,0xdf48 8037494: 37 81 00 18 addi r1,sp,24 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 8037498: 29 6c 00 40 lw r12,(r11+64) bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 803749c: b8 60 70 00 mv r14,r3 80374a0: fb ff 34 13 calli 80044ec <_TOD_Get_with_nanoseconds> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80374a4: 2b 85 00 1c lw r5,(sp+28) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 80374a8: 29 61 00 54 lw r1,(r11+84) 80374ac: 29 66 00 50 lw r6,(r11+80) 80374b0: 2b 82 00 18 lw r2,(sp+24) 80374b4: c8 a1 08 00 sub r1,r5,r1 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 80374b8: 78 04 08 06 mvhi r4,0x806 80374bc: f4 25 38 00 cmpgu r7,r1,r5 80374c0: 38 84 e1 40 ori r4,r4,0xe140 80374c4: 28 88 00 10 lw r8,(r4+16) 80374c8: c8 46 30 00 sub r6,r2,r6 80374cc: c8 c7 30 00 sub r6,r6,r7 80374d0: 59 a1 00 04 sw (r13+4),r1 80374d4: 59 a6 00 00 sw (r13+0),r6 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 80374d8: 29 83 00 80 lw r3,(r12+128) 80374dc: 29 86 00 84 lw r6,(r12+132) if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 80374e0: 34 01 00 01 mvi r1,1 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 80374e4: 45 0c 00 08 be r8,r12,8037504 <_Rate_monotonic_Get_status+0x98> return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 80374e8: 2b 9d 00 04 lw ra,(sp+4) 80374ec: 2b 8b 00 14 lw r11,(sp+20) 80374f0: 2b 8c 00 10 lw r12,(sp+16) 80374f4: 2b 8d 00 0c lw r13,(sp+12) 80374f8: 2b 8e 00 08 lw r14,(sp+8) 80374fc: 37 9c 00 1c addi sp,sp,28 8037500: c3 a0 00 00 ret static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8037504: 28 81 00 24 lw r1,(r4+36) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8037508: b4 c5 28 00 add r5,r6,r5 803750c: f4 c5 30 00 cmpgu r6,r6,r5 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8037510: 28 87 00 20 lw r7,(r4+32) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8037514: b4 62 10 00 add r2,r3,r2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8037518: c8 a1 08 00 sub r1,r5,r1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 803751c: b4 c2 10 00 add r2,r6,r2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8037520: f4 25 28 00 cmpgu r5,r1,r5 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8037524: 29 64 00 48 lw r4,(r11+72) 8037528: c8 47 10 00 sub r2,r2,r7 803752c: c8 45 28 00 sub r5,r2,r5 8037530: 29 62 00 4c lw r2,(r11+76) /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 8037534: 48 85 00 10 bg r4,r5,8037574 <_Rate_monotonic_Get_status+0x108><== NEVER TAKEN 8037538: 44 85 00 11 be r4,r5,803757c <_Rate_monotonic_Get_status+0x110> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 803753c: c8 22 10 00 sub r2,r1,r2 8037540: f4 41 08 00 cmpgu r1,r2,r1 8037544: c8 a4 20 00 sub r4,r5,r4 8037548: c8 81 08 00 sub r1,r4,r1 803754c: 59 c1 00 00 sw (r14+0),r1 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 8037550: 34 01 00 01 mvi r1,1 8037554: 59 c2 00 04 sw (r14+4),r2 } 8037558: 2b 9d 00 04 lw ra,(sp+4) 803755c: 2b 8b 00 14 lw r11,(sp+20) 8037560: 2b 8c 00 10 lw r12,(sp+16) 8037564: 2b 8d 00 0c lw r13,(sp+12) 8037568: 2b 8e 00 08 lw r14,(sp+8) 803756c: 37 9c 00 1c addi sp,sp,28 8037570: c3 a0 00 00 ret /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; 8037574: 34 01 00 00 mvi r1,0 8037578: e3 ff ff dc bi 80374e8 <_Rate_monotonic_Get_status+0x7c> /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 803757c: 54 41 ff fe bgu r2,r1,8037574 <_Rate_monotonic_Get_status+0x108> 8037580: e3 ff ff ef bi 803753c <_Rate_monotonic_Get_status+0xd0> =============================================================================== 08037970 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 8037970: 37 9c ff f4 addi sp,sp,-12 8037974: 5b 8b 00 08 sw (sp+8),r11 8037978: 5b 9d 00 04 sw (sp+4),ra 803797c: b8 20 10 00 mv r2,r1 8037980: 78 01 08 06 mvhi r1,0x806 8037984: 38 21 e3 d0 ori r1,r1,0xe3d0 8037988: 37 83 00 0c addi r3,sp,12 803798c: fb ff 35 f7 calli 8005168 <_Objects_Get> /* * When we get here, the Timer is already off the chain so we do not * have to worry about that -- hence no _Watchdog_Remove(). */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 8037990: 2b 82 00 0c lw r2,(sp+12) 8037994: b8 20 58 00 mv r11,r1 8037998: 44 40 00 05 be r2,r0,80379ac <_Rate_monotonic_Timeout+0x3c><== ALWAYS TAKEN case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 803799c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80379a0: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 80379a4: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 80379a8: c3 a0 00 00 ret <== NOT EXECUTED */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: the_thread = the_period->owner; 80379ac: 28 21 00 40 lw r1,(r1+64) */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 80379b0: 28 23 00 10 lw r3,(r1+16) 80379b4: 20 63 40 00 andi r3,r3,0x4000 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 80379b8: 44 62 00 04 be r3,r2,80379c8 <_Rate_monotonic_Timeout+0x58> 80379bc: 28 23 00 20 lw r3,(r1+32) 80379c0: 29 62 00 08 lw r2,(r11+8) 80379c4: 44 62 00 1a be r3,r2,8037a2c <_Rate_monotonic_Timeout+0xbc> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 80379c8: 29 62 00 38 lw r2,(r11+56) 80379cc: 34 01 00 01 mvi r1,1 80379d0: 44 41 00 0c be r2,r1,8037a00 <_Rate_monotonic_Timeout+0x90><== NEVER TAKEN _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 80379d4: 34 01 00 04 mvi r1,4 80379d8: 59 61 00 38 sw (r11+56),r1 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 80379dc: 78 01 08 06 mvhi r1,0x806 80379e0: 38 21 df c0 ori r1,r1,0xdfc0 80379e4: 28 22 00 00 lw r2,(r1+0) --level; 80379e8: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 80379ec: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 80379f0: 2b 9d 00 04 lw ra,(sp+4) 80379f4: 2b 8b 00 08 lw r11,(sp+8) 80379f8: 37 9c 00 0c addi sp,sp,12 80379fc: c3 a0 00 00 ret _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 8037a00: 34 02 00 03 mvi r2,3 <== NOT EXECUTED _Rate_monotonic_Initiate_statistics( the_period ); 8037a04: b9 60 08 00 mv r1,r11 <== NOT EXECUTED _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 8037a08: 59 62 00 38 sw (r11+56),r2 <== NOT EXECUTED _Rate_monotonic_Initiate_statistics( the_period ); 8037a0c: fb ff ff 2b calli 80376b8 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8037a10: 29 62 00 3c lw r2,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8037a14: 78 01 08 06 mvhi r1,0x806 8037a18: 38 21 e0 58 ori r1,r1,0xe058 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8037a1c: 59 62 00 1c sw (r11+28),r2 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8037a20: 35 62 00 10 addi r2,r11,16 8037a24: fb ff 3d 3e calli 8006f1c <_Watchdog_Insert> 8037a28: e3 ff ff ed bi 80379dc <_Rate_monotonic_Timeout+0x6c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 8037a2c: 78 03 08 05 mvhi r3,0x805 8037a30: 38 63 ca 58 ori r3,r3,0xca58 8037a34: 28 62 00 00 lw r2,(r3+0) 8037a38: fb ff 55 dc calli 800d1a8 <_Thread_Clear_state> the_thread = the_period->owner; if ( _States_Is_waiting_for_period( the_thread->current_state ) && the_thread->Wait.id == the_period->Object.id ) { _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 8037a3c: b9 60 08 00 mv r1,r11 8037a40: e3 ff ff f3 bi 8037a0c <_Rate_monotonic_Timeout+0x9c> =============================================================================== 08037584 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 8037584: 37 9c ff e8 addi sp,sp,-24 8037588: 5b 8b 00 08 sw (sp+8),r11 803758c: 5b 9d 00 04 sw (sp+4),ra 8037590: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8037594: 28 21 00 58 lw r1,(r1+88) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8037598: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 803759c: 34 21 00 01 addi r1,r1,1 80375a0: 59 61 00 58 sw (r11+88),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 80375a4: 34 01 00 04 mvi r1,4 80375a8: 44 41 00 3a be r2,r1,8037690 <_Rate_monotonic_Update_statistics+0x10c> stats->missed_count++; /* * Grab status for time statistics. */ valid_status = 80375ac: b9 60 08 00 mv r1,r11 80375b0: 37 82 00 0c addi r2,sp,12 80375b4: 37 83 00 14 addi r3,sp,20 80375b8: fb ff ff ad calli 803746c <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 80375bc: 44 20 00 13 be r1,r0,8037608 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80375c0: 2b 82 00 18 lw r2,(sp+24) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 80375c4: 29 63 00 74 lw r3,(r11+116) 80375c8: 29 65 00 70 lw r5,(r11+112) 80375cc: 2b 81 00 14 lw r1,(sp+20) 80375d0: b4 43 18 00 add r3,r2,r3 80375d4: f4 43 30 00 cmpgu r6,r2,r3 80375d8: b4 25 28 00 add r5,r1,r5 * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 80375dc: 29 64 00 60 lw r4,(r11+96) 80375e0: b4 c5 28 00 add r5,r6,r5 80375e4: 59 65 00 70 sw (r11+112),r5 80375e8: 59 63 00 74 sw (r11+116),r3 80375ec: 48 81 00 0b bg r4,r1,8037618 <_Rate_monotonic_Update_statistics+0x94> 80375f0: 5c 81 00 0c bne r4,r1,8037620 <_Rate_monotonic_Update_statistics+0x9c><== NEVER TAKEN 80375f4: 29 63 00 64 lw r3,(r11+100) 80375f8: 54 62 00 08 bgu r3,r2,8037618 <_Rate_monotonic_Update_statistics+0x94> 80375fc: e0 00 00 09 bi 8037620 <_Rate_monotonic_Update_statistics+0x9c> if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) stats->max_wall_time = since_last_period; 8037600: 59 61 00 80 sw (r11+128),r1 8037604: 59 62 00 84 sw (r11+132),r2 stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 8037608: 2b 9d 00 04 lw ra,(sp+4) 803760c: 2b 8b 00 08 lw r11,(sp+8) 8037610: 37 9c 00 18 addi sp,sp,24 8037614: c3 a0 00 00 ret */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; 8037618: 59 61 00 60 sw (r11+96),r1 803761c: 59 62 00 64 sw (r11+100),r2 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 8037620: 29 63 00 68 lw r3,(r11+104) 8037624: 48 23 00 18 bg r1,r3,8037684 <_Rate_monotonic_Update_statistics+0x100><== NEVER TAKEN 8037628: 44 61 00 21 be r3,r1,80376ac <_Rate_monotonic_Update_statistics+0x128><== ALWAYS TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 803762c: 2b 82 00 10 lw r2,(sp+16) 8037630: 29 63 00 8c lw r3,(r11+140) 8037634: 29 65 00 88 lw r5,(r11+136) 8037638: 2b 81 00 0c lw r1,(sp+12) 803763c: b4 43 18 00 add r3,r2,r3 8037640: f4 43 30 00 cmpgu r6,r2,r3 8037644: b4 25 28 00 add r5,r1,r5 * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 8037648: 29 64 00 78 lw r4,(r11+120) 803764c: b4 c5 28 00 add r5,r6,r5 8037650: 59 65 00 88 sw (r11+136),r5 8037654: 59 63 00 8c sw (r11+140),r3 8037658: 48 81 00 08 bg r4,r1,8037678 <_Rate_monotonic_Update_statistics+0xf4> 803765c: 44 81 00 11 be r4,r1,80376a0 <_Rate_monotonic_Update_statistics+0x11c><== ALWAYS TAKEN stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 8037660: 29 63 00 80 lw r3,(r11+128) 8037664: 48 23 ff e7 bg r1,r3,8037600 <_Rate_monotonic_Update_statistics+0x7c><== NEVER TAKEN 8037668: 5c 61 ff e8 bne r3,r1,8037608 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 803766c: 29 63 00 84 lw r3,(r11+132) 8037670: 54 43 ff e4 bgu r2,r3,8037600 <_Rate_monotonic_Update_statistics+0x7c> 8037674: e3 ff ff e5 bi 8037608 <_Rate_monotonic_Update_statistics+0x84> */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; 8037678: 59 61 00 78 sw (r11+120),r1 803767c: 59 62 00 7c sw (r11+124),r2 8037680: e3 ff ff f8 bi 8037660 <_Rate_monotonic_Update_statistics+0xdc> if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) stats->max_cpu_time = executed; 8037684: 59 61 00 68 sw (r11+104),r1 8037688: 59 62 00 6c sw (r11+108),r2 803768c: e3 ff ff e8 bi 803762c <_Rate_monotonic_Update_statistics+0xa8> */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) stats->missed_count++; 8037690: 29 61 00 5c lw r1,(r11+92) 8037694: 34 21 00 01 addi r1,r1,1 8037698: 59 61 00 5c sw (r11+92),r1 803769c: e3 ff ff c4 bi 80375ac <_Rate_monotonic_Update_statistics+0x28> * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 80376a0: 29 63 00 7c lw r3,(r11+124) 80376a4: 54 62 ff f5 bgu r3,r2,8037678 <_Rate_monotonic_Update_statistics+0xf4> 80376a8: e3 ff ff ee bi 8037660 <_Rate_monotonic_Update_statistics+0xdc> _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 80376ac: 29 63 00 6c lw r3,(r11+108) 80376b0: 54 43 ff f5 bgu r2,r3,8037684 <_Rate_monotonic_Update_statistics+0x100> 80376b4: e3 ff ff de bi 803762c <_Rate_monotonic_Update_statistics+0xa8> =============================================================================== 08006ec0 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 8006ec0: 37 9c ff f8 addi sp,sp,-8 8006ec4: 5b 8b 00 08 sw (sp+8),r11 8006ec8: 5b 9d 00 04 sw (sp+4),ra 8006ecc: b8 20 58 00 mv r11,r1 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 8006ed0: 34 01 00 1c mvi r1,28 8006ed4: f8 00 07 f6 calli 8008eac <_Workspace_Allocate> if ( sched ) { 8006ed8: 44 20 00 06 be r1,r0,8006ef0 <_Scheduler_CBS_Allocate+0x30><== NEVER TAKEN the_thread->scheduler_info = sched; 8006edc: 59 61 00 88 sw (r11+136),r1 schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 8006ee0: 34 02 00 02 mvi r2,2 sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); if ( sched ) { the_thread->scheduler_info = sched; schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 8006ee4: 58 2b 00 00 sw (r1+0),r11 schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 8006ee8: 58 22 00 14 sw (r1+20),r2 schinfo->cbs_server = NULL; 8006eec: 58 20 00 18 sw (r1+24),r0 } return sched; } 8006ef0: 2b 9d 00 04 lw ra,(sp+4) 8006ef4: 2b 8b 00 08 lw r11,(sp+8) 8006ef8: 37 9c 00 08 addi sp,sp,8 8006efc: c3 a0 00 00 ret =============================================================================== 080081fc <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 80081fc: 37 9c ff f4 addi sp,sp,-12 8008200: 5b 8b 00 08 sw (sp+8),r11 8008204: 5b 9d 00 04 sw (sp+4),ra 8008208: b8 20 58 00 mv r11,r1 Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server_id server_id; /* Put violating task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 800820c: 28 22 00 ac lw r2,(r1+172) if ( the_thread->real_priority != new_priority ) 8008210: 28 21 00 18 lw r1,(r1+24) 8008214: 44 22 00 02 be r1,r2,800821c <_Scheduler_CBS_Budget_callout+0x20><== NEVER TAKEN the_thread->real_priority = new_priority; 8008218: 59 62 00 18 sw (r11+24),r2 if ( the_thread->current_priority != new_priority ) 800821c: 29 61 00 14 lw r1,(r11+20) 8008220: 44 22 00 04 be r1,r2,8008230 <_Scheduler_CBS_Budget_callout+0x34><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); 8008224: b9 60 08 00 mv r1,r11 8008228: 34 03 00 01 mvi r3,1 800822c: f8 00 01 a5 calli 80088c0 <_Thread_Change_priority> /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 8008230: 29 6b 00 88 lw r11,(r11+136) if ( sched_info->cbs_server->cbs_budget_overrun ) { 8008234: 29 61 00 18 lw r1,(r11+24) 8008238: 28 22 00 0c lw r2,(r1+12) 800823c: 44 40 00 08 be r2,r0,800825c <_Scheduler_CBS_Budget_callout+0x60><== NEVER TAKEN _Scheduler_CBS_Get_server_id( 8008240: 28 21 00 00 lw r1,(r1+0) 8008244: 37 82 00 0c addi r2,sp,12 8008248: fb ff ff d6 calli 80081a0 <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 800824c: 29 62 00 18 lw r2,(r11+24) 8008250: 2b 81 00 0c lw r1,(sp+12) 8008254: 28 42 00 0c lw r2,(r2+12) 8008258: d8 40 00 00 call r2 } } 800825c: 2b 9d 00 04 lw ra,(sp+4) 8008260: 2b 8b 00 08 lw r11,(sp+8) 8008264: 37 9c 00 0c addi sp,sp,12 8008268: c3 a0 00 00 ret =============================================================================== 08007c68 <_Scheduler_CBS_Cleanup>: #include #include #include int _Scheduler_CBS_Cleanup (void) { 8007c68: 37 9c ff ec addi sp,sp,-20 8007c6c: 5b 8b 00 14 sw (sp+20),r11 8007c70: 5b 8c 00 10 sw (sp+16),r12 8007c74: 5b 8d 00 0c sw (sp+12),r13 8007c78: 5b 8e 00 08 sw (sp+8),r14 8007c7c: 5b 9d 00 04 sw (sp+4),ra unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007c80: 78 0d 08 02 mvhi r13,0x802 8007c84: 39 ad 20 18 ori r13,r13,0x2018 8007c88: 29 a1 00 00 lw r1,(r13+0) 8007c8c: 44 20 00 1a be r1,r0,8007cf4 <_Scheduler_CBS_Cleanup+0x8c> <== NEVER TAKEN 8007c90: 78 0e 08 02 mvhi r14,0x802 8007c94: 39 ce 2b 28 ori r14,r14,0x2b28 8007c98: 29 c2 00 00 lw r2,(r14+0) 8007c9c: 34 0c 00 00 mvi r12,0 8007ca0: 34 0b 00 00 mvi r11,0 if ( _Scheduler_CBS_Server_list[ i ] ) 8007ca4: b4 4c 08 00 add r1,r2,r12 8007ca8: 28 23 00 00 lw r3,(r1+0) _Scheduler_CBS_Destroy_server( i ); 8007cac: b9 60 08 00 mv r1,r11 int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007cb0: 35 6b 00 01 addi r11,r11,1 if ( _Scheduler_CBS_Server_list[ i ] ) 8007cb4: 44 60 00 03 be r3,r0,8007cc0 <_Scheduler_CBS_Cleanup+0x58> _Scheduler_CBS_Destroy_server( i ); 8007cb8: f8 00 00 57 calli 8007e14 <_Scheduler_CBS_Destroy_server> 8007cbc: 29 c2 00 00 lw r2,(r14+0) int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007cc0: 29 a1 00 00 lw r1,(r13+0) 8007cc4: 35 8c 00 04 addi r12,r12,4 8007cc8: 54 2b ff f7 bgu r1,r11,8007ca4 <_Scheduler_CBS_Cleanup+0x3c> if ( _Scheduler_CBS_Server_list[ i ] ) _Scheduler_CBS_Destroy_server( i ); } _Workspace_Free( _Scheduler_CBS_Server_list ); 8007ccc: b8 40 08 00 mv r1,r2 8007cd0: f8 00 09 6e calli 800a288 <_Workspace_Free> return SCHEDULER_CBS_OK; } 8007cd4: 34 01 00 00 mvi r1,0 8007cd8: 2b 9d 00 04 lw ra,(sp+4) 8007cdc: 2b 8b 00 14 lw r11,(sp+20) 8007ce0: 2b 8c 00 10 lw r12,(sp+16) 8007ce4: 2b 8d 00 0c lw r13,(sp+12) 8007ce8: 2b 8e 00 08 lw r14,(sp+8) 8007cec: 37 9c 00 14 addi sp,sp,20 8007cf0: c3 a0 00 00 ret int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007cf4: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8007cf8: 38 21 2b 28 ori r1,r1,0x2b28 <== NOT EXECUTED 8007cfc: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED 8007d00: e3 ff ff f3 bi 8007ccc <_Scheduler_CBS_Cleanup+0x64> <== NOT EXECUTED =============================================================================== 08007d04 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 8007d04: 37 9c ff e4 addi sp,sp,-28 8007d08: 5b 8b 00 14 sw (sp+20),r11 8007d0c: 5b 8c 00 10 sw (sp+16),r12 8007d10: 5b 8d 00 0c sw (sp+12),r13 8007d14: 5b 8e 00 08 sw (sp+8),r14 8007d18: 5b 9d 00 04 sw (sp+4),ra unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 8007d1c: 28 24 00 04 lw r4,(r1+4) int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 8007d20: b8 20 58 00 mv r11,r1 if ( params->budget <= 0 || params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007d24: 34 01 ff ee mvi r1,-18 ) { unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 8007d28: 4c 04 00 2e bge r0,r4,8007de0 <_Scheduler_CBS_Create_server+0xdc> 8007d2c: 29 64 00 00 lw r4,(r11+0) 8007d30: 4c 04 00 2c bge r0,r4,8007de0 <_Scheduler_CBS_Create_server+0xdc> params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007d34: 78 01 08 02 mvhi r1,0x802 8007d38: 38 21 20 18 ori r1,r1,0x2018 8007d3c: 28 24 00 00 lw r4,(r1+0) if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 8007d40: 34 01 ff e6 mvi r1,-26 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007d44: 44 80 00 27 be r4,r0,8007de0 <_Scheduler_CBS_Create_server+0xdc><== NEVER TAKEN if ( !_Scheduler_CBS_Server_list[i] ) 8007d48: 78 0e 08 02 mvhi r14,0x802 8007d4c: 39 ce 2b 28 ori r14,r14,0x2b28 8007d50: 29 cd 00 00 lw r13,(r14+0) 8007d54: 29 a1 00 00 lw r1,(r13+0) 8007d58: 44 20 00 2d be r1,r0,8007e0c <_Scheduler_CBS_Create_server+0x108> 8007d5c: b9 a0 08 00 mv r1,r13 8007d60: 34 0c 00 00 mvi r12,0 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007d64: 35 8c 00 01 addi r12,r12,1 8007d68: 54 8c 00 25 bgu r4,r12,8007dfc <_Scheduler_CBS_Create_server+0xf8> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 8007d6c: 34 01 ff e6 mvi r1,-26 for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) 8007d70: 45 84 00 1c be r12,r4,8007de0 <_Scheduler_CBS_Create_server+0xdc> return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 8007d74: 58 6c 00 00 sw (r3+0),r12 _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 8007d78: 34 01 00 10 mvi r1,16 8007d7c: 5b 82 00 1c sw (sp+28),r2 8007d80: 5b 83 00 18 sw (sp+24),r3 8007d84: f8 00 09 36 calli 800a25c <_Workspace_Allocate> the_server = _Scheduler_CBS_Server_list[*server_id]; 8007d88: 2b 83 00 18 lw r3,(sp+24) 8007d8c: 29 c4 00 00 lw r4,(r14+0) if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007d90: b5 8c 60 00 add r12,r12,r12 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 8007d94: 28 63 00 00 lw r3,(r3+0) if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007d98: b5 8c 60 00 add r12,r12,r12 8007d9c: b5 ac 60 00 add r12,r13,r12 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 8007da0: b4 63 18 00 add r3,r3,r3 8007da4: b4 63 18 00 add r3,r3,r3 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007da8: 59 81 00 00 sw (r12+0),r1 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 8007dac: b4 83 18 00 add r3,r4,r3 8007db0: 28 63 00 00 lw r3,(r3+0) if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 8007db4: 34 01 ff ef mvi r1,-17 *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) 8007db8: 2b 82 00 1c lw r2,(sp+28) 8007dbc: 44 60 00 09 be r3,r0,8007de0 <_Scheduler_CBS_Create_server+0xdc><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007dc0: 29 64 00 00 lw r4,(r11+0) the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 8007dc4: 34 01 00 00 mvi r1,0 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007dc8: 58 64 00 04 sw (r3+4),r4 8007dcc: 29 65 00 04 lw r5,(r11+4) the_server->task_id = -1; 8007dd0: 34 04 ff ff mvi r4,-1 8007dd4: 58 64 00 00 sw (r3+0),r4 the_server->cbs_budget_overrun = budget_overrun_callback; 8007dd8: 58 62 00 0c sw (r3+12),r2 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007ddc: 58 65 00 08 sw (r3+8),r5 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 8007de0: 2b 9d 00 04 lw ra,(sp+4) 8007de4: 2b 8b 00 14 lw r11,(sp+20) 8007de8: 2b 8c 00 10 lw r12,(sp+16) 8007dec: 2b 8d 00 0c lw r13,(sp+12) 8007df0: 2b 8e 00 08 lw r14,(sp+8) 8007df4: 37 9c 00 1c addi sp,sp,28 8007df8: c3 a0 00 00 ret params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( !_Scheduler_CBS_Server_list[i] ) 8007dfc: 28 25 00 04 lw r5,(r1+4) 8007e00: 34 21 00 04 addi r1,r1,4 8007e04: 5c a0 ff d8 bne r5,r0,8007d64 <_Scheduler_CBS_Create_server+0x60> 8007e08: e3 ff ff d9 bi 8007d6c <_Scheduler_CBS_Create_server+0x68> 8007e0c: 34 0c 00 00 mvi r12,0 8007e10: e3 ff ff d9 bi 8007d74 <_Scheduler_CBS_Create_server+0x70> =============================================================================== 08007eb4 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 8007eb4: 37 9c ff ec addi sp,sp,-20 8007eb8: 5b 8b 00 10 sw (sp+16),r11 8007ebc: 5b 8c 00 0c sw (sp+12),r12 8007ec0: 5b 8d 00 08 sw (sp+8),r13 8007ec4: 5b 9d 00 04 sw (sp+4),ra 8007ec8: b8 40 68 00 mv r13,r2 8007ecc: b8 20 60 00 mv r12,r1 Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 8007ed0: 37 82 00 14 addi r2,sp,20 8007ed4: b9 a0 08 00 mv r1,r13 8007ed8: f8 00 04 09 calli 8008efc <_Thread_Get> 8007edc: b8 20 58 00 mv r11,r1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 8007ee0: 44 20 00 02 be r1,r0,8007ee8 <_Scheduler_CBS_Detach_thread+0x34> _Thread_Enable_dispatch(); 8007ee4: f8 00 03 fa calli 8008ecc <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 8007ee8: 78 03 08 02 mvhi r3,0x802 8007eec: 38 63 20 18 ori r3,r3,0x2018 8007ef0: 28 61 00 00 lw r1,(r3+0) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007ef4: 34 03 ff ee mvi r3,-18 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { _Thread_Enable_dispatch(); } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 8007ef8: 51 81 00 19 bgeu r12,r1,8007f5c <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 8007efc: 45 60 00 18 be r11,r0,8007f5c <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 8007f00: 78 01 08 02 mvhi r1,0x802 8007f04: 38 21 2b 28 ori r1,r1,0x2b28 8007f08: 28 21 00 00 lw r1,(r1+0) 8007f0c: b5 8c 60 00 add r12,r12,r12 8007f10: b5 8c 60 00 add r12,r12,r12 8007f14: b4 2c 60 00 add r12,r1,r12 8007f18: 29 81 00 00 lw r1,(r12+0) return SCHEDULER_CBS_ERROR_NOSERVER; 8007f1c: 34 03 ff e7 mvi r3,-25 if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 8007f20: 44 20 00 0f be r1,r0,8007f5c <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 8007f24: 28 22 00 00 lw r2,(r1+0) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007f28: 34 03 ff ee mvi r3,-18 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 8007f2c: 5c 4d 00 0c bne r2,r13,8007f5c <_Scheduler_CBS_Detach_thread+0xa8><== NEVER TAKEN return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 8007f30: 29 66 00 88 lw r6,(r11+136) the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; 8007f34: 41 63 00 9c lbu r3,(r11+156) _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 8007f38: 29 65 00 a0 lw r5,(r11+160) the_thread->budget_callout = the_thread->Start.budget_callout; 8007f3c: 29 64 00 a4 lw r4,(r11+164) return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 8007f40: 34 02 ff ff mvi r2,-1 8007f44: 58 22 00 00 sw (r1+0),r2 sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 8007f48: 58 c0 00 18 sw (r6+24),r0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; 8007f4c: 31 63 00 70 sb (r11+112),r3 _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 8007f50: 59 65 00 78 sw (r11+120),r5 the_thread->budget_callout = the_thread->Start.budget_callout; 8007f54: 59 64 00 7c sw (r11+124),r4 the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; 8007f58: 34 03 00 00 mvi r3,0 } 8007f5c: b8 60 08 00 mv r1,r3 8007f60: 2b 9d 00 04 lw ra,(sp+4) 8007f64: 2b 8b 00 10 lw r11,(sp+16) 8007f68: 2b 8c 00 0c lw r12,(sp+12) 8007f6c: 2b 8d 00 08 lw r13,(sp+8) 8007f70: 37 9c 00 14 addi sp,sp,20 8007f74: c3 a0 00 00 ret =============================================================================== 080081a0 <_Scheduler_CBS_Get_server_id>: rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 80081a0: 78 03 08 02 mvhi r3,0x802 80081a4: 38 63 20 18 ori r3,r3,0x2018 80081a8: 28 66 00 00 lw r6,(r3+0) _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; 80081ac: 34 03 ff e7 mvi r3,-25 rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 80081b0: 44 c0 00 0d be r6,r0,80081e4 <_Scheduler_CBS_Get_server_id+0x44><== NEVER TAKEN 80081b4: 78 03 08 02 mvhi r3,0x802 80081b8: 38 63 2b 28 ori r3,r3,0x2b28 80081bc: 28 63 00 00 lw r3,(r3+0) 80081c0: 34 04 00 00 mvi r4,0 if ( _Scheduler_CBS_Server_list[i] && 80081c4: 28 65 00 00 lw r5,(r3+0) rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 80081c8: 34 63 00 04 addi r3,r3,4 if ( _Scheduler_CBS_Server_list[i] && 80081cc: 44 a0 00 03 be r5,r0,80081d8 <_Scheduler_CBS_Get_server_id+0x38> 80081d0: 28 a5 00 00 lw r5,(r5+0) 80081d4: 44 a1 00 06 be r5,r1,80081ec <_Scheduler_CBS_Get_server_id+0x4c> rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 80081d8: 34 84 00 01 addi r4,r4,1 80081dc: 54 c4 ff fa bgu r6,r4,80081c4 <_Scheduler_CBS_Get_server_id+0x24> _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; 80081e0: 34 03 ff e7 mvi r3,-25 } 80081e4: b8 60 08 00 mv r1,r3 80081e8: c3 a0 00 00 ret unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; 80081ec: 34 03 00 00 mvi r3,0 { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; 80081f0: 58 44 00 00 sw (r2+0),r4 return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; } 80081f4: b8 60 08 00 mv r1,r3 80081f8: c3 a0 00 00 ret =============================================================================== 0800826c <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 800826c: 37 9c ff f8 addi sp,sp,-8 8008270: 5b 8b 00 08 sw (sp+8),r11 8008274: 5b 9d 00 04 sw (sp+4),ra unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); 8008278: 78 0b 08 02 mvhi r11,0x802 800827c: 39 6b 20 18 ori r11,r11,0x2018 8008280: 29 61 00 00 lw r1,(r11+0) 8008284: b4 21 08 00 add r1,r1,r1 8008288: b4 21 08 00 add r1,r1,r1 } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 800828c: f8 00 07 f4 calli 800a25c <_Workspace_Allocate> 8008290: 78 02 08 02 mvhi r2,0x802 8008294: 38 42 2b 28 ori r2,r2,0x2b28 8008298: 58 41 00 00 sw (r2+0),r1 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 800829c: 34 02 ff ef mvi r2,-17 int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 80082a0: 44 20 00 09 be r1,r0,80082c4 <_Scheduler_CBS_Initialize+0x58><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 80082a4: 29 63 00 00 lw r3,(r11+0) _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 80082a8: 34 02 00 00 mvi r2,0 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 80082ac: 44 60 00 06 be r3,r0,80082c4 <_Scheduler_CBS_Initialize+0x58><== NEVER TAKEN _Scheduler_CBS_Server_list[i] = NULL; 80082b0: 58 20 00 00 sw (r1+0),r0 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 80082b4: 34 42 00 01 addi r2,r2,1 80082b8: 34 21 00 04 addi r1,r1,4 80082bc: 54 62 ff fd bgu r3,r2,80082b0 <_Scheduler_CBS_Initialize+0x44> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 80082c0: 34 02 00 00 mvi r2,0 } 80082c4: b8 40 08 00 mv r1,r2 80082c8: 2b 9d 00 04 lw ra,(sp+4) 80082cc: 2b 8b 00 08 lw r11,(sp+8) 80082d0: 37 9c 00 08 addi sp,sp,8 80082d4: c3 a0 00 00 ret =============================================================================== 08006f00 <_Scheduler_CBS_Release_job>: void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 8006f00: 37 9c ff fc addi sp,sp,-4 8006f04: 5b 9d 00 04 sw (sp+4),ra Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 8006f08: 28 23 00 88 lw r3,(r1+136) void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 8006f0c: b8 40 20 00 mv r4,r2 Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = 8006f10: 28 63 00 18 lw r3,(r3+24) (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { 8006f14: 44 40 00 13 be r2,r0,8006f60 <_Scheduler_CBS_Release_job+0x60> /* Initializing or shifting deadline. */ if (serv_info) 8006f18: 44 60 00 15 be r3,r0,8006f6c <_Scheduler_CBS_Release_job+0x6c> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 8006f1c: 78 02 08 02 mvhi r2,0x802 8006f20: 38 42 0a 30 ori r2,r2,0xa30 8006f24: 28 64 00 04 lw r4,(r3+4) 8006f28: 28 42 00 00 lw r2,(r2+0) 8006f2c: 78 05 08 01 mvhi r5,0x801 8006f30: 38 a5 e3 b8 ori r5,r5,0xe3b8 8006f34: b4 44 10 00 add r2,r2,r4 8006f38: 28 a4 00 00 lw r4,(r5+0) 8006f3c: a0 44 10 00 and r2,r2,r4 new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) the_thread->cpu_time_budget = serv_info->parameters.budget; 8006f40: 28 63 00 08 lw r3,(r3+8) 8006f44: 58 23 00 74 sw (r1+116),r3 the_thread->real_priority = new_priority; 8006f48: 58 22 00 18 sw (r1+24),r2 _Thread_Change_priority(the_thread, new_priority, true); 8006f4c: 34 03 00 01 mvi r3,1 8006f50: f8 00 01 4e calli 8007488 <_Thread_Change_priority> } 8006f54: 2b 9d 00 04 lw ra,(sp+4) 8006f58: 37 9c 00 04 addi sp,sp,4 8006f5c: c3 a0 00 00 ret new_priority = (_Watchdog_Ticks_since_boot + deadline) & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 8006f60: 28 22 00 ac lw r2,(r1+172) } /* Budget replenishment for the next job. */ if (serv_info) 8006f64: 5c 64 ff f7 bne r3,r4,8006f40 <_Scheduler_CBS_Release_job+0x40><== ALWAYS TAKEN 8006f68: e3 ff ff f8 bi 8006f48 <_Scheduler_CBS_Release_job+0x48> <== NOT EXECUTED /* Initializing or shifting deadline. */ if (serv_info) new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 8006f6c: 78 02 08 02 mvhi r2,0x802 8006f70: 38 42 0a 30 ori r2,r2,0xa30 8006f74: 28 42 00 00 lw r2,(r2+0) 8006f78: b4 82 10 00 add r2,r4,r2 8006f7c: 78 04 08 01 mvhi r4,0x801 8006f80: 38 84 e3 b8 ori r4,r4,0xe3b8 8006f84: 28 83 00 00 lw r3,(r4+0) 8006f88: a0 43 10 00 and r2,r2,r3 8006f8c: e3 ff ff ef bi 8006f48 <_Scheduler_CBS_Release_job+0x48> =============================================================================== 08006f90 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 8006f90: 37 9c ff ec addi sp,sp,-20 8006f94: 5b 8b 00 14 sw (sp+20),r11 8006f98: 5b 8c 00 10 sw (sp+16),r12 8006f9c: 5b 8d 00 0c sw (sp+12),r13 8006fa0: 5b 8e 00 08 sw (sp+8),r14 8006fa4: 5b 9d 00 04 sw (sp+4),ra 8006fa8: b8 20 58 00 mv r11,r1 Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 8006fac: f8 00 00 59 calli 8007110 <_Scheduler_EDF_Enqueue> /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 8006fb0: 29 61 00 88 lw r1,(r11+136) 8006fb4: 28 2c 00 18 lw r12,(r1+24) * Late unblock rule for deadline-driven tasks. The remaining time to * deadline must be sufficient to serve the remaining computation time * without increased utilization of this task. It might cause a deadline * miss of another task. */ if (serv_info) { 8006fb8: 45 80 00 0d be r12,r0,8006fec <_Scheduler_CBS_Unblock+0x5c> time_t deadline = serv_info->parameters.deadline; time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - 8006fbc: 78 01 08 02 mvhi r1,0x802 8006fc0: 38 21 0a 30 ori r1,r1,0xa30 8006fc4: 28 21 00 00 lw r1,(r1+0) 8006fc8: 29 6d 00 18 lw r13,(r11+24) _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 8006fcc: 29 82 00 04 lw r2,(r12+4) 8006fd0: c9 a1 08 00 sub r1,r13,r1 8006fd4: f8 00 56 bd calli 801cac8 <__mulsi3> 8006fd8: b8 20 70 00 mv r14,r1 8006fdc: 29 82 00 08 lw r2,(r12+8) 8006fe0: 29 61 00 74 lw r1,(r11+116) 8006fe4: f8 00 56 b9 calli 801cac8 <__mulsi3> 8006fe8: 49 c1 00 18 bg r14,r1,8007048 <_Scheduler_CBS_Unblock+0xb8> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; if ( the_thread->real_priority != new_priority ) the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) _Thread_Change_priority(the_thread, new_priority, true); 8006fec: 29 61 00 14 lw r1,(r11+20) * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, 8006ff0: 78 0c 08 02 mvhi r12,0x802 8006ff4: 39 8c 0a c0 ori r12,r12,0xac0 8006ff8: 29 84 00 14 lw r4,(r12+20) 8006ffc: 78 02 08 02 mvhi r2,0x802 8007000: 38 42 00 1c ori r2,r2,0x1c 8007004: 28 43 00 30 lw r3,(r2+48) 8007008: 28 82 00 14 lw r2,(r4+20) 800700c: d8 60 00 00 call r3 8007010: 4c 01 00 07 bge r0,r1,800702c <_Scheduler_CBS_Unblock+0x9c> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 8007014: 29 81 00 10 lw r1,(r12+16) * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; 8007018: 59 8b 00 14 sw (r12+20),r11 if ( _Thread_Executing->is_preemptible || 800701c: 40 21 00 70 lbu r1,(r1+112) 8007020: 44 20 00 13 be r1,r0,800706c <_Scheduler_CBS_Unblock+0xdc> the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 8007024: 34 01 00 01 mvi r1,1 8007028: 31 81 00 0c sb (r12+12),r1 } } 800702c: 2b 9d 00 04 lw ra,(sp+4) 8007030: 2b 8b 00 14 lw r11,(sp+20) 8007034: 2b 8c 00 10 lw r12,(sp+16) 8007038: 2b 8d 00 0c lw r13,(sp+12) 800703c: 2b 8e 00 08 lw r14,(sp+8) 8007040: 37 9c 00 14 addi sp,sp,20 8007044: c3 a0 00 00 ret time_t budget_left = the_thread->real_priority - _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 8007048: 29 62 00 ac lw r2,(r11+172) if ( the_thread->real_priority != new_priority ) 800704c: 45 a2 00 02 be r13,r2,8007054 <_Scheduler_CBS_Unblock+0xc4> the_thread->real_priority = new_priority; 8007050: 59 62 00 18 sw (r11+24),r2 if ( the_thread->current_priority != new_priority ) 8007054: 29 61 00 14 lw r1,(r11+20) 8007058: 44 22 ff e6 be r1,r2,8006ff0 <_Scheduler_CBS_Unblock+0x60> _Thread_Change_priority(the_thread, new_priority, true); 800705c: b9 60 08 00 mv r1,r11 8007060: 34 03 00 01 mvi r3,1 8007064: f8 00 01 09 calli 8007488 <_Thread_Change_priority> 8007068: e3 ff ff e1 bi 8006fec <_Scheduler_CBS_Unblock+0x5c> * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 800706c: 29 62 00 14 lw r2,(r11+20) 8007070: 44 41 ff ed be r2,r1,8007024 <_Scheduler_CBS_Unblock+0x94> <== NEVER TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } 8007074: 2b 9d 00 04 lw ra,(sp+4) 8007078: 2b 8b 00 14 lw r11,(sp+20) 800707c: 2b 8c 00 10 lw r12,(sp+16) 8007080: 2b 8d 00 0c lw r13,(sp+12) 8007084: 2b 8e 00 08 lw r14,(sp+8) 8007088: 37 9c 00 14 addi sp,sp,20 800708c: c3 a0 00 00 ret =============================================================================== 08006ec0 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 8006ec0: 37 9c ff f8 addi sp,sp,-8 8006ec4: 5b 8b 00 08 sw (sp+8),r11 8006ec8: 5b 9d 00 04 sw (sp+4),ra 8006ecc: b8 20 58 00 mv r11,r1 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 8006ed0: 34 01 00 18 mvi r1,24 8006ed4: f8 00 07 c9 calli 8008df8 <_Workspace_Allocate> if ( sched ) { 8006ed8: 44 20 00 05 be r1,r0,8006eec <_Scheduler_EDF_Allocate+0x2c><== NEVER TAKEN the_thread->scheduler_info = sched; 8006edc: 59 61 00 88 sw (r11+136),r1 schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 8006ee0: 34 02 00 02 mvi r2,2 sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); if ( sched ) { the_thread->scheduler_info = sched; schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 8006ee4: 58 2b 00 00 sw (r1+0),r11 schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 8006ee8: 58 22 00 14 sw (r1+20),r2 } return sched; } 8006eec: 2b 9d 00 04 lw ra,(sp+4) 8006ef0: 2b 8b 00 08 lw r11,(sp+8) 8006ef4: 37 9c 00 08 addi sp,sp,8 8006ef8: c3 a0 00 00 ret =============================================================================== 08007134 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 8007134: 37 9c ff f4 addi sp,sp,-12 8007138: 5b 8b 00 0c sw (sp+12),r11 800713c: 5b 8c 00 08 sw (sp+8),r12 8007140: 5b 9d 00 04 sw (sp+4),ra * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 8007144: 78 0b 08 02 mvhi r11,0x802 #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 8007148: b8 20 60 00 mv r12,r1 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 800714c: 39 6b 0a c0 ori r11,r11,0xac0 void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { _Scheduler_EDF_Enqueue(the_thread); 8007150: fb ff ff 8b calli 8006f7c <_Scheduler_EDF_Enqueue> * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 8007154: 29 61 00 14 lw r1,(r11+20) 8007158: 78 02 08 02 mvhi r2,0x802 800715c: 38 42 00 18 ori r2,r2,0x18 8007160: 28 43 00 30 lw r3,(r2+48) 8007164: 28 21 00 14 lw r1,(r1+20) 8007168: 29 82 00 14 lw r2,(r12+20) 800716c: d8 60 00 00 call r3 8007170: 4c 20 00 07 bge r1,r0,800718c <_Scheduler_EDF_Unblock+0x58> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 8007174: 29 61 00 10 lw r1,(r11+16) * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 8007178: 59 6c 00 14 sw (r11+20),r12 if ( _Thread_Executing->is_preemptible || 800717c: 40 21 00 70 lbu r1,(r1+112) 8007180: 44 20 00 08 be r1,r0,80071a0 <_Scheduler_EDF_Unblock+0x6c> the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 8007184: 34 01 00 01 mvi r1,1 8007188: 31 61 00 0c sb (r11+12),r1 } } 800718c: 2b 9d 00 04 lw ra,(sp+4) 8007190: 2b 8b 00 0c lw r11,(sp+12) 8007194: 2b 8c 00 08 lw r12,(sp+8) 8007198: 37 9c 00 0c addi sp,sp,12 800719c: c3 a0 00 00 ret */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 80071a0: 29 82 00 14 lw r2,(r12+20) 80071a4: 5c 41 ff fa bne r2,r1,800718c <_Scheduler_EDF_Unblock+0x58><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 80071a8: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 80071ac: 31 61 00 0c sb (r11+12),r1 <== NOT EXECUTED 80071b0: e3 ff ff f7 bi 800718c <_Scheduler_EDF_Unblock+0x58> <== NOT EXECUTED =============================================================================== 08005fb0 <_Scheduler_priority_Block>: ) { Scheduler_priority_Per_thread *sched_info; Chain_Control *ready; sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info; 8005fb0: 28 23 00 88 lw r3,(r1+136) ready = sched_info->ready_chain; 8005fb4: 28 62 00 00 lw r2,(r3+0) if ( _Chain_Has_only_one_node( ready ) ) { 8005fb8: 28 45 00 00 lw r5,(r2+0) 8005fbc: 28 44 00 08 lw r4,(r2+8) 8005fc0: 44 a4 00 37 be r5,r4,800609c <_Scheduler_priority_Block+0xec> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8005fc4: 28 23 00 00 lw r3,(r1+0) previous = the_node->previous; 8005fc8: 28 22 00 04 lw r2,(r1+4) next->previous = previous; 8005fcc: 58 62 00 04 sw (r3+4),r2 previous->next = next; 8005fd0: 58 43 00 00 sw (r2+0),r3 RTEMS_INLINE_ROUTINE bool _Thread_Is_heir ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Heir ); 8005fd4: 78 02 08 01 mvhi r2,0x801 8005fd8: 38 42 ea 60 ori r2,r2,0xea60 { _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 8005fdc: 28 43 00 14 lw r3,(r2+20) 8005fe0: 44 23 00 07 be r1,r3,8005ffc <_Scheduler_priority_Block+0x4c> _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) 8005fe4: 28 43 00 10 lw r3,(r2+16) 8005fe8: 44 23 00 02 be r1,r3,8005ff0 <_Scheduler_priority_Block+0x40> 8005fec: c3 a0 00 00 ret _Thread_Dispatch_necessary = true; 8005ff0: 34 01 00 01 mvi r1,1 8005ff4: 30 41 00 0c sb (r2+12),r1 8005ff8: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8005ffc: 78 03 08 01 mvhi r3,0x801 8006000: 38 63 ea a0 ori r3,r3,0xeaa0 8006004: 2c 64 00 00 lhu r4,(r3+0) * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( (Chain_Control *) _Scheduler.information 8006008: 78 03 08 01 mvhi r3,0x801 800600c: 38 63 e0 18 ori r3,r3,0xe018 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 8006010: 28 67 00 00 lw r7,(r3+0) 8006014: 20 84 ff ff andi r4,r4,0xffff 8006018: 34 03 00 ff mvi r3,255 800601c: 54 83 00 3c bgu r4,r3,800610c <_Scheduler_priority_Block+0x15c> 8006020: 78 05 08 01 mvhi r5,0x801 8006024: 38 a5 c1 d4 ori r5,r5,0xc1d4 8006028: b4 a4 20 00 add r4,r5,r4 800602c: 40 84 00 00 lbu r4,(r4+0) 8006030: 34 84 00 08 addi r4,r4,8 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8006034: 78 06 08 01 mvhi r6,0x801 8006038: 38 c6 ea c0 ori r6,r6,0xeac0 800603c: b4 84 20 00 add r4,r4,r4 8006040: b4 c4 30 00 add r6,r6,r4 8006044: 2c c3 00 00 lhu r3,(r6+0) 8006048: 34 06 00 ff mvi r6,255 800604c: 54 66 00 25 bgu r3,r6,80060e0 <_Scheduler_priority_Block+0x130> 8006050: b4 a3 18 00 add r3,r5,r3 8006054: 40 65 00 00 lbu r5,(r3+0) 8006058: 34 a5 00 08 addi r5,r5,8 return (_Priority_Bits_index( major ) << 4) + 800605c: b4 84 18 00 add r3,r4,r4 8006060: b4 63 18 00 add r3,r3,r3 8006064: b4 63 18 00 add r3,r3,r3 8006068: b4 a3 18 00 add r3,r5,r3 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 800606c: b4 63 20 00 add r4,r3,r3 8006070: b4 83 18 00 add r3,r4,r3 8006074: b4 63 18 00 add r3,r3,r3 8006078: b4 63 18 00 add r3,r3,r3 800607c: b4 e3 18 00 add r3,r7,r3 } 8006080: 28 65 00 00 lw r5,(r3+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8006084: 34 63 00 04 addi r3,r3,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 8006088: 34 04 00 00 mvi r4,0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 800608c: 44 a3 00 02 be r5,r3,8006094 <_Scheduler_priority_Block+0xe4><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 8006090: b8 a0 20 00 mv r4,r5 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 8006094: 58 44 00 14 sw (r2+20),r4 8006098: e3 ff ff d3 bi 8005fe4 <_Scheduler_priority_Block+0x34> RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 800609c: 28 64 00 04 lw r4,(r3+4) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 80060a0: 34 45 00 04 addi r5,r2,4 head->next = tail; 80060a4: 58 45 00 00 sw (r2+0),r5 head->previous = NULL; 80060a8: 58 40 00 04 sw (r2+4),r0 tail->previous = head; 80060ac: 58 42 00 08 sw (r2+8),r2 80060b0: 2c 65 00 0e lhu r5,(r3+14) 80060b4: 2c 82 00 00 lhu r2,(r4+0) 80060b8: a0 45 10 00 and r2,r2,r5 80060bc: 0c 82 00 00 sh (r4+0),r2 if ( *the_priority_map->minor == 0 ) 80060c0: 5c 40 ff c5 bne r2,r0,8005fd4 <_Scheduler_priority_Block+0x24> _Priority_Major_bit_map &= the_priority_map->block_major; 80060c4: 78 02 08 01 mvhi r2,0x801 80060c8: 38 42 ea a0 ori r2,r2,0xeaa0 80060cc: 2c 44 00 00 lhu r4,(r2+0) 80060d0: 2c 63 00 0c lhu r3,(r3+12) 80060d4: a0 64 18 00 and r3,r3,r4 80060d8: 0c 43 00 00 sh (r2+0),r3 80060dc: e3 ff ff be bi 8005fd4 <_Scheduler_priority_Block+0x24> { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 80060e0: 00 63 00 01 srui r3,r3,1 80060e4: 00 63 00 01 srui r3,r3,1 80060e8: 00 63 00 01 srui r3,r3,1 80060ec: 00 63 00 01 srui r3,r3,1 80060f0: 00 63 00 01 srui r3,r3,1 80060f4: 00 63 00 01 srui r3,r3,1 80060f8: 00 63 00 01 srui r3,r3,1 80060fc: 00 63 00 01 srui r3,r3,1 8006100: b4 a3 18 00 add r3,r5,r3 8006104: 40 65 00 00 lbu r5,(r3+0) 8006108: e3 ff ff d5 bi 800605c <_Scheduler_priority_Block+0xac> RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 800610c: 00 84 00 01 srui r4,r4,1 8006110: 78 05 08 01 mvhi r5,0x801 8006114: 00 84 00 01 srui r4,r4,1 8006118: 38 a5 c1 d4 ori r5,r5,0xc1d4 800611c: 00 84 00 01 srui r4,r4,1 8006120: 00 84 00 01 srui r4,r4,1 8006124: 00 84 00 01 srui r4,r4,1 8006128: 00 84 00 01 srui r4,r4,1 800612c: 00 84 00 01 srui r4,r4,1 8006130: 00 84 00 01 srui r4,r4,1 8006134: b4 a4 20 00 add r4,r5,r4 8006138: 40 84 00 00 lbu r4,(r4+0) 800613c: e3 ff ff be bi 8006034 <_Scheduler_priority_Block+0x84> =============================================================================== 0800630c <_Scheduler_priority_Schedule>: RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 800630c: 78 01 08 01 mvhi r1,0x801 8006310: 38 21 ea a0 ori r1,r1,0xeaa0 8006314: 2c 22 00 00 lhu r2,(r1+0) * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( (Chain_Control *) _Scheduler.information 8006318: 78 01 08 01 mvhi r1,0x801 800631c: 38 21 e0 18 ori r1,r1,0xe018 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 8006320: 28 25 00 00 lw r5,(r1+0) 8006324: 20 42 ff ff andi r2,r2,0xffff 8006328: 34 01 00 ff mvi r1,255 800632c: 54 41 00 2d bgu r2,r1,80063e0 <_Scheduler_priority_Schedule+0xd4> 8006330: 78 03 08 01 mvhi r3,0x801 8006334: 38 63 c1 d4 ori r3,r3,0xc1d4 8006338: b4 62 10 00 add r2,r3,r2 800633c: 40 42 00 00 lbu r2,(r2+0) 8006340: 34 42 00 08 addi r2,r2,8 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8006344: 78 04 08 01 mvhi r4,0x801 8006348: 38 84 ea c0 ori r4,r4,0xeac0 800634c: b4 42 10 00 add r2,r2,r2 8006350: b4 82 20 00 add r4,r4,r2 8006354: 2c 81 00 00 lhu r1,(r4+0) 8006358: 34 04 00 ff mvi r4,255 800635c: 54 24 00 16 bgu r1,r4,80063b4 <_Scheduler_priority_Schedule+0xa8> 8006360: b4 61 08 00 add r1,r3,r1 8006364: 40 23 00 00 lbu r3,(r1+0) 8006368: 34 63 00 08 addi r3,r3,8 return (_Priority_Bits_index( major ) << 4) + 800636c: b4 42 08 00 add r1,r2,r2 8006370: b4 21 08 00 add r1,r1,r1 8006374: b4 21 08 00 add r1,r1,r1 8006378: b4 61 08 00 add r1,r3,r1 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 800637c: b4 21 10 00 add r2,r1,r1 8006380: b4 41 08 00 add r1,r2,r1 8006384: b4 21 08 00 add r1,r1,r1 8006388: b4 21 08 00 add r1,r1,r1 800638c: b4 a1 08 00 add r1,r5,r1 #include void _Scheduler_priority_Schedule(void) { _Scheduler_priority_Schedule_body(); } 8006390: 28 23 00 00 lw r3,(r1+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8006394: 34 21 00 04 addi r1,r1,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 8006398: 34 02 00 00 mvi r2,0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 800639c: 44 61 00 02 be r3,r1,80063a4 <_Scheduler_priority_Schedule+0x98><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 80063a0: b8 60 10 00 mv r2,r3 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 80063a4: 78 01 08 01 mvhi r1,0x801 80063a8: 38 21 ea 60 ori r1,r1,0xea60 80063ac: 58 22 00 14 sw (r1+20),r2 80063b0: c3 a0 00 00 ret { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 80063b4: 00 21 00 01 srui r1,r1,1 80063b8: 00 21 00 01 srui r1,r1,1 80063bc: 00 21 00 01 srui r1,r1,1 80063c0: 00 21 00 01 srui r1,r1,1 80063c4: 00 21 00 01 srui r1,r1,1 80063c8: 00 21 00 01 srui r1,r1,1 80063cc: 00 21 00 01 srui r1,r1,1 80063d0: 00 21 00 01 srui r1,r1,1 80063d4: b4 61 08 00 add r1,r3,r1 80063d8: 40 23 00 00 lbu r3,(r1+0) 80063dc: e3 ff ff e4 bi 800636c <_Scheduler_priority_Schedule+0x60> RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 80063e0: 00 42 00 01 srui r2,r2,1 80063e4: 78 03 08 01 mvhi r3,0x801 80063e8: 00 42 00 01 srui r2,r2,1 80063ec: 38 63 c1 d4 ori r3,r3,0xc1d4 80063f0: 00 42 00 01 srui r2,r2,1 80063f4: 00 42 00 01 srui r2,r2,1 80063f8: 00 42 00 01 srui r2,r2,1 80063fc: 00 42 00 01 srui r2,r2,1 8006400: 00 42 00 01 srui r2,r2,1 8006404: 00 42 00 01 srui r2,r2,1 8006408: b4 62 10 00 add r2,r3,r2 800640c: 40 42 00 00 lbu r2,(r2+0) 8006410: e3 ff ff cd bi 8006344 <_Scheduler_priority_Schedule+0x38> =============================================================================== 080051a0 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 80051a0: 37 9c ff f4 addi sp,sp,-12 80051a4: 5b 8b 00 0c sw (sp+12),r11 80051a8: 5b 8c 00 08 sw (sp+8),r12 80051ac: 5b 9d 00 04 sw (sp+4),ra uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 80051b0: 78 02 08 01 mvhi r2,0x801 80051b4: 38 42 e0 90 ori r2,r2,0xe090 }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 80051b8: b8 20 58 00 mv r11,r1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 80051bc: 28 42 00 0c lw r2,(r2+12) (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 80051c0: 34 0c 00 00 mvi r12,0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 80051c4: 44 20 00 22 be r1,r0,800524c <_TOD_Validate+0xac> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 80051c8: 78 03 08 01 mvhi r3,0x801 80051cc: 38 63 e4 14 ori r3,r3,0xe414 80051d0: 28 61 00 00 lw r1,(r3+0) 80051d4: f8 00 60 6e calli 801d38c <__udivsi3> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 80051d8: 29 62 00 18 lw r2,(r11+24) 80051dc: 50 41 00 1c bgeu r2,r1,800524c <_TOD_Validate+0xac> (the_tod->ticks >= ticks_per_second) || 80051e0: 29 62 00 14 lw r2,(r11+20) 80051e4: 34 01 00 3b mvi r1,59 80051e8: 54 41 00 19 bgu r2,r1,800524c <_TOD_Validate+0xac> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 80051ec: 29 62 00 10 lw r2,(r11+16) 80051f0: 54 41 00 17 bgu r2,r1,800524c <_TOD_Validate+0xac> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 80051f4: 29 62 00 0c lw r2,(r11+12) 80051f8: 34 01 00 17 mvi r1,23 80051fc: 54 41 00 14 bgu r2,r1,800524c <_TOD_Validate+0xac> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 8005200: 29 61 00 04 lw r1,(r11+4) rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 8005204: 44 20 00 12 be r1,r0,800524c <_TOD_Validate+0xac> <== NEVER TAKEN (the_tod->month == 0) || 8005208: 34 02 00 0c mvi r2,12 800520c: 54 22 00 10 bgu r1,r2,800524c <_TOD_Validate+0xac> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 8005210: 29 62 00 00 lw r2,(r11+0) (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 8005214: 34 03 07 c3 mvi r3,1987 8005218: 50 62 00 0d bgeu r3,r2,800524c <_TOD_Validate+0xac> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 800521c: 29 63 00 08 lw r3,(r11+8) (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 8005220: 44 60 00 0b be r3,r0,800524c <_TOD_Validate+0xac> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 8005224: 20 42 00 03 andi r2,r2,0x3 8005228: 5c 40 00 02 bne r2,r0,8005230 <_TOD_Validate+0x90> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 800522c: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 8005230: 78 02 08 01 mvhi r2,0x801 8005234: b4 21 08 00 add r1,r1,r1 8005238: 38 42 ed 90 ori r2,r2,0xed90 800523c: b4 21 08 00 add r1,r1,r1 8005240: b4 41 08 00 add r1,r2,r1 8005244: 28 2c 00 00 lw r12,(r1+0) const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = { { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }; bool _TOD_Validate( 8005248: f1 83 60 00 cmpgeu r12,r12,r3 if ( the_tod->day > days_in_month ) return false; return true; } 800524c: b9 80 08 00 mv r1,r12 8005250: 2b 9d 00 04 lw ra,(sp+4) 8005254: 2b 8b 00 0c lw r11,(sp+12) 8005258: 2b 8c 00 08 lw r12,(sp+8) 800525c: 37 9c 00 0c addi sp,sp,12 8005260: c3 a0 00 00 ret =============================================================================== 08006680 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8006680: 37 9c ff e4 addi sp,sp,-28 8006684: 5b 8b 00 1c sw (sp+28),r11 8006688: 5b 8c 00 18 sw (sp+24),r12 800668c: 5b 8d 00 14 sw (sp+20),r13 8006690: 5b 8e 00 10 sw (sp+16),r14 8006694: 5b 8f 00 0c sw (sp+12),r15 8006698: 5b 90 00 08 sw (sp+8),r16 800669c: 5b 9d 00 04 sw (sp+4),ra 80066a0: b8 20 58 00 mv r11,r1 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 80066a4: 28 2f 00 10 lw r15,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 80066a8: b8 40 60 00 mv r12,r2 80066ac: 20 70 00 ff andi r16,r3,0xff /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 80066b0: f8 00 03 fe calli 80076a8 <_Thread_Set_transient> /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 80066b4: 29 61 00 14 lw r1,(r11+20) 80066b8: 44 2c 00 04 be r1,r12,80066c8 <_Thread_Change_priority+0x48> _Thread_Set_priority( the_thread, new_priority ); 80066bc: b9 60 08 00 mv r1,r11 80066c0: b9 80 10 00 mv r2,r12 80066c4: f8 00 03 d5 calli 8007618 <_Thread_Set_priority> _ISR_Disable( level ); 80066c8: 90 00 60 00 rcsr r12,IE 80066cc: 34 0d ff fe mvi r13,-2 80066d0: a1 8d 68 00 and r13,r12,r13 80066d4: d0 0d 00 00 wcsr IE,r13 /* * If the thread has more than STATES_TRANSIENT set, then it is blocked, * If it is blocked on a thread queue, then we need to requeue it. */ state = the_thread->current_state; 80066d8: 29 61 00 10 lw r1,(r11+16) if ( state != STATES_TRANSIENT ) { 80066dc: 34 02 00 04 mvi r2,4 80066e0: 44 22 00 1f be r1,r2,800675c <_Thread_Change_priority+0xdc> */ RTEMS_INLINE_ROUTINE bool _States_Is_transient ( States_Control the_states ) { return (the_states & STATES_TRANSIENT); 80066e4: 21 ef 00 04 andi r15,r15,0x4 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 80066e8: 45 e0 00 10 be r15,r0,8006728 <_Thread_Change_priority+0xa8><== ALWAYS TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 80066ec: d0 0c 00 00 wcsr IE,r12 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 80066f0: 78 03 08 01 mvhi r3,0x801 <== NOT EXECUTED 80066f4: 38 63 c3 30 ori r3,r3,0xc330 <== NOT EXECUTED 80066f8: 28 62 00 00 lw r2,(r3+0) <== NOT EXECUTED 80066fc: a0 22 08 00 and r1,r1,r2 <== NOT EXECUTED if ( _States_Is_waiting_on_thread_queue( state ) ) { 8006700: 5c 20 00 13 bne r1,r0,800674c <_Thread_Change_priority+0xcc><== NOT EXECUTED if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } 8006704: 2b 9d 00 04 lw ra,(sp+4) 8006708: 2b 8b 00 1c lw r11,(sp+28) 800670c: 2b 8c 00 18 lw r12,(sp+24) 8006710: 2b 8d 00 14 lw r13,(sp+20) 8006714: 2b 8e 00 10 lw r14,(sp+16) 8006718: 2b 8f 00 0c lw r15,(sp+12) 800671c: 2b 90 00 08 lw r16,(sp+8) 8006720: 37 9c 00 1c addi sp,sp,28 8006724: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 8006728: 34 02 ff fb mvi r2,-5 800672c: a0 22 10 00 and r2,r1,r2 */ state = the_thread->current_state; if ( state != STATES_TRANSIENT ) { /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 8006730: 59 62 00 10 sw (r11+16),r2 _ISR_Enable( level ); 8006734: d0 0c 00 00 wcsr IE,r12 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 8006738: 78 03 08 01 mvhi r3,0x801 800673c: 38 63 c3 30 ori r3,r3,0xc330 8006740: 28 62 00 00 lw r2,(r3+0) 8006744: a0 22 08 00 and r1,r1,r2 if ( _States_Is_waiting_on_thread_queue( state ) ) { 8006748: 44 20 ff ef be r1,r0,8006704 <_Thread_Change_priority+0x84> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 800674c: 29 61 00 44 lw r1,(r11+68) 8006750: b9 60 10 00 mv r2,r11 8006754: f8 00 03 74 calli 8007524 <_Thread_queue_Requeue> 8006758: e3 ff ff eb bi 8006704 <_Thread_Change_priority+0x84> 800675c: 78 0e 08 01 mvhi r14,0x801 */ RTEMS_INLINE_ROUTINE bool _States_Is_transient ( States_Control the_states ) { return (the_states & STATES_TRANSIENT); 8006760: 21 ef 00 04 andi r15,r15,0x4 8006764: 39 ce e0 18 ori r14,r14,0xe018 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 8006768: 5d e0 00 06 bne r15,r0,8006780 <_Thread_Change_priority+0x100><== NEVER TAKEN * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 800676c: 59 60 00 10 sw (r11+16),r0 if ( prepend_it ) 8006770: 46 0f 00 13 be r16,r15,80067bc <_Thread_Change_priority+0x13c> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 8006774: 29 c2 00 28 lw r2,(r14+40) 8006778: b9 60 08 00 mv r1,r11 800677c: d8 40 00 00 call r2 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 8006780: d0 0c 00 00 wcsr IE,r12 8006784: d0 0d 00 00 wcsr IE,r13 * This kernel routine implements the scheduling decision logic for * the scheduler. It does NOT dispatch. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { _Scheduler.Operations.schedule(); 8006788: 29 c1 00 08 lw r1,(r14+8) 800678c: d8 20 00 00 call r1 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 8006790: 78 01 08 01 mvhi r1,0x801 8006794: 38 21 ea 60 ori r1,r1,0xea60 8006798: 28 22 00 10 lw r2,(r1+16) * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 800679c: 28 23 00 14 lw r3,(r1+20) 80067a0: 44 43 00 05 be r2,r3,80067b4 <_Thread_Change_priority+0x134> 80067a4: 40 42 00 70 lbu r2,(r2+112) 80067a8: 44 40 00 03 be r2,r0,80067b4 <_Thread_Change_priority+0x134> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 80067ac: 34 02 00 01 mvi r2,1 80067b0: 30 22 00 0c sb (r1+12),r2 _ISR_Enable( level ); 80067b4: d0 0c 00 00 wcsr IE,r12 80067b8: e3 ff ff d3 bi 8006704 <_Thread_Change_priority+0x84> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 80067bc: 29 c2 00 24 lw r2,(r14+36) 80067c0: b9 60 08 00 mv r1,r11 80067c4: d8 40 00 00 call r2 80067c8: e3 ff ff ee bi 8006780 <_Thread_Change_priority+0x100> =============================================================================== 0800d404 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800d404: 37 9c ff f8 addi sp,sp,-8 800d408: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800d40c: 37 82 00 08 addi r2,sp,8 800d410: f8 00 00 a7 calli 800d6ac <_Thread_Get> switch ( location ) { 800d414: 2b 82 00 08 lw r2,(sp+8) 800d418: 5c 40 00 0a bne r2,r0,800d440 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800d41c: 78 03 08 02 mvhi r3,0x802 800d420: 38 63 6d 70 ori r3,r3,0x6d70 800d424: 28 62 00 00 lw r2,(r3+0) 800d428: fb ff ff 65 calli 800d1bc <_Thread_Clear_state> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 800d42c: 78 01 08 02 mvhi r1,0x802 800d430: 38 21 9a 00 ori r1,r1,0x9a00 800d434: 28 22 00 00 lw r2,(r1+0) --level; 800d438: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 800d43c: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800d440: 2b 9d 00 04 lw ra,(sp+4) 800d444: 37 9c 00 08 addi sp,sp,8 800d448: c3 a0 00 00 ret =============================================================================== 080069a4 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 80069a4: 37 9c ff bc addi sp,sp,-68 80069a8: 5b 8b 00 3c sw (sp+60),r11 80069ac: 5b 8c 00 38 sw (sp+56),r12 80069b0: 5b 8d 00 34 sw (sp+52),r13 80069b4: 5b 8e 00 30 sw (sp+48),r14 80069b8: 5b 8f 00 2c sw (sp+44),r15 80069bc: 5b 90 00 28 sw (sp+40),r16 80069c0: 5b 91 00 24 sw (sp+36),r17 80069c4: 5b 92 00 20 sw (sp+32),r18 80069c8: 5b 93 00 1c sw (sp+28),r19 80069cc: 5b 94 00 18 sw (sp+24),r20 80069d0: 5b 95 00 14 sw (sp+20),r21 80069d4: 5b 96 00 10 sw (sp+16),r22 80069d8: 5b 97 00 0c sw (sp+12),r23 80069dc: 5b 98 00 08 sw (sp+8),r24 80069e0: 5b 9d 00 04 sw (sp+4),ra #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 80069e4: 78 01 08 01 mvhi r1,0x801 80069e8: 38 21 ea 60 ori r1,r1,0xea60 80069ec: 28 2c 00 10 lw r12,(r1+16) _ISR_Disable( level ); 80069f0: 90 00 18 00 rcsr r3,IE 80069f4: 34 01 ff fe mvi r1,-2 80069f8: a0 61 08 00 and r1,r3,r1 80069fc: d0 01 00 00 wcsr IE,r1 while ( _Thread_Dispatch_necessary == true ) { 8006a00: 78 0e 08 01 mvhi r14,0x801 8006a04: 39 ce ea 60 ori r14,r14,0xea60 8006a08: 41 c2 00 0c lbu r2,(r14+12) 8006a0c: 78 11 08 01 mvhi r17,0x801 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); 8006a10: b8 60 08 00 mv r1,r3 while ( _Thread_Dispatch_necessary == true ) { 8006a14: 20 42 00 ff andi r2,r2,0xff 8006a18: 3a 31 e8 e0 ori r17,r17,0xe8e0 8006a1c: 44 40 00 4d be r2,r0,8006b50 <_Thread_Dispatch+0x1ac> heir = _Thread_Heir; 8006a20: 29 cd 00 14 lw r13,(r14+20) * This routine sets thread dispatch level to the * value passed in. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) { _Thread_Dispatch_disable_level = value; 8006a24: 34 01 00 01 mvi r1,1 8006a28: 5a 21 00 00 sw (r17+0),r1 #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 8006a2c: 31 c0 00 0c sb (r14+12),r0 _Thread_Executing = heir; 8006a30: 59 cd 00 10 sw (r14+16),r13 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); 8006a34: b8 60 08 00 mv r1,r3 /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 8006a38: 45 8d 00 46 be r12,r13,8006b50 <_Thread_Dispatch+0x1ac> 8006a3c: 78 15 08 01 mvhi r21,0x801 8006a40: 78 14 08 01 mvhi r20,0x801 8006a44: 78 13 08 01 mvhi r19,0x801 8006a48: 78 0f 08 01 mvhi r15,0x801 #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006a4c: 78 16 08 01 mvhi r22,0x801 8006a50: 37 98 00 40 addi r24,sp,64 8006a54: 3a b5 e8 68 ori r21,r21,0xe868 8006a58: 3a 94 e9 4c ori r20,r20,0xe94c 8006a5c: 3a 73 e1 a0 ori r19,r19,0xe1a0 8006a60: 39 ef e1 a4 ori r15,r15,0xe1a4 */ #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 8006a64: 34 12 00 01 mvi r18,1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006a68: 3a d6 e8 78 ori r22,r22,0xe878 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 8006a6c: 34 17 ff fe mvi r23,-2 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 8006a70: b9 c0 80 00 mv r16,r14 */ #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 8006a74: 29 a1 00 78 lw r1,(r13+120) 8006a78: 44 32 00 54 be r1,r18,8006bc8 <_Thread_Dispatch+0x224> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; _ISR_Enable( level ); 8006a7c: d0 03 00 00 wcsr IE,r3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 8006a80: bb 00 08 00 mv r1,r24 8006a84: ba a0 10 00 mv r2,r21 8006a88: fb ff f8 d9 calli 8004dec <_TOD_Get_with_nanoseconds> #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006a8c: 2b 84 00 44 lw r4,(sp+68) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006a90: 29 83 00 84 lw r3,(r12+132) 8006a94: 29 88 00 80 lw r8,(r12+128) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006a98: 29 c5 00 24 lw r5,(r14+36) 8006a9c: 2b 86 00 40 lw r6,(sp+64) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006aa0: b4 83 18 00 add r3,r4,r3 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006aa4: 29 c1 00 20 lw r1,(r14+32) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006aa8: f4 83 48 00 cmpgu r9,r4,r3 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006aac: c8 65 28 00 sub r5,r3,r5 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006ab0: b4 c8 40 00 add r8,r6,r8 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006ab4: f4 a3 18 00 cmpgu r3,r5,r3 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006ab8: b5 28 38 00 add r7,r9,r8 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006abc: c8 e1 38 00 sub r7,r7,r1 8006ac0: c8 e3 38 00 sub r7,r7,r3 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006ac4: 2a 83 00 00 lw r3,(r20+0) 8006ac8: 59 87 00 80 sw (r12+128),r7 8006acc: 59 85 00 84 sw (r12+132),r5 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 8006ad0: 59 c6 00 20 sw (r14+32),r6 8006ad4: 59 c4 00 24 sw (r14+36),r4 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006ad8: 44 60 00 05 be r3,r0,8006aec <_Thread_Dispatch+0x148> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 8006adc: 28 61 00 00 lw r1,(r3+0) 8006ae0: 59 81 01 10 sw (r12+272),r1 *_Thread_libc_reent = heir->libc_reent; 8006ae4: 29 a1 01 10 lw r1,(r13+272) 8006ae8: 58 61 00 00 sw (r3+0),r1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006aec: 2a 6b 00 00 lw r11,(r19+0) { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 8006af0: 45 6f 00 07 be r11,r15,8006b0c <_Thread_Dispatch+0x168> <== NEVER TAKEN const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 8006af4: 29 63 00 08 lw r3,(r11+8) 8006af8: b9 80 08 00 mv r1,r12 8006afc: b9 a0 10 00 mv r2,r13 8006b00: d8 60 00 00 call r3 8006b04: 29 6b 00 00 lw r11,(r11+0) { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 8006b08: 5d 6f ff fb bne r11,r15,8006af4 <_Thread_Dispatch+0x150> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 8006b0c: 35 81 00 bc addi r1,r12,188 8006b10: 35 a2 00 bc addi r2,r13,188 8006b14: f8 00 05 37 calli 8007ff0 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 8006b18: 29 cc 00 10 lw r12,(r14+16) _ISR_Disable( level ); 8006b1c: 90 00 18 00 rcsr r3,IE 8006b20: a0 77 20 00 and r4,r3,r23 8006b24: d0 04 00 00 wcsr IE,r4 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 8006b28: 42 04 00 0c lbu r4,(r16+12) 8006b2c: ba 00 70 00 mv r14,r16 8006b30: 20 84 00 ff andi r4,r4,0xff 8006b34: 44 80 00 06 be r4,r0,8006b4c <_Thread_Dispatch+0x1a8> heir = _Thread_Heir; 8006b38: 2a 0d 00 14 lw r13,(r16+20) 8006b3c: 5a 32 00 00 sw (r17+0),r18 #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 8006b40: 32 00 00 0c sb (r16+12),r0 _Thread_Executing = heir; 8006b44: 5a 0d 00 10 sw (r16+16),r13 /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 8006b48: 5d ac ff cb bne r13,r12,8006a74 <_Thread_Dispatch+0xd0> <== ALWAYS TAKEN #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 8006b4c: b8 60 08 00 mv r1,r3 8006b50: 5a 20 00 00 sw (r17+0),r0 post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 8006b54: d0 01 00 00 wcsr IE,r1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006b58: 78 01 08 01 mvhi r1,0x801 8006b5c: 38 21 e9 50 ori r1,r1,0xe950 8006b60: 28 2b 00 00 lw r11,(r1+0) { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 8006b64: 78 0d 08 01 mvhi r13,0x801 8006b68: 39 ad e9 54 ori r13,r13,0xe954 8006b6c: 45 6d 00 06 be r11,r13,8006b84 <_Thread_Dispatch+0x1e0> const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 8006b70: 29 62 00 08 lw r2,(r11+8) 8006b74: b9 80 08 00 mv r1,r12 8006b78: d8 40 00 00 call r2 8006b7c: 29 6b 00 00 lw r11,(r11+0) { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 8006b80: 5d 6d ff fc bne r11,r13,8006b70 <_Thread_Dispatch+0x1cc> <== NEVER TAKEN 8006b84: 2b 9d 00 04 lw ra,(sp+4) 8006b88: 2b 8b 00 3c lw r11,(sp+60) 8006b8c: 2b 8c 00 38 lw r12,(sp+56) 8006b90: 2b 8d 00 34 lw r13,(sp+52) 8006b94: 2b 8e 00 30 lw r14,(sp+48) 8006b98: 2b 8f 00 2c lw r15,(sp+44) 8006b9c: 2b 90 00 28 lw r16,(sp+40) 8006ba0: 2b 91 00 24 lw r17,(sp+36) 8006ba4: 2b 92 00 20 lw r18,(sp+32) 8006ba8: 2b 93 00 1c lw r19,(sp+28) 8006bac: 2b 94 00 18 lw r20,(sp+24) 8006bb0: 2b 95 00 14 lw r21,(sp+20) 8006bb4: 2b 96 00 10 lw r22,(sp+16) 8006bb8: 2b 97 00 0c lw r23,(sp+12) 8006bbc: 2b 98 00 08 lw r24,(sp+8) 8006bc0: 37 9c 00 44 addi sp,sp,68 8006bc4: c3 a0 00 00 ret #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006bc8: 2a c1 00 00 lw r1,(r22+0) 8006bcc: 59 a1 00 74 sw (r13+116),r1 8006bd0: e3 ff ff ab bi 8006a7c <_Thread_Dispatch+0xd8> =============================================================================== 0800bdc0 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 800bdc0: 37 9c ff f4 addi sp,sp,-12 800bdc4: 5b 8b 00 0c sw (sp+12),r11 800bdc8: 5b 8c 00 08 sw (sp+8),r12 800bdcc: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 800bdd0: 78 01 08 01 mvhi r1,0x801 800bdd4: 38 21 ea 60 ori r1,r1,0xea60 800bdd8: 28 2b 00 10 lw r11,(r1+16) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 800bddc: 29 61 00 a8 lw r1,(r11+168) _ISR_Set_level(level); 800bde0: 64 21 00 00 cmpei r1,r1,0 800bde4: d0 01 00 00 wcsr IE,r1 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 800bde8: 78 03 08 01 mvhi r3,0x801 800bdec: 38 63 e7 2c ori r3,r3,0xe72c 800bdf0: 40 6c 00 00 lbu r12,(r3+0) doneConstructors = true; 800bdf4: 34 04 00 01 mvi r4,1 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 800bdf8: 78 02 08 00 mvhi r2,0x800 800bdfc: b9 60 08 00 mv r1,r11 800be00: 38 42 78 d8 ori r2,r2,0x78d8 800be04: 30 64 00 00 sb (r3+0),r4 800be08: fb ff ee d0 calli 8007948 <_User_extensions_Iterate> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 800be0c: fb ff eb 72 calli 8006bd4 <_Thread_Enable_dispatch> /* * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (doCons) /* && (volatile void *)_init) */ { 800be10: 45 80 00 0b be r12,r0,800be3c <_Thread_Handler+0x7c> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800be14: 29 61 00 90 lw r1,(r11+144) 800be18: 44 20 00 0c be r1,r0,800be48 <_Thread_Handler+0x88> <== ALWAYS TAKEN } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 800be1c: 78 02 08 00 mvhi r2,0x800 800be20: b9 60 08 00 mv r1,r11 800be24: 38 42 78 f8 ori r2,r2,0x78f8 800be28: fb ff ee c8 calli 8007948 <_User_extensions_Iterate> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 800be2c: 34 01 00 00 mvi r1,0 800be30: 34 02 00 01 mvi r2,1 800be34: 34 03 00 05 mvi r3,5 800be38: fb ff e5 83 calli 8005444 <_Internal_error_Occurred> * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (doCons) /* && (volatile void *)_init) */ { INIT_NAME (); 800be3c: fb ff d0 71 calli 8000000 _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800be40: 29 61 00 90 lw r1,(r11+144) 800be44: 5c 20 ff f6 bne r1,r0,800be1c <_Thread_Handler+0x5c> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 800be48: 29 62 00 8c lw r2,(r11+140) 800be4c: 29 61 00 98 lw r1,(r11+152) 800be50: d8 40 00 00 call r2 #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 800be54: 59 61 00 28 sw (r11+40),r1 800be58: e3 ff ff f1 bi 800be1c <_Thread_Handler+0x5c> =============================================================================== 08006f24 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 8006f24: 37 9c ff f4 addi sp,sp,-12 8006f28: 5b 8b 00 0c sw (sp+12),r11 8006f2c: 5b 8c 00 08 sw (sp+8),r12 8006f30: 5b 9d 00 04 sw (sp+4),ra uint32_t ticks_per_timeslice = 8006f34: 78 01 08 01 mvhi r1,0x801 8006f38: 38 21 b9 9c ori r1,r1,0xb99c #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 8006f3c: 28 23 00 28 lw r3,(r1+40) #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 8006f40: 28 2b 00 14 lw r11,(r1+20) rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 8006f44: 28 2c 00 08 lw r12,(r1+8) rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = 8006f48: 28 22 00 24 lw r2,(r1+36) #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 8006f4c: 44 60 00 1f be r3,r0,8006fc8 <_Thread_Handler_initialization+0xa4><== NEVER TAKEN 8006f50: 28 23 00 2c lw r3,(r1+44) 8006f54: 44 60 00 1d be r3,r0,8006fc8 <_Thread_Handler_initialization+0xa4> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 8006f58: 44 40 00 03 be r2,r0,8006f64 <_Thread_Handler_initialization+0x40> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 8006f5c: 28 21 00 04 lw r1,(r1+4) 8006f60: d8 40 00 00 call r2 _Thread_Dispatch_necessary = false; 8006f64: 78 08 08 01 mvhi r8,0x801 8006f68: 39 08 ea 60 ori r8,r8,0xea60 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 8006f6c: 78 0a 08 01 mvhi r10,0x801 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8006f70: 78 09 08 01 mvhi r9,0x801 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 8006f74: 78 01 08 01 mvhi r1,0x801 ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; 8006f78: 31 00 00 0c sb (r8+12),r0 _Thread_Executing = NULL; 8006f7c: 59 00 00 10 sw (r8+16),r0 _Thread_Heir = NULL; 8006f80: 59 00 00 14 sw (r8+20),r0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 8006f84: 39 4a e9 5c ori r10,r10,0xe95c _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8006f88: 39 29 e8 78 ori r9,r9,0xe878 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 8006f8c: 38 21 e9 d0 ori r1,r1,0xe9d0 8006f90: 34 02 00 01 mvi r2,1 8006f94: 34 03 00 01 mvi r3,1 8006f98: 34 04 00 01 mvi r4,1 8006f9c: 34 05 01 28 mvi r5,296 8006fa0: 34 06 00 00 mvi r6,0 8006fa4: 34 07 00 08 mvi r7,8 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 8006fa8: 59 4c 00 00 sw (r10+0),r12 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8006fac: 59 2b 00 00 sw (r9+0),r11 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 8006fb0: fb ff fb 0b calli 8005bdc <_Objects_Initialize_information> false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 8006fb4: 2b 9d 00 04 lw ra,(sp+4) 8006fb8: 2b 8b 00 0c lw r11,(sp+12) 8006fbc: 2b 8c 00 08 lw r12,(sp+8) 8006fc0: 37 9c 00 0c addi sp,sp,12 8006fc4: c3 a0 00 00 ret _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 8006fc8: 34 01 00 00 mvi r1,0 8006fcc: 34 02 00 01 mvi r2,1 8006fd0: 34 03 00 0e mvi r3,14 8006fd4: fb ff f9 1c calli 8005444 <_Internal_error_Occurred> =============================================================================== 0800a424 <_Thread_blocking_operation_Cancel>: Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 800a424: 37 9c ff f8 addi sp,sp,-8 800a428: 5b 8b 00 08 sw (sp+8),r11 800a42c: 5b 9d 00 04 sw (sp+4),ra 800a430: b8 40 58 00 mv r11,r2 /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 800a434: 28 42 00 50 lw r2,(r2+80) #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 800a438: 59 60 00 44 sw (r11+68),r0 /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 800a43c: 34 01 00 02 mvi r1,2 800a440: 44 41 00 0b be r2,r1,800a46c <_Thread_blocking_operation_Cancel+0x48><== NEVER TAKEN _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); } else _ISR_Enable( level ); 800a444: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800a448: 78 01 08 01 mvhi r1,0x801 800a44c: 38 21 c3 38 ori r1,r1,0xc338 800a450: 28 22 00 00 lw r2,(r1+0) 800a454: b9 60 08 00 mv r1,r11 800a458: f8 00 00 0b calli 800a484 <_Thread_Clear_state> #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 800a45c: 2b 9d 00 04 lw ra,(sp+4) 800a460: 2b 8b 00 08 lw r11,(sp+8) 800a464: 37 9c 00 08 addi sp,sp,8 800a468: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800a46c: 34 01 00 03 mvi r1,3 <== NOT EXECUTED 800a470: 59 61 00 50 sw (r11+80),r1 <== NOT EXECUTED * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800a474: d0 03 00 00 wcsr IE,r3 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 800a478: 35 61 00 48 addi r1,r11,72 <== NOT EXECUTED 800a47c: fb ff f5 ed calli 8007c30 <_Watchdog_Remove> <== NOT EXECUTED 800a480: e3 ff ff f2 bi 800a448 <_Thread_blocking_operation_Cancel+0x24><== NOT EXECUTED =============================================================================== 08006fd8 <_Thread_queue_Dequeue>: #include Thread_Control *_Thread_queue_Dequeue( Thread_queue_Control *the_thread_queue ) { 8006fd8: 37 9c ff f8 addi sp,sp,-8 8006fdc: 5b 8b 00 08 sw (sp+8),r11 8006fe0: 5b 9d 00 04 sw (sp+4),ra Thread_Control *(*dequeue_p)( Thread_queue_Control * ); Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8006fe4: 28 23 00 34 lw r3,(r1+52) #include Thread_Control *_Thread_queue_Dequeue( Thread_queue_Control *the_thread_queue ) { 8006fe8: b8 20 58 00 mv r11,r1 Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) dequeue_p = _Thread_queue_Dequeue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; 8006fec: 78 02 08 00 mvhi r2,0x800 Thread_Control *(*dequeue_p)( Thread_queue_Control * ); Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8006ff0: 34 01 00 01 mvi r1,1 dequeue_p = _Thread_queue_Dequeue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; 8006ff4: 38 42 a5 40 ori r2,r2,0xa540 Thread_Control *(*dequeue_p)( Thread_queue_Control * ); Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8006ff8: 44 61 00 0d be r3,r1,800702c <_Thread_queue_Dequeue+0x54> dequeue_p = _Thread_queue_Dequeue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; the_thread = (*dequeue_p)( the_thread_queue ); 8006ffc: b9 60 08 00 mv r1,r11 8007000: d8 40 00 00 call r2 _ISR_Disable( level ); 8007004: 90 00 10 00 rcsr r2,IE 8007008: 34 03 ff fe mvi r3,-2 800700c: a0 43 18 00 and r3,r2,r3 8007010: d0 03 00 00 wcsr IE,r3 if ( !the_thread ) { 8007014: 44 20 00 0f be r1,r0,8007050 <_Thread_queue_Dequeue+0x78> (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; the_thread = _Thread_Executing; } } _ISR_Enable( level ); 8007018: d0 02 00 00 wcsr IE,r2 return the_thread; } 800701c: 2b 9d 00 04 lw ra,(sp+4) 8007020: 2b 8b 00 08 lw r11,(sp+8) 8007024: 37 9c 00 08 addi sp,sp,8 8007028: c3 a0 00 00 ret Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) dequeue_p = _Thread_queue_Dequeue_priority; 800702c: 78 02 08 00 mvhi r2,0x800 8007030: 38 42 70 78 ori r2,r2,0x7078 else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; the_thread = (*dequeue_p)( the_thread_queue ); 8007034: b9 60 08 00 mv r1,r11 8007038: d8 40 00 00 call r2 _ISR_Disable( level ); 800703c: 90 00 10 00 rcsr r2,IE 8007040: 34 03 ff fe mvi r3,-2 8007044: a0 43 18 00 and r3,r2,r3 8007048: d0 03 00 00 wcsr IE,r3 if ( !the_thread ) { 800704c: 5c 20 ff f3 bne r1,r0,8007018 <_Thread_queue_Dequeue+0x40> sync_state = the_thread_queue->sync_state; if ( (sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 8007050: 29 64 00 30 lw r4,(r11+48) 8007054: 34 03 00 01 mvi r3,1 8007058: 34 84 ff ff addi r4,r4,-1 800705c: 54 83 ff ef bgu r4,r3,8007018 <_Thread_queue_Dequeue+0x40> <== ALWAYS TAKEN (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; the_thread = _Thread_Executing; 8007060: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8007064: 38 21 ea 60 ori r1,r1,0xea60 <== NOT EXECUTED _ISR_Disable( level ); if ( !the_thread ) { sync_state = the_thread_queue->sync_state; if ( (sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 8007068: 34 03 00 03 mvi r3,3 <== NOT EXECUTED the_thread = _Thread_Executing; 800706c: 28 21 00 10 lw r1,(r1+16) <== NOT EXECUTED _ISR_Disable( level ); if ( !the_thread ) { sync_state = the_thread_queue->sync_state; if ( (sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 8007070: 59 63 00 30 sw (r11+48),r3 <== NOT EXECUTED 8007074: e3 ff ff e9 bi 8007018 <_Thread_queue_Dequeue+0x40> <== NOT EXECUTED =============================================================================== 0800a60c <_Thread_queue_Enqueue_fifo>: ) { Thread_blocking_operation_States sync_state; ISR_Level level; _ISR_Disable( level ); 800a60c: 90 00 20 00 rcsr r4,IE 800a610: 34 05 ff fe mvi r5,-2 800a614: a0 85 28 00 and r5,r4,r5 800a618: d0 05 00 00 wcsr IE,r5 sync_state = the_thread_queue->sync_state; 800a61c: 28 25 00 30 lw r5,(r1+48) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { 800a620: 34 06 00 01 mvi r6,1 ISR_Level level; _ISR_Disable( level ); sync_state = the_thread_queue->sync_state; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 800a624: 58 20 00 30 sw (r1+48),r0 if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { 800a628: 44 a6 00 04 be r5,r6,800a638 <_Thread_queue_Enqueue_fifo+0x2c><== ALWAYS TAKEN * 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; 800a62c: 58 64 00 00 sw (r3+0),r4 <== NOT EXECUTED return sync_state; } 800a630: b8 a0 08 00 mv r1,r5 <== NOT EXECUTED 800a634: c3 a0 00 00 ret <== NOT EXECUTED Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 800a638: 28 23 00 08 lw r3,(r1+8) RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 800a63c: 34 26 00 04 addi r6,r1,4 Chain_Node *old_last = tail->previous; the_node->next = tail; 800a640: 58 46 00 00 sw (r2+0),r6 tail->previous = the_node; 800a644: 58 22 00 08 sw (r1+8),r2 old_last->next = the_node; 800a648: 58 62 00 00 sw (r3+0),r2 the_node->previous = old_last; 800a64c: 58 43 00 04 sw (r2+4),r3 if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { _Chain_Append_unprotected( &the_thread_queue->Queues.Fifo, &the_thread->Object.Node ); the_thread->Wait.queue = the_thread_queue; 800a650: 58 41 00 44 sw (r2+68),r1 the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; _ISR_Enable( level ); 800a654: d0 04 00 00 wcsr IE,r4 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return sync_state; } 800a658: b8 a0 08 00 mv r1,r5 800a65c: c3 a0 00 00 ret =============================================================================== 08007284 <_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 ) { 8007284: 37 9c ff f4 addi sp,sp,-12 8007288: 5b 8b 00 0c sw (sp+12),r11 800728c: 5b 8c 00 08 sw (sp+8),r12 8007290: 5b 8d 00 04 sw (sp+4),r13 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 8007294: 28 45 00 14 lw r5,(r2+20) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8007298: 34 47 00 3c addi r7,r2,60 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 800729c: 34 46 00 38 addi r6,r2,56 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 80072a0: 00 a4 00 01 srui r4,r5,1 80072a4: 78 0c 08 01 mvhi r12,0x801 80072a8: 00 84 00 01 srui r4,r4,1 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 80072ac: 58 47 00 38 sw (r2+56),r7 80072b0: 00 84 00 01 srui r4,r4,1 head->previous = NULL; tail->previous = head; 80072b4: 58 46 00 40 sw (r2+64),r6 80072b8: 00 84 00 01 srui r4,r4,1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 80072bc: 58 40 00 3c sw (r2+60),r0 80072c0: 00 84 00 01 srui r4,r4,1 RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_reverse_search ( Priority_Control the_priority ) { return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK ); 80072c4: 20 a8 00 20 andi r8,r5,0x20 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 80072c8: 00 84 00 01 srui r4,r4,1 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; 80072cc: 28 27 00 38 lw r7,(r1+56) 80072d0: b4 84 30 00 add r6,r4,r4 80072d4: 39 8c e0 d8 ori r12,r12,0xe0d8 if ( _Thread_queue_Is_reverse_search( priority ) ) 80072d8: 5d 00 00 18 bne r8,r0,8007338 <_Thread_queue_Enqueue_priority+0xb4> * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 80072dc: b4 c4 20 00 add r4,r6,r4 80072e0: b4 84 20 00 add r4,r4,r4 80072e4: b4 84 20 00 add r4,r4,r4 80072e8: b4 24 60 00 add r12,r1,r4 if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 80072ec: 34 0d ff fe mvi r13,-2 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 80072f0: 35 8b 00 04 addi r11,r12,4 80072f4: 90 00 40 00 rcsr r8,IE 80072f8: a1 0d 50 00 and r10,r8,r13 80072fc: d0 0a 00 00 wcsr IE,r10 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007300: 29 84 00 00 lw r4,(r12+0) restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8007304: 5c 8b 00 04 bne r4,r11,8007314 <_Thread_queue_Enqueue_priority+0x90> 8007308: e0 00 00 24 bi 8007398 <_Thread_queue_Enqueue_priority+0x114> if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 800730c: 28 84 00 00 lw r4,(r4+0) restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8007310: 44 8b 00 23 be r4,r11,800739c <_Thread_queue_Enqueue_priority+0x118> search_priority = search_thread->current_priority; 8007314: 28 86 00 14 lw r6,(r4+20) if ( priority <= search_priority ) 8007318: 50 c5 00 21 bgeu r6,r5,800739c <_Thread_queue_Enqueue_priority+0x118> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 800731c: d0 08 00 00 wcsr IE,r8 8007320: d0 0a 00 00 wcsr IE,r10 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 8007324: 28 89 00 10 lw r9,(r4+16) 8007328: a0 e9 48 00 and r9,r7,r9 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 800732c: 5d 20 ff f8 bne r9,r0,800730c <_Thread_queue_Enqueue_priority+0x88> _ISR_Enable( level ); 8007330: d0 08 00 00 wcsr IE,r8 goto restart_forward_search; 8007334: e3 ff ff f0 bi 80072f4 <_Thread_queue_Enqueue_priority+0x70> * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007338: b4 c4 20 00 add r4,r6,r4 800733c: b4 84 20 00 add r4,r4,r4 8007340: b4 84 20 00 add r4,r4,r4 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 8007344: 34 0d ff fe mvi r13,-2 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007348: b4 24 50 00 add r10,r1,r4 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 800734c: 41 86 00 00 lbu r6,(r12+0) 8007350: 34 c6 00 01 addi r6,r6,1 _ISR_Disable( level ); 8007354: 90 00 40 00 rcsr r8,IE 8007358: a1 0d 58 00 and r11,r8,r13 800735c: d0 0b 00 00 wcsr IE,r11 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007360: 29 44 00 08 lw r4,(r10+8) restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8007364: 5c 8a 00 04 bne r4,r10,8007374 <_Thread_queue_Enqueue_priority+0xf0> 8007368: e0 00 00 18 bi 80073c8 <_Thread_queue_Enqueue_priority+0x144> if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 800736c: 28 84 00 04 lw r4,(r4+4) restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8007370: 44 8a 00 16 be r4,r10,80073c8 <_Thread_queue_Enqueue_priority+0x144> search_priority = search_thread->current_priority; 8007374: 28 86 00 14 lw r6,(r4+20) if ( priority >= search_priority ) 8007378: 50 a6 00 14 bgeu r5,r6,80073c8 <_Thread_queue_Enqueue_priority+0x144> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 800737c: d0 08 00 00 wcsr IE,r8 8007380: d0 0b 00 00 wcsr IE,r11 8007384: 28 89 00 10 lw r9,(r4+16) 8007388: a0 e9 48 00 and r9,r7,r9 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 800738c: 5d 20 ff f8 bne r9,r0,800736c <_Thread_queue_Enqueue_priority+0xe8><== ALWAYS TAKEN _ISR_Enable( level ); 8007390: d0 08 00 00 wcsr IE,r8 <== NOT EXECUTED goto restart_reverse_search; 8007394: e3 ff ff ee bi 800734c <_Thread_queue_Enqueue_priority+0xc8><== NOT EXECUTED if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 8007398: 34 06 ff ff mvi r6,-1 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 800739c: 28 27 00 30 lw r7,(r1+48) 80073a0: 34 0a 00 01 mvi r10,1 80073a4: b9 00 48 00 mv r9,r8 80073a8: 44 ea 00 1b be r7,r10,8007414 <_Thread_queue_Enqueue_priority+0x190><== ALWAYS TAKEN * 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; 80073ac: 58 69 00 00 sw (r3+0),r9 <== NOT EXECUTED return the_thread_queue->sync_state; } 80073b0: b8 e0 08 00 mv r1,r7 80073b4: 2b 8b 00 0c lw r11,(sp+12) 80073b8: 2b 8c 00 08 lw r12,(sp+8) 80073bc: 2b 8d 00 04 lw r13,(sp+4) 80073c0: 37 9c 00 0c addi sp,sp,12 80073c4: c3 a0 00 00 ret } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 80073c8: 28 27 00 30 lw r7,(r1+48) 80073cc: 34 0a 00 01 mvi r10,1 80073d0: b9 00 48 00 mv r9,r8 80073d4: 5c ea ff f6 bne r7,r10,80073ac <_Thread_queue_Enqueue_priority+0x128><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 80073d8: 58 20 00 30 sw (r1+48),r0 if ( priority == search_priority ) 80073dc: 44 a6 00 1d be r5,r6,8007450 <_Thread_queue_Enqueue_priority+0x1cc> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 80073e0: 28 83 00 00 lw r3,(r4+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 80073e4: 58 44 00 04 sw (r2+4),r4 search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 80073e8: 58 43 00 00 sw (r2+0),r3 the_node->previous = search_node; search_node->next = the_node; 80073ec: 58 82 00 00 sw (r4+0),r2 next_node->previous = the_node; 80073f0: 58 62 00 04 sw (r3+4),r2 the_thread->Wait.queue = the_thread_queue; 80073f4: 58 41 00 44 sw (r2+68),r1 _ISR_Enable( level ); 80073f8: d0 08 00 00 wcsr IE,r8 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 80073fc: b8 e0 08 00 mv r1,r7 8007400: 2b 8b 00 0c lw r11,(sp+12) 8007404: 2b 8c 00 08 lw r12,(sp+8) 8007408: 2b 8d 00 04 lw r13,(sp+4) 800740c: 37 9c 00 0c addi sp,sp,12 8007410: c3 a0 00 00 ret if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8007414: 58 20 00 30 sw (r1+48),r0 if ( priority == search_priority ) 8007418: 44 a6 00 0e be r5,r6,8007450 <_Thread_queue_Enqueue_priority+0x1cc> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 800741c: 28 83 00 04 lw r3,(r4+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8007420: 58 44 00 00 sw (r2+0),r4 the_node->previous = previous_node; 8007424: 58 43 00 04 sw (r2+4),r3 previous_node->next = the_node; 8007428: 58 62 00 00 sw (r3+0),r2 search_node->previous = the_node; 800742c: 58 82 00 04 sw (r4+4),r2 the_thread->Wait.queue = the_thread_queue; 8007430: 58 41 00 44 sw (r2+68),r1 _ISR_Enable( level ); 8007434: d0 08 00 00 wcsr IE,r8 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007438: b8 e0 08 00 mv r1,r7 800743c: 2b 8b 00 0c lw r11,(sp+12) 8007440: 2b 8c 00 08 lw r12,(sp+8) 8007444: 2b 8d 00 04 lw r13,(sp+4) 8007448: 37 9c 00 0c addi sp,sp,12 800744c: c3 a0 00 00 ret _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 8007450: 28 83 00 40 lw r3,(r4+64) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 8007454: 34 85 00 3c addi r5,r4,60 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8007458: 58 45 00 00 sw (r2+0),r5 the_node->previous = previous_node; 800745c: 58 43 00 04 sw (r2+4),r3 previous_node->next = the_node; 8007460: 58 62 00 00 sw (r3+0),r2 search_node->previous = the_node; 8007464: 58 82 00 40 sw (r4+64),r2 the_thread->Wait.queue = the_thread_queue; 8007468: 58 41 00 44 sw (r2+68),r1 _ISR_Enable( level ); 800746c: d0 08 00 00 wcsr IE,r8 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8007470: 34 07 00 01 mvi r7,1 8007474: e3 ff ff cf bi 80073b0 <_Thread_queue_Enqueue_priority+0x12c> =============================================================================== 080071a8 <_Thread_queue_Enqueue_with_handler>: void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 80071a8: 37 9c ff e8 addi sp,sp,-24 80071ac: 5b 8b 00 14 sw (sp+20),r11 80071b0: 5b 8c 00 10 sw (sp+16),r12 80071b4: 5b 8d 00 0c sw (sp+12),r13 80071b8: 5b 8e 00 08 sw (sp+8),r14 80071bc: 5b 9d 00 04 sw (sp+4),ra Thread_queue_Control *, Thread_Control *, ISR_Level * ); the_thread = _Thread_Executing; 80071c0: 78 04 08 01 mvhi r4,0x801 80071c4: 38 84 ea 60 ori r4,r4,0xea60 80071c8: 28 8b 00 10 lw r11,(r4+16) void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 80071cc: b8 40 68 00 mv r13,r2 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 80071d0: 28 22 00 38 lw r2,(r1+56) void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 80071d4: b8 20 60 00 mv r12,r1 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 80071d8: b9 60 08 00 mv r1,r11 void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 80071dc: b8 60 70 00 mv r14,r3 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 80071e0: f8 00 01 18 calli 8007640 <_Thread_Set_state> /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { 80071e4: 5d a0 00 16 bne r13,r0,800723c <_Thread_queue_Enqueue_with_handler+0x94> } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 80071e8: 29 82 00 34 lw r2,(r12+52) enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; 80071ec: 78 04 08 00 mvhi r4,0x800 } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 80071f0: 34 01 00 01 mvi r1,1 enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; 80071f4: 38 84 a6 0c ori r4,r4,0xa60c } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 80071f8: 44 41 00 20 be r2,r1,8007278 <_Thread_queue_Enqueue_with_handler+0xd0> enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; sync_state = (*enqueue_p)( the_thread_queue, the_thread, &level ); 80071fc: b9 60 10 00 mv r2,r11 8007200: b9 80 08 00 mv r1,r12 8007204: 37 83 00 18 addi r3,sp,24 8007208: d8 80 00 00 call r4 if ( sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800720c: 34 02 00 01 mvi r2,1 8007210: 44 22 00 04 be r1,r2,8007220 <_Thread_queue_Enqueue_with_handler+0x78><== ALWAYS TAKEN _Thread_blocking_operation_Cancel( sync_state, the_thread, level ); 8007214: 2b 83 00 18 lw r3,(sp+24) <== NOT EXECUTED 8007218: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800721c: f8 00 0c 82 calli 800a424 <_Thread_blocking_operation_Cancel><== NOT EXECUTED } 8007220: 2b 9d 00 04 lw ra,(sp+4) 8007224: 2b 8b 00 14 lw r11,(sp+20) 8007228: 2b 8c 00 10 lw r12,(sp+16) 800722c: 2b 8d 00 0c lw r13,(sp+12) 8007230: 2b 8e 00 08 lw r14,(sp+8) 8007234: 37 9c 00 18 addi sp,sp,24 8007238: c3 a0 00 00 ret /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { _Watchdog_Initialize( 800723c: 29 61 00 08 lw r1,(r11+8) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8007240: 35 62 00 48 addi r2,r11,72 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8007244: 59 60 00 50 sw (r11+80),r0 the_watchdog->routine = routine; the_watchdog->id = id; 8007248: 59 61 00 68 sw (r11+104),r1 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800724c: 78 01 08 01 mvhi r1,0x801 8007250: 38 21 e9 78 ori r1,r1,0xe978 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8007254: 59 6e 00 64 sw (r11+100),r14 the_watchdog->id = id; the_watchdog->user_data = user_data; 8007258: 59 60 00 6c sw (r11+108),r0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800725c: 59 6d 00 54 sw (r11+84),r13 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8007260: f8 00 02 0e calli 8007a98 <_Watchdog_Insert> } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8007264: 29 82 00 34 lw r2,(r12+52) enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; 8007268: 78 04 08 00 mvhi r4,0x800 } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 800726c: 34 01 00 01 mvi r1,1 enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; 8007270: 38 84 a6 0c ori r4,r4,0xa60c } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8007274: 5c 41 ff e2 bne r2,r1,80071fc <_Thread_queue_Enqueue_with_handler+0x54> enqueue_p = _Thread_queue_Enqueue_priority; 8007278: 78 04 08 00 mvhi r4,0x800 800727c: 38 84 72 84 ori r4,r4,0x7284 8007280: e3 ff ff df bi 80071fc <_Thread_queue_Enqueue_with_handler+0x54> =============================================================================== 0800a798 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 800a798: 37 9c ff fc addi sp,sp,-4 800a79c: 5b 9d 00 04 sw (sp+4),ra Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 800a7a0: 28 23 00 44 lw r3,(r1+68) #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 800a7a4: b8 20 20 00 mv r4,r1 * 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 && 800a7a8: 28 62 00 30 lw r2,(r3+48) 800a7ac: 44 40 00 05 be r2,r0,800a7c0 <_Thread_queue_Process_timeout+0x28><== ALWAYS TAKEN RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800a7b0: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 800a7b4: 38 21 ea 60 ori r1,r1,0xea60 <== NOT EXECUTED 800a7b8: 28 21 00 10 lw r1,(r1+16) <== NOT EXECUTED 800a7bc: 44 81 00 09 be r4,r1,800a7e0 <_Thread_queue_Process_timeout+0x48><== NOT EXECUTED if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800a7c0: 28 65 00 3c lw r5,(r3+60) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 800a7c4: b8 60 08 00 mv r1,r3 800a7c8: b8 80 10 00 mv r2,r4 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800a7cc: 58 85 00 34 sw (r4+52),r5 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 800a7d0: fb ff ff a4 calli 800a660 <_Thread_queue_Extract> } } 800a7d4: 2b 9d 00 04 lw ra,(sp+4) 800a7d8: 37 9c 00 04 addi sp,sp,4 800a7dc: c3 a0 00 00 ret * a timeout is not allowed to occur. */ 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 ) { 800a7e0: 34 01 00 03 mvi r1,3 <== NOT EXECUTED 800a7e4: 44 41 ff fc be r2,r1,800a7d4 <_Thread_queue_Process_timeout+0x3c><== NOT EXECUTED the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800a7e8: 28 61 00 3c lw r1,(r3+60) <== NOT EXECUTED 800a7ec: 58 81 00 34 sw (r4+52),r1 <== NOT EXECUTED the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800a7f0: 34 01 00 02 mvi r1,2 <== NOT EXECUTED 800a7f4: 58 61 00 30 sw (r3+48),r1 <== NOT EXECUTED 800a7f8: e3 ff ff f7 bi 800a7d4 <_Thread_queue_Process_timeout+0x3c><== NOT EXECUTED =============================================================================== 08007524 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 8007524: 37 9c ff ec addi sp,sp,-20 8007528: 5b 8b 00 10 sw (sp+16),r11 800752c: 5b 8c 00 0c sw (sp+12),r12 8007530: 5b 8d 00 08 sw (sp+8),r13 8007534: 5b 9d 00 04 sw (sp+4),ra 8007538: b8 20 58 00 mv r11,r1 800753c: b8 40 60 00 mv r12,r2 /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 8007540: 44 20 00 04 be r1,r0,8007550 <_Thread_queue_Requeue+0x2c> <== NEVER TAKEN /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 8007544: 28 22 00 34 lw r2,(r1+52) 8007548: 34 01 00 01 mvi r1,1 800754c: 44 41 00 07 be r2,r1,8007568 <_Thread_queue_Requeue+0x44> <== ALWAYS TAKEN _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } 8007550: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8007554: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED 8007558: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED 800755c: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED 8007560: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED 8007564: c3 a0 00 00 ret <== NOT EXECUTED if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 8007568: 90 00 68 00 rcsr r13,IE 800756c: 34 01 ff fe mvi r1,-2 8007570: a1 a1 08 00 and r1,r13,r1 8007574: d0 01 00 00 wcsr IE,r1 8007578: 78 03 08 01 mvhi r3,0x801 800757c: 38 63 c3 30 ori r3,r3,0xc330 8007580: 29 82 00 10 lw r2,(r12+16) 8007584: 28 61 00 00 lw r1,(r3+0) 8007588: a0 41 08 00 and r1,r2,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 800758c: 5c 20 00 08 bne r1,r0,80075ac <_Thread_queue_Requeue+0x88> <== ALWAYS TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); 8007590: d0 0d 00 00 wcsr IE,r13 <== NOT EXECUTED } } 8007594: 2b 9d 00 04 lw ra,(sp+4) 8007598: 2b 8b 00 10 lw r11,(sp+16) 800759c: 2b 8c 00 0c lw r12,(sp+12) 80075a0: 2b 8d 00 08 lw r13,(sp+8) 80075a4: 37 9c 00 14 addi sp,sp,20 80075a8: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 80075ac: 34 01 00 01 mvi r1,1 80075b0: 59 61 00 30 sw (r11+48),r1 ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 80075b4: b9 80 10 00 mv r2,r12 80075b8: b9 60 08 00 mv r1,r11 80075bc: 34 03 00 01 mvi r3,1 80075c0: f8 00 0c 36 calli 800a698 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 80075c4: b9 60 08 00 mv r1,r11 80075c8: b9 80 10 00 mv r2,r12 80075cc: 37 83 00 14 addi r3,sp,20 80075d0: fb ff ff 2d calli 8007284 <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 80075d4: d0 0d 00 00 wcsr IE,r13 80075d8: e3 ff ff ef bi 8007594 <_Thread_queue_Requeue+0x70> =============================================================================== 080075dc <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 80075dc: 37 9c ff f8 addi sp,sp,-8 80075e0: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 80075e4: 37 82 00 08 addi r2,sp,8 80075e8: fb ff fd 87 calli 8006c04 <_Thread_Get> switch ( location ) { 80075ec: 2b 82 00 08 lw r2,(sp+8) 80075f0: 5c 40 00 07 bne r2,r0,800760c <_Thread_queue_Timeout+0x30> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 80075f4: f8 00 0c 69 calli 800a798 <_Thread_queue_Process_timeout> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 80075f8: 78 01 08 01 mvhi r1,0x801 80075fc: 38 21 e8 e0 ori r1,r1,0xe8e0 8007600: 28 22 00 00 lw r2,(r1+0) --level; 8007604: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 8007608: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 800760c: 2b 9d 00 04 lw ra,(sp+4) 8007610: 37 9c 00 08 addi sp,sp,8 8007614: c3 a0 00 00 ret =============================================================================== 080159cc <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 80159cc: 37 9c ff a4 addi sp,sp,-92 80159d0: 5b 8b 00 44 sw (sp+68),r11 80159d4: 5b 8c 00 40 sw (sp+64),r12 80159d8: 5b 8d 00 3c sw (sp+60),r13 80159dc: 5b 8e 00 38 sw (sp+56),r14 80159e0: 5b 8f 00 34 sw (sp+52),r15 80159e4: 5b 90 00 30 sw (sp+48),r16 80159e8: 5b 91 00 2c sw (sp+44),r17 80159ec: 5b 92 00 28 sw (sp+40),r18 80159f0: 5b 93 00 24 sw (sp+36),r19 80159f4: 5b 94 00 20 sw (sp+32),r20 80159f8: 5b 95 00 1c sw (sp+28),r21 80159fc: 5b 96 00 18 sw (sp+24),r22 8015a00: 5b 97 00 14 sw (sp+20),r23 8015a04: 5b 98 00 10 sw (sp+16),r24 8015a08: 5b 99 00 0c sw (sp+12),r25 8015a0c: 5b 9b 00 08 sw (sp+8),fp 8015a10: 5b 9d 00 04 sw (sp+4),ra 8015a14: 78 13 08 03 mvhi r19,0x803 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8015a18: 37 96 00 54 addi r22,sp,84 8015a1c: 37 95 00 58 addi r21,sp,88 8015a20: 37 8f 00 48 addi r15,sp,72 8015a24: 37 94 00 4c addi r20,sp,76 8015a28: 78 0e 08 03 mvhi r14,0x803 8015a2c: 78 17 08 03 mvhi r23,0x803 8015a30: b8 20 58 00 mv r11,r1 8015a34: 5b 95 00 54 sw (sp+84),r21 head->previous = NULL; 8015a38: 5b 80 00 58 sw (sp+88),r0 tail->previous = head; 8015a3c: 5b 96 00 5c sw (sp+92),r22 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8015a40: 5b 94 00 48 sw (sp+72),r20 head->previous = NULL; 8015a44: 5b 80 00 4c sw (sp+76),r0 tail->previous = head; 8015a48: 5b 8f 00 50 sw (sp+80),r15 8015a4c: 3a 73 dd b8 ori r19,r19,0xddb8 8015a50: 34 31 00 30 addi r17,r1,48 8015a54: 39 ce dc 50 ori r14,r14,0xdc50 8015a58: 34 30 00 68 addi r16,r1,104 8015a5c: 3a f7 dc d0 ori r23,r23,0xdcd0 8015a60: 34 3b 00 08 addi fp,r1,8 8015a64: 34 39 00 40 addi r25,r1,64 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 ) { 8015a68: 34 0d 00 03 mvi r13,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 ); 8015a6c: 34 12 ff fe mvi r18,-2 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 8015a70: 34 18 00 01 mvi r24,1 { /* * 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; 8015a74: 59 76 00 78 sw (r11+120),r22 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8015a78: 2a 64 00 00 lw r4,(r19+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 8015a7c: 29 62 00 3c lw r2,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8015a80: ba 20 08 00 mv r1,r17 8015a84: b9 e0 18 00 mv r3,r15 8015a88: c8 82 10 00 sub r2,r4,r2 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 8015a8c: 59 64 00 3c sw (r11+60),r4 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8015a90: f8 00 14 cc calli 801adc0 <_Watchdog_Adjust_to_chain> 8015a94: 78 03 08 03 mvhi r3,0x803 8015a98: 38 63 75 fc ori r3,r3,0x75fc 8015a9c: 28 64 00 00 lw r4,(r3+0) 8015aa0: 29 c1 00 00 lw r1,(r14+0) 8015aa4: 29 c2 00 04 lw r2,(r14+4) 8015aa8: 34 03 00 00 mvi r3,0 8015aac: f8 00 51 b1 calli 802a170 <__divdi3> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 8015ab0: 29 64 00 74 lw r4,(r11+116) 8015ab4: b8 40 60 00 mv r12,r2 /* * 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 ) { 8015ab8: 50 82 00 1c bgeu r4,r2,8015b28 <_Timer_server_Body+0x15c> /* * 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 ); 8015abc: ba 00 08 00 mv r1,r16 8015ac0: c8 44 10 00 sub r2,r2,r4 8015ac4: b9 e0 18 00 mv r3,r15 8015ac8: f8 00 14 be calli 801adc0 <_Watchdog_Adjust_to_chain> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 8015acc: 59 6c 00 74 sw (r11+116),r12 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015ad0: 34 0c 00 01 mvi r12,1 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8015ad4: 29 61 00 78 lw r1,(r11+120) 8015ad8: f8 00 03 46 calli 80167f0 <_Chain_Get> 8015adc: b8 20 10 00 mv r2,r1 if ( timer == NULL ) { 8015ae0: 44 20 00 0b be r1,r0,8015b0c <_Timer_server_Body+0x140> <== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015ae4: 28 24 00 38 lw r4,(r1+56) <== NOT EXECUTED 8015ae8: 44 8c 00 16 be r4,r12,8015b40 <_Timer_server_Body+0x174> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8015aec: 5c 8d ff fa bne r4,r13,8015ad4 <_Timer_server_Body+0x108> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8015af0: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED 8015af4: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 8015af8: f8 00 14 d6 calli 801ae50 <_Watchdog_Insert> <== NOT EXECUTED } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8015afc: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED 8015b00: f8 00 03 3c calli 80167f0 <_Chain_Get> <== NOT EXECUTED 8015b04: b8 20 10 00 mv r2,r1 <== NOT EXECUTED if ( timer == NULL ) { 8015b08: 5c 20 ff f7 bne r1,r0,8015ae4 <_Timer_server_Body+0x118> <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 8015b0c: 90 00 10 00 rcsr r2,IE 8015b10: a0 52 18 00 and r3,r2,r18 8015b14: d0 03 00 00 wcsr IE,r3 if ( _Chain_Is_empty( insert_chain ) ) { 8015b18: 2b 83 00 54 lw r3,(sp+84) 8015b1c: 44 75 00 0d be r3,r21,8015b50 <_Timer_server_Body+0x184> <== ALWAYS TAKEN ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 8015b20: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED 8015b24: e3 ff ff d5 bi 8015a78 <_Timer_server_Body+0xac> <== NOT EXECUTED * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 8015b28: 50 44 ff e9 bgeu r2,r4,8015acc <_Timer_server_Body+0x100> /* * 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 ); 8015b2c: ba 00 08 00 mv r1,r16 8015b30: 34 02 00 01 mvi r2,1 8015b34: c8 8c 18 00 sub r3,r4,r12 8015b38: f8 00 14 64 calli 801acc8 <_Watchdog_Adjust> 8015b3c: e3 ff ff e4 bi 8015acc <_Timer_server_Body+0x100> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8015b40: ba 20 08 00 mv r1,r17 <== NOT EXECUTED 8015b44: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED 8015b48: f8 00 14 c2 calli 801ae50 <_Watchdog_Insert> <== NOT EXECUTED 8015b4c: e3 ff ff e2 bi 8015ad4 <_Timer_server_Body+0x108> <== NOT EXECUTED */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 8015b50: 59 60 00 78 sw (r11+120),r0 _ISR_Enable( level ); 8015b54: 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 ) ) { 8015b58: 2b 82 00 48 lw r2,(sp+72) 8015b5c: 5c 54 00 0b bne r2,r20,8015b88 <_Timer_server_Body+0x1bc> 8015b60: e0 00 00 11 bi 8015ba4 <_Timer_server_Body+0x1d8> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 8015b64: 28 43 00 00 lw r3,(r2+0) head->next = new_first; new_first->previous = head; 8015b68: 58 6f 00 04 sw (r3+4),r15 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 8015b6c: 5b 83 00 48 sw (sp+72),r3 * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 8015b70: 58 40 00 08 sw (r2+8),r0 _ISR_Enable( level ); 8015b74: d0 04 00 00 wcsr IE,r4 /* * 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 ); 8015b78: 28 43 00 1c lw r3,(r2+28) 8015b7c: 28 41 00 20 lw r1,(r2+32) 8015b80: 28 42 00 24 lw r2,(r2+36) 8015b84: d8 60 00 00 call r3 /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 8015b88: 90 00 20 00 rcsr r4,IE 8015b8c: a0 92 10 00 and r2,r4,r18 8015b90: d0 02 00 00 wcsr IE,r2 initialized = false; } #endif return status; } 8015b94: 2b 82 00 48 lw r2,(sp+72) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 8015b98: 5c 54 ff f3 bne r2,r20,8015b64 <_Timer_server_Body+0x198> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 8015b9c: d0 04 00 00 wcsr IE,r4 8015ba0: e3 ff ff b5 bi 8015a74 <_Timer_server_Body+0xa8> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 8015ba4: 31 60 00 7c sb (r11+124),r0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8015ba8: 2a e1 00 00 lw r1,(r23+0) ++level; 8015bac: 34 21 00 01 addi r1,r1,1 _Thread_Dispatch_disable_level = level; 8015bb0: 5a e1 00 00 sw (r23+0),r1 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 8015bb4: 29 61 00 00 lw r1,(r11+0) 8015bb8: 34 02 00 08 mvi r2,8 8015bbc: f8 00 13 2d calli 801a870 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 8015bc0: b9 60 08 00 mv r1,r11 8015bc4: fb ff ff 40 calli 80158c4 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 8015bc8: b9 60 08 00 mv r1,r11 8015bcc: fb ff ff 5f calli 8015948 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 8015bd0: f8 00 10 5a calli 8019d38 <_Thread_Enable_dispatch> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8015bd4: bb 60 08 00 mv r1,fp _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 8015bd8: 31 78 00 7c sb (r11+124),r24 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8015bdc: f8 00 15 03 calli 801afe8 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8015be0: bb 20 08 00 mv r1,r25 8015be4: f8 00 15 01 calli 801afe8 <_Watchdog_Remove> 8015be8: e3 ff ff a3 bi 8015a74 <_Timer_server_Body+0xa8> =============================================================================== 08015bec <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8015bec: 37 9c ff f0 addi sp,sp,-16 8015bf0: 5b 8b 00 10 sw (sp+16),r11 8015bf4: 5b 8c 00 0c sw (sp+12),r12 8015bf8: 5b 8d 00 08 sw (sp+8),r13 8015bfc: 5b 9d 00 04 sw (sp+4),ra 8015c00: b8 20 58 00 mv r11,r1 if ( ts->insert_chain == NULL ) { 8015c04: 28 21 00 78 lw r1,(r1+120) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8015c08: b8 40 60 00 mv r12,r2 if ( ts->insert_chain == NULL ) { 8015c0c: 44 20 00 09 be r1,r0,8015c30 <_Timer_server_Schedule_operation_method+0x44><== ALWAYS TAKEN * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 8015c10: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED 8015c14: f8 00 02 eb calli 80167c0 <_Chain_Append> <== NOT EXECUTED } } 8015c18: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8015c1c: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED 8015c20: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED 8015c24: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED 8015c28: 37 9c 00 10 addi sp,sp,16 <== NOT EXECUTED 8015c2c: c3 a0 00 00 ret <== NOT EXECUTED * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8015c30: 78 01 08 03 mvhi r1,0x803 8015c34: 38 21 dc d0 ori r1,r1,0xdcd0 8015c38: 28 22 00 00 lw r2,(r1+0) ++level; 8015c3c: 34 42 00 01 addi r2,r2,1 _Thread_Dispatch_disable_level = level; 8015c40: 58 22 00 00 sw (r1+0),r2 * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015c44: 29 81 00 38 lw r1,(r12+56) 8015c48: 34 02 00 01 mvi r2,1 8015c4c: 44 22 00 30 be r1,r2,8015d0c <_Timer_server_Schedule_operation_method+0x120> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); if ( !ts->active ) { _Timer_server_Reset_interval_system_watchdog( ts ); } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8015c50: 34 02 00 03 mvi r2,3 8015c54: 44 22 00 08 be r1,r2,8015c74 <_Timer_server_Schedule_operation_method+0x88> if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 8015c58: f8 00 10 38 calli 8019d38 <_Thread_Enable_dispatch> * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); } } 8015c5c: 2b 9d 00 04 lw ra,(sp+4) 8015c60: 2b 8b 00 10 lw r11,(sp+16) 8015c64: 2b 8c 00 0c lw r12,(sp+12) 8015c68: 2b 8d 00 08 lw r13,(sp+8) 8015c6c: 37 9c 00 10 addi sp,sp,16 8015c70: c3 a0 00 00 ret } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8015c74: 90 00 68 00 rcsr r13,IE 8015c78: 34 01 ff fe mvi r1,-2 8015c7c: a1 a1 08 00 and r1,r13,r1 8015c80: d0 01 00 00 wcsr IE,r1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8015c84: 78 02 08 03 mvhi r2,0x803 8015c88: 78 03 08 03 mvhi r3,0x803 8015c8c: 38 42 dc 50 ori r2,r2,0xdc50 8015c90: 38 63 75 fc ori r3,r3,0x75fc 8015c94: 28 64 00 00 lw r4,(r3+0) 8015c98: 28 41 00 00 lw r1,(r2+0) 8015c9c: 28 42 00 04 lw r2,(r2+4) 8015ca0: 34 03 00 00 mvi r3,0 8015ca4: f8 00 51 33 calli 802a170 <__divdi3> initialized = false; } #endif return status; } 8015ca8: 29 61 00 68 lw r1,(r11+104) * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 8015cac: 29 63 00 74 lw r3,(r11+116) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8015cb0: 35 64 00 6c addi r4,r11,108 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 8015cb4: 44 24 00 0a be r1,r4,8015cdc <_Timer_server_Schedule_operation_method+0xf0> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 8015cb8: 28 25 00 10 lw r5,(r1+16) } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 8015cbc: b4 a3 20 00 add r4,r5,r3 delta_interval += delta; 8015cc0: c8 82 20 00 sub r4,r4,r2 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 8015cc4: 50 62 00 05 bgeu r3,r2,8015cd8 <_Timer_server_Schedule_operation_method+0xec> /* * We advanced in time. */ delta = snapshot - last_snapshot; 8015cc8: c8 43 18 00 sub r3,r2,r3 if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8015ccc: 34 04 00 00 mvi r4,0 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 8015cd0: 50 65 00 02 bgeu r3,r5,8015cd8 <_Timer_server_Schedule_operation_method+0xec><== NEVER TAKEN delta_interval -= delta; 8015cd4: c8 a3 20 00 sub r4,r5,r3 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 8015cd8: 58 24 00 10 sw (r1+16),r4 } ts->TOD_watchdogs.last_snapshot = snapshot; 8015cdc: 59 62 00 74 sw (r11+116),r2 _ISR_Enable( level ); 8015ce0: d0 0d 00 00 wcsr IE,r13 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8015ce4: 35 61 00 68 addi r1,r11,104 8015ce8: 35 82 00 10 addi r2,r12,16 8015cec: f8 00 14 59 calli 801ae50 <_Watchdog_Insert> if ( !ts->active ) { 8015cf0: 41 61 00 7c lbu r1,(r11+124) 8015cf4: 20 21 00 ff andi r1,r1,0xff 8015cf8: 5c 20 ff d8 bne r1,r0,8015c58 <_Timer_server_Schedule_operation_method+0x6c><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); 8015cfc: b9 60 08 00 mv r1,r11 8015d00: fb ff ff 12 calli 8015948 <_Timer_server_Reset_tod_system_watchdog> } } _Thread_Enable_dispatch(); 8015d04: f8 00 10 0d calli 8019d38 <_Thread_Enable_dispatch> 8015d08: e3 ff ff d5 bi 8015c5c <_Timer_server_Schedule_operation_method+0x70> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8015d0c: 90 00 18 00 rcsr r3,IE 8015d10: 34 01 ff fe mvi r1,-2 8015d14: a0 61 08 00 and r1,r3,r1 8015d18: d0 01 00 00 wcsr IE,r1 snapshot = _Watchdog_Ticks_since_boot; 8015d1c: 78 01 08 03 mvhi r1,0x803 8015d20: 38 21 dd b8 ori r1,r1,0xddb8 initialized = false; } #endif return status; } 8015d24: 29 62 00 30 lw r2,(r11+48) /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = _Watchdog_Ticks_since_boot; 8015d28: 28 21 00 00 lw r1,(r1+0) last_snapshot = ts->Interval_watchdogs.last_snapshot; 8015d2c: 29 65 00 3c lw r5,(r11+60) 8015d30: 35 64 00 34 addi r4,r11,52 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 8015d34: 44 44 00 07 be r2,r4,8015d50 <_Timer_server_Schedule_operation_method+0x164> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 8015d38: 28 46 00 10 lw r6,(r2+16) first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 8015d3c: c8 25 28 00 sub r5,r1,r5 delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8015d40: 34 04 00 00 mvi r4,0 * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 8015d44: 50 a6 00 02 bgeu r5,r6,8015d4c <_Timer_server_Schedule_operation_method+0x160> delta_interval -= delta; 8015d48: c8 c5 20 00 sub r4,r6,r5 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 8015d4c: 58 44 00 10 sw (r2+16),r4 } ts->Interval_watchdogs.last_snapshot = snapshot; 8015d50: 59 61 00 3c sw (r11+60),r1 _ISR_Enable( level ); 8015d54: d0 03 00 00 wcsr IE,r3 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8015d58: 35 61 00 30 addi r1,r11,48 8015d5c: 35 82 00 10 addi r2,r12,16 8015d60: f8 00 14 3c calli 801ae50 <_Watchdog_Insert> if ( !ts->active ) { 8015d64: 41 61 00 7c lbu r1,(r11+124) 8015d68: 20 21 00 ff andi r1,r1,0xff 8015d6c: 5c 20 ff bb bne r1,r0,8015c58 <_Timer_server_Schedule_operation_method+0x6c> _Timer_server_Reset_interval_system_watchdog( ts ); 8015d70: b9 60 08 00 mv r1,r11 8015d74: fb ff fe d4 calli 80158c4 <_Timer_server_Reset_interval_system_watchdog> if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 8015d78: f8 00 0f f0 calli 8019d38 <_Thread_Enable_dispatch> 8015d7c: e3 ff ff b8 bi 8015c5c <_Timer_server_Schedule_operation_method+0x70> =============================================================================== 08007854 <_Timespec_Add_to>: uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { 8007854: b8 20 20 00 mv r4,r1 uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 8007858: 28 83 00 00 lw r3,(r4+0) uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { uint32_t seconds = add->tv_sec; 800785c: 28 41 00 00 lw r1,(r2+0) /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; 8007860: 28 86 00 04 lw r6,(r4+4) 8007864: 28 42 00 04 lw r2,(r2+4) /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8007868: 78 07 08 01 mvhi r7,0x801 800786c: 38 e7 42 e0 ori r7,r7,0x42e0 8007870: 28 e5 00 00 lw r5,(r7+0) ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 8007874: b4 61 18 00 add r3,r3,r1 time->tv_nsec += add->tv_nsec; 8007878: b4 46 10 00 add r2,r2,r6 ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 800787c: 58 83 00 00 sw (r4+0),r3 time->tv_nsec += add->tv_nsec; 8007880: 58 82 00 04 sw (r4+4),r2 /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8007884: 50 a2 00 0a bgeu r5,r2,80078ac <_Timespec_Add_to+0x58> time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 8007888: 78 07 08 01 mvhi r7,0x801 800788c: 38 e7 42 e4 ori r7,r7,0x42e4 8007890: 28 e6 00 00 lw r6,(r7+0) 8007894: b4 46 10 00 add r2,r2,r6 #include #include #include #include uint32_t _Timespec_Add_to( 8007898: 34 63 00 01 addi r3,r3,1 /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; time->tv_sec++; seconds++; 800789c: 34 21 00 01 addi r1,r1,1 /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 80078a0: 54 45 ff fd bgu r2,r5,8007894 <_Timespec_Add_to+0x40> <== NEVER TAKEN 80078a4: 58 82 00 04 sw (r4+4),r2 80078a8: 58 83 00 00 sw (r4+0),r3 time->tv_sec++; seconds++; } return seconds; } 80078ac: c3 a0 00 00 ret =============================================================================== 08007a4c <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 8007a4c: 37 9c ff f8 addi sp,sp,-8 8007a50: 5b 9d 00 04 sw (sp+4),ra uint32_t number_of_initial_extensions = 8007a54: 78 01 08 01 mvhi r1,0x801 8007a58: 38 21 b9 9c ori r1,r1,0xb99c 8007a5c: 28 21 00 40 lw r1,(r1+64) rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 8007a60: 44 20 00 0b be r1,r0,8007a8c <_User_extensions_Handler_initialization+0x40><== NEVER TAKEN User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) 8007a64: b4 21 10 00 add r2,r1,r1 8007a68: b4 41 08 00 add r1,r2,r1 8007a6c: b4 21 08 00 add r1,r1,r1 8007a70: b4 21 08 00 add r1,r1,r1 uint32_t number_of_initial_extensions = rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( 8007a74: f8 00 01 50 calli 8007fb4 <_Workspace_Allocate_or_fatal_error> number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 8007a78: 78 02 08 00 mvhi r2,0x800 User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; 8007a7c: 5b 81 00 08 sw (sp+8),r1 _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 8007a80: 38 42 7a 0c ori r2,r2,0x7a0c 8007a84: 37 81 00 08 addi r1,sp,8 8007a88: fb ff ff b0 calli 8007948 <_User_extensions_Iterate> } } 8007a8c: 2b 9d 00 04 lw ra,(sp+4) 8007a90: 37 9c 00 08 addi sp,sp,8 8007a94: c3 a0 00 00 ret =============================================================================== 08007948 <_User_extensions_Iterate>: void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { 8007948: 37 9c ff e8 addi sp,sp,-24 800794c: 5b 8b 00 18 sw (sp+24),r11 8007950: 5b 8c 00 14 sw (sp+20),r12 8007954: 5b 8d 00 10 sw (sp+16),r13 8007958: 5b 8e 00 0c sw (sp+12),r14 800795c: 5b 8f 00 08 sw (sp+8),r15 8007960: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = 8007964: 78 04 08 01 mvhi r4,0x801 8007968: 38 84 b9 9c ori r4,r4,0xb99c rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); 800796c: 28 83 00 40 lw r3,(r4+64) void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = 8007970: 28 8b 00 44 lw r11,(r4+68) void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; 8007974: 78 04 08 01 mvhi r4,0x801 const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); 8007978: b4 63 18 00 add r3,r3,r3 800797c: b4 63 18 00 add r3,r3,r3 8007980: b4 63 18 00 add r3,r3,r3 8007984: b4 63 18 00 add r3,r3,r3 8007988: b4 63 18 00 add r3,r3,r3 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; 800798c: 38 84 ea 60 ori r4,r4,0xea60 const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = 8007990: b5 63 78 00 add r15,r11,r3 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { 8007994: b8 20 68 00 mv r13,r1 8007998: b8 40 70 00 mv r14,r2 Thread_Control *executing = _Thread_Executing; 800799c: 28 8c 00 10 lw r12,(r4+16) const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { 80079a0: 45 6f 00 07 be r11,r15,80079bc <_User_extensions_Iterate+0x74><== NEVER TAKEN (*visitor)( executing, arg, callouts_current ); 80079a4: b9 60 18 00 mv r3,r11 80079a8: b9 80 08 00 mv r1,r12 ++callouts_current; 80079ac: 35 6b 00 20 addi r11,r11,32 callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { (*visitor)( executing, arg, callouts_current ); 80079b0: b9 a0 10 00 mv r2,r13 80079b4: d9 c0 00 00 call r14 const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { 80079b8: 5d eb ff fb bne r15,r11,80079a4 <_User_extensions_Iterate+0x5c> (*visitor)( executing, arg, &extension->Callouts ); node = _Chain_Immutable_next( node ); } } 80079bc: 78 01 08 01 mvhi r1,0x801 80079c0: 38 21 e1 94 ori r1,r1,0xe194 80079c4: 28 2b 00 00 lw r11,(r1+0) ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { 80079c8: 78 0f 08 01 mvhi r15,0x801 80079cc: 39 ef e1 98 ori r15,r15,0xe198 80079d0: 45 6f 00 07 be r11,r15,80079ec <_User_extensions_Iterate+0xa4> const User_extensions_Control *extension = (const User_extensions_Control *) node; (*visitor)( executing, arg, &extension->Callouts ); 80079d4: 35 63 00 14 addi r3,r11,20 80079d8: b9 80 08 00 mv r1,r12 80079dc: b9 a0 10 00 mv r2,r13 80079e0: d9 c0 00 00 call r14 node = _Chain_Immutable_next( node ); } } 80079e4: 29 6b 00 00 lw r11,(r11+0) ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { 80079e8: 5d 6f ff fb bne r11,r15,80079d4 <_User_extensions_Iterate+0x8c> (*visitor)( executing, arg, &extension->Callouts ); node = _Chain_Immutable_next( node ); } } 80079ec: 2b 9d 00 04 lw ra,(sp+4) 80079f0: 2b 8b 00 18 lw r11,(sp+24) 80079f4: 2b 8c 00 14 lw r12,(sp+20) 80079f8: 2b 8d 00 10 lw r13,(sp+16) 80079fc: 2b 8e 00 0c lw r14,(sp+12) 8007a00: 2b 8f 00 08 lw r15,(sp+8) 8007a04: 37 9c 00 18 addi sp,sp,24 8007a08: c3 a0 00 00 ret =============================================================================== 080099b8 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 80099b8: 37 9c ff e4 addi sp,sp,-28 80099bc: 5b 8b 00 1c sw (sp+28),r11 80099c0: 5b 8c 00 18 sw (sp+24),r12 80099c4: 5b 8d 00 14 sw (sp+20),r13 80099c8: 5b 8e 00 10 sw (sp+16),r14 80099cc: 5b 8f 00 0c sw (sp+12),r15 80099d0: 5b 90 00 08 sw (sp+8),r16 80099d4: 5b 9d 00 04 sw (sp+4),ra 80099d8: b8 20 60 00 mv r12,r1 80099dc: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 80099e0: 90 00 18 00 rcsr r3,IE 80099e4: 34 01 ff fe mvi r1,-2 80099e8: a0 61 08 00 and r1,r3,r1 80099ec: d0 01 00 00 wcsr IE,r1 } } _ISR_Enable( level ); } 80099f0: 29 81 00 00 lw r1,(r12+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 80099f4: 35 8e 00 04 addi r14,r12,4 Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 80099f8: b8 60 20 00 mv r4,r3 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 80099fc: 44 2e 00 04 be r1,r14,8009a0c <_Watchdog_Adjust+0x54> switch ( direction ) { 8009a00: 44 40 00 11 be r2,r0,8009a44 <_Watchdog_Adjust+0x8c> 8009a04: 34 03 00 01 mvi r3,1 8009a08: 44 43 00 0b be r2,r3,8009a34 <_Watchdog_Adjust+0x7c> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 8009a0c: d0 04 00 00 wcsr IE,r4 } 8009a10: 2b 9d 00 04 lw ra,(sp+4) 8009a14: 2b 8b 00 1c lw r11,(sp+28) 8009a18: 2b 8c 00 18 lw r12,(sp+24) 8009a1c: 2b 8d 00 14 lw r13,(sp+20) 8009a20: 2b 8e 00 10 lw r14,(sp+16) 8009a24: 2b 8f 00 0c lw r15,(sp+12) 8009a28: 2b 90 00 08 lw r16,(sp+8) 8009a2c: 37 9c 00 1c addi sp,sp,28 8009a30: c3 a0 00 00 ret * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 8009a34: 28 22 00 10 lw r2,(r1+16) 8009a38: b4 4b 58 00 add r11,r2,r11 8009a3c: 58 2b 00 10 sw (r1+16),r11 break; 8009a40: e3 ff ff f3 bi 8009a0c <_Watchdog_Adjust+0x54> case WATCHDOG_FORWARD: while ( units ) { 8009a44: b8 60 20 00 mv r4,r3 8009a48: 45 62 ff f1 be r11,r2,8009a0c <_Watchdog_Adjust+0x54> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 8009a4c: 28 2d 00 10 lw r13,(r1+16) 8009a50: 55 ab 00 13 bgu r13,r11,8009a9c <_Watchdog_Adjust+0xe4> <== NEVER TAKEN _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 8009a54: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009a58: 34 0f ff fe mvi r15,-2 if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 8009a5c: 58 30 00 10 sw (r1+16),r16 _ISR_Enable( level ); 8009a60: d0 03 00 00 wcsr IE,r3 _Watchdog_Tickle( header ); 8009a64: b9 80 08 00 mv r1,r12 8009a68: f8 00 00 ad calli 8009d1c <_Watchdog_Tickle> _ISR_Disable( level ); 8009a6c: 90 00 10 00 rcsr r2,IE 8009a70: a0 4f 08 00 and r1,r2,r15 8009a74: d0 01 00 00 wcsr IE,r1 } } _ISR_Enable( level ); } 8009a78: 29 84 00 00 lw r4,(r12+0) while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 8009a7c: c9 6d 58 00 sub r11,r11,r13 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009a80: b8 40 18 00 mv r3,r2 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 8009a84: b8 80 08 00 mv r1,r4 if ( _Chain_Is_empty( header ) ) 8009a88: 45 c4 00 08 be r14,r4,8009aa8 <_Watchdog_Adjust+0xf0> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 8009a8c: 45 60 00 07 be r11,r0,8009aa8 <_Watchdog_Adjust+0xf0> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 8009a90: 28 2d 00 10 lw r13,(r1+16) 8009a94: 51 6d ff f2 bgeu r11,r13,8009a5c <_Watchdog_Adjust+0xa4> _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009a98: b8 40 20 00 mv r4,r2 _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; 8009a9c: c9 ab 58 00 sub r11,r13,r11 8009aa0: 58 2b 00 10 sw (r1+16),r11 break; 8009aa4: e3 ff ff da bi 8009a0c <_Watchdog_Adjust+0x54> _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009aa8: b8 40 20 00 mv r4,r2 8009aac: e3 ff ff d8 bi 8009a0c <_Watchdog_Adjust+0x54> =============================================================================== 08007a98 <_Watchdog_Insert>: void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 8007a98: 37 9c ff f8 addi sp,sp,-8 8007a9c: 5b 8b 00 08 sw (sp+8),r11 8007aa0: 5b 8c 00 04 sw (sp+4),r12 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 8007aa4: 78 03 08 01 mvhi r3,0x801 8007aa8: 38 63 ea 60 ori r3,r3,0xea60 8007aac: 28 69 00 08 lw r9,(r3+8) _ISR_Disable( level ); 8007ab0: 90 00 30 00 rcsr r6,IE 8007ab4: 34 08 ff fe mvi r8,-2 8007ab8: a0 c8 40 00 and r8,r6,r8 8007abc: d0 08 00 00 wcsr IE,r8 /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_watchdog->state != WATCHDOG_INACTIVE ) { 8007ac0: 28 43 00 08 lw r3,(r2+8) 8007ac4: 5c 60 00 32 bne r3,r0,8007b8c <_Watchdog_Insert+0xf4> _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 8007ac8: 78 0c 08 01 mvhi r12,0x801 8007acc: 39 8c e9 c4 ori r12,r12,0xe9c4 8007ad0: 29 83 00 00 lw r3,(r12+0) 8007ad4: 78 07 08 01 mvhi r7,0x801 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 8007ad8: 34 04 00 01 mvi r4,1 _Watchdog_Sync_count++; 8007adc: 34 63 00 01 addi r3,r3,1 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 8007ae0: 58 44 00 08 sw (r2+8),r4 _Watchdog_Sync_count++; 8007ae4: 59 83 00 00 sw (r12+0),r3 8007ae8: 38 e7 e9 64 ori r7,r7,0xe964 delta_interval -= after->delta_interval; _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007aec: 34 0a 00 01 mvi r10,1 the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; restart: delta_interval = the_watchdog->initial; 8007af0: 28 44 00 0c lw r4,(r2+12) RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 8007af4: 28 23 00 00 lw r3,(r1+0) for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 8007af8: 44 80 00 14 be r4,r0,8007b48 <_Watchdog_Insert+0xb0> 8007afc: 28 65 00 00 lw r5,(r3+0) 8007b00: 44 a0 00 12 be r5,r0,8007b48 <_Watchdog_Insert+0xb0> break; if ( delta_interval < after->delta_interval ) { 8007b04: 28 65 00 10 lw r5,(r3+16) 8007b08: 54 a4 00 0e bgu r5,r4,8007b40 <_Watchdog_Insert+0xa8> break; } delta_interval -= after->delta_interval; _ISR_Flash( level ); 8007b0c: d0 06 00 00 wcsr IE,r6 8007b10: d0 08 00 00 wcsr IE,r8 if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007b14: 28 4b 00 08 lw r11,(r2+8) 8007b18: 5d 6a 00 19 bne r11,r10,8007b7c <_Watchdog_Insert+0xe4> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 8007b1c: 28 eb 00 00 lw r11,(r7+0) 8007b20: 55 69 00 28 bgu r11,r9,8007bc0 <_Watchdog_Insert+0x128> if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 8007b24: c8 85 20 00 sub r4,r4,r5 exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; _Watchdog_Sync_count--; _ISR_Enable( level ); } 8007b28: 28 63 00 00 lw r3,(r3+0) for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 8007b2c: 44 80 00 07 be r4,r0,8007b48 <_Watchdog_Insert+0xb0> 8007b30: 28 65 00 00 lw r5,(r3+0) 8007b34: 44 a0 00 05 be r5,r0,8007b48 <_Watchdog_Insert+0xb0> break; if ( delta_interval < after->delta_interval ) { 8007b38: 28 65 00 10 lw r5,(r3+16) 8007b3c: 50 85 00 19 bgeu r4,r5,8007ba0 <_Watchdog_Insert+0x108> after->delta_interval -= delta_interval; 8007b40: c8 a4 28 00 sub r5,r5,r4 8007b44: 58 65 00 10 sw (r3+16),r5 _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); 8007b48: 28 63 00 04 lw r3,(r3+4) the_watchdog->start_time = _Watchdog_Ticks_since_boot; 8007b4c: 78 01 08 01 mvhi r1,0x801 8007b50: 38 21 e9 c8 ori r1,r1,0xe9c8 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8007b54: 28 65 00 00 lw r5,(r3+0) 8007b58: 28 28 00 00 lw r8,(r1+0) RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 8007b5c: 34 01 00 02 mvi r1,2 8007b60: 58 41 00 08 sw (r2+8),r1 } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 8007b64: 58 44 00 10 sw (r2+16),r4 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8007b68: 58 43 00 04 sw (r2+4),r3 before_node = after_node->next; after_node->next = the_node; 8007b6c: 58 62 00 00 sw (r3+0),r2 the_node->next = before_node; before_node->previous = the_node; 8007b70: 58 a2 00 04 sw (r5+4),r2 Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 8007b74: 58 45 00 00 sw (r2+0),r5 _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; 8007b78: 58 48 00 14 sw (r2+20),r8 exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 8007b7c: 58 e9 00 00 sw (r7+0),r9 _Watchdog_Sync_count--; 8007b80: 29 81 00 00 lw r1,(r12+0) 8007b84: 34 21 ff ff addi r1,r1,-1 8007b88: 59 81 00 00 sw (r12+0),r1 _ISR_Enable( level ); 8007b8c: d0 06 00 00 wcsr IE,r6 } 8007b90: 2b 8b 00 08 lw r11,(sp+8) 8007b94: 2b 8c 00 04 lw r12,(sp+4) 8007b98: 37 9c 00 08 addi sp,sp,8 8007b9c: c3 a0 00 00 ret break; } delta_interval -= after->delta_interval; _ISR_Flash( level ); 8007ba0: d0 06 00 00 wcsr IE,r6 8007ba4: d0 08 00 00 wcsr IE,r8 if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007ba8: 28 4b 00 08 lw r11,(r2+8) if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 8007bac: c8 85 20 00 sub r4,r4,r5 _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007bb0: 5d 6a ff f3 bne r11,r10,8007b7c <_Watchdog_Insert+0xe4> <== NEVER TAKEN goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 8007bb4: 28 e5 00 00 lw r5,(r7+0) 8007bb8: 54 a9 00 02 bgu r5,r9,8007bc0 <_Watchdog_Insert+0x128> <== NEVER TAKEN 8007bbc: e3 ff ff db bi 8007b28 <_Watchdog_Insert+0x90> _Watchdog_Sync_level = insert_isr_nest_level; 8007bc0: 58 e9 00 00 sw (r7+0),r9 goto restart; 8007bc4: e3 ff ff cb bi 8007af0 <_Watchdog_Insert+0x58> =============================================================================== 08007c30 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 8007c30: 90 00 20 00 rcsr r4,IE 8007c34: 34 02 ff fe mvi r2,-2 8007c38: a0 82 10 00 and r2,r4,r2 8007c3c: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 8007c40: 28 22 00 08 lw r2,(r1+8) switch ( previous_state ) { 8007c44: 34 03 00 01 mvi r3,1 8007c48: 44 43 00 27 be r2,r3,8007ce4 <_Watchdog_Remove+0xb4> 8007c4c: 5c 40 00 08 bne r2,r0,8007c6c <_Watchdog_Remove+0x3c> _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007c50: 78 03 08 01 mvhi r3,0x801 8007c54: 38 63 e9 c8 ori r3,r3,0xe9c8 8007c58: 28 63 00 00 lw r3,(r3+0) 8007c5c: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8007c60: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8007c64: b8 40 08 00 mv r1,r2 8007c68: c3 a0 00 00 ret Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { 8007c6c: 34 03 00 03 mvi r3,3 8007c70: 54 43 ff f8 bgu r2,r3,8007c50 <_Watchdog_Remove+0x20> <== NEVER TAKEN } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 8007c74: 28 23 00 00 lw r3,(r1+0) break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 8007c78: 58 20 00 08 sw (r1+8),r0 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 8007c7c: 28 65 00 00 lw r5,(r3+0) 8007c80: 44 a0 00 05 be r5,r0,8007c94 <_Watchdog_Remove+0x64> next_watchdog->delta_interval += the_watchdog->delta_interval; 8007c84: 28 66 00 10 lw r6,(r3+16) 8007c88: 28 25 00 10 lw r5,(r1+16) 8007c8c: b4 c5 28 00 add r5,r6,r5 8007c90: 58 65 00 10 sw (r3+16),r5 if ( _Watchdog_Sync_count ) 8007c94: 78 05 08 01 mvhi r5,0x801 8007c98: 38 a5 e9 c4 ori r5,r5,0xe9c4 8007c9c: 28 a5 00 00 lw r5,(r5+0) 8007ca0: 44 a0 00 07 be r5,r0,8007cbc <_Watchdog_Remove+0x8c> _Watchdog_Sync_level = _ISR_Nest_level; 8007ca4: 78 05 08 01 mvhi r5,0x801 8007ca8: 38 a5 ea 60 ori r5,r5,0xea60 8007cac: 28 a6 00 08 lw r6,(r5+8) 8007cb0: 78 05 08 01 mvhi r5,0x801 8007cb4: 38 a5 e9 64 ori r5,r5,0xe964 8007cb8: 58 a6 00 00 sw (r5+0),r6 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 8007cbc: 28 25 00 04 lw r5,(r1+4) next->previous = previous; 8007cc0: 58 65 00 04 sw (r3+4),r5 previous->next = next; 8007cc4: 58 a3 00 00 sw (r5+0),r3 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007cc8: 78 03 08 01 mvhi r3,0x801 8007ccc: 38 63 e9 c8 ori r3,r3,0xe9c8 8007cd0: 28 63 00 00 lw r3,(r3+0) 8007cd4: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8007cd8: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8007cdc: b8 40 08 00 mv r1,r2 8007ce0: c3 a0 00 00 ret _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007ce4: 78 03 08 01 mvhi r3,0x801 8007ce8: 38 63 e9 c8 ori r3,r3,0xe9c8 8007cec: 28 63 00 00 lw r3,(r3+0) /* * It is not actually on the chain so just change the state and * the Insert operation we interrupted will be aborted. */ the_watchdog->state = WATCHDOG_INACTIVE; 8007cf0: 58 20 00 08 sw (r1+8),r0 _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007cf4: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8007cf8: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8007cfc: b8 40 08 00 mv r1,r2 8007d00: c3 a0 00 00 ret =============================================================================== 08009524 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 8009524: 37 9c ff ec addi sp,sp,-20 8009528: 5b 8b 00 14 sw (sp+20),r11 800952c: 5b 8c 00 10 sw (sp+16),r12 8009530: 5b 8d 00 0c sw (sp+12),r13 8009534: 5b 8e 00 08 sw (sp+8),r14 8009538: 5b 9d 00 04 sw (sp+4),ra 800953c: b8 20 70 00 mv r14,r1 8009540: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 8009544: 90 00 68 00 rcsr r13,IE 8009548: 34 01 ff fe mvi r1,-2 800954c: a1 a1 08 00 and r1,r13,r1 8009550: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 8009554: 78 01 08 01 mvhi r1,0x801 8009558: b9 80 18 00 mv r3,r12 800955c: 38 21 e7 48 ori r1,r1,0xe748 8009560: b9 c0 10 00 mv r2,r14 8009564: fb ff e6 ff calli 8003160 printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); } 8009568: 29 8b 00 00 lw r11,(r12+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800956c: 35 8c 00 04 addi r12,r12,4 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { 8009570: 45 6c 00 12 be r11,r12,80095b8 <_Watchdog_Report_chain+0x94> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 8009574: b9 60 10 00 mv r2,r11 8009578: 34 01 00 00 mvi r1,0 800957c: f8 00 00 13 calli 80095c8 <_Watchdog_Report> _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; node != _Chain_Tail(header) ; node = node->next ) 8009580: 29 6b 00 00 lw r11,(r11+0) Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 8009584: 5d 6c ff fc bne r11,r12,8009574 <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 8009588: 78 01 08 01 mvhi r1,0x801 800958c: 38 21 e7 60 ori r1,r1,0xe760 8009590: b9 c0 10 00 mv r2,r14 8009594: fb ff e6 f3 calli 8003160 } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); 8009598: d0 0d 00 00 wcsr IE,r13 } 800959c: 2b 9d 00 04 lw ra,(sp+4) 80095a0: 2b 8b 00 14 lw r11,(sp+20) 80095a4: 2b 8c 00 10 lw r12,(sp+16) 80095a8: 2b 8d 00 0c lw r13,(sp+12) 80095ac: 2b 8e 00 08 lw r14,(sp+8) 80095b0: 37 9c 00 14 addi sp,sp,20 80095b4: c3 a0 00 00 ret _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 80095b8: 78 01 08 01 mvhi r1,0x801 80095bc: 38 21 e7 70 ori r1,r1,0xe770 80095c0: fb ff e6 e8 calli 8003160 80095c4: e3 ff ff f5 bi 8009598 <_Watchdog_Report_chain+0x74> =============================================================================== 08007d04 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 8007d04: 37 9c ff e4 addi sp,sp,-28 8007d08: 5b 8b 00 1c sw (sp+28),r11 8007d0c: 5b 8c 00 18 sw (sp+24),r12 8007d10: 5b 8d 00 14 sw (sp+20),r13 8007d14: 5b 8e 00 10 sw (sp+16),r14 8007d18: 5b 8f 00 0c sw (sp+12),r15 8007d1c: 5b 90 00 08 sw (sp+8),r16 8007d20: 5b 9d 00 04 sw (sp+4),ra 8007d24: b8 20 60 00 mv r12,r1 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 8007d28: 90 00 68 00 rcsr r13,IE 8007d2c: 34 01 ff fe mvi r1,-2 8007d30: a1 a1 08 00 and r1,r13,r1 8007d34: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8007d38: 29 8b 00 00 lw r11,(r12+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8007d3c: 35 8e 00 04 addi r14,r12,4 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 8007d40: b9 a0 10 00 mv r2,r13 if ( _Chain_Is_empty( header ) ) 8007d44: 45 6e 00 1e be r11,r14,8007dbc <_Watchdog_Tickle+0xb8> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 8007d48: 29 61 00 10 lw r1,(r11+16) 8007d4c: 5c 20 00 26 bne r1,r0,8007de4 <_Watchdog_Tickle+0xe0> <== ALWAYS TAKEN do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 8007d50: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007d54: 34 0f ff fe mvi r15,-2 8007d58: e0 00 00 0a bi 8007d80 <_Watchdog_Tickle+0x7c> 8007d5c: 90 00 10 00 rcsr r2,IE <== NOT EXECUTED 8007d60: a0 4f 08 00 and r1,r2,r15 <== NOT EXECUTED 8007d64: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8007d68: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007d6c: b8 40 68 00 mv r13,r2 <== NOT EXECUTED RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 8007d70: b8 20 58 00 mv r11,r1 <== NOT EXECUTED the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 8007d74: 44 2e 00 12 be r1,r14,8007dbc <_Watchdog_Tickle+0xb8> <== NOT EXECUTED } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 8007d78: 28 21 00 10 lw r1,(r1+16) 8007d7c: 5c 20 00 10 bne r1,r0,8007dbc <_Watchdog_Tickle+0xb8> if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 8007d80: b9 60 08 00 mv r1,r11 8007d84: fb ff ff ab calli 8007c30 <_Watchdog_Remove> _ISR_Enable( level ); 8007d88: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 8007d8c: 5c 30 ff f4 bne r1,r16,8007d5c <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 8007d90: 29 63 00 1c lw r3,(r11+28) 8007d94: 29 61 00 20 lw r1,(r11+32) 8007d98: 29 62 00 24 lw r2,(r11+36) 8007d9c: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007da0: 90 00 10 00 rcsr r2,IE 8007da4: a0 4f 08 00 and r1,r2,r15 8007da8: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8007dac: 29 81 00 00 lw r1,(r12+0) case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007db0: b8 40 68 00 mv r13,r2 8007db4: b8 20 58 00 mv r11,r1 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 8007db8: 5c 2e ff f0 bne r1,r14,8007d78 <_Watchdog_Tickle+0x74> leave: _ISR_Enable(level); 8007dbc: d0 02 00 00 wcsr IE,r2 } 8007dc0: 2b 9d 00 04 lw ra,(sp+4) 8007dc4: 2b 8b 00 1c lw r11,(sp+28) 8007dc8: 2b 8c 00 18 lw r12,(sp+24) 8007dcc: 2b 8d 00 14 lw r13,(sp+20) 8007dd0: 2b 8e 00 10 lw r14,(sp+16) 8007dd4: 2b 8f 00 0c lw r15,(sp+12) 8007dd8: 2b 90 00 08 lw r16,(sp+8) 8007ddc: 37 9c 00 1c addi sp,sp,28 8007de0: c3 a0 00 00 ret * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { the_watchdog->delta_interval--; 8007de4: 34 21 ff ff addi r1,r1,-1 8007de8: 59 61 00 10 sw (r11+16),r1 if ( the_watchdog->delta_interval != 0 ) 8007dec: 44 20 ff d9 be r1,r0,8007d50 <_Watchdog_Tickle+0x4c> 8007df0: e3 ff ff f3 bi 8007dbc <_Watchdog_Tickle+0xb8> =============================================================================== 08007df4 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8007df4: 37 9c ff d0 addi sp,sp,-48 8007df8: 5b 8b 00 30 sw (sp+48),r11 8007dfc: 5b 8c 00 2c sw (sp+44),r12 8007e00: 5b 8d 00 28 sw (sp+40),r13 8007e04: 5b 8e 00 24 sw (sp+36),r14 8007e08: 5b 8f 00 20 sw (sp+32),r15 8007e0c: 5b 90 00 1c sw (sp+28),r16 8007e10: 5b 91 00 18 sw (sp+24),r17 8007e14: 5b 92 00 14 sw (sp+20),r18 8007e18: 5b 93 00 10 sw (sp+16),r19 8007e1c: 5b 94 00 0c sw (sp+12),r20 8007e20: 5b 95 00 08 sw (sp+8),r21 8007e24: 5b 9d 00 04 sw (sp+4),ra Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 8007e28: 78 04 08 01 mvhi r4,0x801 8007e2c: 38 84 b9 9c ori r4,r4,0xb99c 8007e30: 40 85 00 32 lbu r5,(r4+50) void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8007e34: b8 40 80 00 mv r16,r2 8007e38: b8 60 a0 00 mv r20,r3 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 8007e3c: 28 8e 00 00 lw r14,(r4+0) 8007e40: 34 02 00 00 mvi r2,0 8007e44: 5c a0 00 02 bne r5,r0,8007e4c <_Workspace_Handler_initialization+0x58> 8007e48: 28 82 00 04 lw r2,(r4+4) 8007e4c: b4 4e 70 00 add r14,r2,r14 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 8007e50: 40 92 00 30 lbu r18,(r4+48) bool unified = rtems_configuration_get_unified_work_area(); 8007e54: 40 95 00 31 lbu r21,(r4+49) uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 8007e58: 46 00 00 21 be r16,r0,8007edc <_Workspace_Handler_initialization+0xe8><== NEVER TAKEN Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 8007e5c: 78 0f 08 00 mvhi r15,0x800 } else { size = 0; } } space_available = (*init_or_extend)( 8007e60: 78 11 08 01 mvhi r17,0x801 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 8007e64: b8 20 58 00 mv r11,r1 8007e68: 34 0d 00 00 mvi r13,0 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 8007e6c: 39 ef 51 80 ori r15,r15,0x5180 if ( do_zero ) { memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 8007e70: 34 13 00 0e mvi r19,14 } else { size = 0; } } space_available = (*init_or_extend)( 8007e74: 3a 31 e8 f0 ori r17,r17,0xe8f0 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 8007e78: 5e 40 00 28 bne r18,r0,8007f18 <_Workspace_Handler_initialization+0x124> memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 8007e7c: 29 6c 00 04 lw r12,(r11+4) 8007e80: 52 6c 00 14 bgeu r19,r12,8007ed0 <_Workspace_Handler_initialization+0xdc> uintptr_t space_available; uintptr_t size; if ( unified ) { 8007e84: 5e a0 00 05 bne r21,r0,8007e98 <_Workspace_Handler_initialization+0xa4> size = area->size; } else { if ( remaining > 0 ) { 8007e88: 45 d5 00 29 be r14,r21,8007f2c <_Workspace_Handler_initialization+0x138><== NEVER TAKEN size = remaining < area->size - overhead ? 8007e8c: 35 81 ff f2 addi r1,r12,-14 remaining + overhead : area->size; 8007e90: 51 c1 00 02 bgeu r14,r1,8007e98 <_Workspace_Handler_initialization+0xa4><== NEVER TAKEN 8007e94: 35 cc 00 0e addi r12,r14,14 } else { size = 0; } } space_available = (*init_or_extend)( 8007e98: 29 62 00 00 lw r2,(r11+0) 8007e9c: b9 80 18 00 mv r3,r12 8007ea0: ba 20 08 00 mv r1,r17 8007ea4: 34 04 00 04 mvi r4,4 8007ea8: d9 e0 00 00 call r15 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 8007eac: 29 62 00 00 lw r2,(r11+0) area->size -= size; 8007eb0: 29 63 00 04 lw r3,(r11+4) area->begin, size, page_size ); area->begin = (char *) area->begin + size; 8007eb4: b4 4c 10 00 add r2,r2,r12 area->size -= size; 8007eb8: c8 6c 60 00 sub r12,r3,r12 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 8007ebc: 59 62 00 00 sw (r11+0),r2 area->size -= size; 8007ec0: 59 6c 00 04 sw (r11+4),r12 if ( space_available < remaining ) { 8007ec4: 50 2e 00 21 bgeu r1,r14,8007f48 <_Workspace_Handler_initialization+0x154><== ALWAYS TAKEN remaining -= space_available; 8007ec8: c9 c1 70 00 sub r14,r14,r1 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 8007ecc: ba 80 78 00 mv r15,r20 <== NOT EXECUTED bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 8007ed0: 35 ad 00 01 addi r13,r13,1 8007ed4: 35 6b 00 08 addi r11,r11,8 8007ed8: 56 0d ff e8 bgu r16,r13,8007e78 <_Workspace_Handler_initialization+0x84><== NEVER TAKEN init_or_extend = extend; } } if ( remaining > 0 ) { 8007edc: 5d c0 00 1e bne r14,r0,8007f54 <_Workspace_Handler_initialization+0x160> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } 8007ee0: 2b 9d 00 04 lw ra,(sp+4) 8007ee4: 2b 8b 00 30 lw r11,(sp+48) 8007ee8: 2b 8c 00 2c lw r12,(sp+44) 8007eec: 2b 8d 00 28 lw r13,(sp+40) 8007ef0: 2b 8e 00 24 lw r14,(sp+36) 8007ef4: 2b 8f 00 20 lw r15,(sp+32) 8007ef8: 2b 90 00 1c lw r16,(sp+28) 8007efc: 2b 91 00 18 lw r17,(sp+24) 8007f00: 2b 92 00 14 lw r18,(sp+20) 8007f04: 2b 93 00 10 lw r19,(sp+16) 8007f08: 2b 94 00 0c lw r20,(sp+12) 8007f0c: 2b 95 00 08 lw r21,(sp+8) 8007f10: 37 9c 00 30 addi sp,sp,48 8007f14: c3 a0 00 00 ret for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { memset( area->begin, 0, area->size ); 8007f18: 29 61 00 00 lw r1,(r11+0) 8007f1c: 29 63 00 04 lw r3,(r11+4) 8007f20: 34 02 00 00 mvi r2,0 8007f24: f8 00 13 5b calli 800cc90 8007f28: e3 ff ff d5 bi 8007e7c <_Workspace_Handler_initialization+0x88> } else { size = 0; } } space_available = (*init_or_extend)( 8007f2c: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED 8007f30: ba 20 08 00 mv r1,r17 <== NOT EXECUTED 8007f34: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8007f38: 34 04 00 04 mvi r4,4 <== NOT EXECUTED 8007f3c: d9 e0 00 00 call r15 <== NOT EXECUTED remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 8007f40: ba 80 78 00 mv r15,r20 <== NOT EXECUTED 8007f44: e3 ff ff e3 bi 8007ed0 <_Workspace_Handler_initialization+0xdc><== NOT EXECUTED 8007f48: ba 80 78 00 mv r15,r20 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 8007f4c: 34 0e 00 00 mvi r14,0 8007f50: e3 ff ff e0 bi 8007ed0 <_Workspace_Handler_initialization+0xdc> init_or_extend = extend; } } if ( remaining > 0 ) { _Internal_error_Occurred( 8007f54: 34 01 00 00 mvi r1,0 8007f58: 34 02 00 01 mvi r2,1 8007f5c: 34 03 00 02 mvi r3,2 8007f60: fb ff f5 39 calli 8005444 <_Internal_error_Occurred> =============================================================================== 08007484 <_Workspace_String_duplicate>: char *_Workspace_String_duplicate( const char *string, size_t len ) { 8007484: 37 9c ff f0 addi sp,sp,-16 8007488: 5b 8b 00 10 sw (sp+16),r11 800748c: 5b 8c 00 0c sw (sp+12),r12 8007490: 5b 8d 00 08 sw (sp+8),r13 8007494: 5b 9d 00 04 sw (sp+4),ra 8007498: b8 20 68 00 mv r13,r1 char *dup = _Workspace_Allocate(len + 1); 800749c: 34 41 00 01 addi r1,r2,1 char *_Workspace_String_duplicate( const char *string, size_t len ) { 80074a0: b8 40 60 00 mv r12,r2 char *dup = _Workspace_Allocate(len + 1); 80074a4: fb ff ff d5 calli 80073f8 <_Workspace_Allocate> 80074a8: b8 20 58 00 mv r11,r1 if (dup != NULL) { 80074ac: 44 20 00 06 be r1,r0,80074c4 <_Workspace_String_duplicate+0x40><== NEVER TAKEN dup [len] = '\0'; 80074b0: b4 2c 10 00 add r2,r1,r12 80074b4: 30 40 00 00 sb (r2+0),r0 memcpy(dup, string, len); 80074b8: b9 80 18 00 mv r3,r12 80074bc: b9 a0 10 00 mv r2,r13 80074c0: f8 00 13 e1 calli 800c444 } return dup; } 80074c4: b9 60 08 00 mv r1,r11 80074c8: 2b 9d 00 04 lw ra,(sp+4) 80074cc: 2b 8b 00 10 lw r11,(sp+16) 80074d0: 2b 8c 00 0c lw r12,(sp+12) 80074d4: 2b 8d 00 08 lw r13,(sp+8) 80074d8: 37 9c 00 10 addi sp,sp,16 80074dc: c3 a0 00 00 ret =============================================================================== 0800499c : rtems_chain_control *free_chain, rtems_rbtree_control *chunk_tree, rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { 800499c: 37 9c ff fc addi sp,sp,-4 80049a0: 5b 9d 00 04 sw (sp+4),ra 80049a4: b8 20 28 00 mv r5,r1 if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { 80049a8: 34 01 ff f8 mvi r1,-8 80049ac: 44 81 00 15 be r4,r1,8004a00 rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); if (chunk != NULL) { rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 80049b0: 28 86 00 00 lw r6,(r4+0) */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 80049b4: 44 c0 00 1b be r6,r0,8004a20 rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { if (b->begin < a->begin) { 80049b8: 28 81 00 18 lw r1,(r4+24) 80049bc: 28 67 00 18 lw r7,(r3+24) 80049c0: 54 e1 00 13 bgu r7,r1,8004a0c a = b; b = t; } a->size += b->size; 80049c4: 28 69 00 1c lw r9,(r3+28) 80049c8: 28 88 00 1c lw r8,(r4+28) { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 80049cc: 28 87 00 04 lw r7,(r4+4) rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); 80049d0: b8 40 08 00 mv r1,r2 a = b; b = t; } a->size += b->size; 80049d4: b5 28 10 00 add r2,r9,r8 80049d8: 58 62 00 1c sw (r3+28),r2 next->previous = previous; previous->next = next; 80049dc: 58 e6 00 00 sw (r7+0),r6 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 80049e0: 28 a2 00 00 lw r2,(r5+0) Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 80049e4: 58 c7 00 04 sw (r6+4),r7 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 80049e8: 58 85 00 04 sw (r4+4),r5 before_node = after_node->next; after_node->next = the_node; 80049ec: 58 a4 00 00 sw (r5+0),r4 the_node->next = before_node; 80049f0: 58 82 00 00 sw (r4+0),r2 before_node->previous = the_node; 80049f4: 58 44 00 04 sw (r2+4),r4 rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); 80049f8: 34 82 00 08 addi r2,r4,8 80049fc: f8 00 07 b1 calli 80068c0 <_RBTree_Extract_unprotected> } } 8004a00: 2b 9d 00 04 lw ra,(sp+4) 8004a04: 37 9c 00 04 addi sp,sp,4 8004a08: c3 a0 00 00 ret rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { if (b->begin < a->begin) { 8004a0c: b8 60 08 00 mv r1,r3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 8004a10: 28 66 00 00 lw r6,(r3+0) 8004a14: b8 80 18 00 mv r3,r4 8004a18: b8 20 20 00 mv r4,r1 8004a1c: e3 ff ff ea bi 80049c4 8004a20: 28 81 00 04 lw r1,(r4+4) 8004a24: 5c 26 ff e5 bne r1,r6,80049b8 <== NEVER TAKEN 8004a28: e3 ff ff f6 bi 8004a00 =============================================================================== 080046f8 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 80046f8: 37 9c ff e4 addi sp,sp,-28 80046fc: 5b 8b 00 18 sw (sp+24),r11 8004700: 5b 8c 00 14 sw (sp+20),r12 8004704: 5b 8d 00 10 sw (sp+16),r13 8004708: 5b 8e 00 0c sw (sp+12),r14 800470c: 5b 8f 00 08 sw (sp+8),r15 8004710: 5b 9d 00 04 sw (sp+4),ra 8004714: b8 20 70 00 mv r14,r1 8004718: b8 40 68 00 mv r13,r2 800471c: b8 60 60 00 mv r12,r3 8004720: b8 80 78 00 mv r15,r4 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 8004724: b9 c0 08 00 mv r1,r14 8004728: f8 00 01 92 calli 8004d70 <_Chain_Get> 800472c: b8 20 58 00 mv r11,r1 while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 8004730: 34 02 00 00 mvi r2,0 8004734: b9 a0 08 00 mv r1,r13 8004738: b9 80 18 00 mv r3,r12 800473c: 37 84 00 1c addi r4,sp,28 rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 8004740: 5d 60 00 0e bne r11,r0,8004778 ) { rtems_event_set out; sc = rtems_event_receive( 8004744: fb ff fd 81 calli 8003d48 8004748: b8 20 28 00 mv r5,r1 ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 800474c: 44 2b ff f6 be r1,r11,8004724 <== NEVER TAKEN } *node_ptr = node; return sc; } 8004750: b8 a0 08 00 mv r1,r5 timeout, &out ); } *node_ptr = node; 8004754: 59 eb 00 00 sw (r15+0),r11 return sc; } 8004758: 2b 9d 00 04 lw ra,(sp+4) 800475c: 2b 8b 00 18 lw r11,(sp+24) 8004760: 2b 8c 00 14 lw r12,(sp+20) 8004764: 2b 8d 00 10 lw r13,(sp+16) 8004768: 2b 8e 00 0c lw r14,(sp+12) 800476c: 2b 8f 00 08 lw r15,(sp+8) 8004770: 37 9c 00 1c addi sp,sp,28 8004774: c3 a0 00 00 ret rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 8004778: 34 05 00 00 mvi r5,0 800477c: e3 ff ff f5 bi 8004750 =============================================================================== 080112dc : * error code - if unsuccessful */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { 80112dc: b8 20 18 00 mv r3,r1 if ( !routine ) return RTEMS_INVALID_ADDRESS; 80112e0: 34 01 00 09 mvi r1,9 */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { if ( !routine ) 80112e4: 44 60 00 05 be r3,r0,80112f8 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _Watchdog_Nanoseconds_since_tick_handler = routine; 80112e8: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED 80112ec: 38 42 91 c8 ori r2,r2,0x91c8 <== NOT EXECUTED 80112f0: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED return RTEMS_SUCCESSFUL; 80112f4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } 80112f8: c3 a0 00 00 ret =============================================================================== 0800e6d0 : rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 800e6d0: 37 9c ff f8 addi sp,sp,-8 800e6d4: 5b 8b 00 08 sw (sp+8),r11 800e6d8: 5b 9d 00 04 sw (sp+4),ra } else { *event_out = event->pending_events; sc = RTEMS_SUCCESSFUL; } } else { sc = RTEMS_INVALID_ADDRESS; 800e6dc: 34 05 00 09 mvi r5,9 rtems_event_set *event_out ) { rtems_status_code sc; if ( event_out != NULL ) { 800e6e0: 44 80 00 09 be r4,r0,800e704 <== NEVER TAKEN Thread_Control *executing = _Thread_Executing; 800e6e4: 78 05 08 01 mvhi r5,0x801 800e6e8: 38 a5 9a 80 ori r5,r5,0x9a80 800e6ec: 28 ab 00 10 lw r11,(r5+16) RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ]; 800e6f0: 29 66 01 14 lw r6,(r11+276) Event_Control *event = &api->System_event; if ( !_Event_sets_Is_empty( event_in ) ) { 800e6f4: 5c 20 00 09 bne r1,r0,800e718 <== ALWAYS TAKEN ); _Thread_Enable_dispatch(); sc = executing->Wait.return_code; } else { *event_out = event->pending_events; 800e6f8: 28 c1 00 04 lw r1,(r6+4) <== NOT EXECUTED sc = RTEMS_SUCCESSFUL; 800e6fc: 34 05 00 00 mvi r5,0 <== NOT EXECUTED ); _Thread_Enable_dispatch(); sc = executing->Wait.return_code; } else { *event_out = event->pending_events; 800e700: 58 81 00 00 sw (r4+0),r1 <== NOT EXECUTED } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 800e704: b8 a0 08 00 mv r1,r5 <== NOT EXECUTED 800e708: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800e70c: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 800e710: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 800e714: c3 a0 00 00 ret <== NOT EXECUTED * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 800e718: 78 05 08 01 mvhi r5,0x801 800e71c: 38 a5 99 00 ori r5,r5,0x9900 800e720: 28 a7 00 00 lw r7,(r5+0) ++level; 800e724: 34 e7 00 01 addi r7,r7,1 _Thread_Dispatch_disable_level = level; 800e728: 58 a7 00 00 sw (r5+0),r7 RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ]; Event_Control *event = &api->System_event; if ( !_Event_sets_Is_empty( event_in ) ) { _Thread_Disable_dispatch(); _Event_Seize( 800e72c: 78 07 08 01 mvhi r7,0x801 800e730: b9 60 28 00 mv r5,r11 800e734: 34 c6 00 04 addi r6,r6,4 800e738: 38 e7 9b 08 ori r7,r7,0x9b08 800e73c: 78 08 00 04 mvhi r8,0x4 800e740: fb ff fe 79 calli 800e124 <_Event_Seize> executing, event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 800e744: fb ff e5 7d calli 8007d38 <_Thread_Enable_dispatch> sc = executing->Wait.return_code; 800e748: 29 65 00 34 lw r5,(r11+52) } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 800e74c: b8 a0 08 00 mv r1,r5 800e750: 2b 9d 00 04 lw ra,(sp+4) 800e754: 2b 8b 00 08 lw r11,(sp+8) 800e758: 37 9c 00 08 addi sp,sp,8 800e75c: c3 a0 00 00 ret =============================================================================== 08003eb0 : rtems_status_code rtems_event_system_send( rtems_id id, rtems_event_set event_in ) { 8003eb0: 37 9c ff f4 addi sp,sp,-12 8003eb4: 5b 8b 00 08 sw (sp+8),r11 8003eb8: 5b 9d 00 04 sw (sp+4),ra 8003ebc: b8 40 58 00 mv r11,r2 rtems_status_code sc; Thread_Control *thread; Objects_Locations location; RTEMS_API_Control *api; thread = _Thread_Get( id, &location ); 8003ec0: 37 82 00 0c addi r2,sp,12 8003ec4: f8 00 0b 50 calli 8006c04 <_Thread_Get> switch ( location ) { 8003ec8: 2b 82 00 0c lw r2,(sp+12) 8003ecc: 44 40 00 06 be r2,r0,8003ee4 <== ALWAYS TAKEN case OBJECTS_REMOTE: sc = RTEMS_ILLEGAL_ON_REMOTE_OBJECT; break; #endif default: sc = RTEMS_INVALID_ID; 8003ed0: 34 01 00 04 mvi r1,4 <== NOT EXECUTED break; } return sc; } 8003ed4: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8003ed8: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8003edc: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 8003ee0: c3 a0 00 00 ret <== NOT EXECUTED thread = _Thread_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: api = thread->API_Extensions[ THREAD_API_RTEMS ]; _Event_Surrender( 8003ee4: 28 23 01 14 lw r3,(r1+276) 8003ee8: 78 04 08 01 mvhi r4,0x801 8003eec: b9 60 10 00 mv r2,r11 8003ef0: 34 63 00 04 addi r3,r3,4 8003ef4: 38 84 ea e8 ori r4,r4,0xeae8 8003ef8: 78 05 00 04 mvhi r5,0x4 8003efc: f8 00 16 6d calli 80098b0 <_Event_Surrender> event_in, &api->System_event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 8003f00: f8 00 0b 35 calli 8006bd4 <_Thread_Enable_dispatch> sc = RTEMS_SUCCESSFUL; 8003f04: 34 01 00 00 mvi r1,0 sc = RTEMS_INVALID_ID; break; } return sc; } 8003f08: 2b 9d 00 04 lw ra,(sp+4) 8003f0c: 2b 8b 00 08 lw r11,(sp+8) 8003f10: 37 9c 00 0c addi sp,sp,12 8003f14: c3 a0 00 00 ret =============================================================================== 080059ec : rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 80059ec: 37 9c ff f8 addi sp,sp,-8 80059f0: 5b 8b 00 08 sw (sp+8),r11 80059f4: 5b 9d 00 04 sw (sp+4),ra rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 80059f8: 78 04 08 01 mvhi r4,0x801 80059fc: 38 84 9a 80 ori r4,r4,0x9a80 8005a00: 28 85 00 08 lw r5,(r4+8) rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; 8005a04: 78 04 08 01 mvhi r4,0x801 8005a08: 38 84 9b 90 ori r4,r4,0x9b90 rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 8005a0c: b8 20 58 00 mv r11,r1 rtems_device_major_number major_limit = _IO_Number_of_drivers; 8005a10: 28 86 00 00 lw r6,(r4+0) if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; 8005a14: 34 01 00 12 mvi r1,18 rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 8005a18: 5c a0 00 33 bne r5,r0,8005ae4 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) return RTEMS_INVALID_ADDRESS; 8005a1c: 34 01 00 09 mvi r1,9 rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 8005a20: 44 65 00 31 be r3,r5,8005ae4 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 8005a24: 58 66 00 00 sw (r3+0),r6 if ( driver_table == NULL ) 8005a28: 44 40 00 2f be r2,r0,8005ae4 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8005a2c: 28 45 00 00 lw r5,(r2+0) 8005a30: 44 a0 00 42 be r5,r0,8005b38 if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; 8005a34: 34 01 00 0a mvi r1,10 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 8005a38: 51 66 00 2b bgeu r11,r6,8005ae4 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8005a3c: 78 01 08 01 mvhi r1,0x801 8005a40: 38 21 99 00 ori r1,r1,0x9900 8005a44: 28 25 00 00 lw r5,(r1+0) ++level; 8005a48: 34 a5 00 01 addi r5,r5,1 _Thread_Dispatch_disable_level = level; 8005a4c: 58 25 00 00 sw (r1+0),r5 return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 8005a50: 5d 60 00 29 bne r11,r0,8005af4 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 8005a54: 28 85 00 00 lw r5,(r4+0) rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 8005a58: 44 ab 00 3e be r5,r11,8005b50 <== NEVER TAKEN 8005a5c: 78 06 08 01 mvhi r6,0x801 8005a60: 38 c6 9b 94 ori r6,r6,0x9b94 8005a64: 28 c1 00 00 lw r1,(r6+0) static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8005a68: 28 24 00 00 lw r4,(r1+0) 8005a6c: 44 80 00 36 be r4,r0,8005b44 rtems_device_major_number n = _IO_Number_of_drivers; rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 8005a70: 35 6b 00 01 addi r11,r11,1 8005a74: 34 21 00 18 addi r1,r1,24 8005a78: 54 ab ff fc bgu r5,r11,8005a68 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 8005a7c: 58 6b 00 00 sw (r3+0),r11 if ( m != n ) 8005a80: 44 ab 00 35 be r5,r11,8005b54 8005a84: b5 6b 08 00 add r1,r11,r11 8005a88: b4 2b 08 00 add r1,r1,r11 8005a8c: b4 21 08 00 add r1,r1,r1 8005a90: b4 21 08 00 add r1,r1,r1 8005a94: b4 21 08 00 add r1,r1,r1 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 8005a98: 28 c3 00 00 lw r3,(r6+0) 8005a9c: 28 44 00 00 lw r4,(r2+0) 8005aa0: b4 61 08 00 add r1,r3,r1 8005aa4: 58 24 00 00 sw (r1+0),r4 8005aa8: 28 43 00 04 lw r3,(r2+4) 8005aac: 58 23 00 04 sw (r1+4),r3 8005ab0: 28 43 00 08 lw r3,(r2+8) 8005ab4: 58 23 00 08 sw (r1+8),r3 8005ab8: 28 43 00 0c lw r3,(r2+12) 8005abc: 58 23 00 0c sw (r1+12),r3 8005ac0: 28 43 00 10 lw r3,(r2+16) 8005ac4: 58 23 00 10 sw (r1+16),r3 8005ac8: 28 42 00 14 lw r2,(r2+20) 8005acc: 58 22 00 14 sw (r1+20),r2 _Thread_Enable_dispatch(); 8005ad0: f8 00 08 9a calli 8007d38 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 8005ad4: b9 60 08 00 mv r1,r11 8005ad8: 34 02 00 00 mvi r2,0 8005adc: 34 03 00 00 mvi r3,0 8005ae0: f8 00 24 b7 calli 800edbc } 8005ae4: 2b 9d 00 04 lw ra,(sp+4) 8005ae8: 2b 8b 00 08 lw r11,(sp+8) 8005aec: 37 9c 00 08 addi sp,sp,8 8005af0: c3 a0 00 00 ret _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 8005af4: b5 6b 08 00 add r1,r11,r11 8005af8: 78 06 08 01 mvhi r6,0x801 8005afc: b4 2b 08 00 add r1,r1,r11 8005b00: 38 c6 9b 94 ori r6,r6,0x9b94 8005b04: b4 21 08 00 add r1,r1,r1 8005b08: 28 c5 00 00 lw r5,(r6+0) 8005b0c: b4 21 08 00 add r1,r1,r1 8005b10: b4 21 08 00 add r1,r1,r1 8005b14: b4 a1 28 00 add r5,r5,r1 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8005b18: 28 a4 00 00 lw r4,(r5+0) 8005b1c: 44 80 00 11 be r4,r0,8005b60 major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); 8005b20: f8 00 08 86 calli 8007d38 <_Thread_Enable_dispatch> return RTEMS_RESOURCE_IN_USE; 8005b24: 34 01 00 0c mvi r1,12 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 8005b28: 2b 9d 00 04 lw ra,(sp+4) 8005b2c: 2b 8b 00 08 lw r11,(sp+8) 8005b30: 37 9c 00 08 addi sp,sp,8 8005b34: c3 a0 00 00 ret static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8005b38: 28 47 00 04 lw r7,(r2+4) 8005b3c: 5c e5 ff be bne r7,r5,8005a34 8005b40: e3 ff ff e9 bi 8005ae4 8005b44: 28 27 00 04 lw r7,(r1+4) 8005b48: 5c e4 ff ca bne r7,r4,8005a70 8005b4c: e3 ff ff cc bi 8005a7c if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 8005b50: 58 60 00 00 sw (r3+0),r0 <== NOT EXECUTED if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 8005b54: f8 00 08 79 calli 8007d38 <_Thread_Enable_dispatch> *major = m; if ( m != n ) return RTEMS_SUCCESSFUL; return RTEMS_TOO_MANY; 8005b58: 34 01 00 05 mvi r1,5 if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); return sc; 8005b5c: e3 ff ff e2 bi 8005ae4 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8005b60: 28 a5 00 04 lw r5,(r5+4) 8005b64: 5c a4 ff ef bne r5,r4,8005b20 if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 8005b68: 58 6b 00 00 sw (r3+0),r11 8005b6c: e3 ff ff cb bi 8005a98 =============================================================================== 08007144 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 8007144: 37 9c ff e4 addi sp,sp,-28 8007148: 5b 8b 00 1c sw (sp+28),r11 800714c: 5b 8c 00 18 sw (sp+24),r12 8007150: 5b 8d 00 14 sw (sp+20),r13 8007154: 5b 8e 00 10 sw (sp+16),r14 8007158: 5b 8f 00 0c sw (sp+12),r15 800715c: 5b 90 00 08 sw (sp+8),r16 8007160: 5b 9d 00 04 sw (sp+4),ra 8007164: b8 20 78 00 mv r15,r1 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 8007168: 44 20 00 1a be r1,r0,80071d0 <== NEVER TAKEN #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 800716c: 78 01 08 02 mvhi r1,0x802 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 8007170: 78 0e 08 02 mvhi r14,0x802 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 8007174: 38 21 1c 5c ori r1,r1,0x1c5c uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 8007178: 39 ce 1c 60 ori r14,r14,0x1c60 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 800717c: 34 30 00 10 addi r16,r1,16 if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) 8007180: 29 c1 00 00 lw r1,(r14+0) 8007184: 44 20 00 11 be r1,r0,80071c8 continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 8007188: 28 2d 00 04 lw r13,(r1+4) if ( !information ) 800718c: 45 a0 00 0f be r13,r0,80071c8 continue; for ( i=1 ; i <= information->maximum ; i++ ) { 8007190: 2d a3 00 10 lhu r3,(r13+16) 8007194: 44 60 00 0d be r3,r0,80071c8 <== NEVER TAKEN 8007198: 34 0c 00 04 mvi r12,4 800719c: 34 0b 00 01 mvi r11,1 the_thread = (Thread_Control *)information->local_table[ i ]; 80071a0: 29 a2 00 1c lw r2,(r13+28) information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 80071a4: 35 6b 00 01 addi r11,r11,1 the_thread = (Thread_Control *)information->local_table[ i ]; 80071a8: b4 4c 10 00 add r2,r2,r12 80071ac: 28 42 00 00 lw r2,(r2+0) information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 80071b0: 35 8c 00 04 addi r12,r12,4 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) continue; (*routine)(the_thread); 80071b4: b8 40 08 00 mv r1,r2 continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 80071b8: 44 40 00 03 be r2,r0,80071c4 continue; (*routine)(the_thread); 80071bc: d9 e0 00 00 call r15 80071c0: 2d a3 00 10 lhu r3,(r13+16) information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 80071c4: 50 6b ff f7 bgeu r3,r11,80071a0 80071c8: 35 ce 00 04 addi r14,r14,4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 80071cc: 5d d0 ff ed bne r14,r16,8007180 (*routine)(the_thread); } } } 80071d0: 2b 9d 00 04 lw ra,(sp+4) 80071d4: 2b 8b 00 1c lw r11,(sp+28) 80071d8: 2b 8c 00 18 lw r12,(sp+24) 80071dc: 2b 8d 00 14 lw r13,(sp+20) 80071e0: 2b 8e 00 10 lw r14,(sp+16) 80071e4: 2b 8f 00 0c lw r15,(sp+12) 80071e8: 2b 90 00 08 lw r16,(sp+8) 80071ec: 37 9c 00 1c addi sp,sp,28 80071f0: c3 a0 00 00 ret =============================================================================== 08005930 : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 8005930: 37 9c ff f8 addi sp,sp,-8 8005934: 5b 8b 00 08 sw (sp+8),r11 8005938: 5b 9d 00 04 sw (sp+4),ra 800593c: b8 60 58 00 mv r11,r3 /* * Validate parameters and look up information structure. */ if ( !info ) return RTEMS_INVALID_ADDRESS; 8005940: 34 03 00 09 mvi r3,9 int i; /* * Validate parameters and look up information structure. */ if ( !info ) 8005944: 45 60 00 1e be r11,r0,80059bc return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 8005948: 20 42 ff ff andi r2,r2,0xffff 800594c: f8 00 07 f2 calli 8007914 <_Objects_Get_information> 8005950: b8 20 10 00 mv r2,r1 if ( !obj_info ) return RTEMS_INVALID_NUMBER; 8005954: 34 03 00 0a mvi r3,10 */ if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); if ( !obj_info ) 8005958: 44 20 00 19 be r1,r0,80059bc return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 800595c: 28 24 00 08 lw r4,(r1+8) info->maximum_id = obj_info->maximum_id; 8005960: 28 23 00 0c lw r3,(r1+12) info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 8005964: 2c 46 00 10 lhu r6,(r2+16) /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; 8005968: 40 21 00 12 lbu r1,(r1+18) return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 800596c: 59 64 00 00 sw (r11+0),r4 info->maximum_id = obj_info->maximum_id; 8005970: 59 63 00 04 sw (r11+4),r3 info->auto_extend = obj_info->auto_extend; 8005974: 31 61 00 0c sb (r11+12),r1 info->maximum = obj_info->maximum; 8005978: 59 66 00 08 sw (r11+8),r6 for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 800597c: 34 04 00 00 mvi r4,0 8005980: 44 c0 00 0d be r6,r0,80059b4 <== NEVER TAKEN 8005984: 28 43 00 1c lw r3,(r2+28) 8005988: 34 01 00 01 mvi r1,1 800598c: 34 02 00 01 mvi r2,1 if ( !obj_info->local_table[i] ) 8005990: b4 21 08 00 add r1,r1,r1 8005994: b4 21 08 00 add r1,r1,r1 8005998: b4 61 08 00 add r1,r3,r1 800599c: 28 25 00 00 lw r5,(r1+0) info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 80059a0: 34 42 00 01 addi r2,r2,1 80059a4: b8 40 08 00 mv r1,r2 if ( !obj_info->local_table[i] ) unallocated++; 80059a8: 64 a5 00 00 cmpei r5,r5,0 80059ac: b4 85 20 00 add r4,r4,r5 info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 80059b0: 50 c2 ff f8 bgeu r6,r2,8005990 if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 80059b4: 59 64 00 10 sw (r11+16),r4 return RTEMS_SUCCESSFUL; 80059b8: 34 03 00 00 mvi r3,0 } 80059bc: b8 60 08 00 mv r1,r3 80059c0: 2b 9d 00 04 lw ra,(sp+4) 80059c4: 2b 8b 00 08 lw r11,(sp+8) 80059c8: 37 9c 00 08 addi sp,sp,8 80059cc: c3 a0 00 00 ret =============================================================================== 080125b8 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 80125b8: 37 9c ff d8 addi sp,sp,-40 80125bc: 5b 8b 00 18 sw (sp+24),r11 80125c0: 5b 8c 00 14 sw (sp+20),r12 80125c4: 5b 8d 00 10 sw (sp+16),r13 80125c8: 5b 8e 00 0c sw (sp+12),r14 80125cc: 5b 8f 00 08 sw (sp+8),r15 80125d0: 5b 9d 00 04 sw (sp+4),ra register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 80125d4: 34 07 00 03 mvi r7,3 uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 80125d8: b8 20 60 00 mv r12,r1 80125dc: b8 40 58 00 mv r11,r2 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 80125e0: 44 20 00 3e be r1,r0,80126d8 return RTEMS_INVALID_NAME; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 80125e4: 34 07 00 09 mvi r7,9 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) 80125e8: 44 40 00 3c be r2,r0,80126d8 return RTEMS_INVALID_ADDRESS; if ( !id ) 80125ec: 44 c0 00 3b be r6,r0,80126d8 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 80125f0: 64 82 00 00 cmpei r2,r4,0 80125f4: 64 61 00 00 cmpei r1,r3,0 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; 80125f8: 34 07 00 08 mvi r7,8 return RTEMS_INVALID_ADDRESS; if ( !id ) return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 80125fc: b8 41 08 00 or r1,r2,r1 8012600: 5c 20 00 36 bne r1,r0,80126d8 8012604: 54 83 00 35 bgu r4,r3,80126d8 */ RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned ( uint32_t buffer_size ) { return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0); 8012608: 20 81 00 03 andi r1,r4,0x3 801260c: 5c 20 00 33 bne r1,r0,80126d8 ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8012610: 21 6f 00 03 andi r15,r11,0x3 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; 8012614: 34 07 00 09 mvi r7,9 if ( length == 0 || buffer_size == 0 || length < buffer_size || !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 8012618: 5d e1 00 30 bne r15,r1,80126d8 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 801261c: 78 01 08 03 mvhi r1,0x803 8012620: 38 21 dc d0 ori r1,r1,0xdcd0 8012624: 28 22 00 00 lw r2,(r1+0) ++level; 8012628: 34 42 00 01 addi r2,r2,1 _Thread_Dispatch_disable_level = level; 801262c: 58 22 00 00 sw (r1+0),r2 * This function allocates a partition control block from * the inactive chain of free partition control blocks. */ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void ) { return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); 8012630: 78 0e 08 03 mvhi r14,0x803 8012634: 39 ce db 10 ori r14,r14,0xdb10 8012638: b9 c0 08 00 mv r1,r14 801263c: 5b 83 00 28 sw (sp+40),r3 8012640: 5b 84 00 20 sw (sp+32),r4 8012644: 5b 85 00 24 sw (sp+36),r5 8012648: 5b 86 00 1c sw (sp+28),r6 801264c: f8 00 17 ae calli 8018504 <_Objects_Allocate> 8012650: b8 20 68 00 mv r13,r1 _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 8012654: 2b 83 00 28 lw r3,(sp+40) 8012658: 2b 84 00 20 lw r4,(sp+32) 801265c: 2b 85 00 24 lw r5,(sp+36) 8012660: 2b 86 00 1c lw r6,(sp+28) 8012664: 44 2f 00 26 be r1,r15,80126fc #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 8012668: 58 25 00 1c sw (r1+28),r5 return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; the_partition->length = length; 801266c: 58 23 00 14 sw (r1+20),r3 the_partition->buffer_size = buffer_size; 8012670: 58 24 00 18 sw (r1+24),r4 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 8012674: 58 2b 00 10 sw (r1+16),r11 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 8012678: 58 20 00 20 sw (r1+32),r0 _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 801267c: b8 80 10 00 mv r2,r4 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 8012680: 34 2f 00 24 addi r15,r1,36 length / buffer_size, buffer_size ); 8012684: b8 60 08 00 mv r1,r3 8012688: 5b 86 00 1c sw (sp+28),r6 801268c: 5b 84 00 20 sw (sp+32),r4 8012690: f8 00 74 45 calli 802f7a4 <__udivsi3> the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 8012694: 2b 84 00 20 lw r4,(sp+32) length / buffer_size, buffer_size ); 8012698: b8 20 18 00 mv r3,r1 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 801269c: b9 60 10 00 mv r2,r11 80126a0: b9 e0 08 00 mv r1,r15 80126a4: f8 00 10 64 calli 8016834 <_Chain_Initialize> Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 80126a8: 29 a2 00 08 lw r2,(r13+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 80126ac: 29 c3 00 1c lw r3,(r14+28) Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 80126b0: 20 41 ff ff andi r1,r2,0xffff #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 80126b4: b4 21 08 00 add r1,r1,r1 80126b8: b4 21 08 00 add r1,r1,r1 80126bc: b4 61 08 00 add r1,r3,r1 80126c0: 58 2d 00 00 sw (r1+0),r13 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 80126c4: 59 ac 00 0c sw (r13+12),r12 &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 80126c8: 2b 86 00 1c lw r6,(sp+28) 80126cc: 58 c2 00 00 sw (r6+0),r2 name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 80126d0: f8 00 1d 9a calli 8019d38 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80126d4: 34 07 00 00 mvi r7,0 } 80126d8: b8 e0 08 00 mv r1,r7 80126dc: 2b 9d 00 04 lw ra,(sp+4) 80126e0: 2b 8b 00 18 lw r11,(sp+24) 80126e4: 2b 8c 00 14 lw r12,(sp+20) 80126e8: 2b 8d 00 10 lw r13,(sp+16) 80126ec: 2b 8e 00 0c lw r14,(sp+12) 80126f0: 2b 8f 00 08 lw r15,(sp+8) 80126f4: 37 9c 00 28 addi sp,sp,40 80126f8: c3 a0 00 00 ret _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { _Thread_Enable_dispatch(); 80126fc: f8 00 1d 8f calli 8019d38 <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 8012700: 34 07 00 05 mvi r7,5 8012704: e3 ff ff f5 bi 80126d8 =============================================================================== 08037770 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 8037770: 37 9c ff e4 addi sp,sp,-28 8037774: 5b 8b 00 18 sw (sp+24),r11 8037778: 5b 8c 00 14 sw (sp+20),r12 803777c: 5b 8d 00 10 sw (sp+16),r13 8037780: 5b 8e 00 0c sw (sp+12),r14 8037784: 5b 8f 00 08 sw (sp+8),r15 8037788: 5b 9d 00 04 sw (sp+4),ra 803778c: 78 03 08 06 mvhi r3,0x806 8037790: b8 20 68 00 mv r13,r1 8037794: b8 60 08 00 mv r1,r3 8037798: b8 40 70 00 mv r14,r2 803779c: 38 21 e3 d0 ori r1,r1,0xe3d0 80377a0: b9 a0 10 00 mv r2,r13 80377a4: 37 83 00 1c addi r3,sp,28 80377a8: fb ff 36 70 calli 8005168 <_Objects_Get> 80377ac: 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 ) { 80377b0: 2b 81 00 1c lw r1,(sp+28) #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 80377b4: 34 0c 00 04 mvi r12,4 rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 80377b8: 44 20 00 0a be r1,r0,80377e0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80377bc: b9 80 08 00 mv r1,r12 80377c0: 2b 9d 00 04 lw ra,(sp+4) 80377c4: 2b 8b 00 18 lw r11,(sp+24) 80377c8: 2b 8c 00 14 lw r12,(sp+20) 80377cc: 2b 8d 00 10 lw r13,(sp+16) 80377d0: 2b 8e 00 0c lw r14,(sp+12) 80377d4: 2b 8f 00 08 lw r15,(sp+8) 80377d8: 37 9c 00 1c addi sp,sp,28 80377dc: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 80377e0: 78 0c 08 06 mvhi r12,0x806 80377e4: 39 8c e1 40 ori r12,r12,0xe140 the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 80377e8: 29 62 00 40 lw r2,(r11+64) 80377ec: 29 81 00 10 lw r1,(r12+16) 80377f0: 44 41 00 04 be r2,r1,8037800 _Thread_Enable_dispatch(); 80377f4: fb ff 3a 29 calli 8006098 <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 80377f8: 34 0c 00 17 mvi r12,23 80377fc: e3 ff ff f0 bi 80377bc } if ( length == RTEMS_PERIOD_STATUS ) { 8037800: 5d c0 00 0d bne r14,r0,8037834 switch ( the_period->state ) { 8037804: 29 61 00 38 lw r1,(r11+56) 8037808: 34 02 00 04 mvi r2,4 803780c: 34 0c 00 00 mvi r12,0 8037810: 54 22 00 07 bgu r1,r2,803782c <== NEVER TAKEN 8037814: 78 02 08 06 mvhi r2,0x806 8037818: b4 21 08 00 add r1,r1,r1 803781c: 38 42 65 d8 ori r2,r2,0x65d8 8037820: b4 21 08 00 add r1,r1,r1 8037824: b4 41 08 00 add r1,r2,r1 8037828: 28 2c 00 00 lw r12,(r1+0) id, NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 803782c: fb ff 3a 1b calli 8006098 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8037830: e3 ff ff e3 bi 80377bc } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 8037834: 90 00 78 00 rcsr r15,IE 8037838: 34 01 ff fe mvi r1,-2 803783c: a1 e1 08 00 and r1,r15,r1 8037840: d0 01 00 00 wcsr IE,r1 if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 8037844: 29 61 00 38 lw r1,(r11+56) 8037848: 44 20 00 19 be r1,r0,80378ac _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 803784c: 34 02 00 02 mvi r2,2 8037850: 44 22 00 2b be r1,r2,80378fc #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8037854: 34 0c 00 04 mvi r12,4 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 8037858: 5c 2c ff d9 bne r1,r12,80377bc <== NEVER TAKEN /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 803785c: b9 60 08 00 mv r1,r11 8037860: fb ff ff 49 calli 8037584 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 8037864: d0 0f 00 00 wcsr IE,r15 the_period->state = RATE_MONOTONIC_ACTIVE; 8037868: 34 03 00 02 mvi r3,2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803786c: 78 01 08 06 mvhi r1,0x806 8037870: 35 62 00 10 addi r2,r11,16 8037874: 59 63 00 38 sw (r11+56),r3 8037878: 38 21 e0 58 ori r1,r1,0xe058 the_period->next_length = length; 803787c: 59 6e 00 3c sw (r11+60),r14 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8037880: 59 6e 00 1c sw (r11+28),r14 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8037884: fb ff 3d a6 calli 8006f1c <_Watchdog_Insert> 8037888: 78 03 08 06 mvhi r3,0x806 803788c: 38 63 a0 18 ori r3,r3,0xa018 8037890: 29 61 00 40 lw r1,(r11+64) 8037894: 29 62 00 3c lw r2,(r11+60) 8037898: 28 63 00 34 lw r3,(r3+52) _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 803789c: 34 0c 00 06 mvi r12,6 80378a0: d8 60 00 00 call r3 the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); 80378a4: fb ff 39 fd calli 8006098 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 80378a8: e3 ff ff c5 bi 80377bc return( return_value ); } _ISR_Disable( level ); if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { _ISR_Enable( level ); 80378ac: d0 0f 00 00 wcsr IE,r15 the_period->next_length = length; /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 80378b0: b9 60 08 00 mv r1,r11 _ISR_Disable( level ); if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { _ISR_Enable( level ); the_period->next_length = length; 80378b4: 59 6e 00 3c sw (r11+60),r14 /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 80378b8: fb ff ff 80 calli 80376b8 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 80378bc: 78 03 08 03 mvhi r3,0x803 80378c0: 38 63 79 70 ori r3,r3,0x7970 the_period->state = RATE_MONOTONIC_ACTIVE; 80378c4: 34 04 00 02 mvi r4,2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80378c8: 78 01 08 06 mvhi r1,0x806 80378cc: 38 21 e0 58 ori r1,r1,0xe058 80378d0: 35 62 00 10 addi r2,r11,16 80378d4: 59 64 00 38 sw (r11+56),r4 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 80378d8: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 80378dc: 59 63 00 2c sw (r11+44),r3 the_watchdog->id = id; 80378e0: 59 6d 00 30 sw (r11+48),r13 the_watchdog->user_data = user_data; 80378e4: 59 60 00 34 sw (r11+52),r0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80378e8: 59 6e 00 1c sw (r11+28),r14 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80378ec: fb ff 3d 8c calli 8006f1c <_Watchdog_Insert> NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 80378f0: 34 0c 00 00 mvi r12,0 id, NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 80378f4: fb ff 39 e9 calli 8006098 <_Thread_Enable_dispatch> 80378f8: e3 ff ff b1 bi 80377bc if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 80378fc: b9 60 08 00 mv r1,r11 8037900: fb ff ff 21 calli 8037584 <_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; 8037904: 34 01 00 01 mvi r1,1 8037908: 59 61 00 38 sw (r11+56),r1 the_period->next_length = length; 803790c: 59 6e 00 3c sw (r11+60),r14 _ISR_Enable( level ); 8037910: d0 0f 00 00 wcsr IE,r15 _Thread_Executing->Wait.id = the_period->Object.id; 8037914: 29 83 00 10 lw r3,(r12+16) 8037918: 29 64 00 08 lw r4,(r11+8) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 803791c: 34 02 40 00 mvi r2,16384 8037920: b8 60 08 00 mv r1,r3 the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; the_period->next_length = length; _ISR_Enable( level ); _Thread_Executing->Wait.id = the_period->Object.id; 8037924: 58 64 00 20 sw (r3+32),r4 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 8037928: fb ff 3c 67 calli 8006ac4 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 803792c: 90 00 08 00 rcsr r1,IE 8037930: 34 02 ff fe mvi r2,-2 8037934: a0 22 10 00 and r2,r1,r2 8037938: d0 02 00 00 wcsr IE,r2 local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 803793c: 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; 8037940: 29 62 00 38 lw r2,(r11+56) the_period->state = RATE_MONOTONIC_ACTIVE; 8037944: 59 63 00 38 sw (r11+56),r3 _ISR_Enable( level ); 8037948: 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 ) 803794c: 34 01 00 03 mvi r1,3 8037950: 44 41 00 04 be r2,r1,8037960 <== NEVER TAKEN _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); _Thread_Enable_dispatch(); 8037954: fb ff 39 d1 calli 8006098 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8037958: 34 0c 00 00 mvi r12,0 803795c: e3 ff ff 98 bi 80377bc /* * 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 ) _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 8037960: 29 81 00 10 lw r1,(r12+16) <== NOT EXECUTED 8037964: 34 02 40 00 mvi r2,16384 <== NOT EXECUTED 8037968: fb ff 56 10 calli 800d1a8 <_Thread_Clear_state> <== NOT EXECUTED 803796c: e3 ff ff fa bi 8037954 <== NOT EXECUTED =============================================================================== 08027cbc : void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 8027cbc: 37 9c ff 5c addi sp,sp,-164 8027cc0: 5b 8b 00 44 sw (sp+68),r11 8027cc4: 5b 8c 00 40 sw (sp+64),r12 8027cc8: 5b 8d 00 3c sw (sp+60),r13 8027ccc: 5b 8e 00 38 sw (sp+56),r14 8027cd0: 5b 8f 00 34 sw (sp+52),r15 8027cd4: 5b 90 00 30 sw (sp+48),r16 8027cd8: 5b 91 00 2c sw (sp+44),r17 8027cdc: 5b 92 00 28 sw (sp+40),r18 8027ce0: 5b 93 00 24 sw (sp+36),r19 8027ce4: 5b 94 00 20 sw (sp+32),r20 8027ce8: 5b 95 00 1c sw (sp+28),r21 8027cec: 5b 96 00 18 sw (sp+24),r22 8027cf0: 5b 97 00 14 sw (sp+20),r23 8027cf4: 5b 98 00 10 sw (sp+16),r24 8027cf8: 5b 99 00 0c sw (sp+12),r25 8027cfc: 5b 9b 00 08 sw (sp+8),fp 8027d00: 5b 9d 00 04 sw (sp+4),ra 8027d04: b8 40 68 00 mv r13,r2 8027d08: b8 20 78 00 mv r15,r1 rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 8027d0c: 44 40 00 2f be r2,r0,8027dc8 <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 8027d10: 78 02 08 06 mvhi r2,0x806 8027d14: 38 42 33 f0 ori r2,r2,0x33f0 8027d18: d9 a0 00 00 call r13 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 8027d1c: 78 02 08 06 mvhi r2,0x806 8027d20: 38 42 34 10 ori r2,r2,0x3410 8027d24: b9 e0 08 00 mv r1,r15 8027d28: d9 a0 00 00 call r13 (*print)( context, "--- Wall times are in seconds ---\n" ); 8027d2c: 78 02 08 06 mvhi r2,0x806 8027d30: 38 42 34 34 ori r2,r2,0x3434 8027d34: b9 e0 08 00 mv r1,r15 8027d38: d9 a0 00 00 call r13 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 8027d3c: 78 02 08 06 mvhi r2,0x806 8027d40: 38 42 34 58 ori r2,r2,0x3458 8027d44: b9 e0 08 00 mv r1,r15 8027d48: d9 a0 00 00 call r13 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 8027d4c: 78 02 08 06 mvhi r2,0x806 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 8027d50: 78 0c 08 06 mvhi r12,0x806 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 8027d54: b9 e0 08 00 mv r1,r15 8027d58: 38 42 34 a4 ori r2,r2,0x34a4 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 8027d5c: 39 8c e3 d0 ori r12,r12,0xe3d0 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 8027d60: d9 a0 00 00 call r13 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 8027d64: 29 81 00 0c lw r1,(r12+12) 8027d68: 29 8b 00 08 lw r11,(r12+8) 8027d6c: 55 61 00 17 bgu r11,r1,8027dc8 <== NEVER TAKEN rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 8027d70: 78 12 08 06 mvhi r18,0x806 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 8027d74: 78 15 08 06 mvhi r21,0x806 struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 8027d78: 78 14 08 06 mvhi r20,0x806 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 8027d7c: 78 11 08 06 mvhi r17,0x806 8027d80: 37 90 00 48 addi r16,sp,72 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 8027d84: 37 98 00 80 addi r24,sp,128 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 8027d88: 37 93 00 a0 addi r19,sp,160 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 8027d8c: 3a 52 34 f0 ori r18,r18,0x34f0 { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; 8027d90: 37 97 00 60 addi r23,sp,96 _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 8027d94: 37 96 00 98 addi r22,sp,152 (*print)( context, 8027d98: 3a b5 35 08 ori r21,r21,0x3508 { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; 8027d9c: 37 9b 00 78 addi fp,sp,120 _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 8027da0: 3a 94 35 28 ori r20,r20,0x3528 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 8027da4: 3a 31 4e 90 ori r17,r17,0x4e90 * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 8027da8: b9 60 08 00 mv r1,r11 8027dac: ba 00 10 00 mv r2,r16 8027db0: f8 00 3c c9 calli 80370d4 8027db4: b8 20 70 00 mv r14,r1 if ( status != RTEMS_SUCCESSFUL ) 8027db8: 44 20 00 17 be r1,r0,8027e14 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 8027dbc: 29 85 00 0c lw r5,(r12+12) id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 8027dc0: 35 6b 00 01 addi r11,r11,1 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 8027dc4: 50 ab ff f9 bgeu r5,r11,8027da8 <== NEVER TAKEN the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 8027dc8: 2b 9d 00 04 lw ra,(sp+4) 8027dcc: 2b 8b 00 44 lw r11,(sp+68) 8027dd0: 2b 8c 00 40 lw r12,(sp+64) 8027dd4: 2b 8d 00 3c lw r13,(sp+60) 8027dd8: 2b 8e 00 38 lw r14,(sp+56) 8027ddc: 2b 8f 00 34 lw r15,(sp+52) 8027de0: 2b 90 00 30 lw r16,(sp+48) 8027de4: 2b 91 00 2c lw r17,(sp+44) 8027de8: 2b 92 00 28 lw r18,(sp+40) 8027dec: 2b 93 00 24 lw r19,(sp+36) 8027df0: 2b 94 00 20 lw r20,(sp+32) 8027df4: 2b 95 00 1c lw r21,(sp+28) 8027df8: 2b 96 00 18 lw r22,(sp+24) 8027dfc: 2b 97 00 14 lw r23,(sp+20) 8027e00: 2b 98 00 10 lw r24,(sp+16) 8027e04: 2b 99 00 0c lw r25,(sp+12) 8027e08: 2b 9b 00 08 lw fp,(sp+8) 8027e0c: 37 9c 00 a4 addi sp,sp,164 8027e10: c3 a0 00 00 ret #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 8027e14: bb 00 10 00 mv r2,r24 8027e18: b9 60 08 00 mv r1,r11 8027e1c: f8 00 3d 40 calli 803731c #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 8027e20: 2b 81 00 80 lw r1,(sp+128) 8027e24: ba 60 18 00 mv r3,r19 8027e28: 34 02 00 05 mvi r2,5 8027e2c: fb ff 91 64 calli 800c3bc /* * Print part of report line that is not dependent on granularity */ (*print)( context, 8027e30: 2b 85 00 48 lw r5,(sp+72) 8027e34: 2b 86 00 4c lw r6,(sp+76) 8027e38: ba 40 10 00 mv r2,r18 8027e3c: b9 60 18 00 mv r3,r11 8027e40: b9 e0 08 00 mv r1,r15 8027e44: ba 60 20 00 mv r4,r19 8027e48: d9 a0 00 00 call r13 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 8027e4c: 2b 85 00 48 lw r5,(sp+72) struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 8027e50: ba c0 18 00 mv r3,r22 8027e54: ba e0 08 00 mv r1,r23 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 8027e58: ba 20 10 00 mv r2,r17 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 8027e5c: 5c ae 00 04 bne r5,r14,8027e6c (*print)( context, "\n" ); 8027e60: b9 e0 08 00 mv r1,r15 8027e64: d9 a0 00 00 call r13 continue; 8027e68: e3 ff ff d5 bi 8027dbc struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 8027e6c: b8 a0 10 00 mv r2,r5 8027e70: f8 00 04 83 calli 802907c <_Timespec_Divide_by_integer> (*print)( context, 8027e74: 2b 81 00 54 lw r1,(sp+84) 8027e78: 34 02 03 e8 mvi r2,1000 8027e7c: f8 00 d0 53 calli 805bfc8 <__divsi3> 8027e80: b8 20 c8 00 mv r25,r1 8027e84: 2b 81 00 5c lw r1,(sp+92) 8027e88: 34 02 03 e8 mvi r2,1000 8027e8c: f8 00 d0 4f calli 805bfc8 <__divsi3> 8027e90: b8 20 70 00 mv r14,r1 8027e94: 2b 81 00 9c lw r1,(sp+156) 8027e98: 34 02 03 e8 mvi r2,1000 8027e9c: f8 00 d0 4b calli 805bfc8 <__divsi3> 8027ea0: 2b 85 00 58 lw r5,(sp+88) 8027ea4: 2b 87 00 98 lw r7,(sp+152) 8027ea8: 2b 83 00 50 lw r3,(sp+80) 8027eac: b8 20 40 00 mv r8,r1 8027eb0: bb 20 20 00 mv r4,r25 8027eb4: b9 c0 30 00 mv r6,r14 8027eb8: ba a0 10 00 mv r2,r21 8027ebc: b9 e0 08 00 mv r1,r15 8027ec0: d9 a0 00 00 call r13 struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 8027ec4: 2b 82 00 48 lw r2,(sp+72) 8027ec8: ba c0 18 00 mv r3,r22 8027ecc: bb 60 08 00 mv r1,fp 8027ed0: f8 00 04 6b calli 802907c <_Timespec_Divide_by_integer> (*print)( context, 8027ed4: 2b 81 00 6c lw r1,(sp+108) 8027ed8: 34 02 03 e8 mvi r2,1000 8027edc: f8 00 d0 3b calli 805bfc8 <__divsi3> 8027ee0: b8 20 c8 00 mv r25,r1 8027ee4: 2b 81 00 74 lw r1,(sp+116) 8027ee8: 34 02 03 e8 mvi r2,1000 8027eec: f8 00 d0 37 calli 805bfc8 <__divsi3> 8027ef0: b8 20 70 00 mv r14,r1 8027ef4: 2b 81 00 9c lw r1,(sp+156) 8027ef8: 34 02 03 e8 mvi r2,1000 8027efc: f8 00 d0 33 calli 805bfc8 <__divsi3> 8027f00: 2b 83 00 68 lw r3,(sp+104) 8027f04: 2b 85 00 70 lw r5,(sp+112) 8027f08: 2b 87 00 98 lw r7,(sp+152) 8027f0c: b8 20 40 00 mv r8,r1 8027f10: ba 80 10 00 mv r2,r20 8027f14: b9 e0 08 00 mv r1,r15 8027f18: bb 20 20 00 mv r4,r25 8027f1c: b9 c0 30 00 mv r6,r14 8027f20: d9 a0 00 00 call r13 8027f24: e3 ff ff a6 bi 8027dbc =============================================================================== 08027f4c : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 8027f4c: 37 9c ff f4 addi sp,sp,-12 8027f50: 5b 8b 00 0c sw (sp+12),r11 8027f54: 5b 8c 00 08 sw (sp+8),r12 8027f58: 5b 9d 00 04 sw (sp+4),ra * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8027f5c: 78 01 08 06 mvhi r1,0x806 8027f60: 38 21 df c0 ori r1,r1,0xdfc0 8027f64: 28 22 00 00 lw r2,(r1+0) ++level; 8027f68: 34 42 00 01 addi r2,r2,1 _Thread_Dispatch_disable_level = level; 8027f6c: 58 22 00 00 sw (r1+0),r2 /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 8027f70: 78 0c 08 06 mvhi r12,0x806 8027f74: 39 8c e3 d0 ori r12,r12,0xe3d0 8027f78: 29 8b 00 08 lw r11,(r12+8) 8027f7c: 29 81 00 0c lw r1,(r12+12) 8027f80: 55 61 00 06 bgu r11,r1,8027f98 <== NEVER TAKEN id <= _Rate_monotonic_Information.maximum_id ; id++ ) { (void) rtems_rate_monotonic_reset_statistics( id ); 8027f84: b9 60 08 00 mv r1,r11 8027f88: f8 00 00 0a calli 8027fb0 /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 8027f8c: 29 81 00 0c lw r1,(r12+12) id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 8027f90: 35 6b 00 01 addi r11,r11,1 /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 8027f94: 50 2b ff fc bgeu r1,r11,8027f84 } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 8027f98: fb ff 78 40 calli 8006098 <_Thread_Enable_dispatch> } 8027f9c: 2b 9d 00 04 lw ra,(sp+4) 8027fa0: 2b 8b 00 0c lw r11,(sp+12) 8027fa4: 2b 8c 00 08 lw r12,(sp+8) 8027fa8: 37 9c 00 0c addi sp,sp,12 8027fac: c3 a0 00 00 ret =============================================================================== 08004b98 : return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { 8004b98: 37 9c ff e8 addi sp,sp,-24 8004b9c: 5b 8b 00 18 sw (sp+24),r11 8004ba0: 5b 8c 00 14 sw (sp+20),r12 8004ba4: 5b 8d 00 10 sw (sp+16),r13 8004ba8: 5b 8e 00 0c sw (sp+12),r14 8004bac: 5b 8f 00 08 sw (sp+8),r15 8004bb0: 5b 9d 00 04 sw (sp+4),ra void *ptr = NULL; rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; 8004bb4: 28 2e 00 30 lw r14,(r1+48) return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { 8004bb8: b8 40 58 00 mv r11,r2 8004bbc: b8 20 68 00 mv r13,r1 #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 8004bc0: b8 40 08 00 mv r1,r2 8004bc4: b9 c0 10 00 mv r2,r14 8004bc8: f8 00 38 cc calli 8012ef8 <__umodsi3> if (excess > 0) { 8004bcc: b9 60 60 00 mv r12,r11 8004bd0: 34 03 00 01 mvi r3,1 8004bd4: 44 20 00 04 be r1,r0,8004be4 <== ALWAYS TAKEN value += alignment - excess; 8004bd8: b5 6e 60 00 add r12,r11,r14 <== NOT EXECUTED 8004bdc: c9 81 60 00 sub r12,r12,r1 <== NOT EXECUTED 8004be0: f1 8b 18 00 cmpgeu r3,r12,r11 <== NOT EXECUTED rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { 8004be4: 7d 6b 00 00 cmpnei r11,r11,0 return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 8004be8: 34 02 00 00 mvi r2,0 rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { 8004bec: a0 6b 18 00 and r3,r3,r11 8004bf0: 5c 60 00 0a bne r3,r0,8004c18 } } } return ptr; } 8004bf4: b8 40 08 00 mv r1,r2 8004bf8: 2b 9d 00 04 lw ra,(sp+4) 8004bfc: 2b 8b 00 18 lw r11,(sp+24) 8004c00: 2b 8c 00 14 lw r12,(sp+20) 8004c04: 2b 8d 00 10 lw r13,(sp+16) 8004c08: 2b 8e 00 0c lw r14,(sp+12) 8004c0c: 2b 8f 00 08 lw r15,(sp+8) 8004c10: 37 9c 00 18 addi sp,sp,24 8004c14: c3 a0 00 00 ret rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); if (chunk != NULL) { rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 8004c18: 29 ab 00 00 lw r11,(r13+0) rtems_chain_control *free_chain, size_t size ) { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); 8004c1c: 35 a1 00 04 addi r1,r13,4 rtems_rbheap_chunk *big_enough = NULL; while (current != tail && big_enough == NULL) { 8004c20: 45 61 ff f5 be r11,r1,8004bf4 rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current; if (free_chunk->size >= size) { 8004c24: 29 6e 00 1c lw r14,(r11+28) 8004c28: 55 8e 00 1f bgu r12,r14,8004ca4 uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size); if (free_chunk != NULL) { 8004c2c: 45 60 00 20 be r11,r0,8004cac <== NEVER TAKEN uintptr_t free_size = free_chunk->size; if (free_size > aligned_size) { 8004c30: 51 8e 00 15 bgeu r12,r14,8004c84 rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); if (chunk != NULL) { rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 8004c34: 29 af 00 0c lw r15,(r13+12) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8004c38: 35 a1 00 10 addi r1,r13,16 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 8004c3c: 45 e1 00 1e be r15,r1,8004cb4 <== NEVER TAKEN Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 8004c40: 29 e1 00 00 lw r1,(r15+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 8004c44: 35 a2 00 0c addi r2,r13,12 Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 8004c48: 59 a1 00 0c sw (r13+12),r1 new_first->previous = head; 8004c4c: 58 22 00 04 sw (r1+4),r2 if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; 8004c50: 29 61 00 18 lw r1,(r11+24) if (free_size > aligned_size) { rtems_rbheap_chunk *new_chunk = get_chunk(control); if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; 8004c54: c9 cc 70 00 sub r14,r14,r12 free_chunk->size = new_free_size; 8004c58: 59 6e 00 1c sw (r11+28),r14 new_chunk->begin = free_chunk->begin + new_free_size; 8004c5c: b5 c1 70 00 add r14,r14,r1 static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 8004c60: 35 e2 00 08 addi r2,r15,8 if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; 8004c64: 59 ee 00 18 sw (r15+24),r14 new_chunk->size = aligned_size; 8004c68: 59 ec 00 1c sw (r15+28),r12 */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 8004c6c: 59 e0 00 04 sw (r15+4),r0 8004c70: 59 e0 00 00 sw (r15+0),r0 static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 8004c74: 35 a1 00 18 addi r1,r13,24 8004c78: f8 00 07 85 calli 8006a8c <_RBTree_Insert_unprotected> free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; new_chunk->size = aligned_size; rtems_chain_set_off_chain(&new_chunk->chain_node); insert_into_tree(chunk_tree, new_chunk); ptr = (void *) new_chunk->begin; 8004c7c: 29 e2 00 18 lw r2,(r15+24) 8004c80: e3 ff ff dd bi 8004bf4 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8004c84: 29 63 00 00 lw r3,(r11+0) previous = the_node->previous; 8004c88: 29 61 00 04 lw r1,(r11+4) } } else { rtems_chain_extract_unprotected(&free_chunk->chain_node); rtems_chain_set_off_chain(&free_chunk->chain_node); ptr = (void *) free_chunk->begin; 8004c8c: 29 62 00 18 lw r2,(r11+24) next->previous = previous; 8004c90: 58 61 00 04 sw (r3+4),r1 previous->next = next; 8004c94: 58 23 00 00 sw (r1+0),r3 */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 8004c98: 59 60 00 04 sw (r11+4),r0 8004c9c: 59 60 00 00 sw (r11+0),r0 8004ca0: e3 ff ff d5 bi 8004bf4 rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); if (chunk != NULL) { rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 8004ca4: 29 6b 00 00 lw r11,(r11+0) { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_chunk *big_enough = NULL; while (current != tail && big_enough == NULL) { 8004ca8: 5c 2b ff df bne r1,r11,8004c24 <== NEVER TAKEN return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 8004cac: 34 02 00 00 mvi r2,0 8004cb0: e3 ff ff d1 bi 8004bf4 { rtems_chain_control *chain = &control->spare_descriptor_chain; rtems_chain_node *chunk = rtems_chain_get_unprotected(chain); if (chunk == NULL) { (*control->extend_descriptors)(control); 8004cb4: 29 a2 00 34 lw r2,(r13+52) <== NOT EXECUTED 8004cb8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8004cbc: d8 40 00 00 call r2 <== NOT EXECUTED rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); if (chunk != NULL) { rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 8004cc0: 29 a1 00 0c lw r1,(r13+12) <== NOT EXECUTED return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 8004cc4: 34 02 00 00 mvi r2,0 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 8004cc8: 45 e1 ff cb be r15,r1,8004bf4 <== NOT EXECUTED Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 8004ccc: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 8004cd0: 35 a3 00 0c addi r3,r13,12 <== NOT EXECUTED Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; new_first->previous = head; 8004cd4: b8 20 78 00 mv r15,r1 <== NOT EXECUTED { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 8004cd8: 59 a2 00 0c sw (r13+12),r2 <== NOT EXECUTED new_first->previous = head; 8004cdc: 58 43 00 04 sw (r2+4),r3 <== NOT EXECUTED 8004ce0: e3 ff ff dc bi 8004c50 <== NOT EXECUTED =============================================================================== 08004e1c : void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control) { 8004e1c: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 8004e20: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 8004e24: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 8004e28: b8 20 58 00 mv r11,r1 <== NOT EXECUTED rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); 8004e2c: 34 01 00 20 mvi r1,32 <== NOT EXECUTED 8004e30: fb ff f4 b2 calli 80020f8 <== NOT EXECUTED if (chunk != NULL) { 8004e34: 44 20 00 07 be r1,r0,8004e50 <== NOT EXECUTED ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8004e38: 29 62 00 0c lw r2,(r11+12) <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert_unprotected(_Chain_Head(the_chain), the_node); 8004e3c: 35 63 00 0c addi r3,r11,12 <== NOT EXECUTED Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8004e40: 58 23 00 04 sw (r1+4),r3 <== NOT EXECUTED before_node = after_node->next; after_node->next = the_node; 8004e44: 59 61 00 0c sw (r11+12),r1 <== NOT EXECUTED the_node->next = before_node; 8004e48: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED before_node->previous = the_node; 8004e4c: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 8004e50: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8004e54: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8004e58: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 8004e5c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08004ce4 : _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { 8004ce4: 37 9c ff cc addi sp,sp,-52 8004ce8: 5b 8b 00 14 sw (sp+20),r11 8004cec: 5b 8c 00 10 sw (sp+16),r12 8004cf0: 5b 8d 00 0c sw (sp+12),r13 8004cf4: 5b 8e 00 08 sw (sp+8),r14 8004cf8: 5b 9d 00 04 sw (sp+4),ra 8004cfc: b8 20 60 00 mv r12,r1 rtems_status_code sc = RTEMS_SUCCESSFUL; 8004d00: 34 01 00 00 mvi r1,0 if (ptr != NULL) { 8004d04: 44 40 00 22 be r2,r0,8004d8c RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 8004d08: 29 8b 00 1c lw r11,(r12+28) #define NULL_PAGE rtems_rbheap_chunk_of_node(NULL) static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key) { rtems_rbheap_chunk chunk = { .begin = key }; 8004d0c: 5b 80 00 18 sw (sp+24),r0 8004d10: 5b 80 00 1c sw (sp+28),r0 8004d14: 5b 80 00 20 sw (sp+32),r0 8004d18: 5b 80 00 24 sw (sp+36),r0 8004d1c: 5b 80 00 28 sw (sp+40),r0 8004d20: 5b 80 00 2c sw (sp+44),r0 8004d24: 5b 80 00 34 sw (sp+52),r0 8004d28: 5b 82 00 30 sw (sp+48),r2 check_and_merge(free_chain, chunk_tree, chunk, pred); } else { sc = RTEMS_INCORRECT_STATE; } } else { sc = RTEMS_INVALID_ID; 8004d2c: 34 01 00 04 mvi r1,4 RBTree_Node* found = NULL; int compare_result; while (iter_node) { 8004d30: 45 60 00 17 be r11,r0,8004d8c <== NEVER TAKEN 8004d34: 34 0d 00 00 mvi r13,0 8004d38: 37 8e 00 20 addi r14,sp,32 compare_result = the_rbtree->compare_function(the_node, iter_node); 8004d3c: 29 83 00 28 lw r3,(r12+40) 8004d40: b9 60 10 00 mv r2,r11 8004d44: b9 c0 08 00 mv r1,r14 8004d48: d8 60 00 00 call r3 found = iter_node; if ( the_rbtree->is_unique ) break; } RBTree_Direction dir = 8004d4c: 68 22 00 00 cmpgi r2,r1,0 RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { 8004d50: 5c 20 00 04 bne r1,r0,8004d60 found = iter_node; if ( the_rbtree->is_unique ) 8004d54: 41 83 00 2c lbu r3,(r12+44) 8004d58: b9 60 68 00 mv r13,r11 8004d5c: 5c 61 00 13 bne r3,r1,8004da8 <== ALWAYS TAKEN break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 8004d60: b4 42 10 00 add r2,r2,r2 8004d64: b4 42 10 00 add r2,r2,r2 8004d68: b5 62 58 00 add r11,r11,r2 8004d6c: 29 6b 00 04 lw r11,(r11+4) ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 8004d70: 5d 60 ff f3 bne r11,r0,8004d3c if (ptr != NULL) { rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr); if (chunk != NULL_PAGE) { 8004d74: 35 ab ff f8 addi r11,r13,-8 check_and_merge(free_chain, chunk_tree, chunk, pred); } else { sc = RTEMS_INCORRECT_STATE; } } else { sc = RTEMS_INVALID_ID; 8004d78: 34 01 00 04 mvi r1,4 if (ptr != NULL) { rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr); if (chunk != NULL_PAGE) { 8004d7c: 45 a0 00 04 be r13,r0,8004d8c */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 8004d80: 29 a2 ff f8 lw r2,(r13+-8) check_and_merge(free_chain, chunk_tree, chunk, succ); add_to_chain(free_chain, chunk); check_and_merge(free_chain, chunk_tree, chunk, pred); } else { sc = RTEMS_INCORRECT_STATE; 8004d84: 34 01 00 0e mvi r1,14 8004d88: 44 40 00 0a be r2,r0,8004db0 sc = RTEMS_INVALID_ID; } } return sc; } 8004d8c: 2b 9d 00 04 lw ra,(sp+4) 8004d90: 2b 8b 00 14 lw r11,(sp+20) 8004d94: 2b 8c 00 10 lw r12,(sp+16) 8004d98: 2b 8d 00 0c lw r13,(sp+12) 8004d9c: 2b 8e 00 08 lw r14,(sp+8) 8004da0: 37 9c 00 34 addi sp,sp,52 8004da4: c3 a0 00 00 ret compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { found = iter_node; if ( the_rbtree->is_unique ) 8004da8: b9 60 68 00 mv r13,r11 8004dac: e3 ff ff f2 bi 8004d74 8004db0: 29 63 00 04 lw r3,(r11+4) 8004db4: 5c 62 ff f6 bne r3,r2,8004d8c <== NEVER TAKEN static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 8004db8: b9 a0 08 00 mv r1,r13 8004dbc: f8 00 08 20 calli 8006e3c <_RBTree_Next_unprotected> 8004dc0: b8 20 70 00 mv r14,r1 8004dc4: 34 02 00 01 mvi r2,1 8004dc8: b9 a0 08 00 mv r1,r13 8004dcc: f8 00 08 1c calli 8006e3c <_RBTree_Next_unprotected> { rtems_status_code sc = RTEMS_SUCCESSFUL; if (ptr != NULL) { rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; 8004dd0: 35 8d 00 18 addi r13,r12,24 static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 8004dd4: 34 24 ff f8 addi r4,r1,-8 if (chunk != NULL_PAGE) { if (!rtems_rbheap_is_chunk_free(chunk)) { rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT); rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT); check_and_merge(free_chain, chunk_tree, chunk, succ); 8004dd8: b9 a0 10 00 mv r2,r13 8004ddc: b9 80 08 00 mv r1,r12 8004de0: b9 60 18 00 mv r3,r11 8004de4: fb ff fe ee calli 800499c ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8004de8: 29 82 00 00 lw r2,(r12+0) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8004dec: 59 6c 00 04 sw (r11+4),r12 before_node = after_node->next; after_node->next = the_node; 8004df0: 59 8b 00 00 sw (r12+0),r11 the_node->next = before_node; 8004df4: 59 62 00 00 sw (r11+0),r2 before_node->previous = the_node; 8004df8: 58 4b 00 04 sw (r2+4),r11 add_to_chain(free_chain, chunk); check_and_merge(free_chain, chunk_tree, chunk, pred); 8004dfc: b9 80 08 00 mv r1,r12 8004e00: b9 a0 10 00 mv r2,r13 8004e04: b9 60 18 00 mv r3,r11 8004e08: 35 c4 ff f8 addi r4,r14,-8 8004e0c: fb ff fe e4 calli 800499c } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { rtems_status_code sc = RTEMS_SUCCESSFUL; 8004e10: 34 01 00 00 mvi r1,0 8004e14: e3 ff ff de bi 8004d8c =============================================================================== 080143e4 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 80143e4: 37 9c ff f4 addi sp,sp,-12 80143e8: 5b 8b 00 08 sw (sp+8),r11 80143ec: 5b 9d 00 04 sw (sp+4),ra Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 80143f0: 34 03 00 0a mvi r3,10 rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 80143f4: b8 40 58 00 mv r11,r2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 80143f8: 5c 40 00 06 bne r2,r0,8014410 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80143fc: b8 60 08 00 mv r1,r3 8014400: 2b 9d 00 04 lw ra,(sp+4) 8014404: 2b 8b 00 08 lw r11,(sp+8) 8014408: 37 9c 00 0c addi sp,sp,12 801440c: c3 a0 00 00 ret ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 8014410: 37 82 00 0c addi r2,sp,12 8014414: f8 00 16 55 calli 8019d68 <_Thread_Get> switch ( location ) { 8014418: 2b 83 00 0c lw r3,(sp+12) 801441c: 44 60 00 07 be r3,r0,8014438 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8014420: 34 03 00 04 mvi r3,4 } 8014424: b8 60 08 00 mv r1,r3 8014428: 2b 9d 00 04 lw ra,(sp+4) 801442c: 2b 8b 00 08 lw r11,(sp+8) 8014430: 37 9c 00 0c addi sp,sp,12 8014434: c3 a0 00 00 ret the_thread = _Thread_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 8014438: 28 22 01 14 lw r2,(r1+276) asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 801443c: 28 44 00 0c lw r4,(r2+12) 8014440: 44 83 00 23 be r4,r3,80144cc if ( asr->is_enabled ) { 8014444: 40 43 00 08 lbu r3,(r2+8) 8014448: 44 60 00 12 be r3,r0,8014490 <== NEVER TAKEN rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 801444c: 90 00 18 00 rcsr r3,IE 8014450: 34 04 ff fe mvi r4,-2 8014454: a0 64 20 00 and r4,r3,r4 8014458: d0 04 00 00 wcsr IE,r4 *signal_set |= signals; 801445c: 28 44 00 14 lw r4,(r2+20) 8014460: b8 8b 58 00 or r11,r4,r11 8014464: 58 4b 00 14 sw (r2+20),r11 _ISR_Enable( _level ); 8014468: d0 03 00 00 wcsr IE,r3 _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 801446c: 78 02 08 03 mvhi r2,0x803 8014470: 38 42 de 60 ori r2,r2,0xde60 8014474: 28 43 00 08 lw r3,(r2+8) 8014478: 44 60 00 0e be r3,r0,80144b0 801447c: 28 43 00 10 lw r3,(r2+16) 8014480: 5c 23 00 0c bne r1,r3,80144b0 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 8014484: 34 01 00 01 mvi r1,1 8014488: 30 41 00 0c sb (r2+12),r1 801448c: e0 00 00 09 bi 80144b0 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 8014490: 90 00 08 00 rcsr r1,IE 8014494: 34 03 ff fe mvi r3,-2 8014498: a0 23 18 00 and r3,r1,r3 801449c: d0 03 00 00 wcsr IE,r3 *signal_set |= signals; 80144a0: 28 43 00 18 lw r3,(r2+24) 80144a4: b8 6b 58 00 or r11,r3,r11 80144a8: 58 4b 00 18 sw (r2+24),r11 _ISR_Enable( _level ); 80144ac: d0 01 00 00 wcsr IE,r1 } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 80144b0: f8 00 16 22 calli 8019d38 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80144b4: 34 03 00 00 mvi r3,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80144b8: b8 60 08 00 mv r1,r3 80144bc: 2b 9d 00 04 lw ra,(sp+4) 80144c0: 2b 8b 00 08 lw r11,(sp+8) 80144c4: 37 9c 00 0c addi sp,sp,12 80144c8: c3 a0 00 00 ret _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 80144cc: f8 00 16 1b calli 8019d38 <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 80144d0: 34 03 00 0b mvi r3,11 80144d4: e3 ff ff ca bi 80143fc =============================================================================== 0800e954 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 800e954: 37 9c ff dc addi sp,sp,-36 800e958: 5b 8b 00 24 sw (sp+36),r11 800e95c: 5b 8c 00 20 sw (sp+32),r12 800e960: 5b 8d 00 1c sw (sp+28),r13 800e964: 5b 8e 00 18 sw (sp+24),r14 800e968: 5b 8f 00 14 sw (sp+20),r15 800e96c: 5b 90 00 10 sw (sp+16),r16 800e970: 5b 91 00 0c sw (sp+12),r17 800e974: 5b 92 00 08 sw (sp+8),r18 800e978: 5b 9d 00 04 sw (sp+4),ra 800e97c: b8 40 70 00 mv r14,r2 800e980: b8 60 88 00 mv r17,r3 800e984: b8 20 80 00 mv r16,r1 bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 800e988: 34 02 00 09 mvi r2,9 ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 800e98c: 44 60 00 46 be r3,r0,800eaa4 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 800e990: 78 0f 08 01 mvhi r15,0x801 800e994: 39 ef 9a 80 ori r15,r15,0x9a80 800e998: 29 eb 00 10 lw r11,(r15+16) api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800e99c: 41 6d 00 70 lbu r13,(r11+112) if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800e9a0: 29 61 00 78 lw r1,(r11+120) if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 800e9a4: 29 6c 01 14 lw r12,(r11+276) asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800e9a8: 65 ad 00 00 cmpei r13,r13,0 800e9ac: b5 ad 20 00 add r4,r13,r13 800e9b0: b4 84 20 00 add r4,r4,r4 800e9b4: b4 84 20 00 add r4,r4,r4 800e9b8: b4 84 20 00 add r4,r4,r4 800e9bc: b4 84 20 00 add r4,r4,r4 800e9c0: b4 84 20 00 add r4,r4,r4 800e9c4: b4 84 20 00 add r4,r4,r4 800e9c8: b4 84 68 00 add r13,r4,r4 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800e9cc: 5c 20 00 42 bne r1,r0,800ead4 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 800e9d0: 41 92 00 08 lbu r18,(r12+8) old_mode |= _ISR_Get_level(); 800e9d4: fb ff ea 09 calli 80091f8 <_CPU_ISR_Get_level> if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 800e9d8: 66 52 00 00 cmpei r18,r18,0 800e9dc: c8 12 90 00 sub r18,r0,r18 800e9e0: 22 52 04 00 andi r18,r18,0x400 800e9e4: ba 41 08 00 or r1,r18,r1 old_mode |= _ISR_Get_level(); 800e9e8: b8 2d 68 00 or r13,r1,r13 *previous_mode_set = old_mode; 800e9ec: 5a 2d 00 00 sw (r17+0),r13 /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 800e9f0: 21 c1 01 00 andi r1,r14,0x100 800e9f4: 44 20 00 04 be r1,r0,800ea04 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt ( Modes_Control mode_set ) { return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT; 800e9f8: 22 01 01 00 andi r1,r16,0x100 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 800e9fc: 64 21 00 00 cmpei r1,r1,0 800ea00: 31 61 00 70 sb (r11+112),r1 if ( mask & RTEMS_TIMESLICE_MASK ) { 800ea04: 21 c1 02 00 andi r1,r14,0x200 800ea08: 44 20 00 09 be r1,r0,800ea2c */ RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice ( Modes_Control mode_set ) { return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE; 800ea0c: 22 01 02 00 andi r1,r16,0x200 if ( _Modes_Is_timeslice(mode_set) ) { 800ea10: 44 20 00 3e be r1,r0,800eb08 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800ea14: 78 01 08 01 mvhi r1,0x801 800ea18: 38 21 98 98 ori r1,r1,0x9898 800ea1c: 28 22 00 00 lw r2,(r1+0) if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 800ea20: 34 01 00 01 mvi r1,1 800ea24: 59 61 00 78 sw (r11+120),r1 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800ea28: 59 62 00 74 sw (r11+116),r2 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 800ea2c: 21 c1 00 01 andi r1,r14,0x1 800ea30: 44 20 00 04 be r1,r0,800ea40 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 800ea34: 22 01 00 01 andi r1,r16,0x1 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 800ea38: 64 21 00 00 cmpei r1,r1,0 800ea3c: d0 01 00 00 wcsr IE,r1 * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 800ea40: 21 ce 04 00 andi r14,r14,0x400 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 800ea44: 34 04 00 00 mvi r4,0 if ( mask & RTEMS_ASR_MASK ) { 800ea48: 45 c0 00 11 be r14,r0,800ea8c */ RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled ( Modes_Control mode_set ) { return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR; 800ea4c: 22 10 04 00 andi r16,r16,0x400 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 800ea50: 41 81 00 08 lbu r1,(r12+8) #include #include #include #include rtems_status_code rtems_task_mode( 800ea54: 66 10 00 00 cmpei r16,r16,0 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 800ea58: 44 30 00 0d be r1,r16,800ea8c asr->is_enabled = is_asr_enabled; 800ea5c: 31 90 00 08 sb (r12+8),r16 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 800ea60: 90 00 08 00 rcsr r1,IE 800ea64: 34 02 ff fe mvi r2,-2 800ea68: a0 22 10 00 and r2,r1,r2 800ea6c: d0 02 00 00 wcsr IE,r2 _signals = information->signals_pending; 800ea70: 29 83 00 18 lw r3,(r12+24) information->signals_pending = information->signals_posted; 800ea74: 29 82 00 14 lw r2,(r12+20) information->signals_posted = _signals; 800ea78: 59 83 00 14 sw (r12+20),r3 rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; 800ea7c: 59 82 00 18 sw (r12+24),r2 information->signals_posted = _signals; _ISR_Enable( _level ); 800ea80: d0 01 00 00 wcsr IE,r1 _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 800ea84: 29 84 00 14 lw r4,(r12+20) /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 800ea88: 7c 84 00 00 cmpnei r4,r4,0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 800ea8c: 78 01 08 01 mvhi r1,0x801 800ea90: 38 21 9a 74 ori r1,r1,0x9a74 800ea94: 28 23 00 00 lw r3,(r1+0) 800ea98: 34 01 00 03 mvi r1,3 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 800ea9c: 34 02 00 00 mvi r2,0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 800eaa0: 44 61 00 0f be r3,r1,800eadc if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; } 800eaa4: b8 40 08 00 mv r1,r2 800eaa8: 2b 9d 00 04 lw ra,(sp+4) 800eaac: 2b 8b 00 24 lw r11,(sp+36) 800eab0: 2b 8c 00 20 lw r12,(sp+32) 800eab4: 2b 8d 00 1c lw r13,(sp+28) 800eab8: 2b 8e 00 18 lw r14,(sp+24) 800eabc: 2b 8f 00 14 lw r15,(sp+20) 800eac0: 2b 90 00 10 lw r16,(sp+16) 800eac4: 2b 91 00 0c lw r17,(sp+12) 800eac8: 2b 92 00 08 lw r18,(sp+8) 800eacc: 37 9c 00 24 addi sp,sp,36 800ead0: c3 a0 00 00 ret old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 800ead4: 39 ad 02 00 ori r13,r13,0x200 800ead8: e3 ff ff be bi 800e9d0 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 800eadc: 29 e1 00 10 lw r1,(r15+16) if ( are_signals_pending || 800eae0: 5c 80 00 05 bne r4,r0,800eaf4 800eae4: 29 e3 00 14 lw r3,(r15+20) 800eae8: 44 23 ff ef be r1,r3,800eaa4 (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 800eaec: 40 21 00 70 lbu r1,(r1+112) 800eaf0: 44 20 ff ed be r1,r0,800eaa4 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 800eaf4: 34 01 00 01 mvi r1,1 800eaf8: 31 e1 00 0c sb (r15+12),r1 } } if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 800eafc: f8 00 03 56 calli 800f854 <_Thread_Dispatch> } return RTEMS_SUCCESSFUL; 800eb00: 34 02 00 00 mvi r2,0 800eb04: e3 ff ff e8 bi 800eaa4 if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800eb08: 59 60 00 78 sw (r11+120),r0 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 800eb0c: 21 c1 00 01 andi r1,r14,0x1 800eb10: 44 20 ff cc be r1,r0,800ea40 800eb14: e3 ff ff c8 bi 800ea34 =============================================================================== 08009798 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 8009798: 37 9c ff f0 addi sp,sp,-16 800979c: 5b 8b 00 0c sw (sp+12),r11 80097a0: 5b 8c 00 08 sw (sp+8),r12 80097a4: 5b 9d 00 04 sw (sp+4),ra 80097a8: b8 40 58 00 mv r11,r2 80097ac: b8 60 60 00 mv r12,r3 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 80097b0: 44 40 00 06 be r2,r0,80097c8 RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 80097b4: 78 02 08 01 mvhi r2,0x801 80097b8: 38 42 a0 d8 ori r2,r2,0xa0d8 80097bc: 40 42 00 00 lbu r2,(r2+0) !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 80097c0: 34 04 00 13 mvi r4,19 */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 80097c4: 55 62 00 08 bgu r11,r2,80097e4 if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 80097c8: 34 04 00 09 mvi r4,9 if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 80097cc: 45 80 00 06 be r12,r0,80097e4 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 80097d0: 37 82 00 10 addi r2,sp,16 80097d4: f8 00 0b 57 calli 800c530 <_Thread_Get> switch ( location ) { 80097d8: 2b 82 00 10 lw r2,(sp+16) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 80097dc: 34 04 00 04 mvi r4,4 if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); switch ( location ) { 80097e0: 44 40 00 07 be r2,r0,80097fc case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80097e4: b8 80 08 00 mv r1,r4 80097e8: 2b 9d 00 04 lw ra,(sp+4) 80097ec: 2b 8b 00 0c lw r11,(sp+12) 80097f0: 2b 8c 00 08 lw r12,(sp+8) 80097f4: 37 9c 00 10 addi sp,sp,16 80097f8: c3 a0 00 00 ret the_thread = _Thread_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 80097fc: 28 23 00 14 lw r3,(r1+20) 8009800: 59 83 00 00 sw (r12+0),r3 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 8009804: 45 62 00 09 be r11,r2,8009828 the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 8009808: 28 22 00 1c lw r2,(r1+28) case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; if ( new_priority != RTEMS_CURRENT_PRIORITY ) { the_thread->real_priority = new_priority; 800980c: 58 2b 00 18 sw (r1+24),r11 if ( the_thread->resource_count == 0 || 8009810: 44 40 00 03 be r2,r0,800981c 8009814: 28 22 00 14 lw r2,(r1+20) 8009818: 51 62 00 04 bgeu r11,r2,8009828 <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 800981c: b9 60 10 00 mv r2,r11 8009820: 34 03 00 00 mvi r3,0 8009824: f8 00 09 c6 calli 800bf3c <_Thread_Change_priority> } _Thread_Enable_dispatch(); 8009828: f8 00 0b 36 calli 800c500 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 800982c: 34 04 00 00 mvi r4,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8009830: b8 80 08 00 mv r1,r4 8009834: 2b 9d 00 04 lw ra,(sp+4) 8009838: 2b 8b 00 0c lw r11,(sp+12) 800983c: 2b 8c 00 08 lw r12,(sp+8) 8009840: 37 9c 00 10 addi sp,sp,16 8009844: c3 a0 00 00 ret =============================================================================== 08004fa4 : rtems_status_code rtems_task_variable_add( rtems_id tid, void **ptr, void (*dtor)(void *) ) { 8004fa4: 37 9c ff ec addi sp,sp,-20 8004fa8: 5b 8b 00 10 sw (sp+16),r11 8004fac: 5b 8c 00 0c sw (sp+12),r12 8004fb0: 5b 8d 00 08 sw (sp+8),r13 8004fb4: 5b 9d 00 04 sw (sp+4),ra 8004fb8: b8 40 58 00 mv r11,r2 8004fbc: b8 60 68 00 mv r13,r3 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *new; if ( !ptr ) return RTEMS_INVALID_ADDRESS; 8004fc0: 34 02 00 09 mvi r2,9 { Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *new; if ( !ptr ) 8004fc4: 45 60 00 07 be r11,r0,8004fe0 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 8004fc8: 37 82 00 14 addi r2,sp,20 8004fcc: f8 00 09 af calli 8007688 <_Thread_Get> 8004fd0: b8 20 60 00 mv r12,r1 switch (location) { 8004fd4: 2b 81 00 14 lw r1,(sp+20) #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8004fd8: 34 02 00 04 mvi r2,4 if ( !ptr ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); switch (location) { 8004fdc: 44 20 00 08 be r1,r0,8004ffc case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8004fe0: b8 40 08 00 mv r1,r2 8004fe4: 2b 9d 00 04 lw ra,(sp+4) 8004fe8: 2b 8b 00 10 lw r11,(sp+16) 8004fec: 2b 8c 00 0c lw r12,(sp+12) 8004ff0: 2b 8d 00 08 lw r13,(sp+8) 8004ff4: 37 9c 00 14 addi sp,sp,20 8004ff8: c3 a0 00 00 ret case OBJECTS_LOCAL: /* * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; 8004ffc: 29 84 01 20 lw r4,(r12+288) while (tvp) { 8005000: 44 81 00 08 be r4,r1,8005020 if (tvp->ptr == ptr) { 8005004: 28 81 00 04 lw r1,(r4+4) 8005008: 5c 2b 00 04 bne r1,r11,8005018 800500c: e0 00 00 18 bi 800506c 8005010: 28 82 00 04 lw r2,(r4+4) 8005014: 44 4b 00 16 be r2,r11,800506c <== NEVER TAKEN tvp->dtor = dtor; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; 8005018: 28 84 00 00 lw r4,(r4+0) case OBJECTS_LOCAL: /* * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; while (tvp) { 800501c: 5c 80 ff fd bne r4,r0,8005010 /* * Now allocate memory for this task variable. */ new = (rtems_task_variable_t *) _Workspace_Allocate(sizeof(rtems_task_variable_t)); 8005020: 34 01 00 14 mvi r1,20 8005024: f8 00 0e 5f calli 80089a0 <_Workspace_Allocate> if (new == NULL) { 8005028: 44 20 00 1b be r1,r0,8005094 } new->gval = *ptr; new->ptr = ptr; new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; 800502c: 29 82 01 20 lw r2,(r12+288) _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { _Thread_Enable_dispatch(); return RTEMS_NO_MEMORY; } new->gval = *ptr; 8005030: 29 63 00 00 lw r3,(r11+0) new->ptr = ptr; 8005034: 58 2b 00 04 sw (r1+4),r11 new->dtor = dtor; 8005038: 58 2d 00 10 sw (r1+16),r13 _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { _Thread_Enable_dispatch(); return RTEMS_NO_MEMORY; } new->gval = *ptr; 800503c: 58 23 00 08 sw (r1+8),r3 new->ptr = ptr; new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; 8005040: 58 22 00 00 sw (r1+0),r2 the_thread->task_variables = new; 8005044: 59 81 01 20 sw (r12+288),r1 _Thread_Enable_dispatch(); 8005048: f8 00 09 84 calli 8007658 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 800504c: 34 02 00 00 mvi r2,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8005050: b8 40 08 00 mv r1,r2 8005054: 2b 9d 00 04 lw ra,(sp+4) 8005058: 2b 8b 00 10 lw r11,(sp+16) 800505c: 2b 8c 00 0c lw r12,(sp+12) 8005060: 2b 8d 00 08 lw r13,(sp+8) 8005064: 37 9c 00 14 addi sp,sp,20 8005068: c3 a0 00 00 ret * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; while (tvp) { if (tvp->ptr == ptr) { tvp->dtor = dtor; 800506c: 58 8d 00 10 sw (r4+16),r13 _Thread_Enable_dispatch(); 8005070: f8 00 09 7a calli 8007658 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8005074: 34 02 00 00 mvi r2,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8005078: b8 40 08 00 mv r1,r2 800507c: 2b 9d 00 04 lw ra,(sp+4) 8005080: 2b 8b 00 10 lw r11,(sp+16) 8005084: 2b 8c 00 0c lw r12,(sp+12) 8005088: 2b 8d 00 08 lw r13,(sp+8) 800508c: 37 9c 00 14 addi sp,sp,20 8005090: c3 a0 00 00 ret * Now allocate memory for this task variable. */ new = (rtems_task_variable_t *) _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { _Thread_Enable_dispatch(); 8005094: f8 00 09 71 calli 8007658 <_Thread_Enable_dispatch> return RTEMS_NO_MEMORY; 8005098: 34 02 00 1a mvi r2,26 800509c: e3 ff ff d1 bi 8004fe0 =============================================================================== 080050a0 : rtems_status_code rtems_task_variable_delete( rtems_id tid, void **ptr ) { 80050a0: 37 9c ff f4 addi sp,sp,-12 80050a4: 5b 8b 00 08 sw (sp+8),r11 80050a8: 5b 9d 00 04 sw (sp+4),ra 80050ac: b8 40 58 00 mv r11,r2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) return RTEMS_INVALID_ADDRESS; 80050b0: 34 02 00 09 mvi r2,9 { Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) 80050b4: 45 60 00 06 be r11,r0,80050cc return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); 80050b8: 37 82 00 0c addi r2,sp,12 80050bc: f8 00 09 73 calli 8007688 <_Thread_Get> switch (location) { 80050c0: 2b 82 00 0c lw r2,(sp+12) 80050c4: 44 40 00 07 be r2,r0,80050e0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 80050c8: 34 02 00 04 mvi r2,4 } 80050cc: b8 40 08 00 mv r1,r2 80050d0: 2b 9d 00 04 lw ra,(sp+4) 80050d4: 2b 8b 00 08 lw r11,(sp+8) 80050d8: 37 9c 00 0c addi sp,sp,12 80050dc: c3 a0 00 00 ret the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; 80050e0: 28 24 01 20 lw r4,(r1+288) while (tvp) { 80050e4: 44 82 00 09 be r4,r2,8005108 if (tvp->ptr == ptr) { 80050e8: 28 82 00 04 lw r2,(r4+4) 80050ec: 5c 4b 00 05 bne r2,r11,8005100 80050f0: e0 00 00 18 bi 8005150 80050f4: 28 62 00 04 lw r2,(r3+4) 80050f8: 44 4b 00 0b be r2,r11,8005124 80050fc: b8 60 20 00 mv r4,r3 _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; 8005100: 28 83 00 00 lw r3,(r4+0) the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { 8005104: 5c 60 ff fc bne r3,r0,80050f4 <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 8005108: f8 00 09 54 calli 8007658 <_Thread_Enable_dispatch> return RTEMS_INVALID_ADDRESS; 800510c: 34 02 00 09 mvi r2,9 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8005110: b8 40 08 00 mv r1,r2 8005114: 2b 9d 00 04 lw ra,(sp+4) 8005118: 2b 8b 00 08 lw r11,(sp+8) 800511c: 37 9c 00 0c addi sp,sp,12 8005120: c3 a0 00 00 ret case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { if (tvp->ptr == ptr) { if (prev) prev->next = tvp->next; 8005124: 28 62 00 00 lw r2,(r3+0) 8005128: 58 82 00 00 sw (r4+0),r2 else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 800512c: b8 60 10 00 mv r2,r3 8005130: f8 00 00 39 calli 8005214 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 8005134: f8 00 09 49 calli 8007658 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8005138: 34 02 00 00 mvi r2,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 800513c: b8 40 08 00 mv r1,r2 8005140: 2b 9d 00 04 lw ra,(sp+4) 8005144: 2b 8b 00 08 lw r11,(sp+8) 8005148: 37 9c 00 0c addi sp,sp,12 800514c: c3 a0 00 00 ret while (tvp) { if (tvp->ptr == ptr) { if (prev) prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; 8005150: 28 82 00 00 lw r2,(r4+0) 8005154: b8 80 18 00 mv r3,r4 8005158: 58 22 01 20 sw (r1+288),r2 800515c: e3 ff ff f4 bi 800512c =============================================================================== 08005160 : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 8005160: 37 9c ff f0 addi sp,sp,-16 8005164: 5b 8b 00 0c sw (sp+12),r11 8005168: 5b 8c 00 08 sw (sp+8),r12 800516c: 5b 9d 00 04 sw (sp+4),ra 8005170: b8 40 58 00 mv r11,r2 8005174: b8 60 60 00 mv r12,r3 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) return RTEMS_INVALID_ADDRESS; 8005178: 34 02 00 09 mvi r2,9 { Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 800517c: 45 60 00 07 be r11,r0,8005198 return RTEMS_INVALID_ADDRESS; if ( !result ) 8005180: 44 60 00 06 be r3,r0,8005198 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 8005184: 37 82 00 10 addi r2,sp,16 8005188: f8 00 09 40 calli 8007688 <_Thread_Get> switch (location) { 800518c: 2b 82 00 10 lw r2,(sp+16) 8005190: 44 40 00 08 be r2,r0,80051b0 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8005194: 34 02 00 04 mvi r2,4 } 8005198: b8 40 08 00 mv r1,r2 800519c: 2b 9d 00 04 lw ra,(sp+4) 80051a0: 2b 8b 00 0c lw r11,(sp+12) 80051a4: 2b 8c 00 08 lw r12,(sp+8) 80051a8: 37 9c 00 10 addi sp,sp,16 80051ac: c3 a0 00 00 ret case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 80051b0: 28 21 01 20 lw r1,(r1+288) while (tvp) { 80051b4: 5c 22 00 04 bne r1,r2,80051c4 80051b8: e0 00 00 0f bi 80051f4 */ *result = tvp->tval; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; 80051bc: 28 21 00 00 lw r1,(r1+0) case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; while (tvp) { 80051c0: 44 20 00 0d be r1,r0,80051f4 <== NEVER TAKEN if (tvp->ptr == ptr) { 80051c4: 28 22 00 04 lw r2,(r1+4) 80051c8: 5c 4b ff fd bne r2,r11,80051bc /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; 80051cc: 28 21 00 0c lw r1,(r1+12) 80051d0: 59 81 00 00 sw (r12+0),r1 _Thread_Enable_dispatch(); 80051d4: f8 00 09 21 calli 8007658 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80051d8: 34 02 00 00 mvi r2,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80051dc: b8 40 08 00 mv r1,r2 80051e0: 2b 9d 00 04 lw ra,(sp+4) 80051e4: 2b 8b 00 0c lw r11,(sp+12) 80051e8: 2b 8c 00 08 lw r12,(sp+8) 80051ec: 37 9c 00 10 addi sp,sp,16 80051f0: c3 a0 00 00 ret _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 80051f4: f8 00 09 19 calli 8007658 <_Thread_Enable_dispatch> return RTEMS_INVALID_ADDRESS; 80051f8: 34 02 00 09 mvi r2,9 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80051fc: b8 40 08 00 mv r1,r2 8005200: 2b 9d 00 04 lw ra,(sp+4) 8005204: 2b 8b 00 0c lw r11,(sp+12) 8005208: 2b 8c 00 08 lw r12,(sp+8) 800520c: 37 9c 00 10 addi sp,sp,16 8005210: c3 a0 00 00 ret =============================================================================== 0800569c : #include rtems_status_code rtems_task_wake_when( rtems_time_of_day *time_buffer ) { 800569c: 37 9c ff ec addi sp,sp,-20 80056a0: 5b 8b 00 14 sw (sp+20),r11 80056a4: 5b 8c 00 10 sw (sp+16),r12 80056a8: 5b 8d 00 0c sw (sp+12),r13 80056ac: 5b 8e 00 08 sw (sp+8),r14 80056b0: 5b 9d 00 04 sw (sp+4),ra Watchdog_Interval seconds; if ( !_TOD.is_set ) 80056b4: 78 0b 08 02 mvhi r11,0x802 80056b8: 39 6b 08 a8 ori r11,r11,0x8a8 80056bc: 41 62 00 14 lbu r2,(r11+20) #include rtems_status_code rtems_task_wake_when( rtems_time_of_day *time_buffer ) { 80056c0: b8 20 68 00 mv r13,r1 Watchdog_Interval seconds; if ( !_TOD.is_set ) return RTEMS_NOT_DEFINED; 80056c4: 34 0c 00 0b mvi r12,11 rtems_time_of_day *time_buffer ) { Watchdog_Interval seconds; if ( !_TOD.is_set ) 80056c8: 44 40 00 07 be r2,r0,80056e4 return RTEMS_NOT_DEFINED; if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; 80056cc: 34 0c 00 09 mvi r12,9 Watchdog_Interval seconds; if ( !_TOD.is_set ) return RTEMS_NOT_DEFINED; if ( !time_buffer ) 80056d0: 44 20 00 05 be r1,r0,80056e4 return RTEMS_INVALID_ADDRESS; time_buffer->ticks = 0; 80056d4: 58 20 00 18 sw (r1+24),r0 if ( !_TOD_Validate( time_buffer ) ) 80056d8: fb ff fd 5c calli 8004c48 <_TOD_Validate> return RTEMS_INVALID_CLOCK; 80056dc: 34 0c 00 14 mvi r12,20 if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; time_buffer->ticks = 0; if ( !_TOD_Validate( time_buffer ) ) 80056e0: 5c 20 00 09 bne r1,r0,8005704 &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 80056e4: b9 80 08 00 mv r1,r12 80056e8: 2b 9d 00 04 lw ra,(sp+4) 80056ec: 2b 8b 00 14 lw r11,(sp+20) 80056f0: 2b 8c 00 10 lw r12,(sp+16) 80056f4: 2b 8d 00 0c lw r13,(sp+12) 80056f8: 2b 8e 00 08 lw r14,(sp+8) 80056fc: 37 9c 00 14 addi sp,sp,20 8005700: c3 a0 00 00 ret time_buffer->ticks = 0; if ( !_TOD_Validate( time_buffer ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( time_buffer ); 8005704: b9 a0 08 00 mv r1,r13 8005708: fb ff fc ef calli 8004ac4 <_TOD_To_seconds> static inline uint32_t _Timestamp64_implementation_Get_seconds( const Timestamp64_Control *_time ) { return (uint32_t) (*_time / 1000000000L); 800570c: 78 03 08 01 mvhi r3,0x801 8005710: 38 63 df 44 ori r3,r3,0xdf44 8005714: b8 20 70 00 mv r14,r1 8005718: 28 64 00 00 lw r4,(r3+0) 800571c: 29 62 00 04 lw r2,(r11+4) 8005720: 29 61 00 00 lw r1,(r11+0) 8005724: 34 03 00 00 mvi r3,0 8005728: f8 00 47 c5 calli 801763c <__divdi3> if ( seconds <= _TOD_Seconds_since_epoch() ) 800572c: 50 4e ff ee bgeu r2,r14,80056e4 <== NEVER TAKEN * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8005730: 78 02 08 02 mvhi r2,0x802 8005734: 38 42 09 28 ori r2,r2,0x928 8005738: 28 41 00 00 lw r1,(r2+0) ++level; 800573c: 34 21 00 01 addi r1,r1,1 _Thread_Dispatch_disable_level = level; 8005740: 58 41 00 00 sw (r2+0),r1 return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); 8005744: 78 0d 08 02 mvhi r13,0x802 8005748: 39 ad 0a a0 ori r13,r13,0xaa0 800574c: 29 a1 00 10 lw r1,(r13+16) 8005750: 34 02 00 10 mvi r2,16 _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 8005754: 34 0c 00 00 mvi r12,0 if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); 8005758: f8 00 0d 57 calli 8008cb4 <_Thread_Set_state> _Watchdog_Initialize( &_Thread_Executing->Timer, 800575c: 29 ad 00 10 lw r13,(r13+16) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8005760: 78 01 08 00 mvhi r1,0x800 8005764: 38 21 7f d0 ori r1,r1,0x7fd0 if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); _Watchdog_Initialize( 8005768: 29 a2 00 08 lw r2,(r13+8) 800576c: 78 03 08 01 mvhi r3,0x801 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8005770: 59 a0 00 50 sw (r13+80),r0 the_watchdog->routine = routine; 8005774: 59 a1 00 64 sw (r13+100),r1 the_watchdog->id = id; 8005778: 59 a2 00 68 sw (r13+104),r2 the_watchdog->user_data = user_data; 800577c: 59 a0 00 6c sw (r13+108),r0 8005780: 38 63 df 44 ori r3,r3,0xdf44 8005784: 28 64 00 00 lw r4,(r3+0) 8005788: 29 61 00 00 lw r1,(r11+0) 800578c: 29 62 00 04 lw r2,(r11+4) 8005790: 34 03 00 00 mvi r3,0 8005794: f8 00 47 aa calli 801763c <__divdi3> &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_seconds( 8005798: c9 c2 70 00 sub r14,r14,r2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 800579c: 78 01 08 02 mvhi r1,0x802 80057a0: 38 21 09 b4 ori r1,r1,0x9b4 80057a4: 35 a2 00 48 addi r2,r13,72 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80057a8: 59 ae 00 54 sw (r13+84),r14 _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 80057ac: f8 00 0e 96 calli 8009204 <_Watchdog_Insert> &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 80057b0: f8 00 0a a6 calli 8008248 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80057b4: e3 ff ff cc bi 80056e4 =============================================================================== 080150c8 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 80150c8: 37 9c ff f8 addi sp,sp,-8 80150cc: 5b 9d 00 04 sw (sp+4),ra 80150d0: b8 20 10 00 mv r2,r1 Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) _Objects_Get( &_Timer_Information, id, location ); 80150d4: 78 01 08 03 mvhi r1,0x803 80150d8: 38 21 df 30 ori r1,r1,0xdf30 80150dc: 37 83 00 08 addi r3,sp,8 80150e0: f8 00 0e aa calli 8018b88 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 80150e4: 2b 82 00 08 lw r2,(sp+8) 80150e8: 44 40 00 05 be r2,r0,80150fc #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 80150ec: 34 01 00 04 mvi r1,4 } 80150f0: 2b 9d 00 04 lw ra,(sp+4) 80150f4: 37 9c 00 08 addi sp,sp,8 80150f8: c3 a0 00 00 ret the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 80150fc: 28 23 00 38 lw r3,(r1+56) 8015100: 34 02 00 04 mvi r2,4 8015104: 44 62 00 03 be r3,r2,8015110 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 8015108: 34 21 00 10 addi r1,r1,16 801510c: f8 00 17 b7 calli 801afe8 <_Watchdog_Remove> _Thread_Enable_dispatch(); 8015110: f8 00 13 0a calli 8019d38 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8015114: 34 01 00 00 mvi r1,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8015118: 2b 9d 00 04 lw ra,(sp+4) 801511c: 37 9c 00 08 addi sp,sp,8 8015120: c3 a0 00 00 ret =============================================================================== 0801576c : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 801576c: 37 9c ff d8 addi sp,sp,-40 8015770: 5b 8b 00 24 sw (sp+36),r11 8015774: 5b 8c 00 20 sw (sp+32),r12 8015778: 5b 8d 00 1c sw (sp+28),r13 801577c: 5b 8e 00 18 sw (sp+24),r14 8015780: 5b 8f 00 14 sw (sp+20),r15 8015784: 5b 90 00 10 sw (sp+16),r16 8015788: 5b 91 00 0c sw (sp+12),r17 801578c: 5b 92 00 08 sw (sp+8),r18 8015790: 5b 9d 00 04 sw (sp+4),ra Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 8015794: 78 05 08 03 mvhi r5,0x803 8015798: 38 a5 df 70 ori r5,r5,0xdf70 801579c: 28 ad 00 00 lw r13,(r5+0) rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 80157a0: b8 20 80 00 mv r16,r1 80157a4: b8 40 70 00 mv r14,r2 80157a8: b8 60 78 00 mv r15,r3 80157ac: b8 80 88 00 mv r17,r4 Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 80157b0: 34 0c 00 0e mvi r12,14 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 80157b4: 45 a0 00 0c be r13,r0,80157e4 return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) 80157b8: 78 0b 08 03 mvhi r11,0x803 80157bc: 39 6b dc 50 ori r11,r11,0xdc50 80157c0: 41 65 00 14 lbu r5,(r11+20) return RTEMS_NOT_DEFINED; 80157c4: 34 0c 00 0b mvi r12,11 Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) 80157c8: 44 a0 00 07 be r5,r0,80157e4 <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; 80157cc: 34 0c 00 09 mvi r12,9 return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 80157d0: 44 60 00 05 be r3,r0,80157e4 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 80157d4: b8 40 08 00 mv r1,r2 80157d8: fb ff ef f6 calli 80117b0 <_TOD_Validate> return RTEMS_INVALID_CLOCK; 80157dc: 34 0c 00 14 mvi r12,20 return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 80157e0: 5c 20 00 0d bne r1,r0,8015814 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80157e4: b9 80 08 00 mv r1,r12 80157e8: 2b 9d 00 04 lw ra,(sp+4) 80157ec: 2b 8b 00 24 lw r11,(sp+36) 80157f0: 2b 8c 00 20 lw r12,(sp+32) 80157f4: 2b 8d 00 1c lw r13,(sp+28) 80157f8: 2b 8e 00 18 lw r14,(sp+24) 80157fc: 2b 8f 00 14 lw r15,(sp+20) 8015800: 2b 90 00 10 lw r16,(sp+16) 8015804: 2b 91 00 0c lw r17,(sp+12) 8015808: 2b 92 00 08 lw r18,(sp+8) 801580c: 37 9c 00 28 addi sp,sp,40 8015810: c3 a0 00 00 ret return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8015814: b9 c0 08 00 mv r1,r14 8015818: fb ff ef 85 calli 801162c <_TOD_To_seconds> 801581c: 78 03 08 03 mvhi r3,0x803 8015820: 38 63 75 fc ori r3,r3,0x75fc 8015824: b8 20 90 00 mv r18,r1 8015828: 28 64 00 00 lw r4,(r3+0) 801582c: 29 62 00 04 lw r2,(r11+4) 8015830: 29 61 00 00 lw r1,(r11+0) 8015834: 34 03 00 00 mvi r3,0 8015838: f8 00 52 4e calli 802a170 <__divdi3> if ( seconds <= _TOD_Seconds_since_epoch() ) 801583c: 50 52 ff ea bgeu r2,r18,80157e4 8015840: 78 01 08 03 mvhi r1,0x803 8015844: 38 21 df 30 ori r1,r1,0xdf30 8015848: ba 00 10 00 mv r2,r16 801584c: 37 83 00 28 addi r3,sp,40 8015850: f8 00 0c ce calli 8018b88 <_Objects_Get> 8015854: b8 20 70 00 mv r14,r1 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8015858: 2b 81 00 28 lw r1,(sp+40) #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 801585c: 34 0c 00 04 mvi r12,4 seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8015860: 5c 20 ff e1 bne r1,r0,80157e4 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 8015864: 35 c1 00 10 addi r1,r14,16 8015868: f8 00 15 e0 calli 801afe8 <_Watchdog_Remove> the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 801586c: 34 01 00 03 mvi r1,3 8015870: 78 03 08 03 mvhi r3,0x803 8015874: 59 c1 00 38 sw (r14+56),r1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8015878: 59 c0 00 18 sw (r14+24),r0 the_watchdog->routine = routine; 801587c: 59 cf 00 2c sw (r14+44),r15 the_watchdog->id = id; 8015880: 59 d0 00 30 sw (r14+48),r16 the_watchdog->user_data = user_data; 8015884: 59 d1 00 34 sw (r14+52),r17 8015888: 38 63 75 fc ori r3,r3,0x75fc 801588c: 28 64 00 00 lw r4,(r3+0) 8015890: 29 61 00 00 lw r1,(r11+0) 8015894: 29 62 00 04 lw r2,(r11+4) 8015898: 34 03 00 00 mvi r3,0 the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 801589c: 34 0c 00 00 mvi r12,0 80158a0: f8 00 52 34 calli 802a170 <__divdi3> (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); 80158a4: 29 a3 00 04 lw r3,(r13+4) case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 80158a8: ca 42 90 00 sub r18,r18,r2 (*timer_server->schedule_operation)( timer_server, the_timer ); 80158ac: b9 a0 08 00 mv r1,r13 80158b0: b9 c0 10 00 mv r2,r14 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 80158b4: 59 d2 00 1c sw (r14+28),r18 (*timer_server->schedule_operation)( timer_server, the_timer ); 80158b8: d8 60 00 00 call r3 _Thread_Enable_dispatch(); 80158bc: f8 00 11 1f calli 8019d38 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80158c0: e3 ff ff c9 bi 80157e4