08014e74 <_CORE_message_queue_Broadcast>: Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 8014e74: 37 9c ff e4 addi sp,sp,-28 8014e78: 5b 8b 00 1c sw (sp+28),r11 8014e7c: 5b 8c 00 18 sw (sp+24),r12 8014e80: 5b 8d 00 14 sw (sp+20),r13 8014e84: 5b 8e 00 10 sw (sp+16),r14 8014e88: 5b 8f 00 0c sw (sp+12),r15 8014e8c: 5b 90 00 08 sw (sp+8),r16 8014e90: 5b 9d 00 04 sw (sp+4),ra 8014e94: b8 20 58 00 mv r11,r1 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 8014e98: 28 21 00 4c lw r1,(r1+76) Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 8014e9c: b8 60 70 00 mv r14,r3 8014ea0: b8 40 80 00 mv r16,r2 8014ea4: b8 c0 78 00 mv r15,r6 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 8014ea8: 50 23 00 03 bgeu r1,r3,8014eb4 <_CORE_message_queue_Broadcast+0x40><== ALWAYS TAKEN 8014eac: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8014eb0: e0 00 00 13 bi 8014efc <_CORE_message_queue_Broadcast+0x88><== NOT EXECUTED * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 8014eb4: 29 63 00 48 lw r3,(r11+72) 8014eb8: 34 01 00 00 mvi r1,0 * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 8014ebc: b8 60 68 00 mv r13,r3 * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 8014ec0: 44 61 00 08 be r3,r1,8014ee0 <_CORE_message_queue_Broadcast+0x6c> *count = 0; 8014ec4: 58 c1 00 00 sw (r6+0),r1 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 8014ec8: e0 00 00 0d bi 8014efc <_CORE_message_queue_Broadcast+0x88> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 8014ecc: 29 81 00 2c lw r1,(r12+44) */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 8014ed0: 35 ad 00 01 addi r13,r13,1 8014ed4: f8 00 26 93 calli 801e920 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 8014ed8: 29 81 00 28 lw r1,(r12+40) 8014edc: 58 2e 00 00 sw (r1+0),r14 * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 8014ee0: b9 60 08 00 mv r1,r11 8014ee4: f8 00 0b d3 calli 8017e30 <_Thread_queue_Dequeue> 8014ee8: b8 20 60 00 mv r12,r1 8014eec: ba 00 10 00 mv r2,r16 8014ef0: b9 c0 18 00 mv r3,r14 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 8014ef4: 5c 20 ff f6 bne r1,r0,8014ecc <_CORE_message_queue_Broadcast+0x58> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 8014ef8: 59 ed 00 00 sw (r15+0),r13 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 8014efc: 2b 9d 00 04 lw ra,(sp+4) 8014f00: 2b 8b 00 1c lw r11,(sp+28) 8014f04: 2b 8c 00 18 lw r12,(sp+24) 8014f08: 2b 8d 00 14 lw r13,(sp+20) 8014f0c: 2b 8e 00 10 lw r14,(sp+16) 8014f10: 2b 8f 00 0c lw r15,(sp+12) 8014f14: 2b 90 00 08 lw r16,(sp+8) 8014f18: 37 9c 00 1c addi sp,sp,28 8014f1c: c3 a0 00 00 ret 0800d6b4 <_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 ) { 800d6b4: 37 9c ff e8 addi sp,sp,-24 800d6b8: 5b 8b 00 18 sw (sp+24),r11 800d6bc: 5b 8c 00 14 sw (sp+20),r12 800d6c0: 5b 8d 00 10 sw (sp+16),r13 800d6c4: 5b 8e 00 0c sw (sp+12),r14 800d6c8: 5b 8f 00 08 sw (sp+8),r15 800d6cc: 5b 9d 00 04 sw (sp+4),ra 800d6d0: b8 20 58 00 mv r11,r1 size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; the_message_queue->number_of_pending_messages = 0; 800d6d4: 34 01 00 00 mvi r1,0 800d6d8: 59 61 00 48 sw (r11+72),r1 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 800d6dc: 59 63 00 44 sw (r11+68),r3 the_message_queue->number_of_pending_messages = 0; the_message_queue->maximum_message_size = maximum_message_size; 800d6e0: 59 64 00 4c sw (r11+76),r4 /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { 800d6e4: 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 ) { 800d6e8: b8 60 68 00 mv r13,r3 800d6ec: b8 40 78 00 mv r15,r2 /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { 800d6f0: b8 80 60 00 mv r12,r4 800d6f4: 44 20 00 05 be r1,r0,800d708 <_CORE_message_queue_Initialize+0x54> allocated_message_size += sizeof(uint32_t); 800d6f8: 34 8c 00 04 addi r12,r4,4 allocated_message_size &= ~(sizeof(uint32_t) - 1); 800d6fc: 34 01 ff fc mvi r1,-4 800d700: a1 81 60 00 and r12,r12,r1 } if (allocated_message_size < maximum_message_size) 800d704: 54 8c 00 1c bgu r4,r12,800d774 <_CORE_message_queue_Initialize+0xc0><== NEVER TAKEN /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); 800d708: 35 8e 00 10 addi r14,r12,16 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * 800d70c: b9 c0 08 00 mv r1,r14 800d710: b9 a0 10 00 mv r2,r13 800d714: f8 00 64 bc calli 8026a04 <__mulsi3> (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 800d718: 55 81 00 17 bgu r12,r1,800d774 <_CORE_message_queue_Initialize+0xc0><== NEVER TAKEN return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 800d71c: f8 00 0d 98 calli 8010d7c <_Workspace_Allocate> 800d720: 59 61 00 5c sw (r11+92),r1 _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 800d724: 44 20 00 14 be r1,r0,800d774 <_CORE_message_queue_Initialize+0xc0> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 800d728: b8 20 10 00 mv r2,r1 800d72c: b9 a0 18 00 mv r3,r13 800d730: b9 c0 20 00 mv r4,r14 800d734: 35 61 00 60 addi r1,r11,96 800d738: f8 00 15 fe calli 8012f30 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 800d73c: 29 e2 00 00 lw r2,(r15+0) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 800d740: 35 63 00 54 addi r3,r11,84 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 800d744: 35 61 00 50 addi r1,r11,80 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 800d748: 59 63 00 50 sw (r11+80),r3 800d74c: 64 42 00 01 cmpei r2,r2,1 the_chain->permanent_null = NULL; 800d750: 34 03 00 00 mvi r3,0 800d754: 59 63 00 54 sw (r11+84),r3 the_chain->last = _Chain_Head(the_chain); 800d758: 59 61 00 58 sw (r11+88),r1 800d75c: 34 03 00 80 mvi r3,128 800d760: b9 60 08 00 mv r1,r11 800d764: 34 04 00 06 mvi r4,6 800d768: f8 00 0a 1d calli 800ffdc <_Thread_queue_Initialize> 800d76c: 34 01 00 01 mvi r1,1 THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 800d770: e0 00 00 02 bi 800d778 <_CORE_message_queue_Initialize+0xc4> 800d774: 34 01 00 00 mvi r1,0 } 800d778: 2b 9d 00 04 lw ra,(sp+4) 800d77c: 2b 8b 00 18 lw r11,(sp+24) 800d780: 2b 8c 00 14 lw r12,(sp+20) 800d784: 2b 8d 00 10 lw r13,(sp+16) 800d788: 2b 8e 00 0c lw r14,(sp+12) 800d78c: 2b 8f 00 08 lw r15,(sp+8) 800d790: 37 9c 00 18 addi sp,sp,24 800d794: c3 a0 00 00 ret 0800d798 <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800d798: 37 9c ff f4 addi sp,sp,-12 800d79c: 5b 8b 00 0c sw (sp+12),r11 800d7a0: 5b 8c 00 08 sw (sp+8),r12 800d7a4: 5b 9d 00 04 sw (sp+4),ra ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 800d7a8: 78 07 08 02 mvhi r7,0x802 800d7ac: 38 e7 aa 78 ori r7,r7,0xaa78 800d7b0: 28 e7 00 00 lw r7,(r7+0) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800d7b4: b8 20 58 00 mv r11,r1 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 800d7b8: 34 01 00 00 mvi r1,0 800d7bc: 58 e1 00 34 sw (r7+52),r1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800d7c0: 20 a5 00 ff andi r5,r5,0xff 800d7c4: b8 60 08 00 mv r1,r3 CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 800d7c8: 90 00 40 00 rcsr r8,IE 800d7cc: 34 03 ff fe mvi r3,-2 800d7d0: a1 03 18 00 and r3,r8,r3 800d7d4: d0 03 00 00 wcsr IE,r3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 800d7d8: 29 6c 00 50 lw r12,(r11+80) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800d7dc: 35 63 00 54 addi r3,r11,84 800d7e0: 5d 83 00 03 bne r12,r3,800d7ec <_CORE_message_queue_Seize+0x54> 800d7e4: 34 0c 00 00 mvi r12,0 800d7e8: e0 00 00 17 bi 800d844 <_CORE_message_queue_Seize+0xac> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 800d7ec: 29 83 00 00 lw r3,(r12+0) the_chain->first = new_first; new_first->previous = _Chain_Head(the_chain); 800d7f0: 35 69 00 50 addi r9,r11,80 Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; the_chain->first = new_first; 800d7f4: 59 63 00 50 sw (r11+80),r3 new_first->previous = _Chain_Head(the_chain); 800d7f8: 58 69 00 04 sw (r3+4),r9 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 800d7fc: 45 80 00 12 be r12,r0,800d844 <_CORE_message_queue_Seize+0xac><== NEVER TAKEN the_message_queue->number_of_pending_messages -= 1; 800d800: 29 62 00 48 lw r2,(r11+72) 800d804: 34 42 ff ff addi r2,r2,-1 800d808: 59 62 00 48 sw (r11+72),r2 _ISR_Enable( level ); 800d80c: d0 08 00 00 wcsr IE,r8 *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 800d810: 78 02 08 02 mvhi r2,0x802 800d814: 38 42 aa 78 ori r2,r2,0xaa78 800d818: 28 42 00 00 lw r2,(r2+0) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; 800d81c: 29 83 00 08 lw r3,(r12+8) _Thread_Executing->Wait.count = 800d820: 34 05 00 00 mvi r5,0 800d824: 58 45 00 24 sw (r2+36),r5 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; 800d828: 58 83 00 00 sw (r4+0),r3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800d82c: 35 82 00 0c addi r2,r12,12 800d830: f8 00 22 45 calli 8016144 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 800d834: 35 61 00 60 addi r1,r11,96 800d838: b9 80 10 00 mv r2,r12 800d83c: fb ff ff 6e calli 800d5f4 <_Chain_Append> /* * There is not an API with blocking sends enabled. * So return immediately. */ _CORE_message_queue_Free_message_buffer(the_message_queue, the_message); return; 800d840: e0 00 00 12 bi 800d888 <_CORE_message_queue_Seize+0xf0> return; } #endif } if ( !wait ) { 800d844: 5c ac 00 05 bne r5,r12,800d858 <_CORE_message_queue_Seize+0xc0> _ISR_Enable( level ); 800d848: d0 08 00 00 wcsr IE,r8 executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 800d84c: 34 01 00 04 mvi r1,4 800d850: 58 e1 00 34 sw (r7+52),r1 return; 800d854: e0 00 00 0d bi 800d888 <_CORE_message_queue_Seize+0xf0> 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; 800d858: 34 03 00 01 mvi r3,1 800d85c: 59 63 00 30 sw (r11+48),r3 _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 800d860: 58 e4 00 28 sw (r7+40),r4 return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; 800d864: 58 e2 00 20 sw (r7+32),r2 executing->Wait.return_argument_second.mutable_object = buffer; 800d868: 58 e1 00 2c sw (r7+44),r1 executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 800d86c: 58 eb 00 44 sw (r7+68),r11 executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 800d870: d0 08 00 00 wcsr IE,r8 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 800d874: 78 03 08 01 mvhi r3,0x801 800d878: b9 60 08 00 mv r1,r11 800d87c: b8 c0 10 00 mv r2,r6 800d880: 38 63 00 bc ori r3,r3,0xbc 800d884: f8 00 09 0e calli 800fcbc <_Thread_queue_Enqueue_with_handler> } 800d888: 2b 9d 00 04 lw ra,(sp+4) 800d88c: 2b 8b 00 0c lw r11,(sp+12) 800d890: 2b 8c 00 08 lw r12,(sp+8) 800d894: 37 9c 00 0c addi sp,sp,12 800d898: c3 a0 00 00 ret 08002bec <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8002bec: 37 9c ff e8 addi sp,sp,-24 8002bf0: 5b 8b 00 14 sw (sp+20),r11 8002bf4: 5b 8c 00 10 sw (sp+16),r12 8002bf8: 5b 8d 00 0c sw (sp+12),r13 8002bfc: 5b 8e 00 08 sw (sp+8),r14 8002c00: 5b 9d 00 04 sw (sp+4),ra _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 8002c04: 78 06 08 01 mvhi r6,0x801 8002c08: 38 c6 c8 24 ori r6,r6,0xc824 8002c0c: 28 c6 00 00 lw r6,(r6+0) Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8002c10: 5b 85 00 18 sw (sp+24),r5 8002c14: b8 20 58 00 mv r11,r1 8002c18: b8 40 70 00 mv r14,r2 8002c1c: b8 80 68 00 mv r13,r4 8002c20: 20 6c 00 ff andi r12,r3,0xff _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 8002c24: 44 c0 00 0b be r6,r0,8002c50 <_CORE_mutex_Seize+0x64> 8002c28: 45 80 00 0a be r12,r0,8002c50 <_CORE_mutex_Seize+0x64> <== NEVER TAKEN 8002c2c: 78 01 08 01 mvhi r1,0x801 8002c30: 38 21 c9 c0 ori r1,r1,0xc9c0 8002c34: 28 21 00 00 lw r1,(r1+0) 8002c38: 34 02 00 01 mvi r2,1 8002c3c: 50 41 00 05 bgeu r2,r1,8002c50 <_CORE_mutex_Seize+0x64> 8002c40: 34 01 00 00 mvi r1,0 8002c44: b8 20 10 00 mv r2,r1 8002c48: 34 03 00 13 mvi r3,19 8002c4c: f8 00 01 d4 calli 800339c <_Internal_error_Occurred> 8002c50: b9 60 08 00 mv r1,r11 8002c54: 37 82 00 18 addi r2,sp,24 8002c58: f8 00 15 30 calli 8008118 <_CORE_mutex_Seize_interrupt_trylock> 8002c5c: 44 20 00 19 be r1,r0,8002cc0 <_CORE_mutex_Seize+0xd4> 8002c60: 78 01 08 01 mvhi r1,0x801 8002c64: 38 21 c8 e0 ori r1,r1,0xc8e0 8002c68: 5d 80 00 07 bne r12,r0,8002c84 <_CORE_mutex_Seize+0x98> 8002c6c: 2b 82 00 18 lw r2,(sp+24) 8002c70: d0 02 00 00 wcsr IE,r2 8002c74: 28 21 00 00 lw r1,(r1+0) 8002c78: 34 02 00 01 mvi r2,1 8002c7c: 58 22 00 34 sw (r1+52),r2 8002c80: e0 00 00 10 bi 8002cc0 <_CORE_mutex_Seize+0xd4> 8002c84: 28 23 00 00 lw r3,(r1+0) 8002c88: 78 01 08 01 mvhi r1,0x801 8002c8c: 38 21 c8 24 ori r1,r1,0xc824 8002c90: 58 6e 00 20 sw (r3+32),r14 8002c94: 28 22 00 00 lw r2,(r1+0) RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8002c98: 34 04 00 01 mvi r4,1 8002c9c: 59 64 00 30 sw (r11+48),r4 8002ca0: b4 44 10 00 add r2,r2,r4 8002ca4: 58 22 00 00 sw (r1+0),r2 8002ca8: 58 6b 00 44 sw (r3+68),r11 8002cac: 2b 81 00 18 lw r1,(sp+24) 8002cb0: d0 01 00 00 wcsr IE,r1 8002cb4: b9 60 08 00 mv r1,r11 8002cb8: b9 a0 10 00 mv r2,r13 8002cbc: fb ff ff ab calli 8002b68 <_CORE_mutex_Seize_interrupt_blocking> } 8002cc0: 2b 9d 00 04 lw ra,(sp+4) 8002cc4: 2b 8b 00 14 lw r11,(sp+20) 8002cc8: 2b 8c 00 10 lw r12,(sp+16) 8002ccc: 2b 8d 00 0c lw r13,(sp+12) 8002cd0: 2b 8e 00 08 lw r14,(sp+8) 8002cd4: 37 9c 00 18 addi sp,sp,24 8002cd8: c3 a0 00 00 ret 08008118 <_CORE_mutex_Seize_interrupt_trylock>: #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { 8008118: 37 9c ff fc addi sp,sp,-4 800811c: 5b 9d 00 04 sw (sp+4),ra { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 8008120: 78 03 08 01 mvhi r3,0x801 8008124: 38 63 c8 e0 ori r3,r3,0xc8e0 8008128: 28 63 00 00 lw r3,(r3+0) executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 800812c: 34 04 00 00 mvi r4,0 8008130: 58 64 00 34 sw (r3+52),r4 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 8008134: 28 25 00 50 lw r5,(r1+80) 8008138: 44 a4 00 34 be r5,r4,8008208 <_CORE_mutex_Seize_interrupt_trylock+0xf0> the_mutex->lock = CORE_MUTEX_LOCKED; 800813c: 58 24 00 50 sw (r1+80),r4 the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 8008140: 28 65 00 08 lw r5,(r3+8) */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 8008144: 28 24 00 48 lw r4,(r1+72) executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; 8008148: 58 23 00 5c sw (r1+92),r3 the_mutex->holder_id = executing->Object.id; 800814c: 58 25 00 60 sw (r1+96),r5 the_mutex->nest_count = 1; 8008150: 34 05 00 01 mvi r5,1 8008154: 58 25 00 54 sw (r1+84),r5 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 8008158: 34 05 00 02 mvi r5,2 800815c: 44 85 00 03 be r4,r5,8008168 <_CORE_mutex_Seize_interrupt_trylock+0x50> 8008160: 34 05 00 03 mvi r5,3 8008164: 5c 85 00 06 bne r4,r5,800817c <_CORE_mutex_Seize_interrupt_trylock+0x64> _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 8008168: 28 65 00 1c lw r5,(r3+28) 800816c: 34 a5 00 01 addi r5,r5,1 8008170: 58 65 00 1c sw (r3+28),r5 } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 8008174: 34 05 00 03 mvi r5,3 8008178: 44 85 00 04 be r4,r5,8008188 <_CORE_mutex_Seize_interrupt_trylock+0x70> _ISR_Enable( *level_p ); 800817c: 28 41 00 00 lw r1,(r2+0) 8008180: d0 01 00 00 wcsr IE,r1 8008184: e0 00 00 2d bi 8008238 <_CORE_mutex_Seize_interrupt_trylock+0x120> */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 8008188: 28 25 00 4c lw r5,(r1+76) current = executing->current_priority; 800818c: 28 64 00 14 lw r4,(r3+20) if ( current == ceiling ) { 8008190: 5c 85 00 04 bne r4,r5,80081a0 <_CORE_mutex_Seize_interrupt_trylock+0x88> _ISR_Enable( *level_p ); 8008194: 28 41 00 00 lw r1,(r2+0) 8008198: d0 01 00 00 wcsr IE,r1 800819c: e0 00 00 27 bi 8008238 <_CORE_mutex_Seize_interrupt_trylock+0x120> return 0; } if ( current > ceiling ) { 80081a0: 50 a4 00 0e bgeu r5,r4,80081d8 <_CORE_mutex_Seize_interrupt_trylock+0xc0> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80081a4: 78 03 08 01 mvhi r3,0x801 80081a8: 38 63 c8 24 ori r3,r3,0xc824 80081ac: 28 64 00 00 lw r4,(r3+0) 80081b0: 34 84 00 01 addi r4,r4,1 80081b4: 58 64 00 00 sw (r3+0),r4 _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 80081b8: 28 42 00 00 lw r2,(r2+0) 80081bc: d0 02 00 00 wcsr IE,r2 _Thread_Change_priority( 80081c0: 28 22 00 4c lw r2,(r1+76) 80081c4: 28 21 00 5c lw r1,(r1+92) 80081c8: 34 03 00 00 mvi r3,0 80081cc: fb ff ee c2 calli 8003cd4 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 80081d0: fb ff f0 32 calli 8004298 <_Thread_Enable_dispatch> 80081d4: e0 00 00 19 bi 8008238 <_CORE_mutex_Seize_interrupt_trylock+0x120> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 80081d8: 34 04 00 06 mvi r4,6 80081dc: 58 64 00 34 sw (r3+52),r4 the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */ 80081e0: 34 04 00 00 mvi r4,0 80081e4: 58 24 00 54 sw (r1+84),r4 _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; the_mutex->lock = CORE_MUTEX_UNLOCKED; 80081e8: 34 04 00 01 mvi r4,1 80081ec: 58 24 00 50 sw (r1+80),r4 the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ 80081f0: 28 61 00 1c lw r1,(r3+28) 80081f4: 34 21 ff ff addi r1,r1,-1 80081f8: 58 61 00 1c sw (r3+28),r1 _ISR_Enable( *level_p ); 80081fc: 28 41 00 00 lw r1,(r2+0) 8008200: d0 01 00 00 wcsr IE,r1 8008204: e0 00 00 0d bi 8008238 <_CORE_mutex_Seize_interrupt_trylock+0x120> /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 8008208: 28 24 00 5c lw r4,(r1+92) 800820c: 5c 83 00 12 bne r4,r3,8008254 <_CORE_mutex_Seize_interrupt_trylock+0x13c> switch ( the_mutex->Attributes.lock_nesting_behavior ) { 8008210: 28 23 00 40 lw r3,(r1+64) 8008214: 44 60 00 04 be r3,r0,8008224 <_CORE_mutex_Seize_interrupt_trylock+0x10c> 8008218: 34 01 00 01 mvi r1,1 800821c: 5c 61 00 0e bne r3,r1,8008254 <_CORE_mutex_Seize_interrupt_trylock+0x13c><== ALWAYS TAKEN 8008220: e0 00 00 08 bi 8008240 <_CORE_mutex_Seize_interrupt_trylock+0x128><== NOT EXECUTED case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 8008224: 28 23 00 54 lw r3,(r1+84) 8008228: 34 63 00 01 addi r3,r3,1 800822c: 58 23 00 54 sw (r1+84),r3 _ISR_Enable( *level_p ); 8008230: 28 41 00 00 lw r1,(r2+0) 8008234: d0 01 00 00 wcsr IE,r1 8008238: 34 01 00 00 mvi r1,0 800823c: e0 00 00 07 bi 8008258 <_CORE_mutex_Seize_interrupt_trylock+0x140> return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 8008240: 34 01 00 02 mvi r1,2 <== NOT EXECUTED 8008244: 58 81 00 34 sw (r4+52),r1 <== NOT EXECUTED _ISR_Enable( *level_p ); 8008248: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 800824c: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED 8008250: e3 ff ff fa bi 8008238 <_CORE_mutex_Seize_interrupt_trylock+0x120><== NOT EXECUTED 8008254: 34 01 00 01 mvi r1,1 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 8008258: 2b 9d 00 04 lw ra,(sp+4) 800825c: 37 9c 00 04 addi sp,sp,4 8008260: c3 a0 00 00 ret 0800827c <_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 ) { 800827c: 37 9c ff f8 addi sp,sp,-8 8008280: 5b 8b 00 08 sw (sp+8),r11 8008284: 5b 9d 00 04 sw (sp+4),ra 8008288: 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)) ) { 800828c: fb ff f1 12 calli 80046d4 <_Thread_queue_Dequeue> 8008290: 34 02 00 00 mvi r2,0 8008294: 5c 22 00 0e bne r1,r2,80082cc <_CORE_semaphore_Surrender+0x50> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 8008298: 90 00 08 00 rcsr r1,IE 800829c: 34 02 ff fe mvi r2,-2 80082a0: a0 22 10 00 and r2,r1,r2 80082a4: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 80082a8: 29 62 00 48 lw r2,(r11+72) 80082ac: 29 63 00 40 lw r3,(r11+64) 80082b0: 54 62 00 03 bgu r3,r2,80082bc <_CORE_semaphore_Surrender+0x40><== ALWAYS TAKEN 80082b4: 34 02 00 04 mvi r2,4 <== NOT EXECUTED 80082b8: e0 00 00 04 bi 80082c8 <_CORE_semaphore_Surrender+0x4c> <== NOT EXECUTED the_semaphore->count += 1; 80082bc: 34 42 00 01 addi r2,r2,1 80082c0: 59 62 00 48 sw (r11+72),r2 80082c4: 34 02 00 00 mvi r2,0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 80082c8: d0 01 00 00 wcsr IE,r1 } return status; } 80082cc: b8 40 08 00 mv r1,r2 80082d0: 2b 9d 00 04 lw ra,(sp+4) 80082d4: 2b 8b 00 08 lw r11,(sp+8) 80082d8: 37 9c 00 08 addi sp,sp,8 80082dc: c3 a0 00 00 ret 0800d670 <_Event_Seize>: rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 800d670: 37 9c ff f8 addi sp,sp,-8 800d674: 5b 8b 00 08 sw (sp+8),r11 800d678: 5b 9d 00 04 sw (sp+4),ra rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 800d67c: 78 05 08 02 mvhi r5,0x802 800d680: 38 a5 39 70 ori r5,r5,0x3970 800d684: 28 ab 00 00 lw r11,(r5+0) executing->Wait.return_code = RTEMS_SUCCESSFUL; 800d688: 34 05 00 00 mvi r5,0 800d68c: 59 65 00 34 sw (r11+52),r5 api = executing->API_Extensions[ THREAD_API_RTEMS ]; 800d690: 29 67 01 24 lw r7,(r11+292) _ISR_Disable( level ); 800d694: 90 00 30 00 rcsr r6,IE 800d698: 34 05 ff fe mvi r5,-2 800d69c: a0 c5 28 00 and r5,r6,r5 800d6a0: d0 05 00 00 wcsr IE,r5 pending_events = api->pending_events; 800d6a4: 28 e8 00 00 lw r8,(r7+0) 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 ); 800d6a8: a0 28 28 00 and r5,r1,r8 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 800d6ac: 44 a0 00 09 be r5,r0,800d6d0 <_Event_Seize+0x60> 800d6b0: 44 a1 00 03 be r5,r1,800d6bc <_Event_Seize+0x4c> 800d6b4: 20 49 00 02 andi r9,r2,0x2 800d6b8: 45 20 00 06 be r9,r0,800d6d0 <_Event_Seize+0x60> <== NEVER TAKEN (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 800d6bc: a4 a0 08 00 not r1,r5 800d6c0: a0 28 40 00 and r8,r1,r8 800d6c4: 58 e8 00 00 sw (r7+0),r8 _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 800d6c8: d0 06 00 00 wcsr IE,r6 800d6cc: e0 00 00 06 bi 800d6e4 <_Event_Seize+0x74> *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 800d6d0: 20 47 00 01 andi r7,r2,0x1 800d6d4: 44 e0 00 06 be r7,r0,800d6ec <_Event_Seize+0x7c> _ISR_Enable( level ); 800d6d8: d0 06 00 00 wcsr IE,r6 executing->Wait.return_code = RTEMS_UNSATISFIED; 800d6dc: 34 01 00 0d mvi r1,13 800d6e0: 59 61 00 34 sw (r11+52),r1 *event_out = seized_events; 800d6e4: 58 85 00 00 sw (r4+0),r5 return; 800d6e8: e0 00 00 29 bi 800d78c <_Event_Seize+0x11c> */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800d6ec: 78 05 08 02 mvhi r5,0x802 800d6f0: 38 a5 3b b0 ori r5,r5,0x3bb0 800d6f4: 34 07 00 01 mvi r7,1 800d6f8: 58 a7 00 00 sw (r5+0),r7 * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 800d6fc: 59 62 00 30 sw (r11+48),r2 executing->Wait.count = (uint32_t) event_in; 800d700: 59 61 00 24 sw (r11+36),r1 executing->Wait.return_argument = event_out; 800d704: 59 64 00 28 sw (r11+40),r4 _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; _ISR_Enable( level ); 800d708: d0 06 00 00 wcsr IE,r6 if ( ticks ) { 800d70c: 34 04 00 00 mvi r4,0 800d710: 44 64 00 0d be r3,r4,800d744 <_Event_Seize+0xd4> _Watchdog_Initialize( 800d714: 29 65 00 08 lw r5,(r11+8) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 800d718: 78 02 08 00 mvhi r2,0x800 800d71c: 38 42 d9 58 ori r2,r2,0xd958 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800d720: 78 01 08 02 mvhi r1,0x802 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 800d724: 59 62 00 64 sw (r11+100),r2 the_watchdog->id = id; 800d728: 59 65 00 68 sw (r11+104),r5 the_watchdog->user_data = user_data; 800d72c: 59 64 00 6c sw (r11+108),r4 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800d730: 59 63 00 54 sw (r11+84),r3 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 800d734: 59 64 00 50 sw (r11+80),r4 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800d738: 38 21 39 90 ori r1,r1,0x3990 800d73c: 35 62 00 48 addi r2,r11,72 800d740: fb ff e8 91 calli 8007984 <_Watchdog_Insert> NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 800d744: b9 60 08 00 mv r1,r11 800d748: 34 02 01 00 mvi r2,256 800d74c: fb ff e6 9d calli 80071c0 <_Thread_Set_state> _ISR_Disable( level ); 800d750: 90 00 18 00 rcsr r3,IE 800d754: 34 01 ff fe mvi r1,-2 800d758: a0 61 08 00 and r1,r3,r1 800d75c: d0 01 00 00 wcsr IE,r1 sync_state = _Event_Sync_state; 800d760: 78 02 08 02 mvhi r2,0x802 800d764: 38 42 3b b0 ori r2,r2,0x3bb0 800d768: 28 41 00 00 lw r1,(r2+0) _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 800d76c: 34 04 00 00 mvi r4,0 800d770: 58 44 00 00 sw (r2+0),r4 if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 800d774: 34 02 00 01 mvi r2,1 800d778: 5c 22 00 03 bne r1,r2,800d784 <_Event_Seize+0x114> _ISR_Enable( level ); 800d77c: d0 03 00 00 wcsr IE,r3 return; 800d780: e0 00 00 03 bi 800d78c <_Event_Seize+0x11c> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 800d784: b9 60 10 00 mv r2,r11 800d788: f8 00 05 b5 calli 800ee5c <_Thread_blocking_operation_Cancel> } 800d78c: 2b 9d 00 04 lw ra,(sp+4) 800d790: 2b 8b 00 08 lw r11,(sp+8) 800d794: 37 9c 00 08 addi sp,sp,8 800d798: c3 a0 00 00 ret 0800d804 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 800d804: 37 9c ff f8 addi sp,sp,-8 800d808: 5b 8b 00 08 sw (sp+8),r11 800d80c: 5b 9d 00 04 sw (sp+4),ra rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; RTEMS_API_Control *api; api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 800d810: 28 24 01 24 lw r4,(r1+292) option_set = (rtems_option) the_thread->Wait.option; 800d814: 28 28 00 30 lw r8,(r1+48) */ void _Event_Surrender( Thread_Control *the_thread ) { 800d818: b8 20 58 00 mv r11,r1 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 800d81c: 90 00 08 00 rcsr r1,IE 800d820: 34 07 ff fe mvi r7,-2 800d824: a0 27 38 00 and r7,r1,r7 800d828: d0 07 00 00 wcsr IE,r7 pending_events = api->pending_events; 800d82c: 28 85 00 00 lw r5,(r4+0) event_condition = (rtems_event_set) the_thread->Wait.count; 800d830: 29 66 00 24 lw r6,(r11+36) 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 ); 800d834: a0 c5 10 00 and r2,r6,r5 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 800d838: 5c 40 00 03 bne r2,r0,800d844 <_Event_Surrender+0x40> _ISR_Enable( level ); 800d83c: d0 01 00 00 wcsr IE,r1 return; 800d840: e0 00 00 42 bi 800d948 <_Event_Surrender+0x144> /* * 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() && 800d844: 78 03 08 02 mvhi r3,0x802 800d848: 38 63 39 4c ori r3,r3,0x394c 800d84c: 28 63 00 00 lw r3,(r3+0) 800d850: 44 60 00 1d be r3,r0,800d8c4 <_Event_Surrender+0xc0> 800d854: 78 03 08 02 mvhi r3,0x802 800d858: 38 63 39 70 ori r3,r3,0x3970 800d85c: 28 63 00 00 lw r3,(r3+0) 800d860: 5d 63 00 19 bne r11,r3,800d8c4 <_Event_Surrender+0xc0> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800d864: 78 03 08 02 mvhi r3,0x802 800d868: 38 63 3b b0 ori r3,r3,0x3bb0 800d86c: 28 6a 00 00 lw r10,(r3+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() && 800d870: 34 09 00 02 mvi r9,2 800d874: 45 49 00 04 be r10,r9,800d884 <_Event_Surrender+0x80> <== NEVER TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 800d878: 28 69 00 00 lw r9,(r3+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() && 800d87c: 34 03 00 01 mvi r3,1 800d880: 5d 23 00 11 bne r9,r3,800d8c4 <_Event_Surrender+0xc0> <== NEVER TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 800d884: 44 46 00 03 be r2,r6,800d890 <_Event_Surrender+0x8c> <== ALWAYS TAKEN 800d888: 21 08 00 02 andi r8,r8,0x2 <== NOT EXECUTED 800d88c: 45 00 00 0c be r8,r0,800d8bc <_Event_Surrender+0xb8> <== NOT EXECUTED api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 800d890: a4 40 18 00 not r3,r2 800d894: a0 65 28 00 and r5,r3,r5 the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800d898: 29 66 00 28 lw r6,(r11+40) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 800d89c: 58 85 00 00 sw (r4+0),r5 the_thread->Wait.count = 0; 800d8a0: 34 04 00 00 mvi r4,0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 800d8a4: 78 03 08 02 mvhi r3,0x802 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; 800d8a8: 59 64 00 24 sw (r11+36),r4 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 800d8ac: 38 63 3b b0 ori r3,r3,0x3bb0 ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800d8b0: 58 c2 00 00 sw (r6+0),r2 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 800d8b4: 34 02 00 03 mvi r2,3 800d8b8: 58 62 00 00 sw (r3+0),r2 } _ISR_Enable( level ); 800d8bc: d0 01 00 00 wcsr IE,r1 return; 800d8c0: e0 00 00 22 bi 800d948 <_Event_Surrender+0x144> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 800d8c4: 29 63 00 10 lw r3,(r11+16) 800d8c8: 20 63 01 00 andi r3,r3,0x100 800d8cc: 44 60 00 1e be r3,r0,800d944 <_Event_Surrender+0x140> <== NEVER TAKEN if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 800d8d0: 44 46 00 03 be r2,r6,800d8dc <_Event_Surrender+0xd8> 800d8d4: 21 08 00 02 andi r8,r8,0x2 800d8d8: 45 00 00 1b be r8,r0,800d944 <_Event_Surrender+0x140> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 800d8dc: a4 40 18 00 not r3,r2 800d8e0: a0 65 28 00 and r5,r3,r5 the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800d8e4: 29 66 00 28 lw r6,(r11+40) /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 800d8e8: 58 85 00 00 sw (r4+0),r5 the_thread->Wait.count = 0; 800d8ec: 34 03 00 00 mvi r3,0 800d8f0: 59 63 00 24 sw (r11+36),r3 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800d8f4: 58 c2 00 00 sw (r6+0),r2 _ISR_Flash( level ); 800d8f8: d0 01 00 00 wcsr IE,r1 800d8fc: d0 07 00 00 wcsr IE,r7 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 800d900: 29 63 00 50 lw r3,(r11+80) 800d904: 34 02 00 02 mvi r2,2 800d908: 44 62 00 05 be r3,r2,800d91c <_Event_Surrender+0x118> _ISR_Enable( level ); 800d90c: d0 01 00 00 wcsr IE,r1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800d910: 78 02 10 03 mvhi r2,0x1003 800d914: b9 60 08 00 mv r1,r11 800d918: e0 00 00 08 bi 800d938 <_Event_Surrender+0x134> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800d91c: 34 02 00 03 mvi r2,3 800d920: 59 62 00 50 sw (r11+80),r2 _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800d924: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 800d928: 35 61 00 48 addi r1,r11,72 800d92c: fb ff e8 75 calli 8007b00 <_Watchdog_Remove> 800d930: b9 60 08 00 mv r1,r11 800d934: 78 02 10 03 mvhi r2,0x1003 800d938: 38 42 ff f8 ori r2,r2,0xfff8 800d93c: f8 00 05 60 calli 800eebc <_Thread_Clear_state> 800d940: e0 00 00 02 bi 800d948 <_Event_Surrender+0x144> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 800d944: d0 01 00 00 wcsr IE,r1 } 800d948: 2b 9d 00 04 lw ra,(sp+4) 800d94c: 2b 8b 00 08 lw r11,(sp+8) 800d950: 37 9c 00 08 addi sp,sp,8 800d954: c3 a0 00 00 ret 0800d958 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 800d958: 37 9c ff f8 addi sp,sp,-8 800d95c: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 800d960: 37 82 00 08 addi r2,sp,8 800d964: fb ff e3 7b calli 8006750 <_Thread_Get> switch ( location ) { 800d968: 2b 82 00 08 lw r2,(sp+8) 800d96c: 5c 40 00 1d bne r2,r0,800d9e0 <_Event_Timeout+0x88> <== NEVER TAKEN * * 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 ); 800d970: 90 00 18 00 rcsr r3,IE 800d974: 34 02 ff fe mvi r2,-2 800d978: a0 62 10 00 and r2,r3,r2 800d97c: d0 02 00 00 wcsr IE,r2 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800d980: 78 02 08 02 mvhi r2,0x802 800d984: 38 42 39 70 ori r2,r2,0x3970 800d988: 28 42 00 00 lw r2,(r2+0) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800d98c: 34 04 00 00 mvi r4,0 800d990: 58 24 00 24 sw (r1+36),r4 if ( _Thread_Is_executing( the_thread ) ) { 800d994: 5c 22 00 08 bne r1,r2,800d9b4 <_Event_Timeout+0x5c> <== ALWAYS TAKEN if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800d998: 78 02 08 02 mvhi r2,0x802 <== NOT EXECUTED 800d99c: 38 42 3b b0 ori r2,r2,0x3bb0 <== NOT EXECUTED 800d9a0: 28 45 00 00 lw r5,(r2+0) <== NOT EXECUTED 800d9a4: 34 04 00 01 mvi r4,1 <== NOT EXECUTED 800d9a8: 5c a4 00 03 bne r5,r4,800d9b4 <_Event_Timeout+0x5c> <== NOT EXECUTED _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800d9ac: 34 04 00 02 mvi r4,2 <== NOT EXECUTED 800d9b0: 58 44 00 00 sw (r2+0),r4 <== NOT EXECUTED } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800d9b4: 34 02 00 06 mvi r2,6 800d9b8: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800d9bc: d0 03 00 00 wcsr IE,r3 800d9c0: 78 02 10 03 mvhi r2,0x1003 800d9c4: 38 42 ff f8 ori r2,r2,0xfff8 800d9c8: f8 00 05 3d calli 800eebc <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800d9cc: 78 01 08 02 mvhi r1,0x802 800d9d0: 38 21 38 b4 ori r1,r1,0x38b4 800d9d4: 28 22 00 00 lw r2,(r1+0) 800d9d8: 34 42 ff ff addi r2,r2,-1 800d9dc: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800d9e0: 2b 9d 00 04 lw ra,(sp+4) 800d9e4: 37 9c 00 08 addi sp,sp,8 800d9e8: c3 a0 00 00 ret 08008410 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 8008410: 37 9c ff b4 addi sp,sp,-76 8008414: 5b 8b 00 44 sw (sp+68),r11 8008418: 5b 8c 00 40 sw (sp+64),r12 800841c: 5b 8d 00 3c sw (sp+60),r13 8008420: 5b 8e 00 38 sw (sp+56),r14 8008424: 5b 8f 00 34 sw (sp+52),r15 8008428: 5b 90 00 30 sw (sp+48),r16 800842c: 5b 91 00 2c sw (sp+44),r17 8008430: 5b 92 00 28 sw (sp+40),r18 8008434: 5b 93 00 24 sw (sp+36),r19 8008438: 5b 94 00 20 sw (sp+32),r20 800843c: 5b 95 00 1c sw (sp+28),r21 8008440: 5b 96 00 18 sw (sp+24),r22 8008444: 5b 97 00 14 sw (sp+20),r23 8008448: 5b 98 00 10 sw (sp+16),r24 800844c: 5b 99 00 0c sw (sp+12),r25 8008450: 5b 9b 00 08 sw (sp+8),fp 8008454: 5b 9d 00 04 sw (sp+4),ra Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; 8008458: 34 55 00 04 addi r21,r2,4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800845c: b8 40 68 00 mv r13,r2 8008460: b8 20 60 00 mv r12,r1 8008464: b8 60 78 00 mv r15,r3 8008468: b8 80 90 00 mv r18,r4 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 800846c: 28 2e 00 08 lw r14,(r1+8) Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; 8008470: 28 33 00 10 lw r19,(r1+16) uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 8008474: 54 55 00 59 bgu r2,r21,80085d8 <_Heap_Allocate_aligned_with_boundary+0x1c8> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 8008478: 44 80 00 04 be r4,r0,8008488 <_Heap_Allocate_aligned_with_boundary+0x78> if ( boundary < alloc_size ) { 800847c: 54 44 00 57 bgu r2,r4,80085d8 <_Heap_Allocate_aligned_with_boundary+0x1c8> return NULL; } if ( alignment == 0 ) { 8008480: 5c 60 00 02 bne r3,r0,8008488 <_Heap_Allocate_aligned_with_boundary+0x78> 8008484: ba 60 78 00 mv r15,r19 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 8008488: 34 01 00 04 mvi r1,4 800848c: c8 2d 08 00 sub r1,r1,r13 8008490: 5b 81 00 4c sw (sp+76),r1 if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 8008494: 34 11 00 00 mvi r17,0 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; 8008498: 34 1b ff fe mvi fp,-2 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; 800849c: 36 79 00 07 addi r25,r19,7 /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 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; 80084a0: 34 18 ff f8 mvi r24,-8 80084a4: e0 00 00 3d bi 8008598 <_Heap_Allocate_aligned_with_boundary+0x188> /* * 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 ) { 80084a8: 29 d0 00 04 lw r16,(r14+4) while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 80084ac: 36 31 00 01 addi r17,r17,1 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 80084b0: 52 b0 00 39 bgeu r21,r16,8008594 <_Heap_Allocate_aligned_with_boundary+0x184> 80084b4: 35 d4 00 08 addi r20,r14,8 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 80084b8: ba 80 58 00 mv r11,r20 if ( alignment == 0 ) { 80084bc: 45 e0 00 35 be r15,r0,8008590 <_Heap_Allocate_aligned_with_boundary+0x180> uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 80084c0: 2b 81 00 4c lw r1,(sp+76) 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; 80084c4: a2 1b 80 00 and r16,r16,fp uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 80084c8: 29 96 00 14 lw r22,(r12+20) 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; 80084cc: b5 d0 80 00 add r16,r14,r16 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 80084d0: b4 30 58 00 add r11,r1,r16 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; 80084d4: cb 36 18 00 sub r3,r25,r22 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 80084d8: b9 60 08 00 mv r1,r11 80084dc: b9 e0 10 00 mv r2,r15 80084e0: b4 70 80 00 add r16,r3,r16 80084e4: f8 00 42 ff calli 80190e0 <__umodsi3> 80084e8: c9 61 58 00 sub r11,r11,r1 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 ) { 80084ec: 52 0b 00 05 bgeu r16,r11,8008500 <_Heap_Allocate_aligned_with_boundary+0xf0> 80084f0: ba 00 08 00 mv r1,r16 80084f4: b9 e0 10 00 mv r2,r15 80084f8: f8 00 42 fa calli 80190e0 <__umodsi3> 80084fc: ca 01 58 00 sub r11,r16,r1 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 8008500: 46 40 00 19 be r18,r0,8008564 <_Heap_Allocate_aligned_with_boundary+0x154> /* 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; 8008504: b5 6d 80 00 add r16,r11,r13 8008508: ba 00 08 00 mv r1,r16 800850c: ba 40 10 00 mv r2,r18 8008510: f8 00 42 f4 calli 80190e0 <__umodsi3> 8008514: ca 01 18 00 sub r3,r16,r1 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 8008518: b6 8d 20 00 add r4,r20,r13 800851c: e0 00 00 0b bi 8008548 <_Heap_Allocate_aligned_with_boundary+0x138> uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 8008520: 54 83 00 1d bgu r4,r3,8008594 <_Heap_Allocate_aligned_with_boundary+0x184> 8008524: 5b 84 00 48 sw (sp+72),r4 8008528: f8 00 42 ee calli 80190e0 <__umodsi3> 800852c: ca e1 58 00 sub r11,r23,r1 return 0; } alloc_begin = boundary_line - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 8008530: b5 6d 80 00 add r16,r11,r13 8008534: ba 00 08 00 mv r1,r16 8008538: ba 40 10 00 mv r2,r18 800853c: f8 00 42 e9 calli 80190e0 <__umodsi3> 8008540: 2b 84 00 48 lw r4,(sp+72) 8008544: ca 01 18 00 sub r3,r16,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 ) { 8008548: f6 03 80 00 cmpgu r16,r16,r3 800854c: f4 6b 28 00 cmpgu r5,r3,r11 if ( boundary_line < boundary_floor ) { return 0; } alloc_begin = boundary_line - alloc_size; 8008550: c8 6d b8 00 sub r23,r3,r13 /* 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 ) { 8008554: a2 05 80 00 and r16,r16,r5 8008558: b9 e0 10 00 mv r2,r15 800855c: ba e0 08 00 mv r1,r23 8008560: 5e 00 ff f0 bne r16,r0,8008520 <_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 ) { 8008564: 56 8b 00 0c bgu r20,r11,8008594 <_Heap_Allocate_aligned_with_boundary+0x184> 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; 8008568: cb 0e 80 00 sub r16,r24,r14 800856c: b9 60 08 00 mv r1,r11 8008570: ba 60 10 00 mv r2,r19 8008574: b6 0b 80 00 add r16,r16,r11 8008578: f8 00 42 da calli 80190e0 <__umodsi3> 800857c: ca 01 08 00 sub r1,r16,r1 if ( free_size >= min_block_size || free_size == 0 ) { 8008580: f0 36 b0 00 cmpgeu r22,r1,r22 8008584: 64 21 00 00 cmpei r1,r1,0 8008588: b8 36 08 00 or r1,r1,r22 800858c: 44 20 00 02 be r1,r0,8008594 <_Heap_Allocate_aligned_with_boundary+0x184> boundary ); } } if ( alloc_begin != 0 ) { 8008590: 5d 60 00 05 bne r11,r0,80085a4 <_Heap_Allocate_aligned_with_boundary+0x194><== ALWAYS TAKEN break; } block = block->next; 8008594: 29 ce 00 08 lw r14,(r14+8) if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 8008598: 5d cc ff c4 bne r14,r12,80084a8 <_Heap_Allocate_aligned_with_boundary+0x98> 800859c: 34 0b 00 00 mvi r11,0 80085a0: e0 00 00 09 bi 80085c4 <_Heap_Allocate_aligned_with_boundary+0x1b4> block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 80085a4: 29 81 00 4c lw r1,(r12+76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 80085a8: b9 c0 10 00 mv r2,r14 80085ac: b9 a0 20 00 mv r4,r13 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 80085b0: b4 31 08 00 add r1,r1,r17 80085b4: 59 81 00 4c sw (r12+76),r1 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 80085b8: b9 60 18 00 mv r3,r11 80085bc: b9 80 08 00 mv r1,r12 80085c0: fb ff eb 15 calli 8003214 <_Heap_Block_allocate> uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 80085c4: 29 81 00 44 lw r1,(r12+68) 80085c8: 50 31 00 02 bgeu r1,r17,80085d0 <_Heap_Allocate_aligned_with_boundary+0x1c0> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 80085cc: 59 91 00 44 sw (r12+68),r17 } return (void *) alloc_begin; 80085d0: b9 60 08 00 mv r1,r11 80085d4: e0 00 00 02 bi 80085dc <_Heap_Allocate_aligned_with_boundary+0x1cc> 80085d8: 34 01 00 00 mvi r1,0 } 80085dc: 2b 9d 00 04 lw ra,(sp+4) 80085e0: 2b 8b 00 44 lw r11,(sp+68) 80085e4: 2b 8c 00 40 lw r12,(sp+64) 80085e8: 2b 8d 00 3c lw r13,(sp+60) 80085ec: 2b 8e 00 38 lw r14,(sp+56) 80085f0: 2b 8f 00 34 lw r15,(sp+52) 80085f4: 2b 90 00 30 lw r16,(sp+48) 80085f8: 2b 91 00 2c lw r17,(sp+44) 80085fc: 2b 92 00 28 lw r18,(sp+40) 8008600: 2b 93 00 24 lw r19,(sp+36) 8008604: 2b 94 00 20 lw r20,(sp+32) 8008608: 2b 95 00 1c lw r21,(sp+28) 800860c: 2b 96 00 18 lw r22,(sp+24) 8008610: 2b 97 00 14 lw r23,(sp+20) 8008614: 2b 98 00 10 lw r24,(sp+16) 8008618: 2b 99 00 0c lw r25,(sp+12) 800861c: 2b 9b 00 08 lw fp,(sp+8) 8008620: 37 9c 00 4c addi sp,sp,76 8008624: c3 a0 00 00 ret 0800e374 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800e374: 37 9c ff e8 addi sp,sp,-24 800e378: 5b 8b 00 18 sw (sp+24),r11 800e37c: 5b 8c 00 14 sw (sp+20),r12 800e380: 5b 8d 00 10 sw (sp+16),r13 800e384: 5b 8e 00 0c sw (sp+12),r14 800e388: 5b 8f 00 08 sw (sp+8),r15 800e38c: 5b 9d 00 04 sw (sp+4),ra Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 800e390: 28 2d 00 18 lw r13,(r1+24) uintptr_t const heap_area_end = heap->area_end; 800e394: 28 25 00 1c lw r5,(r1+28) Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800e398: b8 20 58 00 mv r11,r1 Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 800e39c: f0 4d 68 00 cmpgeu r13,r2,r13 * 5. non-contiguous higher address (NOT SUPPORTED) * * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { 800e3a0: f4 a2 08 00 cmpgu r1,r5,r2 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800e3a4: b8 80 78 00 mv r15,r4 Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 800e3a8: a0 2d 68 00 and r13,r1,r13 uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; uintptr_t extend_size = 0; Heap_Block *const last_block = heap->last_block; 800e3ac: 29 6c 00 24 lw r12,(r11+36) uintptr_t *amount_extended ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 800e3b0: 34 01 00 01 mvi r1,1 800e3b4: 5d a0 00 26 bne r13,r0,800e44c <_Heap_Extend+0xd8> * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 800e3b8: 34 01 00 02 mvi r1,2 800e3bc: 5c 45 00 24 bne r2,r5,800e44c <_Heap_Extend+0xd8> { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; 800e3c0: b4 62 18 00 add r3,r3,r2 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 800e3c4: c8 6c 70 00 sub r14,r3,r12 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800e3c8: 29 62 00 10 lw r2,(r11+16) 800e3cc: 35 ce ff f8 addi r14,r14,-8 * Currently only case 4 should make it to this point. * The basic trick is to make the extend area look like a used * block and free it. */ heap->area_end = new_heap_area_end; 800e3d0: 59 63 00 1c sw (r11+28),r3 800e3d4: b9 c0 08 00 mv r1,r14 800e3d8: fb ff d7 e8 calli 8004378 <__umodsi3> 800e3dc: c9 c1 08 00 sub r1,r14,r1 extend_size = new_heap_area_end - (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE; extend_size = _Heap_Align_down( extend_size, heap->page_size ); *amount_extended = extend_size; 800e3e0: 59 e1 00 00 sw (r15+0),r1 if( extend_size >= heap->min_block_size ) { 800e3e4: 29 62 00 14 lw r2,(r11+20) 800e3e8: 50 22 00 02 bgeu r1,r2,800e3f0 <_Heap_Extend+0x7c> <== ALWAYS TAKEN 800e3ec: e0 00 00 17 bi 800e448 <_Heap_Extend+0xd4> <== NOT EXECUTED uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 800e3f0: 29 84 00 04 lw r4,(r12+4) Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 800e3f4: 29 63 00 20 lw r3,(r11+32) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800e3f8: b4 2c 10 00 add r2,r1,r12 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 800e3fc: 20 84 00 01 andi r4,r4,0x1 800e400: b8 24 20 00 or r4,r1,r4 800e404: c8 62 18 00 sub r3,r3,r2 800e408: 59 84 00 04 sw (r12+4),r4 800e40c: 38 63 00 01 ori r3,r3,0x1 800e410: 58 43 00 04 sw (r2+4),r3 | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 800e414: 29 65 00 2c lw r5,(r11+44) ++stats->used_blocks; 800e418: 29 64 00 40 lw r4,(r11+64) --stats->frees; /* Do not count subsequent call as actual free() */ 800e41c: 29 63 00 50 lw r3,(r11+80) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 800e420: b4 a1 08 00 add r1,r5,r1 ++stats->used_blocks; 800e424: 34 84 00 01 addi r4,r4,1 --stats->frees; /* Do not count subsequent call as actual free() */ 800e428: 34 63 ff ff addi r3,r3,-1 new_last_block->size_and_flag = ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 800e42c: 59 62 00 24 sw (r11+36),r2 /* Statistics */ stats->size += extend_size; 800e430: 59 61 00 2c sw (r11+44),r1 ++stats->used_blocks; 800e434: 59 64 00 40 sw (r11+64),r4 --stats->frees; /* Do not count subsequent call as actual free() */ 800e438: 59 63 00 50 sw (r11+80),r3 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 800e43c: b9 60 08 00 mv r1,r11 800e440: 35 82 00 08 addi r2,r12,8 800e444: fb ff e7 bb calli 8008330 <_Heap_Free> 800e448: b9 a0 08 00 mv r1,r13 } return HEAP_EXTEND_SUCCESSFUL; } 800e44c: 2b 9d 00 04 lw ra,(sp+4) 800e450: 2b 8b 00 18 lw r11,(sp+24) 800e454: 2b 8c 00 14 lw r12,(sp+20) 800e458: 2b 8d 00 10 lw r13,(sp+16) 800e45c: 2b 8e 00 0c lw r14,(sp+12) 800e460: 2b 8f 00 08 lw r15,(sp+8) 800e464: 37 9c 00 18 addi sp,sp,24 800e468: c3 a0 00 00 ret 08008628 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 8008628: 37 9c ff f4 addi sp,sp,-12 800862c: 5b 8b 00 0c sw (sp+12),r11 8008630: 5b 8c 00 08 sw (sp+8),r12 8008634: 5b 9d 00 04 sw (sp+4),ra 8008638: b8 40 18 00 mv r3,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 800863c: 28 22 00 10 lw r2,(r1+16) 8008640: b8 20 58 00 mv r11,r1 8008644: b8 60 08 00 mv r1,r3 8008648: 34 6c ff f8 addi r12,r3,-8 800864c: f8 00 42 a5 calli 80190e0 <__umodsi3> const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 8008650: 29 66 00 20 lw r6,(r11+32) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 8008654: c9 81 08 00 sub r1,r12,r1 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 8008658: 50 26 00 03 bgeu r1,r6,8008664 <_Heap_Free+0x3c> 800865c: 34 02 00 00 mvi r2,0 8008660: e0 00 00 03 bi 800866c <_Heap_Free+0x44> 8008664: 29 62 00 24 lw r2,(r11+36) 8008668: f0 41 10 00 cmpgeu r2,r2,r1 Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800866c: 44 40 00 66 be r2,r0,8008804 <_Heap_Free+0x1dc> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8008670: 28 25 00 04 lw r5,(r1+4) 8008674: 34 02 ff fe mvi r2,-2 8008678: a0 a2 10 00 and r2,r5,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800867c: b4 22 18 00 add r3,r1,r2 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 8008680: 50 66 00 03 bgeu r3,r6,800868c <_Heap_Free+0x64> <== ALWAYS TAKEN 8008684: 34 04 00 00 mvi r4,0 <== NOT EXECUTED 8008688: e0 00 00 03 bi 8008694 <_Heap_Free+0x6c> <== NOT EXECUTED 800868c: 29 64 00 24 lw r4,(r11+36) 8008690: f0 83 20 00 cmpgeu r4,r4,r3 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 8008694: 44 80 00 5c be r4,r0,8008804 <_Heap_Free+0x1dc> <== 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; 8008698: 28 64 00 04 lw r4,(r3+4) _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 800869c: 20 87 00 01 andi r7,r4,0x1 80086a0: 44 e0 00 59 be r7,r0,8008804 <_Heap_Free+0x1dc> <== NEVER TAKEN return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 80086a4: 29 68 00 24 lw r8,(r11+36) - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 80086a8: 34 07 ff fe mvi r7,-2 80086ac: a0 87 20 00 and r4,r4,r7 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 80086b0: 34 07 00 00 mvi r7,0 80086b4: 45 03 00 05 be r8,r3,80086c8 <_Heap_Free+0xa0> 80086b8: b4 64 38 00 add r7,r3,r4 80086bc: 28 e7 00 04 lw r7,(r7+4) 80086c0: 20 e7 00 01 andi r7,r7,0x1 80086c4: 18 e7 00 01 xori r7,r7,0x1 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 80086c8: 20 a5 00 01 andi r5,r5,0x1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 80086cc: 20 e7 00 ff andi r7,r7,0xff && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 80086d0: 5c a0 00 23 bne r5,r0,800875c <_Heap_Free+0x134> uintptr_t const prev_size = block->prev_size; 80086d4: 28 25 00 00 lw r5,(r1+0) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 80086d8: c8 25 08 00 sub r1,r1,r5 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 80086dc: f0 26 30 00 cmpgeu r6,r1,r6 80086e0: f1 01 40 00 cmpgeu r8,r8,r1 80086e4: c8 06 30 00 sub r6,r0,r6 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 80086e8: a1 06 40 00 and r8,r8,r6 80086ec: 45 00 00 46 be r8,r0,8008804 <_Heap_Free+0x1dc> <== NEVER TAKEN return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 80086f0: 28 26 00 04 lw r6,(r1+4) 80086f4: 20 c6 00 01 andi r6,r6,0x1 80086f8: 44 c0 00 43 be r6,r0,8008804 <_Heap_Free+0x1dc> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 80086fc: 44 e0 00 0f be r7,r0,8008738 <_Heap_Free+0x110> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 8008700: 29 68 00 38 lw r8,(r11+56) } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 8008704: 28 66 00 0c lw r6,(r3+12) return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 8008708: 28 67 00 08 lw r7,(r3+8) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 800870c: b4 44 20 00 add r4,r2,r4 8008710: b4 85 28 00 add r5,r4,r5 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 8008714: 35 03 ff ff addi r3,r8,-1 8008718: 59 63 00 38 sw (r11+56),r3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 800871c: b4 25 20 00 add r4,r1,r5 if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8008720: 38 a3 00 01 ori r3,r5,0x1 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 8008724: 58 e6 00 0c sw (r7+12),r6 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 8008728: 58 85 00 00 sw (r4+0),r5 if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800872c: 58 23 00 04 sw (r1+4),r3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 8008730: 58 c7 00 08 sw (r6+8),r7 8008734: e0 00 00 29 bi 80087d8 <_Heap_Free+0x1b0> next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 8008738: b4 45 28 00 add r5,r2,r5 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800873c: 38 a4 00 01 ori r4,r5,0x1 8008740: 58 24 00 04 sw (r1+4),r4 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8008744: 28 64 00 04 lw r4,(r3+4) 8008748: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 800874c: 58 65 00 00 sw (r3+0),r5 _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8008750: a0 81 08 00 and r1,r4,r1 8008754: 58 61 00 04 sw (r3+4),r1 8008758: e0 00 00 20 bi 80087d8 <_Heap_Free+0x1b0> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 800875c: 44 e0 00 0d be r7,r0,8008790 <_Heap_Free+0x168> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 8008760: 28 65 00 0c lw r5,(r3+12) RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 8008764: 28 66 00 08 lw r6,(r3+8) uintptr_t const size = block_size + next_block_size; 8008768: b4 82 18 00 add r3,r4,r2 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; 800876c: 58 25 00 0c sw (r1+12),r5 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 8008770: 58 26 00 08 sw (r1+8),r6 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 8008774: b4 23 38 00 add r7,r1,r3 next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8008778: 38 64 00 01 ori r4,r3,0x1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800877c: 58 e3 00 00 sw (r7+0),r3 new_block->prev = prev; next->prev = new_block; 8008780: 58 c1 00 0c sw (r6+12),r1 prev->next = new_block; 8008784: 58 a1 00 08 sw (r5+8),r1 next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8008788: 58 24 00 04 sw (r1+4),r4 800878c: e0 00 00 13 bi 80087d8 <_Heap_Free+0x1b0> next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 8008790: 38 44 00 01 ori r4,r2,0x1 8008794: 58 24 00 04 sw (r1+4),r4 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8008798: 28 65 00 04 lw r5,(r3+4) 800879c: 34 04 ff fe mvi r4,-2 next_block->prev_size = block_size; 80087a0: 58 62 00 00 sw (r3+0),r2 } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 80087a4: a0 a4 20 00 and r4,r5,r4 80087a8: 58 64 00 04 sw (r3+4),r4 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 80087ac: 29 63 00 38 lw r3,(r11+56) RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 80087b0: 29 64 00 08 lw r4,(r11+8) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 80087b4: 29 65 00 3c lw r5,(r11+60) new_block->next = next; new_block->prev = block_before; 80087b8: 58 2b 00 0c sw (r1+12),r11 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 80087bc: 58 24 00 08 sw (r1+8),r4 block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 80087c0: 34 63 00 01 addi r3,r3,1 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 80087c4: 58 81 00 0c sw (r4+12),r1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 80087c8: 59 61 00 08 sw (r11+8),r1 80087cc: 59 63 00 38 sw (r11+56),r3 #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 80087d0: 50 a3 00 02 bgeu r5,r3,80087d8 <_Heap_Free+0x1b0> next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; 80087d4: 59 63 00 3c sw (r11+60),r3 } } /* Statistics */ --stats->used_blocks; 80087d8: 29 63 00 40 lw r3,(r11+64) ++stats->frees; 80087dc: 29 61 00 50 lw r1,(r11+80) stats->free_size += block_size; 80087e0: 29 64 00 30 lw r4,(r11+48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 80087e4: 34 63 ff ff addi r3,r3,-1 ++stats->frees; 80087e8: 34 21 00 01 addi r1,r1,1 stats->free_size += block_size; 80087ec: b4 82 10 00 add r2,r4,r2 } } /* Statistics */ --stats->used_blocks; ++stats->frees; 80087f0: 59 61 00 50 sw (r11+80),r1 stats->free_size += block_size; 80087f4: 59 62 00 30 sw (r11+48),r2 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 80087f8: 59 63 00 40 sw (r11+64),r3 ++stats->frees; stats->free_size += block_size; 80087fc: 34 01 00 01 mvi r1,1 return( true ); 8008800: e0 00 00 02 bi 8008808 <_Heap_Free+0x1e0> 8008804: 34 01 00 00 mvi r1,0 } 8008808: 2b 9d 00 04 lw ra,(sp+4) 800880c: 2b 8b 00 0c lw r11,(sp+12) 8008810: 2b 8c 00 08 lw r12,(sp+8) 8008814: 37 9c 00 0c addi sp,sp,12 8008818: c3 a0 00 00 ret 08019c7c <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 8019c7c: 37 9c ff f0 addi sp,sp,-16 8019c80: 5b 8b 00 10 sw (sp+16),r11 8019c84: 5b 8c 00 0c sw (sp+12),r12 8019c88: 5b 8d 00 08 sw (sp+8),r13 8019c8c: 5b 9d 00 04 sw (sp+4),ra 8019c90: b8 40 60 00 mv r12,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 8019c94: 28 22 00 10 lw r2,(r1+16) 8019c98: b8 20 58 00 mv r11,r1 8019c9c: b9 80 08 00 mv r1,r12 8019ca0: b8 60 68 00 mv r13,r3 8019ca4: fb ff fd 0f calli 80190e0 <__umodsi3> const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 8019ca8: 29 62 00 20 lw r2,(r11+32) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 8019cac: 35 84 ff f8 addi r4,r12,-8 8019cb0: c8 81 20 00 sub r4,r4,r1 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 8019cb4: 50 82 00 03 bgeu r4,r2,8019cc0 <_Heap_Size_of_alloc_area+0x44> 8019cb8: 34 01 00 00 mvi r1,0 8019cbc: e0 00 00 03 bi 8019cc8 <_Heap_Size_of_alloc_area+0x4c> 8019cc0: 29 61 00 24 lw r1,(r11+36) 8019cc4: f0 24 08 00 cmpgeu r1,r1,r4 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 8019cc8: 44 20 00 13 be r1,r0,8019d14 <_Heap_Size_of_alloc_area+0x98> RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8019ccc: 28 83 00 04 lw r3,(r4+4) 8019cd0: 34 01 ff fe mvi r1,-2 8019cd4: a0 61 08 00 and r1,r3,r1 8019cd8: b4 81 20 00 add r4,r4,r1 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 8019cdc: 50 82 00 03 bgeu r4,r2,8019ce8 <_Heap_Size_of_alloc_area+0x6c><== ALWAYS TAKEN 8019ce0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8019ce4: e0 00 00 03 bi 8019cf0 <_Heap_Size_of_alloc_area+0x74> <== NOT EXECUTED 8019ce8: 29 61 00 24 lw r1,(r11+36) 8019cec: f0 24 08 00 cmpgeu r1,r1,r4 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 8019cf0: 44 20 00 09 be r1,r0,8019d14 <_Heap_Size_of_alloc_area+0x98><== NEVER TAKEN 8019cf4: 28 81 00 04 lw r1,(r4+4) 8019cf8: 20 21 00 01 andi r1,r1,0x1 8019cfc: 44 20 00 06 be r1,r0,8019d14 <_Heap_Size_of_alloc_area+0x98><== NEVER TAKEN || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 8019d00: c8 8c 20 00 sub r4,r4,r12 8019d04: 34 84 00 04 addi r4,r4,4 8019d08: 59 a4 00 00 sw (r13+0),r4 8019d0c: 34 01 00 01 mvi r1,1 return true; 8019d10: e0 00 00 02 bi 8019d18 <_Heap_Size_of_alloc_area+0x9c> 8019d14: 34 01 00 00 mvi r1,0 } 8019d18: 2b 9d 00 04 lw ra,(sp+4) 8019d1c: 2b 8b 00 10 lw r11,(sp+16) 8019d20: 2b 8c 00 0c lw r12,(sp+12) 8019d24: 2b 8d 00 08 lw r13,(sp+8) 8019d28: 37 9c 00 10 addi sp,sp,16 8019d2c: c3 a0 00 00 ret 08003bec <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8003bec: 37 9c ff ac addi sp,sp,-84 8003bf0: 5b 8b 00 50 sw (sp+80),r11 8003bf4: 5b 8c 00 4c sw (sp+76),r12 8003bf8: 5b 8d 00 48 sw (sp+72),r13 8003bfc: 5b 8e 00 44 sw (sp+68),r14 8003c00: 5b 8f 00 40 sw (sp+64),r15 8003c04: 5b 90 00 3c sw (sp+60),r16 8003c08: 5b 91 00 38 sw (sp+56),r17 8003c0c: 5b 92 00 34 sw (sp+52),r18 8003c10: 5b 93 00 30 sw (sp+48),r19 8003c14: 5b 94 00 2c sw (sp+44),r20 8003c18: 5b 95 00 28 sw (sp+40),r21 8003c1c: 5b 96 00 24 sw (sp+36),r22 8003c20: 5b 97 00 20 sw (sp+32),r23 8003c24: 5b 98 00 1c sw (sp+28),r24 8003c28: 5b 99 00 18 sw (sp+24),r25 8003c2c: 5b 9b 00 14 sw (sp+20),fp 8003c30: 5b 9d 00 10 sw (sp+16),ra 8003c34: 20 63 00 ff andi r3,r3,0xff 8003c38: b8 20 68 00 mv r13,r1 8003c3c: b8 40 70 00 mv r14,r2 uintptr_t const page_size = heap->page_size; 8003c40: 28 2f 00 10 lw r15,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8003c44: 28 33 00 14 lw r19,(r1+20) Heap_Block *const last_block = heap->last_block; 8003c48: 28 32 00 24 lw r18,(r1+36) Heap_Block *block = heap->first_block; 8003c4c: 28 2b 00 20 lw r11,(r1+32) Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8003c50: 5c 60 00 04 bne r3,r0,8003c60 <_Heap_Walk+0x74> 8003c54: 78 0c 08 00 mvhi r12,0x800 8003c58: 39 8c 3b c8 ori r12,r12,0x3bc8 8003c5c: e0 00 00 03 bi 8003c68 <_Heap_Walk+0x7c> 8003c60: 78 0c 08 00 mvhi r12,0x800 8003c64: 39 8c 41 18 ori r12,r12,0x4118 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8003c68: 78 02 08 01 mvhi r2,0x801 8003c6c: 38 42 ea 08 ori r2,r2,0xea08 8003c70: 28 42 00 00 lw r2,(r2+0) 8003c74: 34 01 00 03 mvi r1,3 8003c78: 5c 41 01 0c bne r2,r1,80040a8 <_Heap_Walk+0x4bc> <== NEVER TAKEN 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)( 8003c7c: 29 a1 00 08 lw r1,(r13+8) 8003c80: 29 a6 00 18 lw r6,(r13+24) 8003c84: 29 a7 00 1c lw r7,(r13+28) 8003c88: 5b 81 00 08 sw (sp+8),r1 8003c8c: 29 a1 00 0c lw r1,(r13+12) 8003c90: 78 03 08 01 mvhi r3,0x801 8003c94: 5b 92 00 04 sw (sp+4),r18 8003c98: 5b 81 00 0c sw (sp+12),r1 8003c9c: 38 63 b4 f4 ori r3,r3,0xb4f4 8003ca0: b9 c0 08 00 mv r1,r14 8003ca4: 34 02 00 00 mvi r2,0 8003ca8: b9 e0 20 00 mv r4,r15 8003cac: ba 60 28 00 mv r5,r19 8003cb0: b9 60 40 00 mv r8,r11 8003cb4: d9 80 00 00 call r12 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 8003cb8: 5d e0 00 05 bne r15,r0,8003ccc <_Heap_Walk+0xe0> (*printer)( source, true, "page size is zero\n" ); 8003cbc: 78 03 08 01 mvhi r3,0x801 8003cc0: b9 c0 08 00 mv r1,r14 8003cc4: 38 63 b5 88 ori r3,r3,0xb588 8003cc8: e0 00 00 3b bi 8003db4 <_Heap_Walk+0x1c8> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 8003ccc: 21 f0 00 07 andi r16,r15,0x7 8003cd0: 46 00 00 06 be r16,r0,8003ce8 <_Heap_Walk+0xfc> (*printer)( 8003cd4: 78 03 08 01 mvhi r3,0x801 8003cd8: b9 c0 08 00 mv r1,r14 8003cdc: 38 63 b5 9c ori r3,r3,0xb59c 8003ce0: b9 e0 20 00 mv r4,r15 8003ce4: e0 00 01 09 bi 8004108 <_Heap_Walk+0x51c> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 8003ce8: ba 60 08 00 mv r1,r19 8003cec: b9 e0 10 00 mv r2,r15 8003cf0: fb ff f3 f4 calli 8000cc0 <__umodsi3> 8003cf4: b8 20 88 00 mv r17,r1 8003cf8: 44 30 00 08 be r1,r16,8003d18 <_Heap_Walk+0x12c> (*printer)( 8003cfc: 78 03 08 01 mvhi r3,0x801 8003d00: b9 c0 08 00 mv r1,r14 8003d04: 38 63 b5 bc ori r3,r3,0xb5bc 8003d08: ba 60 20 00 mv r4,r19 8003d0c: 34 02 00 01 mvi r2,1 8003d10: d9 80 00 00 call r12 8003d14: e0 00 00 5a bi 8003e7c <_Heap_Walk+0x290> ); return false; } if ( 8003d18: 35 61 00 08 addi r1,r11,8 8003d1c: b9 e0 10 00 mv r2,r15 8003d20: fb ff f3 e8 calli 8000cc0 <__umodsi3> 8003d24: b8 20 80 00 mv r16,r1 8003d28: 44 31 00 08 be r1,r17,8003d48 <_Heap_Walk+0x15c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8003d2c: 78 03 08 01 mvhi r3,0x801 8003d30: b9 c0 08 00 mv r1,r14 8003d34: 38 63 b5 e0 ori r3,r3,0xb5e0 8003d38: b9 60 20 00 mv r4,r11 8003d3c: 34 02 00 01 mvi r2,1 8003d40: d9 80 00 00 call r12 8003d44: e0 00 00 92 bi 8003f8c <_Heap_Walk+0x3a0> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8003d48: 29 71 00 04 lw r17,(r11+4) 8003d4c: 22 31 00 01 andi r17,r17,0x1 8003d50: 5e 21 00 07 bne r17,r1,8003d6c <_Heap_Walk+0x180> (*printer)( 8003d54: 78 03 08 01 mvhi r3,0x801 8003d58: b9 c0 08 00 mv r1,r14 8003d5c: 38 63 b6 14 ori r3,r3,0xb614 8003d60: 34 02 00 01 mvi r2,1 8003d64: d9 80 00 00 call r12 8003d68: e0 00 00 89 bi 8003f8c <_Heap_Walk+0x3a0> ); return false; } if ( first_block->prev_size != page_size ) { 8003d6c: 29 79 00 00 lw r25,(r11+0) 8003d70: 47 2f 00 07 be r25,r15,8003d8c <_Heap_Walk+0x1a0> (*printer)( 8003d74: 78 03 08 01 mvhi r3,0x801 8003d78: b9 c0 08 00 mv r1,r14 8003d7c: 38 63 b6 44 ori r3,r3,0xb644 8003d80: bb 20 20 00 mv r4,r25 8003d84: b9 e0 28 00 mv r5,r15 8003d88: e0 00 00 3b bi 8003e74 <_Heap_Walk+0x288> ); return false; } if ( _Heap_Is_free( last_block ) ) { 8003d8c: 2a 41 00 04 lw r1,(r18+4) 8003d90: 34 02 ff fe mvi r2,-2 8003d94: a0 22 08 00 and r1,r1,r2 8003d98: b6 41 08 00 add r1,r18,r1 8003d9c: 28 2f 00 04 lw r15,(r1+4) 8003da0: 21 ef 00 01 andi r15,r15,0x1 8003da4: 5d f0 00 07 bne r15,r16,8003dc0 <_Heap_Walk+0x1d4> (*printer)( 8003da8: 78 03 08 01 mvhi r3,0x801 8003dac: b9 c0 08 00 mv r1,r14 8003db0: 38 63 b6 70 ori r3,r3,0xb670 8003db4: 34 02 00 01 mvi r2,1 8003db8: d9 80 00 00 call r12 8003dbc: e0 00 00 a5 bi 8004050 <_Heap_Walk+0x464> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8003dc0: 29 a4 00 08 lw r4,(r13+8) ); return false; } if ( _Heap_Is_used( free_block ) ) { 8003dc4: b8 40 a8 00 mv r21,r2 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8003dc8: 29 b4 00 10 lw r20,(r13+16) 8003dcc: b9 a0 88 00 mv r17,r13 8003dd0: b8 80 b0 00 mv r22,r4 8003dd4: e0 00 00 2e bi 8003e8c <_Heap_Walk+0x2a0> RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 8003dd8: 29 a1 00 20 lw r1,(r13+32) 8003ddc: 34 0f 00 00 mvi r15,0 8003de0: 52 c1 00 02 bgeu r22,r1,8003de8 <_Heap_Walk+0x1fc> 8003de4: e0 00 00 03 bi 8003df0 <_Heap_Walk+0x204> 8003de8: 29 af 00 24 lw r15,(r13+36) 8003dec: f1 f6 78 00 cmpgeu r15,r15,r22 ); return false; } if ( 8003df0: 36 c1 00 08 addi r1,r22,8 8003df4: ba 80 10 00 mv r2,r20 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 8003df8: 5d e0 00 06 bne r15,r0,8003e10 <_Heap_Walk+0x224> (*printer)( 8003dfc: 78 03 08 01 mvhi r3,0x801 8003e00: ba c0 20 00 mv r4,r22 8003e04: b9 c0 08 00 mv r1,r14 8003e08: 38 63 b6 88 ori r3,r3,0xb688 8003e0c: e0 00 00 8f bi 8004048 <_Heap_Walk+0x45c> ); return false; } if ( 8003e10: fb ff f3 ac calli 8000cc0 <__umodsi3> 8003e14: 44 20 00 06 be r1,r0,8003e2c <_Heap_Walk+0x240> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8003e18: 78 03 08 01 mvhi r3,0x801 8003e1c: ba c0 20 00 mv r4,r22 8003e20: b9 c0 08 00 mv r1,r14 8003e24: 38 63 b6 a8 ori r3,r3,0xb6a8 8003e28: e0 00 00 b8 bi 8004108 <_Heap_Walk+0x51c> ); return false; } if ( _Heap_Is_used( free_block ) ) { 8003e2c: 2a c3 00 04 lw r3,(r22+4) 8003e30: a0 75 18 00 and r3,r3,r21 8003e34: b6 c3 18 00 add r3,r22,r3 8003e38: 28 70 00 04 lw r16,(r3+4) 8003e3c: 22 10 00 01 andi r16,r16,0x1 8003e40: 46 01 00 07 be r16,r1,8003e5c <_Heap_Walk+0x270> (*printer)( 8003e44: 78 03 08 01 mvhi r3,0x801 8003e48: b8 20 78 00 mv r15,r1 8003e4c: ba c0 20 00 mv r4,r22 8003e50: b9 c0 08 00 mv r1,r14 8003e54: 38 63 b6 d8 ori r3,r3,0xb6d8 8003e58: e0 00 00 7c bi 8004048 <_Heap_Walk+0x45c> ); return false; } if ( free_block->prev != prev_block ) { 8003e5c: 2a c5 00 0c lw r5,(r22+12) 8003e60: 44 b1 00 09 be r5,r17,8003e84 <_Heap_Walk+0x298> (*printer)( 8003e64: 78 03 08 01 mvhi r3,0x801 8003e68: ba c0 20 00 mv r4,r22 8003e6c: b9 c0 08 00 mv r1,r14 8003e70: 38 63 b6 f4 ori r3,r3,0xb6f4 8003e74: 34 02 00 01 mvi r2,1 8003e78: d9 80 00 00 call r12 8003e7c: ba 00 08 00 mv r1,r16 8003e80: e0 00 00 8b bi 80040ac <_Heap_Walk+0x4c0> return false; } prev_block = free_block; free_block = free_block->next; 8003e84: ba c0 88 00 mv r17,r22 8003e88: 2a d6 00 08 lw r22,(r22+8) const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 8003e8c: 5e cd ff d3 bne r22,r13,8003dd8 <_Heap_Walk+0x1ec> 8003e90: e0 00 00 7a bi 8004078 <_Heap_Walk+0x48c> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8003e94: 29 6f 00 04 lw r15,(r11+4) uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { 8003e98: 21 e2 00 01 andi r2,r15,0x1 8003e9c: a1 fb 78 00 and r15,r15,fp RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8003ea0: b5 6f 80 00 add r16,r11,r15 8003ea4: 44 40 00 09 be r2,r0,8003ec8 <_Heap_Walk+0x2dc> (*printer)( 8003ea8: 78 03 08 01 mvhi r3,0x801 8003eac: b9 c0 08 00 mv r1,r14 8003eb0: 34 02 00 00 mvi r2,0 8003eb4: 38 63 b7 28 ori r3,r3,0xb728 8003eb8: b9 60 20 00 mv r4,r11 8003ebc: b9 e0 28 00 mv r5,r15 8003ec0: d9 80 00 00 call r12 8003ec4: e0 00 00 08 bi 8003ee4 <_Heap_Walk+0x2f8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8003ec8: 29 66 00 00 lw r6,(r11+0) 8003ecc: 78 03 08 01 mvhi r3,0x801 8003ed0: b9 c0 08 00 mv r1,r14 8003ed4: 38 63 b7 40 ori r3,r3,0xb740 8003ed8: b9 60 20 00 mv r4,r11 8003edc: b9 e0 28 00 mv r5,r15 8003ee0: d9 80 00 00 call r12 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 8003ee4: 29 a1 00 20 lw r1,(r13+32) 8003ee8: 52 01 00 03 bgeu r16,r1,8003ef4 <_Heap_Walk+0x308> <== ALWAYS TAKEN 8003eec: 34 11 00 00 mvi r17,0 <== NOT EXECUTED 8003ef0: e0 00 00 03 bi 8003efc <_Heap_Walk+0x310> <== NOT EXECUTED 8003ef4: 29 b1 00 24 lw r17,(r13+36) 8003ef8: f2 30 88 00 cmpgeu r17,r17,r16 block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 8003efc: 5e 20 00 05 bne r17,r0,8003f10 <_Heap_Walk+0x324> (*printer)( 8003f00: 78 03 08 01 mvhi r3,0x801 8003f04: b9 c0 08 00 mv r1,r14 8003f08: 38 63 b7 68 ori r3,r3,0xb768 8003f0c: e0 00 00 1c bi 8003f7c <_Heap_Walk+0x390> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 8003f10: b9 e0 08 00 mv r1,r15 8003f14: bb 20 10 00 mv r2,r25 8003f18: fb ff f3 6a calli 8000cc0 <__umodsi3> 8003f1c: b8 20 88 00 mv r17,r1 8003f20: 44 20 00 09 be r1,r0,8003f44 <_Heap_Walk+0x358> (*printer)( 8003f24: 78 03 08 01 mvhi r3,0x801 8003f28: b9 c0 08 00 mv r1,r14 8003f2c: 38 63 b7 98 ori r3,r3,0xb798 8003f30: b9 60 20 00 mv r4,r11 8003f34: b9 e0 28 00 mv r5,r15 8003f38: 34 02 00 01 mvi r2,1 8003f3c: d9 80 00 00 call r12 8003f40: e0 00 00 74 bi 8004110 <_Heap_Walk+0x524> ); return false; } if ( block_size < min_block_size ) { 8003f44: 51 f3 00 0a bgeu r15,r19,8003f6c <_Heap_Walk+0x380> (*printer)( 8003f48: 78 03 08 01 mvhi r3,0x801 8003f4c: b9 c0 08 00 mv r1,r14 8003f50: 38 63 b7 c8 ori r3,r3,0xb7c8 8003f54: b9 60 20 00 mv r4,r11 8003f58: b9 e0 28 00 mv r5,r15 8003f5c: ba 60 30 00 mv r6,r19 8003f60: 34 02 00 01 mvi r2,1 8003f64: d9 80 00 00 call r12 8003f68: e0 00 00 09 bi 8003f8c <_Heap_Walk+0x3a0> ); return false; } if ( next_block_begin <= block_begin ) { 8003f6c: 56 0b 00 0a bgu r16,r11,8003f94 <_Heap_Walk+0x3a8> (*printer)( 8003f70: 78 03 08 01 mvhi r3,0x801 8003f74: b9 c0 08 00 mv r1,r14 8003f78: 38 63 b7 f4 ori r3,r3,0xb7f4 8003f7c: b9 60 20 00 mv r4,r11 8003f80: ba 00 28 00 mv r5,r16 8003f84: 34 02 00 01 mvi r2,1 8003f88: d9 80 00 00 call r12 8003f8c: ba 20 08 00 mv r1,r17 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 8003f90: e0 00 00 47 bi 80040ac <_Heap_Walk+0x4c0> } if ( !_Heap_Is_prev_used( next_block ) ) { 8003f94: 2a 03 00 04 lw r3,(r16+4) 8003f98: 20 63 00 01 andi r3,r3,0x1 8003f9c: 5c 60 00 35 bne r3,r0,8004070 <_Heap_Walk+0x484> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8003fa0: 29 6f 00 04 lw r15,(r11+4) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8003fa4: 29 65 00 0c lw r5,(r11+12) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8003fa8: 29 a1 00 08 lw r1,(r13+8) - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8003fac: a1 fb 88 00 and r17,r15,fp return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 8003fb0: 29 a3 00 0c lw r3,(r13+12) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8003fb4: b5 71 50 00 add r10,r11,r17 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8003fb8: ba a0 30 00 mv r6,r21 8003fbc: 44 a1 00 04 be r5,r1,8003fcc <_Heap_Walk+0x3e0> "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 8003fc0: ba 80 30 00 mv r6,r20 8003fc4: 5c ad 00 02 bne r5,r13,8003fcc <_Heap_Walk+0x3e0> 8003fc8: ba c0 30 00 mv r6,r22 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8003fcc: 29 67 00 08 lw r7,(r11+8) 8003fd0: ba e0 40 00 mv r8,r23 8003fd4: 44 e3 00 04 be r7,r3,8003fe4 <_Heap_Walk+0x3f8> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 8003fd8: ba 80 40 00 mv r8,r20 8003fdc: 5c ed 00 02 bne r7,r13,8003fe4 <_Heap_Walk+0x3f8> 8003fe0: bb 00 40 00 mv r8,r24 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8003fe4: 78 03 08 01 mvhi r3,0x801 8003fe8: 5b 8a 00 54 sw (sp+84),r10 8003fec: b9 c0 08 00 mv r1,r14 8003ff0: 34 02 00 00 mvi r2,0 8003ff4: 38 63 b8 58 ori r3,r3,0xb858 8003ff8: b9 60 20 00 mv r4,r11 8003ffc: d9 80 00 00 call r12 block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 8004000: 2b 8a 00 54 lw r10,(sp+84) 8004004: 29 46 00 00 lw r6,(r10+0) 8004008: 46 26 00 0a be r17,r6,8004030 <_Heap_Walk+0x444> (*printer)( 800400c: 78 03 08 01 mvhi r3,0x801 8004010: b9 c0 08 00 mv r1,r14 8004014: 38 63 b8 84 ori r3,r3,0xb884 8004018: b9 60 20 00 mv r4,r11 800401c: ba 20 28 00 mv r5,r17 8004020: b9 40 38 00 mv r7,r10 8004024: 34 02 00 01 mvi r2,1 8004028: d9 80 00 00 call r12 800402c: e0 00 00 39 bi 8004110 <_Heap_Walk+0x524> ); return false; } if ( !prev_used ) { 8004030: 21 ef 00 01 andi r15,r15,0x1 8004034: 5d e0 00 09 bne r15,r0,8004058 <_Heap_Walk+0x46c> (*printer)( 8004038: 78 03 08 01 mvhi r3,0x801 800403c: b9 c0 08 00 mv r1,r14 8004040: 38 63 b8 c0 ori r3,r3,0xb8c0 8004044: b9 60 20 00 mv r4,r11 8004048: 34 02 00 01 mvi r2,1 800404c: d9 80 00 00 call r12 8004050: b9 e0 08 00 mv r1,r15 8004054: e0 00 00 16 bi 80040ac <_Heap_Walk+0x4c0> 8004058: 29 a3 00 08 lw r3,(r13+8) 800405c: e0 00 00 03 bi 8004068 <_Heap_Walk+0x47c> { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 8004060: 44 6b 00 04 be r3,r11,8004070 <_Heap_Walk+0x484> return true; } free_block = free_block->next; 8004064: 28 63 00 08 lw r3,(r3+8) ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { 8004068: 5c 6d ff fe bne r3,r13,8004060 <_Heap_Walk+0x474> 800406c: e0 00 00 23 bi 80040f8 <_Heap_Walk+0x50c> 8004070: ba 00 58 00 mv r11,r16 8004074: e0 00 00 0c bi 80040a4 <_Heap_Walk+0x4b8> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 8004078: 78 18 08 01 mvhi r24,0x801 800407c: 78 14 08 01 mvhi r20,0x801 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8004080: 78 17 08 01 mvhi r23,0x801 "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 8004084: 78 16 08 01 mvhi r22,0x801 8004088: 78 15 08 01 mvhi r21,0x801 block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 800408c: 3b 18 b8 4c ori r24,r24,0xb84c 8004090: 3a 94 b8 bc ori r20,r20,0xb8bc Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8004094: 3a f7 b8 40 ori r23,r23,0xb840 "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 8004098: 3a d6 b8 34 ori r22,r22,0xb834 800409c: 3a b5 b8 28 ori r21,r21,0xb828 - 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; 80040a0: 34 1b ff fe mvi fp,-2 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 80040a4: 5d 72 ff 7c bne r11,r18,8003e94 <_Heap_Walk+0x2a8> 80040a8: 34 01 00 01 mvi r1,1 block = next_block; } return true; } 80040ac: 2b 9d 00 10 lw ra,(sp+16) 80040b0: 2b 8b 00 50 lw r11,(sp+80) 80040b4: 2b 8c 00 4c lw r12,(sp+76) 80040b8: 2b 8d 00 48 lw r13,(sp+72) 80040bc: 2b 8e 00 44 lw r14,(sp+68) 80040c0: 2b 8f 00 40 lw r15,(sp+64) 80040c4: 2b 90 00 3c lw r16,(sp+60) 80040c8: 2b 91 00 38 lw r17,(sp+56) 80040cc: 2b 92 00 34 lw r18,(sp+52) 80040d0: 2b 93 00 30 lw r19,(sp+48) 80040d4: 2b 94 00 2c lw r20,(sp+44) 80040d8: 2b 95 00 28 lw r21,(sp+40) 80040dc: 2b 96 00 24 lw r22,(sp+36) 80040e0: 2b 97 00 20 lw r23,(sp+32) 80040e4: 2b 98 00 1c lw r24,(sp+28) 80040e8: 2b 99 00 18 lw r25,(sp+24) 80040ec: 2b 9b 00 14 lw fp,(sp+20) 80040f0: 37 9c 00 54 addi sp,sp,84 80040f4: c3 a0 00 00 ret return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 80040f8: 78 03 08 01 mvhi r3,0x801 80040fc: b9 c0 08 00 mv r1,r14 8004100: 38 63 b8 f0 ori r3,r3,0xb8f0 8004104: b9 60 20 00 mv r4,r11 8004108: 34 02 00 01 mvi r2,1 800410c: d9 80 00 00 call r12 8004110: 34 01 00 00 mvi r1,0 8004114: e3 ff ff e6 bi 80040ac <_Heap_Walk+0x4c0> 08002708 <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 8002708: 37 9c ff e8 addi sp,sp,-24 800270c: 5b 8b 00 18 sw (sp+24),r11 8002710: 5b 8c 00 14 sw (sp+20),r12 8002714: 5b 8d 00 10 sw (sp+16),r13 8002718: 5b 8e 00 0c sw (sp+12),r14 800271c: 5b 8f 00 08 sw (sp+8),r15 8002720: 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 = Configuration.Device_driver_table; 8002724: 78 01 08 01 mvhi r1,0x801 8002728: 38 21 c0 c4 ori r1,r1,0xc0c4 drivers_in_table = Configuration.number_of_device_drivers; number_of_drivers = Configuration.maximum_drivers; 800272c: 28 2b 00 2c lw r11,(r1+44) rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; drivers_in_table = Configuration.number_of_device_drivers; 8002730: 28 2d 00 30 lw r13,(r1+48) uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; 8002734: 28 2f 00 34 lw r15,(r1+52) /* * 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 ) 8002738: 51 ab 00 02 bgeu r13,r11,8002740 <_IO_Manager_initialization+0x38> /* * 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 ) { 800273c: 5d 6d 00 08 bne r11,r13,800275c <_IO_Manager_initialization+0x54><== ALWAYS TAKEN _IO_Driver_address_table = driver_table; 8002740: 78 02 08 01 mvhi r2,0x801 _IO_Number_of_drivers = number_of_drivers; 8002744: 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; 8002748: 38 42 ca 68 ori r2,r2,0xca68 _IO_Number_of_drivers = number_of_drivers; 800274c: 38 21 ca 64 ori r1,r1,0xca64 * 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; 8002750: 58 4f 00 00 sw (r2+0),r15 _IO_Number_of_drivers = number_of_drivers; 8002754: 58 2d 00 00 sw (r1+0),r13 return; 8002758: e0 00 00 1b bi 80027c4 <_IO_Manager_initialization+0xbc> * 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 ) 800275c: b5 6b 08 00 add r1,r11,r11 8002760: 34 02 00 03 mvi r2,3 8002764: b4 2b 08 00 add r1,r1,r11 8002768: fb ff f6 a2 calli 80001f0 <__ashlsi3> 800276c: b8 20 60 00 mv r12,r1 /* * 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 *) 8002770: f8 00 0c 56 calli 80058c8 <_Workspace_Allocate_or_fatal_error> 8002774: 78 04 08 01 mvhi r4,0x801 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8002778: 78 05 08 01 mvhi r5,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 *) 800277c: 38 84 ca 68 ori r4,r4,0xca68 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8002780: 38 a5 ca 64 ori r5,r5,0xca64 memset( 8002784: 34 02 00 00 mvi r2,0 8002788: 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; 800278c: 58 ab 00 00 sw (r5+0),r11 _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]; 8002790: b8 40 60 00 mv r12,r2 /* * 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 *) 8002794: 58 81 00 00 sw (r4+0),r1 8002798: b8 20 70 00 mv r14,r1 _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]; 800279c: b9 80 58 00 mv r11,r12 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 80027a0: f8 00 24 e0 calli 800bb20 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 80027a4: e0 00 00 04 bi 80027b4 <_IO_Manager_initialization+0xac> _IO_Driver_address_table[index] = driver_table[index]; 80027a8: f8 00 24 80 calli 800b9a8 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 80027ac: 35 6b 00 01 addi r11,r11,1 80027b0: 35 8c 00 18 addi r12,r12,24 _IO_Driver_address_table[index] = driver_table[index]; 80027b4: b5 cc 08 00 add r1,r14,r12 80027b8: b5 ec 10 00 add r2,r15,r12 80027bc: 34 03 00 18 mvi r3,24 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 80027c0: 55 ab ff fa bgu r13,r11,80027a8 <_IO_Manager_initialization+0xa0> _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 80027c4: 2b 9d 00 04 lw ra,(sp+4) 80027c8: 2b 8b 00 18 lw r11,(sp+24) 80027cc: 2b 8c 00 14 lw r12,(sp+20) 80027d0: 2b 8d 00 10 lw r13,(sp+16) 80027d4: 2b 8e 00 0c lw r14,(sp+12) 80027d8: 2b 8f 00 08 lw r15,(sp+8) 80027dc: 37 9c 00 18 addi sp,sp,24 80027e0: c3 a0 00 00 ret 080033d8 <_ISR_Handler_initialization>: * * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { 80033d8: 37 9c ff f4 addi sp,sp,-12 80033dc: 5b 8b 00 0c sw (sp+12),r11 80033e0: 5b 8c 00 08 sw (sp+8),r12 80033e4: 5b 9d 00 04 sw (sp+4),ra _ISR_Signals_to_thread_executing = false; 80033e8: 78 03 08 01 mvhi r3,0x801 _ISR_Nest_level = 0; 80033ec: 78 02 08 01 mvhi r2,0x801 * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; 80033f0: 34 04 00 00 mvi r4,0 80033f4: 38 63 c9 78 ori r3,r3,0xc978 _ISR_Nest_level = 0; 80033f8: 38 42 c8 bc ori r2,r2,0xc8bc * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; 80033fc: 30 64 00 00 sb (r3+0),r4 _ISR_Nest_level = 0; 8003400: 58 44 00 00 sw (r2+0),r4 #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( 8003404: 34 01 00 80 mvi r1,128 void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; _ISR_Nest_level = 0; 8003408: b8 80 60 00 mv r12,r4 #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( 800340c: f8 00 09 2f calli 80058c8 <_Workspace_Allocate_or_fatal_error> _CPU_Initialize_vectors(); #if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE ) if ( !_Stack_Is_enough(Configuration.interrupt_stack_size) ) 8003410: 78 0b 08 01 mvhi r11,0x801 8003414: 78 02 08 01 mvhi r2,0x801 8003418: 38 42 c0 bc ori r2,r2,0xc0bc 800341c: 39 6b c0 c4 ori r11,r11,0xc0c4 8003420: 28 44 00 00 lw r4,(r2+0) 8003424: 29 63 00 1c lw r3,(r11+28) _ISR_Signals_to_thread_executing = false; _ISR_Nest_level = 0; #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( 8003428: 78 02 08 01 mvhi r2,0x801 800342c: 38 42 c8 a0 ori r2,r2,0xc8a0 8003430: 58 41 00 00 sw (r2+0),r1 _CPU_Initialize_vectors(); #if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE ) if ( !_Stack_Is_enough(Configuration.interrupt_stack_size) ) 8003434: 50 64 00 05 bgeu r3,r4,8003448 <_ISR_Handler_initialization+0x70><== ALWAYS TAKEN _Internal_error_Occurred( 8003438: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 800343c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8003440: 34 03 00 05 mvi r3,5 <== NOT EXECUTED 8003444: fb ff ff d6 calli 800339c <_Internal_error_Occurred> <== NOT EXECUTED INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL ); _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( 8003448: b8 60 08 00 mv r1,r3 800344c: f8 00 09 1f calli 80058c8 <_Workspace_Allocate_or_fatal_error> Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 8003450: 29 64 00 1c lw r4,(r11+28) INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL ); _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( 8003454: 78 02 08 01 mvhi r2,0x801 Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 8003458: 78 03 08 01 mvhi r3,0x801 800345c: b4 24 20 00 add r4,r1,r4 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL ); _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( 8003460: 38 42 c8 34 ori r2,r2,0xc834 Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 8003464: 38 63 c7 b8 ori r3,r3,0xc7b8 8003468: 58 64 00 00 sw (r3+0),r4 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL ); _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( 800346c: 58 41 00 00 sw (r2+0),r1 #if ( CPU_HAS_HARDWARE_INTERRUPT_STACK == TRUE ) _CPU_Install_interrupt_stack(); #endif } 8003470: 2b 9d 00 04 lw ra,(sp+4) 8003474: 2b 8b 00 0c lw r11,(sp+12) 8003478: 2b 8c 00 08 lw r12,(sp+8) 800347c: 37 9c 00 0c addi sp,sp,12 8003480: c3 a0 00 00 ret 08003484 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 8003484: 37 9c ff ec addi sp,sp,-20 8003488: 5b 8b 00 14 sw (sp+20),r11 800348c: 5b 8c 00 10 sw (sp+16),r12 8003490: 5b 8d 00 0c sw (sp+12),r13 8003494: 5b 8e 00 08 sw (sp+8),r14 8003498: 5b 9d 00 04 sw (sp+4),ra 800349c: 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 ) 80034a0: 28 21 00 18 lw r1,(r1+24) 80034a4: b8 20 60 00 mv r12,r1 80034a8: 44 20 00 20 be r1,r0,8003528 <_Objects_Allocate+0xa4> <== NEVER TAKEN /* * 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 ); 80034ac: 35 6d 00 20 addi r13,r11,32 80034b0: b9 a0 08 00 mv r1,r13 80034b4: f8 00 12 f6 calli 800808c <_Chain_Get> 80034b8: b8 20 60 00 mv r12,r1 if ( information->auto_extend ) { 80034bc: 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 ); 80034c0: b9 80 70 00 mv r14,r12 if ( information->auto_extend ) { 80034c4: 44 20 00 19 be r1,r0,8003528 <_Objects_Allocate+0xa4> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 80034c8: 5d 80 00 07 bne r12,r0,80034e4 <_Objects_Allocate+0x60> _Objects_Extend_information( information ); 80034cc: b9 60 08 00 mv r1,r11 80034d0: f8 00 00 1e calli 8003548 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 80034d4: b9 a0 08 00 mv r1,r13 80034d8: f8 00 12 ed calli 800808c <_Chain_Get> 80034dc: b8 20 60 00 mv r12,r1 } if ( the_object ) { 80034e0: 44 2e 00 12 be r1,r14,8003528 <_Objects_Allocate+0xa4> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 80034e4: 29 83 00 08 lw r3,(r12+8) 80034e8: 29 61 00 08 lw r1,(r11+8) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 80034ec: 2d 62 00 14 lhu r2,(r11+20) } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 80034f0: 20 63 ff ff andi r3,r3,0xffff 80034f4: 20 21 ff ff andi r1,r1,0xffff _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 80034f8: c8 61 08 00 sub r1,r3,r1 80034fc: f8 00 56 e9 calli 80190a0 <__udivsi3> 8003500: 34 02 00 02 mvi r2,2 8003504: fb ff f3 3b calli 80001f0 <__ashlsi3> 8003508: 29 62 00 30 lw r2,(r11+48) information->inactive--; 800350c: 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 ]--; 8003510: b4 41 08 00 add r1,r2,r1 8003514: 28 22 00 00 lw r2,(r1+0) information->inactive--; 8003518: 34 63 ff ff addi r3,r3,-1 800351c: 0d 63 00 2c sh (r11+44),r3 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 8003520: 34 42 ff ff addi r2,r2,-1 8003524: 58 22 00 00 sw (r1+0),r2 information->inactive--; } } return the_object; } 8003528: b9 80 08 00 mv r1,r12 800352c: 2b 9d 00 04 lw ra,(sp+4) 8003530: 2b 8b 00 14 lw r11,(sp+20) 8003534: 2b 8c 00 10 lw r12,(sp+16) 8003538: 2b 8d 00 0c lw r13,(sp+12) 800353c: 2b 8e 00 08 lw r14,(sp+8) 8003540: 37 9c 00 14 addi sp,sp,20 8003544: c3 a0 00 00 ret 08003548 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 8003548: 37 9c ff c4 addi sp,sp,-60 800354c: 5b 8b 00 30 sw (sp+48),r11 8003550: 5b 8c 00 2c sw (sp+44),r12 8003554: 5b 8d 00 28 sw (sp+40),r13 8003558: 5b 8e 00 24 sw (sp+36),r14 800355c: 5b 8f 00 20 sw (sp+32),r15 8003560: 5b 90 00 1c sw (sp+28),r16 8003564: 5b 91 00 18 sw (sp+24),r17 8003568: 5b 92 00 14 sw (sp+20),r18 800356c: 5b 93 00 10 sw (sp+16),r19 8003570: 5b 94 00 0c sw (sp+12),r20 8003574: 5b 95 00 08 sw (sp+8),r21 8003578: 5b 9d 00 04 sw (sp+4),ra /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); 800357c: 28 2e 00 08 lw r14,(r1+8) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 8003580: 28 2f 00 34 lw r15,(r1+52) */ void _Objects_Extend_information( Objects_Information *information ) { 8003584: b8 20 58 00 mv r11,r1 /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); 8003588: 21 ce ff ff andi r14,r14,0xffff index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 800358c: b9 e0 68 00 mv r13,r15 8003590: b9 c0 60 00 mv r12,r14 8003594: b9 e0 88 00 mv r17,r15 8003598: 45 e0 00 0f be r15,r0,80035d4 <_Objects_Extend_information+0x8c> block_count = 0; else { block_count = information->maximum / information->allocation_size; 800359c: 2c 30 00 14 lhu r16,(r1+20) 80035a0: 2c 21 00 10 lhu r1,(r1+16) 80035a4: 34 0d 00 00 mvi r13,0 80035a8: ba 00 10 00 mv r2,r16 80035ac: f8 00 56 bd calli 80190a0 <__udivsi3> 80035b0: 20 31 ff ff andi r17,r1,0xffff 80035b4: b9 e0 08 00 mv r1,r15 for ( ; block < block_count; block++ ) { 80035b8: e0 00 00 06 bi 80035d0 <_Objects_Extend_information+0x88> if ( information->object_blocks[ block ] == NULL ) 80035bc: 28 22 00 00 lw r2,(r1+0) 80035c0: 34 21 00 04 addi r1,r1,4 80035c4: 44 40 00 04 be r2,r0,80035d4 <_Objects_Extend_information+0x8c> 80035c8: b5 90 60 00 add r12,r12,r16 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 80035cc: 35 ad 00 01 addi r13,r13,1 80035d0: 56 2d ff fb bgu r17,r13,80035bc <_Objects_Extend_information+0x74> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 80035d4: 2d 61 00 14 lhu r1,(r11+20) 80035d8: 2d 74 00 10 lhu r20,(r11+16) /* * 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 ) { 80035dc: 38 02 ff ff mvu r2,0xffff else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 80035e0: b4 34 a0 00 add r20,r1,r20 /* * 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 ) { 80035e4: 56 82 00 97 bgu r20,r2,8003840 <_Objects_Extend_information+0x2f8><== 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; 80035e8: 29 62 00 18 lw r2,(r11+24) 80035ec: f8 00 56 2e calli 8018ea4 <__mulsi3> if ( information->auto_extend ) { 80035f0: 41 62 00 12 lbu r2,(r11+18) 80035f4: 44 40 00 05 be r2,r0,8003608 <_Objects_Extend_information+0xc0> new_object_block = _Workspace_Allocate( block_size ); 80035f8: f8 00 08 c3 calli 8005904 <_Workspace_Allocate> 80035fc: b8 20 78 00 mv r15,r1 if ( !new_object_block ) 8003600: 5c 20 00 04 bne r1,r0,8003610 <_Objects_Extend_information+0xc8> 8003604: e0 00 00 8f bi 8003840 <_Objects_Extend_information+0x2f8> return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 8003608: f8 00 08 b0 calli 80058c8 <_Workspace_Allocate_or_fatal_error> 800360c: b8 20 78 00 mv r15,r1 } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 8003610: 2d 61 00 10 lhu r1,(r11+16) 8003614: 54 2c 00 60 bgu r1,r12,8003794 <_Objects_Extend_information+0x24c> */ /* * Up the block count and maximum */ block_count++; 8003618: 36 32 00 01 addi r18,r17,1 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 800361c: b6 52 08 00 add r1,r18,r18 8003620: b6 8e 10 00 add r2,r20,r14 8003624: b4 32 08 00 add r1,r1,r18 8003628: b4 41 08 00 add r1,r2,r1 800362c: 34 02 00 02 mvi r2,2 8003630: fb ff f2 f0 calli 80001f0 <__ashlsi3> 8003634: f8 00 08 b4 calli 8005904 <_Workspace_Allocate> 8003638: b8 20 80 00 mv r16,r1 if ( !object_blocks ) { 800363c: 5c 20 00 04 bne r1,r0,800364c <_Objects_Extend_information+0x104> _Workspace_Free( new_object_block ); 8003640: b9 e0 08 00 mv r1,r15 8003644: f8 00 08 bb calli 8005930 <_Workspace_Free> return; 8003648: e0 00 00 7e bi 8003840 <_Objects_Extend_information+0x2f8> } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 800364c: ba 40 08 00 mv r1,r18 8003650: 34 02 00 02 mvi r2,2 8003654: fb ff f2 e7 calli 80001f0 <__ashlsi3> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 8003658: 2d 62 00 10 lhu r2,(r11+16) RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 800365c: b6 01 98 00 add r19,r16,r1 8003660: b6 61 90 00 add r18,r19,r1 8003664: 54 4e 00 05 bgu r2,r14,8003678 <_Objects_Extend_information+0x130> 8003668: 34 01 00 00 mvi r1,0 800366c: ba 40 10 00 mv r2,r18 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 8003670: b8 20 18 00 mv r3,r1 8003674: e0 00 00 19 bi 80036d8 <_Objects_Extend_information+0x190> * separate parts as size of each block has changed. */ memcpy( object_blocks, information->object_blocks, block_count * sizeof(void*) ); 8003678: ba 20 08 00 mv r1,r17 800367c: 34 02 00 02 mvi r2,2 8003680: fb ff f2 dc calli 80001f0 <__ashlsi3> /* * 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, 8003684: 29 62 00 34 lw r2,(r11+52) information->object_blocks, block_count * sizeof(void*) ); 8003688: b8 20 a8 00 mv r21,r1 /* * 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, 800368c: ba a0 18 00 mv r3,r21 8003690: ba 00 08 00 mv r1,r16 8003694: f8 00 20 c5 calli 800b9a8 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 8003698: 29 62 00 30 lw r2,(r11+48) 800369c: ba a0 18 00 mv r3,r21 80036a0: ba 60 08 00 mv r1,r19 80036a4: f8 00 20 c1 calli 800b9a8 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 80036a8: 2d 61 00 10 lhu r1,(r11+16) 80036ac: 34 02 00 02 mvi r2,2 80036b0: b5 c1 08 00 add r1,r14,r1 80036b4: fb ff f2 cf calli 80001f0 <__ashlsi3> 80036b8: 29 62 00 1c lw r2,(r11+28) 80036bc: b8 20 18 00 mv r3,r1 80036c0: ba 40 08 00 mv r1,r18 80036c4: f8 00 20 b9 calli 800b9a8 80036c8: e0 00 00 05 bi 80036dc <_Objects_Extend_information+0x194> /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 80036cc: 58 43 00 00 sw (r2+0),r3 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 80036d0: 34 21 00 01 addi r1,r1,1 80036d4: 34 42 00 04 addi r2,r2,4 80036d8: 55 c1 ff fd bgu r14,r1,80036cc <_Objects_Extend_information+0x184> } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 80036dc: ba 20 08 00 mv r1,r17 80036e0: 34 02 00 02 mvi r2,2 80036e4: fb ff f2 c3 calli 80001f0 <__ashlsi3> inactive_per_block[block_count] = 0; 80036e8: b6 61 10 00 add r2,r19,r1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 80036ec: 34 0e 00 00 mvi r14,0 80036f0: b6 01 08 00 add r1,r16,r1 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 80036f4: 2d 71 00 14 lhu r17,(r11+20) } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 80036f8: 58 2e 00 00 sw (r1+0),r14 inactive_per_block[block_count] = 0; 80036fc: 58 4e 00 00 sw (r2+0),r14 for ( index=index_base ; index < ( information->allocation_size + index_base ); 8003700: b9 80 08 00 mv r1,r12 8003704: 34 02 00 02 mvi r2,2 8003708: fb ff f2 ba calli 80001f0 <__ashlsi3> 800370c: b5 91 88 00 add r17,r12,r17 8003710: b6 41 08 00 add r1,r18,r1 8003714: b9 80 10 00 mv r2,r12 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8003718: e0 00 00 04 bi 8003728 <_Objects_Extend_information+0x1e0> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 800371c: 58 2e 00 00 sw (r1+0),r14 object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 8003720: 34 42 00 01 addi r2,r2,1 8003724: 34 21 00 04 addi r1,r1,4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8003728: 56 22 ff fd bgu r17,r2,800371c <_Objects_Extend_information+0x1d4> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 800372c: 90 00 88 00 rcsr r17,IE 8003730: 34 01 ff fe mvi r1,-2 8003734: a2 21 08 00 and r1,r17,r1 8003738: d0 01 00 00 wcsr IE,r1 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 800373c: 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; 8003740: 22 94 ff ff andi r20,r20,0xffff 8003744: 0d 74 00 10 sh (r11+16),r20 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 8003748: 59 73 00 30 sw (r11+48),r19 information->local_table = local_table; 800374c: 59 72 00 1c sw (r11+28),r18 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 8003750: 29 6e 00 34 lw r14,(r11+52) information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 8003754: 34 02 00 18 mvi r2,24 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 8003758: 59 70 00 34 sw (r11+52),r16 information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 800375c: fb ff f2 a5 calli 80001f0 <__ashlsi3> 8003760: 78 02 00 01 mvhi r2,0x1 8003764: 38 42 00 00 ori r2,r2,0x0 8003768: b8 22 80 00 or r16,r1,r2 800376c: 2d 61 00 04 lhu r1,(r11+4) 8003770: 34 02 00 1b mvi r2,27 8003774: fb ff f2 9f calli 80001f0 <__ashlsi3> 8003778: ba 01 08 00 or r1,r16,r1 800377c: b8 34 a0 00 or r20,r1,r20 8003780: 59 74 00 0c sw (r11+12),r20 information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 8003784: d0 11 00 00 wcsr IE,r17 if ( old_tables ) 8003788: 45 c0 00 03 be r14,r0,8003794 <_Objects_Extend_information+0x24c> _Workspace_Free( old_tables ); 800378c: b9 c0 08 00 mv r1,r14 8003790: f8 00 08 68 calli 8005930 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 8003794: b9 a0 08 00 mv r1,r13 8003798: 34 02 00 02 mvi r2,2 800379c: fb ff f2 95 calli 80001f0 <__ashlsi3> 80037a0: b8 20 80 00 mv r16,r1 80037a4: 29 61 00 34 lw r1,(r11+52) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 80037a8: 2d 63 00 14 lhu r3,(r11+20) 80037ac: 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; 80037b0: b4 30 08 00 add r1,r1,r16 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 80037b4: 37 8e 00 34 addi r14,sp,52 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 80037b8: 58 2f 00 00 sw (r1+0),r15 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 80037bc: b9 e0 10 00 mv r2,r15 80037c0: b9 c0 08 00 mv r1,r14 */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 80037c4: 78 0d 00 01 mvhi r13,0x1 information->object_blocks[ block ] = new_object_block; /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 80037c8: f8 00 12 40 calli 80080c8 <_Chain_Initialize> /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 80037cc: b9 c0 88 00 mv r17,r14 the_object->id = _Objects_Build_id( 80037d0: 39 ad 00 00 ori r13,r13,0x0 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 80037d4: 35 6f 00 20 addi r15,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 ) { 80037d8: e0 00 00 0e bi 8003810 <_Objects_Extend_information+0x2c8> the_object->id = _Objects_Build_id( 80037dc: 29 61 00 00 lw r1,(r11+0) 80037e0: fb ff f2 84 calli 80001f0 <__ashlsi3> 80037e4: b8 2d 90 00 or r18,r1,r13 80037e8: 2d 61 00 04 lhu r1,(r11+4) 80037ec: 34 02 00 1b mvi r2,27 80037f0: fb ff f2 80 calli 80001f0 <__ashlsi3> 80037f4: ba 41 10 00 or r2,r18,r1 80037f8: b8 4c 10 00 or r2,r2,r12 80037fc: 59 c2 00 08 sw (r14+8),r2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 8003800: b9 e0 08 00 mv r1,r15 8003804: b9 c0 10 00 mv r2,r14 8003808: fb ff fc 97 calli 8002a64 <_Chain_Append> index++; 800380c: 35 8c 00 01 addi r12,r12,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 ) { 8003810: ba 20 08 00 mv r1,r17 8003814: f8 00 12 1e calli 800808c <_Chain_Get> 8003818: b8 20 70 00 mv r14,r1 the_object->id = _Objects_Build_id( 800381c: 34 02 00 18 mvi r2,24 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 8003820: 5c 20 ff ef bne r1,r0,80037dc <_Objects_Extend_information+0x294> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 8003824: 2d 62 00 14 lhu r2,(r11+20) information->inactive = 8003828: 2d 61 00 2c lhu r1,(r11+44) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 800382c: 29 63 00 30 lw r3,(r11+48) information->inactive = 8003830: b4 41 08 00 add r1,r2,r1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 8003834: b4 70 80 00 add r16,r3,r16 information->inactive = 8003838: 0d 61 00 2c sh (r11+44),r1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 800383c: 5a 02 00 00 sw (r16+0),r2 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 8003840: 2b 9d 00 04 lw ra,(sp+4) 8003844: 2b 8b 00 30 lw r11,(sp+48) 8003848: 2b 8c 00 2c lw r12,(sp+44) 800384c: 2b 8d 00 28 lw r13,(sp+40) 8003850: 2b 8e 00 24 lw r14,(sp+36) 8003854: 2b 8f 00 20 lw r15,(sp+32) 8003858: 2b 90 00 1c lw r16,(sp+28) 800385c: 2b 91 00 18 lw r17,(sp+24) 8003860: 2b 92 00 14 lw r18,(sp+20) 8003864: 2b 93 00 10 lw r19,(sp+16) 8003868: 2b 94 00 0c lw r20,(sp+12) 800386c: 2b 95 00 08 lw r21,(sp+8) 8003870: 37 9c 00 3c addi sp,sp,60 8003874: c3 a0 00 00 ret 08003970 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 8003970: 37 9c ff f4 addi sp,sp,-12 8003974: 5b 8b 00 0c sw (sp+12),r11 8003978: 5b 8c 00 08 sw (sp+8),r12 800397c: 5b 9d 00 04 sw (sp+4),ra 8003980: b8 40 58 00 mv r11,r2 8003984: b8 20 60 00 mv r12,r1 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 8003988: 44 40 00 14 be r2,r0,80039d8 <_Objects_Get_information+0x68> /* * 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 ); 800398c: f8 00 13 a4 calli 800881c <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 8003990: 44 20 00 12 be r1,r0,80039d8 <_Objects_Get_information+0x68> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 8003994: 55 61 00 11 bgu r11,r1,80039d8 <_Objects_Get_information+0x68> return NULL; if ( !_Objects_Information_table[ the_api ] ) 8003998: b9 80 08 00 mv r1,r12 800399c: 34 02 00 02 mvi r2,2 80039a0: 78 0c 08 01 mvhi r12,0x801 80039a4: 39 8c c7 bc ori r12,r12,0xc7bc 80039a8: fb ff f2 12 calli 80001f0 <__ashlsi3> 80039ac: b5 81 08 00 add r1,r12,r1 80039b0: 28 2c 00 00 lw r12,(r1+0) 80039b4: 45 80 00 09 be r12,r0,80039d8 <_Objects_Get_information+0x68><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 80039b8: b9 60 08 00 mv r1,r11 80039bc: 34 02 00 02 mvi r2,2 80039c0: fb ff f2 0c calli 80001f0 <__ashlsi3> 80039c4: b5 81 08 00 add r1,r12,r1 80039c8: 28 21 00 00 lw r1,(r1+0) if ( !info ) 80039cc: 44 20 00 04 be r1,r0,80039dc <_Objects_Get_information+0x6c><== 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 ) 80039d0: 2c 22 00 10 lhu r2,(r1+16) 80039d4: 5c 40 00 02 bne r2,r0,80039dc <_Objects_Get_information+0x6c> 80039d8: 34 01 00 00 mvi r1,0 return NULL; #endif return info; } 80039dc: 2b 9d 00 04 lw ra,(sp+4) 80039e0: 2b 8b 00 0c lw r11,(sp+12) 80039e4: 2b 8c 00 08 lw r12,(sp+8) 80039e8: 37 9c 00 0c addi sp,sp,12 80039ec: c3 a0 00 00 ret 08016da8 <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 8016da8: 37 9c ff f4 addi sp,sp,-12 8016dac: 5b 8b 00 0c sw (sp+12),r11 8016db0: 5b 8c 00 08 sw (sp+8),r12 8016db4: 5b 9d 00 04 sw (sp+4),ra 8016db8: b8 20 20 00 mv r4,r1 /* * 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; 8016dbc: 28 21 00 08 lw r1,(r1+8) if ( information->maximum >= index ) { 8016dc0: 2c 85 00 10 lhu r5,(r4+16) Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 8016dc4: b8 60 58 00 mv r11,r3 /* * 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; 8016dc8: c8 41 08 00 sub r1,r2,r1 8016dcc: 34 21 00 01 addi r1,r1,1 if ( information->maximum >= index ) { 8016dd0: 54 25 00 0a bgu r1,r5,8016df8 <_Objects_Get_no_protection+0x50> if ( (the_object = information->local_table[ index ]) != NULL ) { 8016dd4: 28 8c 00 1c lw r12,(r4+28) 8016dd8: 34 02 00 02 mvi r2,2 8016ddc: fb ff dc 2f calli 800de98 <__ashlsi3> 8016de0: b5 81 08 00 add r1,r12,r1 8016de4: 28 21 00 00 lw r1,(r1+0) 8016de8: 44 20 00 04 be r1,r0,8016df8 <_Objects_Get_no_protection+0x50><== NEVER TAKEN *location = OBJECTS_LOCAL; 8016dec: 34 02 00 00 mvi r2,0 8016df0: 59 62 00 00 sw (r11+0),r2 return the_object; 8016df4: e0 00 00 04 bi 8016e04 <_Objects_Get_no_protection+0x5c> /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 8016df8: 34 01 00 01 mvi r1,1 8016dfc: 59 61 00 00 sw (r11+0),r1 8016e00: 34 01 00 00 mvi r1,0 return NULL; } 8016e04: 2b 9d 00 04 lw ra,(sp+4) 8016e08: 2b 8b 00 0c lw r11,(sp+12) 8016e0c: 2b 8c 00 08 lw r12,(sp+8) 8016e10: 37 9c 00 0c addi sp,sp,12 8016e14: c3 a0 00 00 ret 08009620 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 8009620: 37 9c ff ec addi sp,sp,-20 8009624: 5b 8b 00 10 sw (sp+16),r11 8009628: 5b 8c 00 0c sw (sp+12),r12 800962c: 5b 8d 00 08 sw (sp+8),r13 8009630: 5b 9d 00 04 sw (sp+4),ra 8009634: b8 40 68 00 mv r13,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 8009638: b8 20 58 00 mv r11,r1 800963c: 5c 20 00 05 bne r1,r0,8009650 <_Objects_Id_to_name+0x30> 8009640: 78 01 08 02 mvhi r1,0x802 8009644: 38 21 e2 00 ori r1,r1,0xe200 8009648: 28 21 00 00 lw r1,(r1+0) 800964c: 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); 8009650: 34 02 00 18 mvi r2,24 8009654: b9 60 08 00 mv r1,r11 8009658: fb ff dc 58 calli 80007b8 <__lshrsi3> 800965c: 20 21 00 07 andi r1,r1,0x7 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 8009660: 34 23 ff ff addi r3,r1,-1 8009664: 34 02 00 03 mvi r2,3 8009668: 54 62 00 13 bgu r3,r2,80096b4 <_Objects_Id_to_name+0x94> 800966c: e0 00 00 19 bi 80096d0 <_Objects_Id_to_name+0xb0> if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 8009670: 34 02 00 1b mvi r2,27 8009674: b9 60 08 00 mv r1,r11 8009678: fb ff dc 50 calli 80007b8 <__lshrsi3> 800967c: 34 02 00 02 mvi r2,2 8009680: fb ff dc 26 calli 8000718 <__ashlsi3> 8009684: b5 81 08 00 add r1,r12,r1 8009688: 28 21 00 00 lw r1,(r1+0) if ( !information ) 800968c: 44 20 00 0a be r1,r0,80096b4 <_Objects_Id_to_name+0x94> <== 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 ); 8009690: b9 60 10 00 mv r2,r11 8009694: 37 83 00 14 addi r3,sp,20 8009698: fb ff ff bb calli 8009584 <_Objects_Get> if ( !the_object ) 800969c: 44 20 00 06 be r1,r0,80096b4 <_Objects_Id_to_name+0x94> return OBJECTS_INVALID_ID; *name = the_object->name; 80096a0: 28 21 00 0c lw r1,(r1+12) 80096a4: 59 a1 00 00 sw (r13+0),r1 _Thread_Enable_dispatch(); 80096a8: f8 00 02 cb calli 800a1d4 <_Thread_Enable_dispatch> 80096ac: 34 01 00 00 mvi r1,0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 80096b0: e0 00 00 02 bi 80096b8 <_Objects_Id_to_name+0x98> 80096b4: 34 01 00 03 mvi r1,3 } 80096b8: 2b 9d 00 04 lw ra,(sp+4) 80096bc: 2b 8b 00 10 lw r11,(sp+16) 80096c0: 2b 8c 00 0c lw r12,(sp+12) 80096c4: 2b 8d 00 08 lw r13,(sp+8) 80096c8: 37 9c 00 14 addi sp,sp,20 80096cc: c3 a0 00 00 ret the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 80096d0: 78 0c 08 02 mvhi r12,0x802 80096d4: 34 02 00 02 mvi r2,2 80096d8: 39 8c e0 dc ori r12,r12,0xe0dc 80096dc: fb ff dc 0f calli 8000718 <__ashlsi3> 80096e0: b5 81 08 00 add r1,r12,r1 80096e4: 28 2c 00 00 lw r12,(r1+0) 80096e8: 5d 80 ff e2 bne r12,r0,8009670 <_Objects_Id_to_name+0x50> 80096ec: e3 ff ff f2 bi 80096b4 <_Objects_Id_to_name+0x94> 080039f0 <_Objects_Initialize_information>: , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 80039f0: 37 9c ff e4 addi sp,sp,-28 80039f4: 5b 8b 00 1c sw (sp+28),r11 80039f8: 5b 8c 00 18 sw (sp+24),r12 80039fc: 5b 8d 00 14 sw (sp+20),r13 8003a00: 5b 8e 00 10 sw (sp+16),r14 8003a04: 5b 8f 00 0c sw (sp+12),r15 8003a08: 5b 90 00 08 sw (sp+8),r16 8003a0c: 5b 9d 00 04 sw (sp+4),ra #endif information->the_api = the_api; information->the_class = the_class; information->size = size; information->local_table = 0; 8003a10: 34 06 00 00 mvi r6,0 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8003a14: b8 20 58 00 mv r11,r1 8003a18: 20 a5 ff ff andi r5,r5,0xffff 8003a1c: b8 40 78 00 mv r15,r2 uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; information->size = size; 8003a20: 58 25 00 18 sw (r1+24),r5 /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 8003a24: 0c 26 00 10 sh (r1+16),r6 #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; 8003a28: 0d 63 00 04 sh (r11+4),r3 information->size = size; information->local_table = 0; 8003a2c: 58 26 00 1c sw (r1+28),r6 information->inactive_per_block = 0; 8003a30: 58 26 00 30 sw (r1+48),r6 information->object_blocks = 0; 8003a34: 58 26 00 34 sw (r1+52),r6 information->inactive = 0; 8003a38: 0c 26 00 2c sh (r1+44),r6 uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 8003a3c: 59 62 00 00 sw (r11+0),r2 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 8003a40: 78 10 08 01 mvhi r16,0x801 8003a44: 34 02 00 02 mvi r2,2 8003a48: b9 e0 08 00 mv r1,r15 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8003a4c: b8 60 70 00 mv r14,r3 8003a50: b8 80 60 00 mv r12,r4 8003a54: b8 e0 68 00 mv r13,r7 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 8003a58: 3a 10 c7 bc ori r16,r16,0xc7bc 8003a5c: fb ff f1 e5 calli 80001f0 <__ashlsi3> 8003a60: b6 01 08 00 add r1,r16,r1 8003a64: 28 30 00 00 lw r16,(r1+0) 8003a68: 34 02 00 02 mvi r2,2 8003a6c: b9 c0 08 00 mv r1,r14 8003a70: fb ff f1 e0 calli 80001f0 <__ashlsi3> 8003a74: b6 01 08 00 add r1,r16,r1 8003a78: 58 2b 00 00 sw (r1+0),r11 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 8003a7c: 34 02 00 1f mvi r2,31 8003a80: b9 80 08 00 mv r1,r12 8003a84: fb ff f2 03 calli 8000290 <__lshrsi3> 8003a88: 20 23 00 ff andi r3,r1,0xff maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8003a8c: 78 02 7f ff mvhi r2,0x7fff 8003a90: 38 42 ff ff ori r2,r2,0xffff _Objects_Information_table[ the_api ][ the_class ] = information; /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = 8003a94: 31 63 00 12 sb (r11+18),r3 (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8003a98: a1 82 60 00 and r12,r12,r2 /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 8003a9c: 44 60 00 06 be r3,r0,8003ab4 <_Objects_Initialize_information+0xc4> 8003aa0: 5d 80 00 05 bne r12,r0,8003ab4 <_Objects_Initialize_information+0xc4> _Internal_error_Occurred( 8003aa4: b9 80 08 00 mv r1,r12 8003aa8: 34 02 00 01 mvi r2,1 8003aac: 34 03 00 14 mvi r3,20 8003ab0: fb ff fe 3b calli 800339c <_Internal_error_Occurred> information->allocation_size = maximum_per_allocation; /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 8003ab4: 78 01 08 01 mvhi r1,0x801 8003ab8: 38 21 c6 20 ori r1,r1,0xc620 8003abc: 59 61 00 1c sw (r11+28),r1 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 8003ac0: 34 02 00 18 mvi r2,24 8003ac4: b9 e0 08 00 mv r1,r15 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 8003ac8: 0d 6c 00 14 sh (r11+20),r12 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 8003acc: fb ff f1 c9 calli 80001f0 <__ashlsi3> 8003ad0: 78 02 00 01 mvhi r2,0x1 8003ad4: 38 42 00 00 ori r2,r2,0x0 8003ad8: b8 22 78 00 or r15,r1,r2 8003adc: 34 02 00 1b mvi r2,27 8003ae0: b9 c0 08 00 mv r1,r14 8003ae4: fb ff f1 c3 calli 80001f0 <__ashlsi3> 8003ae8: 7d 83 00 00 cmpnei r3,r12,0 8003aec: b9 e1 08 00 or r1,r15,r1 8003af0: b8 23 08 00 or r1,r1,r3 8003af4: 59 61 00 08 sw (r11+8),r1 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 8003af8: 21 a2 00 03 andi r2,r13,0x3 8003afc: b9 a0 08 00 mv r1,r13 8003b00: 44 40 00 04 be r2,r0,8003b10 <_Objects_Initialize_information+0x120><== ALWAYS TAKEN name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 8003b04: 35 ad 00 04 addi r13,r13,4 <== NOT EXECUTED 8003b08: 34 01 ff fc mvi r1,-4 <== NOT EXECUTED 8003b0c: a1 a1 08 00 and r1,r13,r1 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8003b10: 35 63 00 24 addi r3,r11,36 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 8003b14: 35 62 00 20 addi r2,r11,32 ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 8003b18: 0d 61 00 38 sh (r11+56),r1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 8003b1c: 34 01 00 00 mvi r1,0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8003b20: 59 63 00 20 sw (r11+32),r3 the_chain->permanent_null = NULL; 8003b24: 59 61 00 24 sw (r11+36),r1 the_chain->last = _Chain_Head(the_chain); 8003b28: 59 62 00 28 sw (r11+40),r2 _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 8003b2c: 45 81 00 03 be r12,r1,8003b38 <_Objects_Initialize_information+0x148> /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 8003b30: b9 60 08 00 mv r1,r11 8003b34: fb ff fe 85 calli 8003548 <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 8003b38: 2b 9d 00 04 lw ra,(sp+4) 8003b3c: 2b 8b 00 1c lw r11,(sp+28) 8003b40: 2b 8c 00 18 lw r12,(sp+24) 8003b44: 2b 8d 00 14 lw r13,(sp+20) 8003b48: 2b 8e 00 10 lw r14,(sp+16) 8003b4c: 2b 8f 00 0c lw r15,(sp+12) 8003b50: 2b 90 00 08 lw r16,(sp+8) 8003b54: 37 9c 00 1c addi sp,sp,28 8003b58: c3 a0 00 00 ret 08007d84 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 8007d84: 37 9c ff f0 addi sp,sp,-16 8007d88: 5b 8b 00 0c sw (sp+12),r11 8007d8c: 5b 8c 00 08 sw (sp+8),r12 8007d90: 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 ]; 8007d94: 28 2b 01 24 lw r11,(r1+292) if ( !api ) 8007d98: 45 60 00 1b be r11,r0,8007e04 <_RTEMS_tasks_Post_switch_extension+0x80><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 8007d9c: 90 00 08 00 rcsr r1,IE 8007da0: 34 02 ff fe mvi r2,-2 8007da4: a0 22 10 00 and r2,r1,r2 8007da8: d0 02 00 00 wcsr IE,r2 signal_set = asr->signals_posted; asr->signals_posted = 0; 8007dac: 34 02 00 00 mvi r2,0 */ asr = &api->Signal; _ISR_Disable( level ); signal_set = asr->signals_posted; 8007db0: 29 6c 00 14 lw r12,(r11+20) asr->signals_posted = 0; 8007db4: 59 62 00 14 sw (r11+20),r2 _ISR_Enable( level ); 8007db8: d0 01 00 00 wcsr IE,r1 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 8007dbc: 45 80 00 12 be r12,r0,8007e04 <_RTEMS_tasks_Post_switch_extension+0x80><== NEVER TAKEN return; asr->nest_level += 1; 8007dc0: 29 63 00 1c lw r3,(r11+28) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8007dc4: 29 61 00 10 lw r1,(r11+16) 8007dc8: 38 02 ff ff mvu r2,0xffff if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 8007dcc: 34 63 00 01 addi r3,r3,1 8007dd0: 59 63 00 1c sw (r11+28),r3 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8007dd4: 37 83 00 10 addi r3,sp,16 8007dd8: f8 00 09 36 calli 800a2b0 (*asr->handler)( signal_set ); 8007ddc: 29 62 00 0c lw r2,(r11+12) 8007de0: b9 80 08 00 mv r1,r12 8007de4: d8 40 00 00 call r2 asr->nest_level -= 1; 8007de8: 29 63 00 1c lw r3,(r11+28) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8007dec: 2b 81 00 10 lw r1,(sp+16) 8007df0: 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; 8007df4: 34 63 ff ff addi r3,r3,-1 8007df8: 59 63 00 1c sw (r11+28),r3 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8007dfc: 37 83 00 10 addi r3,sp,16 8007e00: f8 00 09 2c calli 800a2b0 } 8007e04: 2b 9d 00 04 lw ra,(sp+4) 8007e08: 2b 8b 00 0c lw r11,(sp+12) 8007e0c: 2b 8c 00 08 lw r12,(sp+8) 8007e10: 37 9c 00 10 addi sp,sp,16 8007e14: c3 a0 00 00 ret 0803c80c <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 803c80c: 37 9c ff f4 addi sp,sp,-12 803c810: 5b 8b 00 08 sw (sp+8),r11 803c814: 5b 9d 00 04 sw (sp+4),ra 803c818: b8 20 10 00 mv r2,r1 803c81c: 78 01 08 06 mvhi r1,0x806 803c820: 38 21 f4 9c ori r1,r1,0xf49c 803c824: 37 83 00 0c addi r3,sp,12 803c828: fb ff 37 6d calli 800a5dc <_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 ) { 803c82c: 2b 82 00 0c lw r2,(sp+12) 803c830: b8 20 58 00 mv r11,r1 803c834: 5c 40 00 21 bne r2,r0,803c8b8 <_Rate_monotonic_Timeout+0xac><== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 803c838: 28 21 00 40 lw r1,(r1+64) if ( _States_Is_waiting_for_period( the_thread->current_state ) && 803c83c: 28 23 00 10 lw r3,(r1+16) 803c840: 20 63 40 00 andi r3,r3,0x4000 803c844: 44 62 00 08 be r3,r2,803c864 <_Rate_monotonic_Timeout+0x58> the_thread->Wait.id == the_period->Object.id ) { 803c848: 28 23 00 20 lw r3,(r1+32) 803c84c: 29 62 00 08 lw r2,(r11+8) 803c850: 5c 62 00 05 bne r3,r2,803c864 <_Rate_monotonic_Timeout+0x58> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 803c854: 78 02 10 03 mvhi r2,0x1003 803c858: 38 42 ff f8 ori r2,r2,0xfff8 803c85c: fb ff ba 40 calli 802b15c <_Thread_Clear_state> 803c860: e0 00 00 06 bi 803c878 <_Rate_monotonic_Timeout+0x6c> _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 ) { 803c864: 29 62 00 38 lw r2,(r11+56) 803c868: 34 01 00 01 mvi r1,1 803c86c: 5c 41 00 0c bne r2,r1,803c89c <_Rate_monotonic_Timeout+0x90><== ALWAYS TAKEN the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 803c870: 34 01 00 03 mvi r1,3 <== NOT EXECUTED 803c874: 59 61 00 38 sw (r11+56),r1 <== NOT EXECUTED _Rate_monotonic_Initiate_statistics( the_period ); 803c878: b9 60 08 00 mv r1,r11 803c87c: fb ff fe cd calli 803c3b0 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 803c880: 29 61 00 3c lw r1,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803c884: 35 62 00 10 addi r2,r11,16 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 803c888: 59 61 00 1c sw (r11+28),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803c88c: 78 01 08 06 mvhi r1,0x806 803c890: 38 21 f1 00 ori r1,r1,0xf100 803c894: fb ff 3e dc calli 800c404 <_Watchdog_Insert> 803c898: e0 00 00 03 bi 803c8a4 <_Rate_monotonic_Timeout+0x98> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 803c89c: 34 01 00 04 mvi r1,4 803c8a0: 59 61 00 38 sw (r11+56),r1 */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 803c8a4: 78 01 08 06 mvhi r1,0x806 803c8a8: 38 21 f0 24 ori r1,r1,0xf024 803c8ac: 28 22 00 00 lw r2,(r1+0) 803c8b0: 34 42 ff ff addi r2,r2,-1 803c8b4: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 803c8b8: 2b 9d 00 04 lw ra,(sp+4) 803c8bc: 2b 8b 00 08 lw r11,(sp+8) 803c8c0: 37 9c 00 0c addi sp,sp,12 803c8c4: c3 a0 00 00 ret 0803c528 <_Rate_monotonic_Update_statistics>: } void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 803c528: 37 9c ff e4 addi sp,sp,-28 803c52c: 5b 8b 00 0c sw (sp+12),r11 803c530: 5b 8c 00 08 sw (sp+8),r12 803c534: 5b 9d 00 04 sw (sp+4),ra 803c538: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 803c53c: 28 21 00 54 lw r1,(r1+84) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 803c540: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 803c544: 34 21 00 01 addi r1,r1,1 803c548: 59 61 00 54 sw (r11+84),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 803c54c: 34 01 00 04 mvi r1,4 803c550: 5c 41 00 04 bne r2,r1,803c560 <_Rate_monotonic_Update_statistics+0x38> stats->missed_count++; 803c554: 29 61 00 58 lw r1,(r11+88) 803c558: 34 21 00 01 addi r1,r1,1 803c55c: 59 61 00 58 sw (r11+88),r1 /* * Grab status for time statistics. */ valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 803c560: 37 8c 00 18 addi r12,sp,24 803c564: b9 60 08 00 mv r1,r11 803c568: 37 82 00 10 addi r2,sp,16 803c56c: b9 80 18 00 mv r3,r12 803c570: fb ff ff b5 calli 803c444 <_Rate_monotonic_Get_status> if (!valid_status) 803c574: 44 20 00 28 be r1,r0,803c614 <_Rate_monotonic_Update_statistics+0xec><== NEVER TAKEN /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 803c578: b9 80 10 00 mv r2,r12 803c57c: 35 61 00 6c addi r1,r11,108 803c580: fb ff 3e 87 calli 800bf9c <_Timespec_Add_to> if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 803c584: b9 80 08 00 mv r1,r12 803c588: 35 62 00 5c addi r2,r11,92 803c58c: f8 00 02 d1 calli 803d0d0 <_Timespec_Less_than> 803c590: 44 20 00 05 be r1,r0,803c5a4 <_Rate_monotonic_Update_statistics+0x7c> stats->min_cpu_time = executed; 803c594: 2b 81 00 18 lw r1,(sp+24) 803c598: 59 61 00 5c sw (r11+92),r1 803c59c: 2b 81 00 1c lw r1,(sp+28) 803c5a0: 59 61 00 60 sw (r11+96),r1 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 803c5a4: 37 81 00 18 addi r1,sp,24 803c5a8: 35 62 00 64 addi r2,r11,100 803c5ac: f8 00 02 bd calli 803d0a0 <_Timespec_Greater_than> 803c5b0: 44 20 00 05 be r1,r0,803c5c4 <_Rate_monotonic_Update_statistics+0x9c> stats->max_cpu_time = executed; 803c5b4: 2b 81 00 18 lw r1,(sp+24) 803c5b8: 59 61 00 64 sw (r11+100),r1 803c5bc: 2b 81 00 1c lw r1,(sp+28) 803c5c0: 59 61 00 68 sw (r11+104),r1 /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 803c5c4: 37 8c 00 10 addi r12,sp,16 803c5c8: b9 80 10 00 mv r2,r12 803c5cc: 35 61 00 84 addi r1,r11,132 803c5d0: fb ff 3e 73 calli 800bf9c <_Timespec_Add_to> if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 803c5d4: b9 80 08 00 mv r1,r12 803c5d8: 35 62 00 74 addi r2,r11,116 803c5dc: f8 00 02 bd calli 803d0d0 <_Timespec_Less_than> 803c5e0: 44 20 00 05 be r1,r0,803c5f4 <_Rate_monotonic_Update_statistics+0xcc> stats->min_wall_time = since_last_period; 803c5e4: 2b 81 00 10 lw r1,(sp+16) 803c5e8: 59 61 00 74 sw (r11+116),r1 803c5ec: 2b 81 00 14 lw r1,(sp+20) 803c5f0: 59 61 00 78 sw (r11+120),r1 if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 803c5f4: 37 81 00 10 addi r1,sp,16 803c5f8: 35 62 00 7c addi r2,r11,124 803c5fc: f8 00 02 a9 calli 803d0a0 <_Timespec_Greater_than> 803c600: 44 20 00 05 be r1,r0,803c614 <_Rate_monotonic_Update_statistics+0xec> stats->max_wall_time = since_last_period; 803c604: 2b 81 00 14 lw r1,(sp+20) 803c608: 59 61 00 80 sw (r11+128),r1 803c60c: 2b 81 00 10 lw r1,(sp+16) 803c610: 59 61 00 7c sw (r11+124),r1 stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 803c614: 2b 9d 00 04 lw ra,(sp+4) 803c618: 2b 8b 00 0c lw r11,(sp+12) 803c61c: 2b 8c 00 08 lw r12,(sp+8) 803c620: 37 9c 00 1c addi sp,sp,28 803c624: c3 a0 00 00 ret 080082e0 <_TOD_Get>: */ void _TOD_Get( struct timespec *time ) { 80082e0: 37 9c ff e4 addi sp,sp,-28 80082e4: 5b 8b 00 0c sw (sp+12),r11 80082e8: 5b 8c 00 08 sw (sp+8),r12 80082ec: 5b 9d 00 04 sw (sp+4),ra 80082f0: b8 20 58 00 mv r11,r1 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); 80082f4: 90 00 60 00 rcsr r12,IE 80082f8: 34 01 ff fe mvi r1,-2 80082fc: a1 81 08 00 and r1,r12,r1 8008300: d0 01 00 00 wcsr IE,r1 now = _TOD_Now; 8008304: 78 02 08 01 mvhi r2,0x801 8008308: 38 42 c8 b4 ori r2,r2,0xc8b4 if ( _Watchdog_Nanoseconds_since_tick_handler ) 800830c: 78 03 08 01 mvhi r3,0x801 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 8008310: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008314: 38 63 c9 c4 ori r3,r3,0xc9c4 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 8008318: 28 42 00 00 lw r2,(r2+0) if ( _Watchdog_Nanoseconds_since_tick_handler ) 800831c: 28 63 00 00 lw r3,(r3+0) /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 8008320: 5b 81 00 14 sw (sp+20),r1 8008324: 5b 82 00 10 sw (sp+16),r2 if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008328: b8 60 20 00 mv r4,r3 800832c: 44 60 00 03 be r3,r0,8008338 <_TOD_Get+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 8008330: d8 60 00 00 call r3 <== NOT EXECUTED 8008334: b8 20 20 00 mv r4,r1 <== NOT EXECUTED _ISR_Enable( level ); 8008338: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 800833c: 34 03 00 00 mvi r3,0 _Timestamp_Add_to( &now, &offset ); 8008340: 37 81 00 10 addi r1,sp,16 8008344: 37 82 00 18 addi r2,sp,24 now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 8008348: 5b 83 00 18 sw (sp+24),r3 800834c: 5b 84 00 1c sw (sp+28),r4 _Timestamp_Add_to( &now, &offset ); 8008350: fb ff f3 86 calli 8005168 <_Timespec_Add_to> _Timestamp_To_timespec( &now, time ); 8008354: 2b 81 00 14 lw r1,(sp+20) 8008358: 59 61 00 04 sw (r11+4),r1 800835c: 2b 81 00 10 lw r1,(sp+16) 8008360: 59 61 00 00 sw (r11+0),r1 } 8008364: 2b 9d 00 04 lw ra,(sp+4) 8008368: 2b 8b 00 0c lw r11,(sp+12) 800836c: 2b 8c 00 08 lw r12,(sp+8) 8008370: 37 9c 00 1c addi sp,sp,28 8008374: c3 a0 00 00 ret 08008378 <_TOD_Get_uptime>: */ void _TOD_Get_uptime( Timestamp_Control *uptime ) { 8008378: 37 9c ff e4 addi sp,sp,-28 800837c: 5b 8b 00 0c sw (sp+12),r11 8008380: 5b 8c 00 08 sw (sp+8),r12 8008384: 5b 9d 00 04 sw (sp+4),ra 8008388: b8 20 58 00 mv r11,r1 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); 800838c: 90 00 60 00 rcsr r12,IE 8008390: 34 01 ff fe mvi r1,-2 8008394: a1 81 08 00 and r1,r12,r1 8008398: d0 01 00 00 wcsr IE,r1 up = _TOD_Uptime; 800839c: 78 02 08 01 mvhi r2,0x801 80083a0: 38 42 c8 a4 ori r2,r2,0xc8a4 if ( _Watchdog_Nanoseconds_since_tick_handler ) 80083a4: 78 03 08 01 mvhi r3,0x801 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 80083a8: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 80083ac: 38 63 c9 c4 ori r3,r3,0xc9c4 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 80083b0: 28 42 00 00 lw r2,(r2+0) if ( _Watchdog_Nanoseconds_since_tick_handler ) 80083b4: 28 63 00 00 lw r3,(r3+0) /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 80083b8: 5b 81 00 14 sw (sp+20),r1 80083bc: 5b 82 00 10 sw (sp+16),r2 if ( _Watchdog_Nanoseconds_since_tick_handler ) 80083c0: b8 60 20 00 mv r4,r3 80083c4: 44 60 00 03 be r3,r0,80083d0 <_TOD_Get_uptime+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 80083c8: d8 60 00 00 call r3 <== NOT EXECUTED 80083cc: b8 20 20 00 mv r4,r1 <== NOT EXECUTED _ISR_Enable( level ); 80083d0: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 80083d4: 34 03 00 00 mvi r3,0 _Timestamp_Add_to( &up, &offset ); 80083d8: 37 81 00 10 addi r1,sp,16 80083dc: 37 82 00 18 addi r2,sp,24 up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 80083e0: 5b 83 00 18 sw (sp+24),r3 80083e4: 5b 84 00 1c sw (sp+28),r4 _Timestamp_Add_to( &up, &offset ); 80083e8: fb ff f3 60 calli 8005168 <_Timespec_Add_to> *uptime = up; 80083ec: 2b 81 00 14 lw r1,(sp+20) 80083f0: 59 61 00 04 sw (r11+4),r1 80083f4: 2b 81 00 10 lw r1,(sp+16) 80083f8: 59 61 00 00 sw (r11+0),r1 } 80083fc: 2b 9d 00 04 lw ra,(sp+4) 8008400: 2b 8b 00 0c lw r11,(sp+12) 8008404: 2b 8c 00 08 lw r12,(sp+8) 8008408: 37 9c 00 1c addi sp,sp,28 800840c: c3 a0 00 00 ret 0800380c <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 800380c: 37 9c ff f4 addi sp,sp,-12 8003810: 5b 8b 00 0c sw (sp+12),r11 8003814: 5b 8c 00 08 sw (sp+8),r12 8003818: 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(); 800381c: 78 02 08 02 mvhi r2,0x802 8003820: 38 42 20 c4 ori r2,r2,0x20c4 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 8003824: 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(); 8003828: 28 42 00 0c lw r2,(r2+12) if ((!the_tod) || 800382c: 44 20 00 22 be r1,r0,80038b4 <_TOD_Validate+0xa8> <== NEVER TAKEN (the_tod->ticks >= ticks_per_second) || 8003830: 78 01 00 0f mvhi r1,0xf 8003834: 38 21 42 40 ori r1,r1,0x4240 8003838: f8 00 6a 31 calli 801e0fc <__udivsi3> 800383c: 29 62 00 18 lw r2,(r11+24) 8003840: 50 41 00 1d bgeu r2,r1,80038b4 <_TOD_Validate+0xa8> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 8003844: 29 62 00 14 lw r2,(r11+20) 8003848: 34 01 00 3b mvi r1,59 800384c: 54 41 00 1a bgu r2,r1,80038b4 <_TOD_Validate+0xa8> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 8003850: 29 62 00 10 lw r2,(r11+16) 8003854: 54 41 00 18 bgu r2,r1,80038b4 <_TOD_Validate+0xa8> (the_tod->hour >= TOD_HOURS_PER_DAY) || 8003858: 29 62 00 0c lw r2,(r11+12) 800385c: 34 01 00 17 mvi r1,23 8003860: 54 41 00 15 bgu r2,r1,80038b4 <_TOD_Validate+0xa8> (the_tod->month == 0) || 8003864: 29 61 00 04 lw r1,(r11+4) 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) || 8003868: 44 20 00 13 be r1,r0,80038b4 <_TOD_Validate+0xa8> <== NEVER TAKEN 800386c: 34 02 00 0c mvi r2,12 8003870: 54 22 00 11 bgu r1,r2,80038b4 <_TOD_Validate+0xa8> (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) || 8003874: 29 62 00 00 lw r2,(r11+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) || 8003878: 34 03 07 c3 mvi r3,1987 800387c: 50 62 00 0e bgeu r3,r2,80038b4 <_TOD_Validate+0xa8> (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) || (the_tod->day == 0) ) 8003880: 29 6c 00 08 lw r12,(r11+8) 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) || 8003884: 45 80 00 0c be r12,r0,80038b4 <_TOD_Validate+0xa8> <== NEVER TAKEN 8003888: 78 0b 08 01 mvhi r11,0x801 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 800388c: 20 42 00 03 andi r2,r2,0x3 8003890: 39 6b fb f0 ori r11,r11,0xfbf0 8003894: 5c 40 00 02 bne r2,r0,800389c <_TOD_Validate+0x90> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 8003898: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 800389c: 34 02 00 02 mvi r2,2 80038a0: fb ff f6 62 calli 8001228 <__ashlsi3> 80038a4: b5 61 08 00 add r1,r11,r1 80038a8: 28 21 00 00 lw r1,(r1+0) * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 80038ac: f0 2c 08 00 cmpgeu r1,r1,r12 80038b0: e0 00 00 02 bi 80038b8 <_TOD_Validate+0xac> 80038b4: 34 01 00 00 mvi r1,0 if ( the_tod->day > days_in_month ) return false; return true; } 80038b8: 2b 9d 00 04 lw ra,(sp+4) 80038bc: 2b 8b 00 0c lw r11,(sp+12) 80038c0: 2b 8c 00 08 lw r12,(sp+8) 80038c4: 37 9c 00 0c addi sp,sp,12 80038c8: c3 a0 00 00 ret 08003cd4 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8003cd4: 37 9c ff ec addi sp,sp,-20 8003cd8: 5b 8b 00 14 sw (sp+20),r11 8003cdc: 5b 8c 00 10 sw (sp+16),r12 8003ce0: 5b 8d 00 0c sw (sp+12),r13 8003ce4: 5b 8e 00 08 sw (sp+8),r14 8003ce8: 5b 9d 00 04 sw (sp+4),ra 8003cec: b8 20 58 00 mv r11,r1 */ /* * Save original state */ original_state = the_thread->current_state; 8003cf0: 28 2e 00 10 lw r14,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8003cf4: b8 40 60 00 mv r12,r2 8003cf8: 20 6d 00 ff andi r13,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 ); 8003cfc: f8 00 04 84 calli 8004f0c <_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 ) 8003d00: 29 61 00 14 lw r1,(r11+20) 8003d04: 44 2c 00 04 be r1,r12,8003d14 <_Thread_Change_priority+0x40> _Thread_Set_priority( the_thread, new_priority ); 8003d08: b9 80 10 00 mv r2,r12 8003d0c: b9 60 08 00 mv r1,r11 8003d10: f8 00 03 dc calli 8004c80 <_Thread_Set_priority> _ISR_Disable( level ); 8003d14: 90 00 60 00 rcsr r12,IE 8003d18: 34 05 ff fe mvi r5,-2 8003d1c: a1 85 28 00 and r5,r12,r5 8003d20: d0 05 00 00 wcsr IE,r5 /* * 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; 8003d24: 29 64 00 10 lw r4,(r11+16) if ( state != STATES_TRANSIENT ) { 8003d28: 34 01 00 04 mvi r1,4 8003d2c: 21 c2 00 04 andi r2,r14,0x4 8003d30: 44 81 00 0e be r4,r1,8003d68 <_Thread_Change_priority+0x94> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 8003d34: 5c 40 00 04 bne r2,r0,8003d44 <_Thread_Change_priority+0x70><== NEVER TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 8003d38: 34 01 ff fb mvi r1,-5 8003d3c: a0 81 08 00 and r1,r4,r1 8003d40: 59 61 00 10 sw (r11+16),r1 _ISR_Enable( level ); 8003d44: d0 0c 00 00 wcsr IE,r12 if ( _States_Is_waiting_on_thread_queue( state ) ) { 8003d48: 78 01 00 03 mvhi r1,0x3 8003d4c: 38 21 be e0 ori r1,r1,0xbee0 8003d50: a0 81 08 00 and r1,r4,r1 8003d54: 44 20 00 5f be r1,r0,8003ed0 <_Thread_Change_priority+0x1fc> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 8003d58: 29 61 00 44 lw r1,(r11+68) 8003d5c: b9 60 10 00 mv r2,r11 8003d60: f8 00 03 95 calli 8004bb4 <_Thread_queue_Requeue> 8003d64: e0 00 00 5b bi 8003ed0 <_Thread_Change_priority+0x1fc> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 8003d68: 5c 40 00 1c bne r2,r0,8003dd8 <_Thread_Change_priority+0x104><== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8003d6c: 29 61 00 90 lw r1,(r11+144) 8003d70: 2d 63 00 96 lhu r3,(r11+150) _Priority_Major_bit_map |= the_priority_map->ready_major; 8003d74: 78 04 08 01 mvhi r4,0x801 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8003d78: 2c 26 00 00 lhu r6,(r1+0) _Priority_Major_bit_map |= the_priority_map->ready_major; 8003d7c: 38 84 c8 d4 ori r4,r4,0xc8d4 * 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 ); 8003d80: 59 62 00 10 sw (r11+16),r2 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8003d84: b8 c3 18 00 or r3,r6,r3 8003d88: 0c 23 00 00 sh (r1+0),r3 _Priority_Major_bit_map |= the_priority_map->ready_major; 8003d8c: 2c 83 00 00 lhu r3,(r4+0) 8003d90: 2d 66 00 94 lhu r6,(r11+148) 8003d94: 29 61 00 8c lw r1,(r11+140) 8003d98: b8 c3 18 00 or r3,r6,r3 8003d9c: 20 63 ff ff andi r3,r3,0xffff 8003da0: 0c 83 00 00 sh (r4+0),r3 _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 8003da4: 45 a2 00 07 be r13,r2,8003dc0 <_Thread_Change_priority+0xec> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8003da8: 28 22 00 00 lw r2,(r1+0) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8003dac: 59 61 00 04 sw (r11+4),r1 before_node = after_node->next; after_node->next = the_node; 8003db0: 58 2b 00 00 sw (r1+0),r11 the_node->next = before_node; before_node->previous = the_node; 8003db4: 58 4b 00 04 sw (r2+4),r11 Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 8003db8: 59 62 00 00 sw (r11+0),r2 8003dbc: e0 00 00 07 bi 8003dd8 <_Thread_Change_priority+0x104> Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8003dc0: 34 22 00 04 addi r2,r1,4 8003dc4: 59 62 00 00 sw (r11+0),r2 old_last_node = the_chain->last; 8003dc8: 28 22 00 08 lw r2,(r1+8) the_chain->last = the_node; 8003dcc: 58 2b 00 08 sw (r1+8),r11 old_last_node->next = the_node; the_node->previous = old_last_node; 8003dd0: 59 62 00 04 sw (r11+4),r2 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 8003dd4: 58 4b 00 00 sw (r2+0),r11 _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 8003dd8: d0 0c 00 00 wcsr IE,r12 8003ddc: d0 05 00 00 wcsr IE,r5 RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8003de0: 78 01 08 01 mvhi r1,0x801 8003de4: 38 21 c8 d4 ori r1,r1,0xc8d4 8003de8: 2c 21 00 00 lhu r1,(r1+0) */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_Get_highest() ].first; 8003dec: 78 02 08 01 mvhi r2,0x801 8003df0: 38 42 c7 b0 ori r2,r2,0xc7b0 8003df4: 78 0b 08 01 mvhi r11,0x801 8003df8: 28 4e 00 00 lw r14,(r2+0) 8003dfc: 20 21 ff ff andi r1,r1,0xffff 8003e00: 34 02 00 ff mvi r2,255 8003e04: 39 6b a3 14 ori r11,r11,0xa314 8003e08: 54 22 00 05 bgu r1,r2,8003e1c <_Thread_Change_priority+0x148> 8003e0c: b5 61 58 00 add r11,r11,r1 8003e10: 41 6d 00 00 lbu r13,(r11+0) 8003e14: 35 ad 00 08 addi r13,r13,8 8003e18: e0 00 00 05 bi 8003e2c <_Thread_Change_priority+0x158> 8003e1c: 34 02 00 08 mvi r2,8 8003e20: fb ff f1 1c calli 8000290 <__lshrsi3> 8003e24: b5 61 58 00 add r11,r11,r1 8003e28: 41 6d 00 00 lbu r13,(r11+0) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8003e2c: 78 02 08 01 mvhi r2,0x801 8003e30: b5 ad 08 00 add r1,r13,r13 8003e34: 38 42 c9 50 ori r2,r2,0xc950 8003e38: b4 41 10 00 add r2,r2,r1 8003e3c: 2c 41 00 00 lhu r1,(r2+0) 8003e40: 78 0b 08 01 mvhi r11,0x801 8003e44: 34 02 00 ff mvi r2,255 8003e48: 39 6b a3 14 ori r11,r11,0xa314 8003e4c: 54 22 00 05 bgu r1,r2,8003e60 <_Thread_Change_priority+0x18c> 8003e50: b5 61 58 00 add r11,r11,r1 8003e54: 41 6b 00 00 lbu r11,(r11+0) 8003e58: 35 6b 00 08 addi r11,r11,8 8003e5c: e0 00 00 05 bi 8003e70 <_Thread_Change_priority+0x19c> 8003e60: 34 02 00 08 mvi r2,8 8003e64: fb ff f1 0b calli 8000290 <__lshrsi3> 8003e68: b5 61 58 00 add r11,r11,r1 8003e6c: 41 6b 00 00 lbu r11,(r11+0) * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8003e70: 34 02 00 04 mvi r2,4 8003e74: b9 a0 08 00 mv r1,r13 8003e78: fb ff f0 de calli 80001f0 <__ashlsi3> 8003e7c: b5 61 08 00 add r1,r11,r1 8003e80: b4 21 10 00 add r2,r1,r1 8003e84: b4 41 08 00 add r1,r2,r1 8003e88: 34 02 00 02 mvi r2,2 8003e8c: fb ff f0 d9 calli 80001f0 <__ashlsi3> 8003e90: b5 c1 08 00 add r1,r14,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 ); 8003e94: 78 02 08 01 mvhi r2,0x801 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8003e98: 28 23 00 00 lw r3,(r1+0) * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 8003e9c: 38 42 c8 e0 ori r2,r2,0xc8e0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8003ea0: 78 01 08 01 mvhi r1,0x801 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 8003ea4: 28 42 00 00 lw r2,(r2+0) * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8003ea8: 38 21 c8 b0 ori r1,r1,0xc8b0 8003eac: 58 23 00 00 sw (r1+0),r3 * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 8003eb0: 44 43 00 07 be r2,r3,8003ecc <_Thread_Change_priority+0x1f8> _Thread_Executing->is_preemptible ) 8003eb4: 40 41 00 75 lbu r1,(r2+117) 8003eb8: 44 20 00 05 be r1,r0,8003ecc <_Thread_Change_priority+0x1f8> _Context_Switch_necessary = true; 8003ebc: 78 01 08 01 mvhi r1,0x801 8003ec0: 38 21 c8 f0 ori r1,r1,0xc8f0 8003ec4: 34 02 00 01 mvi r2,1 8003ec8: 30 22 00 00 sb (r1+0),r2 _ISR_Enable( level ); 8003ecc: d0 0c 00 00 wcsr IE,r12 } 8003ed0: 2b 9d 00 04 lw ra,(sp+4) 8003ed4: 2b 8b 00 14 lw r11,(sp+20) 8003ed8: 2b 8c 00 10 lw r12,(sp+16) 8003edc: 2b 8d 00 0c lw r13,(sp+12) 8003ee0: 2b 8e 00 08 lw r14,(sp+8) 8003ee4: 37 9c 00 14 addi sp,sp,20 8003ee8: c3 a0 00 00 ret 08008b38 <_Thread_Clear_state>: ) { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 8008b38: 90 00 18 00 rcsr r3,IE 8008b3c: 34 05 ff fe mvi r5,-2 8008b40: a0 65 28 00 and r5,r3,r5 8008b44: d0 05 00 00 wcsr IE,r5 current_state = the_thread->current_state; 8008b48: 28 24 00 10 lw r4,(r1+16) if ( current_state & state ) { 8008b4c: a0 44 30 00 and r6,r2,r4 8008b50: 44 c0 00 2b be r6,r0,8008bfc <_Thread_Clear_state+0xc4> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 8008b54: a4 40 10 00 not r2,r2 8008b58: a0 44 10 00 and r2,r2,r4 current_state = 8008b5c: 58 22 00 10 sw (r1+16),r2 the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 8008b60: 5c 40 00 27 bne r2,r0,8008bfc <_Thread_Clear_state+0xc4> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8008b64: 28 26 00 90 lw r6,(r1+144) 8008b68: 2c 27 00 96 lhu r7,(r1+150) _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 8008b6c: 28 24 00 8c lw r4,(r1+140) 8008b70: 2c c8 00 00 lhu r8,(r6+0) _Priority_Major_bit_map |= the_priority_map->ready_major; 8008b74: 78 02 08 01 mvhi r2,0x801 8008b78: 38 42 c8 d4 ori r2,r2,0xc8d4 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8008b7c: b9 07 38 00 or r7,r8,r7 8008b80: 0c c7 00 00 sh (r6+0),r7 _Priority_Major_bit_map |= the_priority_map->ready_major; 8008b84: 2c 47 00 00 lhu r7,(r2+0) 8008b88: 2c 28 00 94 lhu r8,(r1+148) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8008b8c: 34 86 00 04 addi r6,r4,4 8008b90: 58 26 00 00 sw (r1+0),r6 old_last_node = the_chain->last; 8008b94: 28 86 00 08 lw r6,(r4+8) 8008b98: b9 07 38 00 or r7,r8,r7 the_chain->last = the_node; 8008b9c: 58 81 00 08 sw (r4+8),r1 8008ba0: 20 e4 ff ff andi r4,r7,0xffff 8008ba4: 0c 44 00 00 sh (r2+0),r4 old_last_node->next = the_node; the_node->previous = old_last_node; 8008ba8: 58 26 00 04 sw (r1+4),r6 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 8008bac: 58 c1 00 00 sw (r6+0),r1 _ISR_Flash( level ); 8008bb0: d0 03 00 00 wcsr IE,r3 8008bb4: d0 05 00 00 wcsr IE,r5 * 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 ( the_thread->current_priority < _Thread_Heir->current_priority ) { 8008bb8: 78 02 08 01 mvhi r2,0x801 8008bbc: 38 42 c8 b0 ori r2,r2,0xc8b0 8008bc0: 28 44 00 00 lw r4,(r2+0) 8008bc4: 28 25 00 14 lw r5,(r1+20) 8008bc8: 28 84 00 14 lw r4,(r4+20) 8008bcc: 50 a4 00 0c bgeu r5,r4,8008bfc <_Thread_Clear_state+0xc4> _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 8008bd0: 78 04 08 01 mvhi r4,0x801 8008bd4: 38 84 c8 e0 ori r4,r4,0xc8e0 8008bd8: 28 84 00 00 lw r4,(r4+0) * 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 ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; 8008bdc: 58 41 00 00 sw (r2+0),r1 if ( _Thread_Executing->is_preemptible || 8008be0: 40 81 00 75 lbu r1,(r4+117) 8008be4: 5c 20 00 02 bne r1,r0,8008bec <_Thread_Clear_state+0xb4> 8008be8: 5c a1 00 05 bne r5,r1,8008bfc <_Thread_Clear_state+0xc4> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 8008bec: 78 01 08 01 mvhi r1,0x801 8008bf0: 38 21 c8 f0 ori r1,r1,0xc8f0 8008bf4: 34 02 00 01 mvi r2,1 8008bf8: 30 22 00 00 sb (r1+0),r2 } } } _ISR_Enable( level ); 8008bfc: d0 03 00 00 wcsr IE,r3 } 8008c00: c3 a0 00 00 ret 0800ba54 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800ba54: 37 9c ff f8 addi sp,sp,-8 800ba58: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800ba5c: 37 82 00 08 addi r2,sp,8 800ba60: f8 00 00 a2 calli 800bce8 <_Thread_Get> switch ( location ) { 800ba64: 2b 82 00 08 lw r2,(sp+8) 800ba68: 5c 40 00 09 bne r2,r0,800ba8c <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800ba6c: 78 02 10 00 mvhi r2,0x1000 800ba70: 38 42 00 18 ori r2,r2,0x18 800ba74: fb ff ff 4e calli 800b7ac <_Thread_Clear_state> 800ba78: 78 01 08 02 mvhi r1,0x802 800ba7c: 38 21 99 b4 ori r1,r1,0x99b4 800ba80: 28 22 00 00 lw r2,(r1+0) 800ba84: 34 42 ff ff addi r2,r2,-1 800ba88: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800ba8c: 2b 9d 00 04 lw ra,(sp+4) 800ba90: 37 9c 00 08 addi sp,sp,8 800ba94: c3 a0 00 00 ret 080040c8 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 80040c8: 37 9c ff b0 addi sp,sp,-80 80040cc: 5b 8b 00 40 sw (sp+64),r11 80040d0: 5b 8c 00 3c sw (sp+60),r12 80040d4: 5b 8d 00 38 sw (sp+56),r13 80040d8: 5b 8e 00 34 sw (sp+52),r14 80040dc: 5b 8f 00 30 sw (sp+48),r15 80040e0: 5b 90 00 2c sw (sp+44),r16 80040e4: 5b 91 00 28 sw (sp+40),r17 80040e8: 5b 92 00 24 sw (sp+36),r18 80040ec: 5b 93 00 20 sw (sp+32),r19 80040f0: 5b 94 00 1c sw (sp+28),r20 80040f4: 5b 95 00 18 sw (sp+24),r21 80040f8: 5b 96 00 14 sw (sp+20),r22 80040fc: 5b 97 00 10 sw (sp+16),r23 8004100: 5b 98 00 0c sw (sp+12),r24 8004104: 5b 99 00 08 sw (sp+8),r25 8004108: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 800410c: 78 01 08 01 mvhi r1,0x801 8004110: 38 21 c8 e0 ori r1,r1,0xc8e0 8004114: 28 2b 00 00 lw r11,(r1+0) _ISR_Disable( level ); 8004118: 90 00 20 00 rcsr r4,IE 800411c: 34 01 ff fe mvi r1,-2 8004120: a0 81 08 00 and r1,r4,r1 8004124: d0 01 00 00 wcsr IE,r1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 8004128: 78 14 08 01 mvhi r20,0x801 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 800412c: 78 0f 08 01 mvhi r15,0x801 8004130: 78 0d 08 01 mvhi r13,0x801 heir = _Thread_Heir; 8004134: 78 12 08 01 mvhi r18,0x801 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; _Thread_Executing = heir; 8004138: 78 0e 08 01 mvhi r14,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; 800413c: 78 11 08 01 mvhi r17,0x801 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004140: 78 10 08 01 mvhi r16,0x801 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 8004144: ba 80 98 00 mv r19,r20 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 8004148: 39 ef c8 f0 ori r15,r15,0xc8f0 800414c: 39 ad c8 24 ori r13,r13,0xc824 heir = _Thread_Heir; 8004150: 3a 52 c8 b0 ori r18,r18,0xc8b0 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; _Thread_Executing = heir; 8004154: 39 ce c8 e0 ori r14,r14,0xc8e0 #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; 8004158: 3a 31 c7 b4 ori r17,r17,0xc7b4 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 800415c: 3a 10 c8 ac ori r16,r16,0xc8ac Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 8004160: 34 19 00 00 mvi r25,0 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 8004164: 34 17 00 01 mvi r23,1 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 8004168: 37 96 00 4c addi r22,sp,76 _Timestamp_Subtract( 800416c: 37 95 00 44 addi r21,sp,68 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 8004170: 3a 73 c8 e8 ori r19,r19,0xc8e8 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 8004174: 34 18 ff fe mvi r24,-2 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 8004178: e0 00 00 28 bi 8004218 <_Thread_Dispatch+0x150> heir = _Thread_Heir; 800417c: 2a 4c 00 00 lw r12,(r18+0) _Thread_Dispatch_disable_level = 1; 8004180: 59 b7 00 00 sw (r13+0),r23 _Context_Switch_necessary = false; 8004184: 31 f9 00 00 sb (r15+0),r25 _Thread_Executing = heir; #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 ) 8004188: 29 81 00 7c lw r1,(r12+124) _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; _Thread_Executing = heir; 800418c: 59 cc 00 00 sw (r14+0),r12 #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 ) 8004190: 5c 37 00 03 bne r1,r23,800419c <_Thread_Dispatch+0xd4> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8004194: 2a 21 00 00 lw r1,(r17+0) 8004198: 59 81 00 78 sw (r12+120),r1 _ISR_Enable( level ); 800419c: d0 04 00 00 wcsr IE,r4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 80041a0: ba c0 08 00 mv r1,r22 80041a4: f8 00 10 75 calli 8008378 <_TOD_Get_uptime> _Timestamp_Subtract( 80041a8: ba 80 08 00 mv r1,r20 80041ac: ba a0 18 00 mv r3,r21 80041b0: 38 21 c8 e8 ori r1,r1,0xc8e8 80041b4: ba c0 10 00 mv r2,r22 80041b8: f8 00 04 02 calli 80051c0 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 80041bc: ba a0 10 00 mv r2,r21 80041c0: 35 61 00 84 addi r1,r11,132 80041c4: f8 00 03 e9 calli 8005168 <_Timespec_Add_to> _Thread_Time_of_last_context_switch = uptime; 80041c8: 2b 83 00 4c lw r3,(sp+76) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 80041cc: 2a 04 00 00 lw r4,(r16+0) executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 80041d0: b9 60 08 00 mv r1,r11 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 80041d4: 5a 63 00 00 sw (r19+0),r3 80041d8: 2b 83 00 50 lw r3,(sp+80) if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 80041dc: b9 80 10 00 mv r2,r12 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 80041e0: 5a 63 00 04 sw (r19+4),r3 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 80041e4: 44 80 00 05 be r4,r0,80041f8 <_Thread_Dispatch+0x130> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 80041e8: 28 83 00 00 lw r3,(r4+0) 80041ec: 59 63 01 20 sw (r11+288),r3 *_Thread_libc_reent = heir->libc_reent; 80041f0: 29 83 01 20 lw r3,(r12+288) 80041f4: 58 83 00 00 sw (r4+0),r3 } _User_extensions_Thread_switch( executing, heir ); 80041f8: f8 00 04 dc calli 8005568 <_User_extensions_Thread_switch> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 80041fc: 35 61 00 cc addi r1,r11,204 8004200: 35 82 00 cc addi r2,r12,204 8004204: f8 00 05 f1 calli 80059c8 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 8004208: 29 cb 00 00 lw r11,(r14+0) _ISR_Disable( level ); 800420c: 90 00 20 00 rcsr r4,IE 8004210: a0 98 08 00 and r1,r4,r24 8004214: d0 01 00 00 wcsr IE,r1 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 8004218: 41 e5 00 00 lbu r5,(r15+0) 800421c: 20 a5 00 ff andi r5,r5,0xff 8004220: 5c a0 ff d7 bne r5,r0,800417c <_Thread_Dispatch+0xb4> executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 8004224: 59 a5 00 00 sw (r13+0),r5 _ISR_Enable( level ); 8004228: d0 04 00 00 wcsr IE,r4 if ( _Thread_Do_post_task_switch_extension || 800422c: 78 01 08 01 mvhi r1,0x801 8004230: 38 21 c8 c4 ori r1,r1,0xc8c4 8004234: 28 21 00 00 lw r1,(r1+0) 8004238: 5c 20 00 03 bne r1,r0,8004244 <_Thread_Dispatch+0x17c> <== NEVER TAKEN executing->do_post_task_switch_extension ) { 800423c: 41 62 00 74 lbu r2,(r11+116) 8004240: 44 41 00 04 be r2,r1,8004250 <_Thread_Dispatch+0x188> executing->do_post_task_switch_extension = false; 8004244: 34 01 00 00 mvi r1,0 8004248: 31 61 00 74 sb (r11+116),r1 _API_extensions_Run_postswitch(); 800424c: fb ff f9 95 calli 80028a0 <_API_extensions_Run_postswitch> } } 8004250: 2b 9d 00 04 lw ra,(sp+4) 8004254: 2b 8b 00 40 lw r11,(sp+64) 8004258: 2b 8c 00 3c lw r12,(sp+60) 800425c: 2b 8d 00 38 lw r13,(sp+56) 8004260: 2b 8e 00 34 lw r14,(sp+52) 8004264: 2b 8f 00 30 lw r15,(sp+48) 8004268: 2b 90 00 2c lw r16,(sp+44) 800426c: 2b 91 00 28 lw r17,(sp+40) 8004270: 2b 92 00 24 lw r18,(sp+36) 8004274: 2b 93 00 20 lw r19,(sp+32) 8004278: 2b 94 00 1c lw r20,(sp+28) 800427c: 2b 95 00 18 lw r21,(sp+24) 8004280: 2b 96 00 14 lw r22,(sp+20) 8004284: 2b 97 00 10 lw r23,(sp+16) 8004288: 2b 98 00 0c lw r24,(sp+12) 800428c: 2b 99 00 08 lw r25,(sp+8) 8004290: 37 9c 00 50 addi sp,sp,80 8004294: c3 a0 00 00 ret 0800a850 <_Thread_Evaluate_mode>: bool _Thread_Evaluate_mode( void ) { Thread_Control *executing; executing = _Thread_Executing; 800a850: 78 01 08 01 mvhi r1,0x801 800a854: 38 21 c8 e0 ori r1,r1,0xc8e0 800a858: 28 21 00 00 lw r1,(r1+0) if ( !_States_Is_ready( executing->current_state ) || 800a85c: 28 22 00 10 lw r2,(r1+16) 800a860: 5c 40 00 07 bne r2,r0,800a87c <_Thread_Evaluate_mode+0x2c> <== NEVER TAKEN 800a864: 78 02 08 01 mvhi r2,0x801 800a868: 38 42 c8 b0 ori r2,r2,0xc8b0 800a86c: 28 42 00 00 lw r2,(r2+0) 800a870: 44 22 00 09 be r1,r2,800a894 <_Thread_Evaluate_mode+0x44> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 800a874: 40 21 00 75 lbu r1,(r1+117) 800a878: 44 20 00 07 be r1,r0,800a894 <_Thread_Evaluate_mode+0x44> <== NEVER TAKEN _Context_Switch_necessary = true; 800a87c: 78 01 08 01 mvhi r1,0x801 800a880: 38 21 c8 f0 ori r1,r1,0xc8f0 800a884: 34 02 00 01 mvi r2,1 800a888: 30 22 00 00 sb (r1+0),r2 800a88c: b8 40 08 00 mv r1,r2 return true; 800a890: c3 a0 00 00 ret 800a894: 34 01 00 00 mvi r1,0 } return false; } 800a898: c3 a0 00 00 ret 0800a89c <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 800a89c: 37 9c ff f4 addi sp,sp,-12 800a8a0: 5b 8b 00 0c sw (sp+12),r11 800a8a4: 5b 8c 00 08 sw (sp+8),r12 800a8a8: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 800a8ac: 78 01 08 01 mvhi r1,0x801 800a8b0: 38 21 c8 e0 ori r1,r1,0xc8e0 800a8b4: 28 2b 00 00 lw r11,(r1+0) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 800a8b8: 29 61 00 b8 lw r1,(r11+184) _ISR_Set_level(level); 800a8bc: 64 21 00 00 cmpei r1,r1,0 800a8c0: d0 01 00 00 wcsr IE,r1 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 800a8c4: 78 02 08 01 mvhi r2,0x801 800a8c8: 38 42 c6 2c ori r2,r2,0xc62c 800a8cc: 40 4c 00 00 lbu r12,(r2+0) doneConstructors = 1; 800a8d0: 34 03 00 01 mvi r3,1 /* * Take care that 'begin' extensions get to complete before * 'switch' extensions can run. This means must keep dispatch * disabled until all 'begin' extensions complete. */ _User_extensions_Thread_begin( executing ); 800a8d4: b9 60 08 00 mv r1,r11 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 800a8d8: 30 43 00 00 sb (r2+0),r3 /* * Take care that 'begin' extensions get to complete before * 'switch' extensions can run. This means must keep dispatch * disabled until all 'begin' extensions complete. */ _User_extensions_Thread_begin( executing ); 800a8dc: fb ff ea 80 calli 80052dc <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 800a8e0: fb ff e6 6e calli 8004298 <_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 (!doneCons) /* && (volatile void *)_init) */ { 800a8e4: 5d 80 00 02 bne r12,r0,800a8ec <_Thread_Handler+0x50> INIT_NAME (); 800a8e8: fb ff d5 c6 calli 8000000 } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800a8ec: 29 61 00 a0 lw r1,(r11+160) 800a8f0: 5c 20 00 05 bne r1,r0,800a904 <_Thread_Handler+0x68> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 800a8f4: 29 62 00 9c lw r2,(r11+156) 800a8f8: 29 61 00 a8 lw r1,(r11+168) 800a8fc: d8 40 00 00 call r2 INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 800a900: 59 61 00 28 sw (r11+40),r1 * was placed in return_argument. This assumed that if it returned * anything (which is not supporting in all APIs), then it would be * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); 800a904: b9 60 08 00 mv r1,r11 800a908: fb ff ea 8c calli 8005338 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 800a90c: 34 01 00 00 mvi r1,0 800a910: 34 02 00 01 mvi r2,1 800a914: 34 03 00 06 mvi r3,6 800a918: fb ff e2 a1 calli 800339c <_Internal_error_Occurred> 080045b0 <_Thread_Handler_initialization>: * * Output parameters: NONE */ void _Thread_Handler_initialization(void) { 80045b0: 37 9c ff f0 addi sp,sp,-16 80045b4: 5b 8b 00 10 sw (sp+16),r11 80045b8: 5b 8c 00 0c sw (sp+12),r12 80045bc: 5b 8d 00 08 sw (sp+8),r13 80045c0: 5b 9d 00 04 sw (sp+4),ra uint32_t maximum_extensions; #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies; #endif ticks_per_timeslice = Configuration.ticks_per_timeslice; 80045c4: 78 01 08 01 mvhi r1,0x801 80045c8: 38 21 c0 c4 ori r1,r1,0xc0c4 #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 80045cc: 28 22 00 20 lw r2,(r1+32) 80045d0: 28 29 00 24 lw r9,(r1+36) uint32_t maximum_extensions; #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies; #endif ticks_per_timeslice = Configuration.ticks_per_timeslice; 80045d4: 28 2a 00 10 lw r10,(r1+16) #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 80045d8: 64 42 00 00 cmpei r2,r2,0 80045dc: 65 29 00 00 cmpei r9,r9,0 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies; #endif ticks_per_timeslice = Configuration.ticks_per_timeslice; maximum_extensions = Configuration.maximum_extensions; 80045e0: 28 2d 00 08 lw r13,(r1+8) #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 80045e4: 99 22 48 00 xor r9,r9,r2 80045e8: b9 20 58 00 mv r11,r9 80045ec: 45 20 00 05 be r9,r0,8004600 <_Thread_Handler_initialization+0x50><== ALWAYS TAKEN == (!Configuration.stack_free_hook) ) ) _Internal_error_Occurred( 80045f0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 80045f4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80045f8: 34 03 00 0f mvi r3,15 <== NOT EXECUTED 80045fc: fb ff fb 68 calli 800339c <_Internal_error_Occurred> <== NOT EXECUTED _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004600: 78 0c 08 01 mvhi r12,0x801 8004604: 39 8c c0 c0 ori r12,r12,0xc0c0 8004608: 41 81 00 00 lbu r1,(r12+0) INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 800460c: 78 08 08 01 mvhi r8,0x801 _Thread_Executing = NULL; 8004610: 78 05 08 01 mvhi r5,0x801 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004614: 34 21 00 01 addi r1,r1,1 INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; _Thread_Executing = NULL; _Thread_Heir = NULL; 8004618: 78 04 08 01 mvhi r4,0x801 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; 800461c: 78 03 08 01 mvhi r3,0x801 _Thread_Maximum_extensions = maximum_extensions; 8004620: 78 07 08 01 mvhi r7,0x801 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8004624: 78 06 08 01 mvhi r6,0x801 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; 8004628: 38 63 c8 c4 ori r3,r3,0xc8c4 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; 800462c: 38 c6 c7 b4 ori r6,r6,0xc7b4 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 8004630: 39 08 c8 f0 ori r8,r8,0xc8f0 _Thread_Executing = NULL; 8004634: 38 a5 c8 e0 ori r5,r5,0xc8e0 _Thread_Heir = NULL; 8004638: 38 84 c8 b0 ori r4,r4,0xc8b0 _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; 800463c: 38 e7 c8 c0 ori r7,r7,0xc8c0 _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004640: b4 21 10 00 add r2,r1,r1 _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8004644: 58 ca 00 00 sw (r6+0),r10 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; 8004648: 58 69 00 00 sw (r3+0),r9 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 800464c: b4 41 08 00 add r1,r2,r1 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 8004650: 31 09 00 00 sb (r8+0),r9 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004654: 34 02 00 02 mvi r2,2 _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; 8004658: 58 ed 00 00 sw (r7+0),r13 true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; _Thread_Executing = NULL; 800465c: 58 a9 00 00 sw (r5+0),r9 _Thread_Heir = NULL; 8004660: 58 89 00 00 sw (r4+0),r9 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004664: fb ff ee e3 calli 80001f0 <__ashlsi3> 8004668: f8 00 04 98 calli 80058c8 <_Workspace_Allocate_or_fatal_error> 800466c: 78 02 08 01 mvhi r2,0x801 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 8004670: 41 83 00 00 lbu r3,(r12+0) _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004674: 38 42 c7 b0 ori r2,r2,0xc7b0 8004678: 58 41 00 00 sw (r2+0),r1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 800467c: b9 60 30 00 mv r6,r11 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8004680: 34 22 00 04 addi r2,r1,4 8004684: 58 22 00 00 sw (r1+0),r2 the_chain->permanent_null = NULL; 8004688: 58 26 00 04 sw (r1+4),r6 the_chain->last = _Chain_Head(the_chain); 800468c: 58 21 00 08 sw (r1+8),r1 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 8004690: 35 6b 00 01 addi r11,r11,1 8004694: 34 21 00 0c addi r1,r1,12 8004698: 50 6b ff fa bgeu r3,r11,8004680 <_Thread_Handler_initialization+0xd0> /* * Initialize this class of objects. */ _Objects_Initialize_information( 800469c: 34 02 00 01 mvi r2,1 80046a0: 78 01 08 01 mvhi r1,0x801 80046a4: 38 21 c9 80 ori r1,r1,0xc980 80046a8: b8 40 18 00 mv r3,r2 80046ac: b8 40 20 00 mv r4,r2 80046b0: 34 05 01 38 mvi r5,312 80046b4: 34 07 00 08 mvi r7,8 80046b8: fb ff fc ce calli 80039f0 <_Objects_Initialize_information> false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 80046bc: 2b 9d 00 04 lw ra,(sp+4) 80046c0: 2b 8b 00 10 lw r11,(sp+16) 80046c4: 2b 8c 00 0c lw r12,(sp+12) 80046c8: 2b 8d 00 08 lw r13,(sp+8) 80046cc: 37 9c 00 10 addi sp,sp,16 80046d0: c3 a0 00 00 ret 080090a8 <_Thread_Reset_timeslice>: { ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 80090a8: 78 01 08 01 mvhi r1,0x801 80090ac: 38 21 c8 e0 ori r1,r1,0xc8e0 80090b0: 28 21 00 00 lw r1,(r1+0) ready = executing->ready; 80090b4: 28 22 00 8c lw r2,(r1+140) _ISR_Disable( level ); 80090b8: 90 00 20 00 rcsr r4,IE 80090bc: 34 03 ff fe mvi r3,-2 80090c0: a0 83 18 00 and r3,r4,r3 80090c4: d0 03 00 00 wcsr IE,r3 if ( _Chain_Has_only_one_node( ready ) ) { 80090c8: 28 46 00 00 lw r6,(r2+0) 80090cc: 28 45 00 08 lw r5,(r2+8) 80090d0: 5c c5 00 03 bne r6,r5,80090dc <_Thread_Reset_timeslice+0x34> _ISR_Enable( level ); 80090d4: d0 04 00 00 wcsr IE,r4 return; 80090d8: c3 a0 00 00 ret ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 80090dc: 28 25 00 00 lw r5,(r1+0) previous = the_node->previous; 80090e0: 28 26 00 04 lw r6,(r1+4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 80090e4: 34 47 00 04 addi r7,r2,4 Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; previous->next = next; 80090e8: 58 c5 00 00 sw (r6+0),r5 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 80090ec: 58 27 00 00 sw (r1+0),r7 Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 80090f0: 58 a6 00 04 sw (r5+4),r6 ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 80090f4: 28 45 00 08 lw r5,(r2+8) the_chain->last = the_node; 80090f8: 58 41 00 08 sw (r2+8),r1 old_last_node->next = the_node; the_node->previous = old_last_node; 80090fc: 58 25 00 04 sw (r1+4),r5 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 8009100: 58 a1 00 00 sw (r5+0),r1 } _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 8009104: d0 04 00 00 wcsr IE,r4 8009108: d0 03 00 00 wcsr IE,r3 if ( _Thread_Is_heir( executing ) ) 800910c: 78 03 08 01 mvhi r3,0x801 8009110: 38 63 c8 b0 ori r3,r3,0xc8b0 8009114: 28 65 00 00 lw r5,(r3+0) 8009118: 5c 25 00 03 bne r1,r5,8009124 <_Thread_Reset_timeslice+0x7c><== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 800911c: 28 42 00 00 lw r2,(r2+0) 8009120: 58 62 00 00 sw (r3+0),r2 _Context_Switch_necessary = true; 8009124: 78 01 08 01 mvhi r1,0x801 8009128: 38 21 c8 f0 ori r1,r1,0xc8f0 800912c: 34 02 00 01 mvi r2,1 8009130: 30 22 00 00 sb (r1+0),r2 _ISR_Enable( level ); 8009134: d0 04 00 00 wcsr IE,r4 8009138: c3 a0 00 00 ret 08005c6c <_Thread_Restart>: bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 8005c6c: 37 9c ff f0 addi sp,sp,-16 8005c70: 5b 8b 00 08 sw (sp+8),r11 8005c74: 5b 9d 00 04 sw (sp+4),ra if ( !_States_Is_dormant( the_thread->current_state ) ) { 8005c78: 28 25 00 10 lw r5,(r1+16) 8005c7c: 34 04 00 00 mvi r4,0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 8005c80: b8 20 58 00 mv r11,r1 if ( !_States_Is_dormant( the_thread->current_state ) ) { 8005c84: 20 a5 00 01 andi r5,r5,0x1 8005c88: 5c a4 00 16 bne r5,r4,8005ce0 <_Thread_Restart+0x74> _Thread_Set_transient( the_thread ); 8005c8c: 5b 82 00 10 sw (sp+16),r2 8005c90: 5b 83 00 0c sw (sp+12),r3 8005c94: f8 00 00 bb calli 8005f80 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 8005c98: 2b 82 00 10 lw r2,(sp+16) 8005c9c: 2b 83 00 0c lw r3,(sp+12) 8005ca0: b9 60 08 00 mv r1,r11 8005ca4: f8 00 11 8a calli 800a2cc <_Thread_Reset> _Thread_Load_environment( the_thread ); 8005ca8: b9 60 08 00 mv r1,r11 8005cac: f8 00 10 5f calli 8009e28 <_Thread_Load_environment> _Thread_Ready( the_thread ); 8005cb0: b9 60 08 00 mv r1,r11 8005cb4: f8 00 11 22 calli 800a13c <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 8005cb8: b9 60 08 00 mv r1,r11 8005cbc: f8 00 02 52 calli 8006604 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 8005cc0: 78 01 08 02 mvhi r1,0x802 8005cc4: 38 21 09 40 ori r1,r1,0x940 8005cc8: 28 21 00 00 lw r1,(r1+0) 8005ccc: 34 04 00 01 mvi r4,1 8005cd0: 5d 61 00 04 bne r11,r1,8005ce0 <_Thread_Restart+0x74> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) _Context_Restore_fp( &_Thread_Executing->fp_context ); #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 8005cd4: 35 61 00 cc addi r1,r11,204 8005cd8: f8 00 03 d0 calli 8006c18 <_CPU_Context_restore> 8005cdc: 34 04 00 01 mvi r4,1 <== NOT EXECUTED return true; } return false; } 8005ce0: b8 80 08 00 mv r1,r4 8005ce4: 2b 9d 00 04 lw ra,(sp+4) 8005ce8: 2b 8b 00 08 lw r11,(sp+8) 8005cec: 37 9c 00 10 addi sp,sp,16 8005cf0: c3 a0 00 00 ret 0800a068 <_Thread_Resume>: { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 800a068: 90 00 18 00 rcsr r3,IE 800a06c: 34 05 ff fe mvi r5,-2 800a070: a0 65 28 00 and r5,r3,r5 800a074: d0 05 00 00 wcsr IE,r5 _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 800a078: 28 22 00 10 lw r2,(r1+16) if ( current_state & STATES_SUSPENDED ) { 800a07c: 20 44 00 02 andi r4,r2,0x2 800a080: 44 80 00 2b be r4,r0,800a12c <_Thread_Resume+0xc4> <== NEVER TAKEN 800a084: 34 04 ff fd mvi r4,-3 800a088: a0 44 10 00 and r2,r2,r4 current_state = 800a08c: 58 22 00 10 sw (r1+16),r2 the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 800a090: 5c 40 00 27 bne r2,r0,800a12c <_Thread_Resume+0xc4> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 800a094: 28 26 00 90 lw r6,(r1+144) 800a098: 2c 27 00 96 lhu r7,(r1+150) _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 800a09c: 28 24 00 8c lw r4,(r1+140) 800a0a0: 2c c8 00 00 lhu r8,(r6+0) _Priority_Major_bit_map |= the_priority_map->ready_major; 800a0a4: 78 02 08 02 mvhi r2,0x802 800a0a8: 38 42 39 b4 ori r2,r2,0x39b4 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 800a0ac: b9 07 38 00 or r7,r8,r7 800a0b0: 0c c7 00 00 sh (r6+0),r7 _Priority_Major_bit_map |= the_priority_map->ready_major; 800a0b4: 2c 47 00 00 lhu r7,(r2+0) 800a0b8: 2c 28 00 94 lhu r8,(r1+148) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 800a0bc: 34 86 00 04 addi r6,r4,4 800a0c0: 58 26 00 00 sw (r1+0),r6 old_last_node = the_chain->last; 800a0c4: 28 86 00 08 lw r6,(r4+8) 800a0c8: b9 07 38 00 or r7,r8,r7 the_chain->last = the_node; 800a0cc: 58 81 00 08 sw (r4+8),r1 800a0d0: 20 e4 ff ff andi r4,r7,0xffff 800a0d4: 0c 44 00 00 sh (r2+0),r4 old_last_node->next = the_node; the_node->previous = old_last_node; 800a0d8: 58 26 00 04 sw (r1+4),r6 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 800a0dc: 58 c1 00 00 sw (r6+0),r1 _ISR_Flash( level ); 800a0e0: d0 03 00 00 wcsr IE,r3 800a0e4: d0 05 00 00 wcsr IE,r5 if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 800a0e8: 78 02 08 02 mvhi r2,0x802 800a0ec: 38 42 39 90 ori r2,r2,0x3990 800a0f0: 28 44 00 00 lw r4,(r2+0) 800a0f4: 28 25 00 14 lw r5,(r1+20) 800a0f8: 28 84 00 14 lw r4,(r4+20) 800a0fc: 50 a4 00 0c bgeu r5,r4,800a12c <_Thread_Resume+0xc4> _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 800a100: 78 04 08 02 mvhi r4,0x802 800a104: 38 84 39 c0 ori r4,r4,0x39c0 800a108: 28 84 00 00 lw r4,(r4+0) _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); _ISR_Flash( level ); if ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; 800a10c: 58 41 00 00 sw (r2+0),r1 if ( _Thread_Executing->is_preemptible || 800a110: 40 81 00 75 lbu r1,(r4+117) 800a114: 5c 20 00 02 bne r1,r0,800a11c <_Thread_Resume+0xb4> 800a118: 5c a1 00 05 bne r5,r1,800a12c <_Thread_Resume+0xc4> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 800a11c: 78 01 08 02 mvhi r1,0x802 800a120: 38 21 39 d0 ori r1,r1,0x39d0 800a124: 34 02 00 01 mvi r2,1 800a128: 30 22 00 00 sb (r1+0),r2 } } } _ISR_Enable( level ); 800a12c: d0 03 00 00 wcsr IE,r3 } 800a130: c3 a0 00 00 ret 0800cbc8 <_Thread_Yield_processor>: { ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 800cbc8: 78 01 08 02 mvhi r1,0x802 800cbcc: 38 21 9a 70 ori r1,r1,0x9a70 800cbd0: 28 21 00 00 lw r1,(r1+0) ready = executing->ready; 800cbd4: 28 22 00 8c lw r2,(r1+140) _ISR_Disable( level ); 800cbd8: 90 00 20 00 rcsr r4,IE 800cbdc: 34 05 ff fe mvi r5,-2 800cbe0: a0 85 28 00 and r5,r4,r5 800cbe4: d0 05 00 00 wcsr IE,r5 if ( !_Chain_Has_only_one_node( ready ) ) { 800cbe8: 28 47 00 00 lw r7,(r2+0) 800cbec: 28 46 00 08 lw r6,(r2+8) 800cbf0: 78 03 08 02 mvhi r3,0x802 800cbf4: 38 63 9a 40 ori r3,r3,0x9a40 800cbf8: 44 e6 00 12 be r7,r6,800cc40 <_Thread_Yield_processor+0x78> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 800cbfc: 28 26 00 00 lw r6,(r1+0) previous = the_node->previous; 800cc00: 28 27 00 04 lw r7,(r1+4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 800cc04: 34 48 00 04 addi r8,r2,4 Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; previous->next = next; 800cc08: 58 e6 00 00 sw (r7+0),r6 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 800cc0c: 58 28 00 00 sw (r1+0),r8 Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 800cc10: 58 c7 00 04 sw (r6+4),r7 ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 800cc14: 28 46 00 08 lw r6,(r2+8) the_chain->last = the_node; 800cc18: 58 41 00 08 sw (r2+8),r1 old_last_node->next = the_node; the_node->previous = old_last_node; 800cc1c: 58 26 00 04 sw (r1+4),r6 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 800cc20: 58 c1 00 00 sw (r6+0),r1 _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 800cc24: d0 04 00 00 wcsr IE,r4 800cc28: d0 05 00 00 wcsr IE,r5 if ( _Thread_Is_heir( executing ) ) 800cc2c: 28 65 00 00 lw r5,(r3+0) 800cc30: 5c 25 00 06 bne r1,r5,800cc48 <_Thread_Yield_processor+0x80><== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 800cc34: 28 42 00 00 lw r2,(r2+0) 800cc38: 58 62 00 00 sw (r3+0),r2 800cc3c: e0 00 00 03 bi 800cc48 <_Thread_Yield_processor+0x80> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 800cc40: 28 62 00 00 lw r2,(r3+0) 800cc44: 44 22 00 05 be r1,r2,800cc58 <_Thread_Yield_processor+0x90><== ALWAYS TAKEN _Context_Switch_necessary = true; 800cc48: 78 01 08 02 mvhi r1,0x802 800cc4c: 38 21 9a 80 ori r1,r1,0x9a80 800cc50: 34 02 00 01 mvi r2,1 800cc54: 30 22 00 00 sb (r1+0),r2 _ISR_Enable( level ); 800cc58: d0 04 00 00 wcsr IE,r4 } 800cc5c: c3 a0 00 00 ret 08004954 <_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 ) { 8004954: 37 9c ff ec addi sp,sp,-20 8004958: 5b 8b 00 14 sw (sp+20),r11 800495c: 5b 8c 00 10 sw (sp+16),r12 8004960: 5b 8d 00 0c sw (sp+12),r13 8004964: 5b 8e 00 08 sw (sp+8),r14 8004968: 5b 9d 00 04 sw (sp+4),ra Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 800496c: 28 4d 00 14 lw r13,(r2+20) Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 8004970: b8 40 58 00 mv r11,r2 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8004974: 34 44 00 3c addi r4,r2,60 8004978: 59 64 00 38 sw (r11+56),r4 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 800497c: 34 42 00 38 addi r2,r2,56 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 8004980: 34 04 00 00 mvi r4,0 8004984: b8 20 60 00 mv r12,r1 8004988: 59 64 00 3c sw (r11+60),r4 the_chain->last = _Chain_Head(the_chain); 800498c: 59 62 00 40 sw (r11+64),r2 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 8004990: b9 a0 08 00 mv r1,r13 8004994: 34 02 00 06 mvi r2,6 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 8004998: b8 60 70 00 mv r14,r3 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 800499c: fb ff ee 3d calli 8000290 <__lshrsi3> 80049a0: b4 21 10 00 add r2,r1,r1 80049a4: b4 41 08 00 add r1,r2,r1 80049a8: 34 02 00 02 mvi r2,2 80049ac: fb ff ee 11 calli 80001f0 <__ashlsi3> block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 80049b0: 21 a2 00 20 andi r2,r13,0x20 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 80049b4: b5 81 08 00 add r1,r12,r1 block_state = the_thread_queue->state; 80049b8: 29 87 00 38 lw r7,(r12+56) if ( _Thread_queue_Is_reverse_search( priority ) ) 80049bc: 5c 40 00 23 bne r2,r0,8004a48 <_Thread_queue_Enqueue_priority+0xf4> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 80049c0: 34 28 00 04 addi r8,r1,4 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 80049c4: 34 03 ff fe mvi r3,-2 80049c8: 90 00 20 00 rcsr r4,IE 80049cc: a0 83 30 00 and r6,r4,r3 80049d0: d0 06 00 00 wcsr IE,r6 search_thread = (Thread_Control *) header->first; 80049d4: 34 05 ff ff mvi r5,-1 80049d8: 28 22 00 00 lw r2,(r1+0) while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 80049dc: e0 00 00 0b bi 8004a08 <_Thread_queue_Enqueue_priority+0xb4> search_priority = search_thread->current_priority; 80049e0: 28 45 00 14 lw r5,(r2+20) if ( priority <= search_priority ) 80049e4: 50 ad 00 0a bgeu r5,r13,8004a0c <_Thread_queue_Enqueue_priority+0xb8> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 80049e8: d0 04 00 00 wcsr IE,r4 80049ec: d0 06 00 00 wcsr IE,r6 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 80049f0: 28 49 00 10 lw r9,(r2+16) 80049f4: a0 e9 48 00 and r9,r7,r9 80049f8: 5d 20 00 03 bne r9,r0,8004a04 <_Thread_queue_Enqueue_priority+0xb0><== ALWAYS TAKEN _ISR_Enable( level ); 80049fc: d0 04 00 00 wcsr IE,r4 <== NOT EXECUTED goto restart_forward_search; 8004a00: e3 ff ff f2 bi 80049c8 <_Thread_queue_Enqueue_priority+0x74><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 8004a04: 28 42 00 00 lw r2,(r2+0) restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8004a08: 5c 48 ff f6 bne r2,r8,80049e0 <_Thread_queue_Enqueue_priority+0x8c> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8004a0c: 29 83 00 30 lw r3,(r12+48) 8004a10: 34 01 00 01 mvi r1,1 the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8004a14: b8 80 38 00 mv r7,r4 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8004a18: 5c 61 00 3b bne r3,r1,8004b04 <_Thread_queue_Enqueue_priority+0x1b0><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8004a1c: 34 01 00 00 mvi r1,0 8004a20: 59 81 00 30 sw (r12+48),r1 if ( priority == search_priority ) 8004a24: 45 a5 00 2f be r13,r5,8004ae0 <_Thread_queue_Enqueue_priority+0x18c> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 8004a28: 28 41 00 04 lw r1,(r2+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8004a2c: 59 62 00 00 sw (r11+0),r2 the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 8004a30: 59 6c 00 44 sw (r11+68),r12 search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; 8004a34: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 8004a38: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 8004a3c: 58 4b 00 04 sw (r2+4),r11 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 8004a40: d0 04 00 00 wcsr IE,r4 8004a44: e0 00 00 25 bi 8004ad8 <_Thread_queue_Enqueue_priority+0x184> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8004a48: 78 04 08 01 mvhi r4,0x801 8004a4c: 38 84 c0 c0 ori r4,r4,0xc0c0 _ISR_Disable( level ); 8004a50: 34 03 ff fe mvi r3,-2 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8004a54: 40 86 00 00 lbu r6,(r4+0) 8004a58: 34 c6 00 01 addi r6,r6,1 _ISR_Disable( level ); 8004a5c: 90 00 28 00 rcsr r5,IE 8004a60: a0 a3 40 00 and r8,r5,r3 8004a64: d0 08 00 00 wcsr IE,r8 search_thread = (Thread_Control *) header->last; 8004a68: 28 22 00 08 lw r2,(r1+8) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8004a6c: e0 00 00 0b bi 8004a98 <_Thread_queue_Enqueue_priority+0x144> search_priority = search_thread->current_priority; 8004a70: 28 46 00 14 lw r6,(r2+20) if ( priority >= search_priority ) 8004a74: 51 a6 00 0a bgeu r13,r6,8004a9c <_Thread_queue_Enqueue_priority+0x148> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 8004a78: d0 05 00 00 wcsr IE,r5 8004a7c: d0 08 00 00 wcsr IE,r8 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8004a80: 28 49 00 10 lw r9,(r2+16) 8004a84: a0 e9 48 00 and r9,r7,r9 8004a88: 5d 20 00 03 bne r9,r0,8004a94 <_Thread_queue_Enqueue_priority+0x140><== ALWAYS TAKEN _ISR_Enable( level ); 8004a8c: d0 05 00 00 wcsr IE,r5 <== NOT EXECUTED goto restart_reverse_search; 8004a90: e3 ff ff f1 bi 8004a54 <_Thread_queue_Enqueue_priority+0x100><== NOT EXECUTED } search_thread = (Thread_Control *) 8004a94: 28 42 00 04 lw r2,(r2+4) restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8004a98: 5c 41 ff f6 bne r2,r1,8004a70 <_Thread_queue_Enqueue_priority+0x11c> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8004a9c: 29 83 00 30 lw r3,(r12+48) 8004aa0: 34 01 00 01 mvi r1,1 8004aa4: b8 a0 38 00 mv r7,r5 8004aa8: 5c 61 00 17 bne r3,r1,8004b04 <_Thread_queue_Enqueue_priority+0x1b0><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8004aac: 34 01 00 00 mvi r1,0 8004ab0: 59 81 00 30 sw (r12+48),r1 if ( priority == search_priority ) 8004ab4: b8 a0 20 00 mv r4,r5 8004ab8: 45 a6 00 0a be r13,r6,8004ae0 <_Thread_queue_Enqueue_priority+0x18c> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8004abc: 28 41 00 00 lw r1,(r2+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 8004ac0: 59 62 00 04 sw (r11+4),r2 search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 8004ac4: 59 6c 00 44 sw (r11+68),r12 search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 8004ac8: 59 61 00 00 sw (r11+0),r1 the_node->previous = search_node; search_node->next = the_node; 8004acc: 58 4b 00 00 sw (r2+0),r11 next_node->previous = the_node; 8004ad0: 58 2b 00 04 sw (r1+4),r11 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 8004ad4: d0 05 00 00 wcsr IE,r5 8004ad8: 34 01 00 01 mvi r1,1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8004adc: e0 00 00 0c bi 8004b0c <_Thread_queue_Enqueue_priority+0x1b8> 8004ae0: 34 42 00 3c addi r2,r2,60 equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 8004ae4: 28 41 00 04 lw r1,(r2+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8004ae8: 59 62 00 00 sw (r11+0),r2 the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 8004aec: 59 6c 00 44 sw (r11+68),r12 search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; 8004af0: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 8004af4: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 8004af8: 58 4b 00 04 sw (r2+4),r11 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 8004afc: d0 04 00 00 wcsr IE,r4 8004b00: e3 ff ff f6 bi 8004ad8 <_Thread_queue_Enqueue_priority+0x184> * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; 8004b04: 29 81 00 30 lw r1,(r12+48) <== NOT EXECUTED * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 8004b08: 59 c7 00 00 sw (r14+0),r7 <== NOT EXECUTED return the_thread_queue->sync_state; } 8004b0c: 2b 9d 00 04 lw ra,(sp+4) 8004b10: 2b 8b 00 14 lw r11,(sp+20) 8004b14: 2b 8c 00 10 lw r12,(sp+16) 8004b18: 2b 8d 00 0c lw r13,(sp+12) 8004b1c: 2b 8e 00 08 lw r14,(sp+8) 8004b20: 37 9c 00 14 addi sp,sp,20 8004b24: c3 a0 00 00 ret 08008eb8 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 8008eb8: 37 9c ff fc addi sp,sp,-4 8008ebc: 5b 9d 00 04 sw (sp+4),ra 8008ec0: b8 20 10 00 mv r2,r1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 8008ec4: 28 21 00 44 lw r1,(r1+68) * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 8008ec8: 28 24 00 30 lw r4,(r1+48) 8008ecc: 44 80 00 0c be r4,r0,8008efc <_Thread_queue_Process_timeout+0x44> 8008ed0: 78 03 08 01 mvhi r3,0x801 8008ed4: 38 63 c8 e0 ori r3,r3,0xc8e0 8008ed8: 28 63 00 00 lw r3,(r3+0) 8008edc: 5c 43 00 08 bne r2,r3,8008efc <_Thread_queue_Process_timeout+0x44><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 8008ee0: 34 03 00 03 mvi r3,3 8008ee4: 44 83 00 0a be r4,r3,8008f0c <_Thread_queue_Process_timeout+0x54> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 8008ee8: 34 03 00 02 mvi r3,2 8008eec: 58 23 00 30 sw (r1+48),r3 */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 8008ef0: 28 21 00 3c lw r1,(r1+60) 8008ef4: 58 41 00 34 sw (r2+52),r1 8008ef8: e0 00 00 05 bi 8008f0c <_Thread_queue_Process_timeout+0x54> the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 8008efc: 28 21 00 3c lw r1,(r1+60) 8008f00: 58 41 00 34 sw (r2+52),r1 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 8008f04: 28 41 00 44 lw r1,(r2+68) 8008f08: fb ff ff 93 calli 8008d54 <_Thread_queue_Extract> } } 8008f0c: 2b 9d 00 04 lw ra,(sp+4) 8008f10: 37 9c 00 04 addi sp,sp,4 8008f14: c3 a0 00 00 ret 08004bb4 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 8004bb4: 37 9c ff ec addi sp,sp,-20 8004bb8: 5b 8b 00 10 sw (sp+16),r11 8004bbc: 5b 8c 00 0c sw (sp+12),r12 8004bc0: 5b 8d 00 08 sw (sp+8),r13 8004bc4: 5b 9d 00 04 sw (sp+4),ra 8004bc8: b8 20 58 00 mv r11,r1 8004bcc: 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 ) 8004bd0: 44 20 00 17 be r1,r0,8004c2c <_Thread_queue_Requeue+0x78> <== 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 ) { 8004bd4: 28 22 00 34 lw r2,(r1+52) 8004bd8: 34 01 00 01 mvi r1,1 8004bdc: 5c 41 00 14 bne r2,r1,8004c2c <_Thread_queue_Requeue+0x78> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 8004be0: 90 00 68 00 rcsr r13,IE 8004be4: 34 01 ff fe mvi r1,-2 8004be8: a1 a1 08 00 and r1,r13,r1 8004bec: d0 01 00 00 wcsr IE,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 8004bf0: 29 82 00 10 lw r2,(r12+16) 8004bf4: 78 01 00 03 mvhi r1,0x3 8004bf8: 38 21 be e0 ori r1,r1,0xbee0 8004bfc: a0 41 08 00 and r1,r2,r1 8004c00: 44 20 00 0a be r1,r0,8004c28 <_Thread_queue_Requeue+0x74> <== NEVER TAKEN 8004c04: 34 03 00 01 mvi r3,1 8004c08: 59 63 00 30 sw (r11+48),r3 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 8004c0c: b9 60 08 00 mv r1,r11 8004c10: b9 80 10 00 mv r2,r12 8004c14: f8 00 10 5c calli 8008d84 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 8004c18: b9 60 08 00 mv r1,r11 8004c1c: b9 80 10 00 mv r2,r12 8004c20: 37 83 00 14 addi r3,sp,20 8004c24: fb ff ff 4c calli 8004954 <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 8004c28: d0 0d 00 00 wcsr IE,r13 } } 8004c2c: 2b 9d 00 04 lw ra,(sp+4) 8004c30: 2b 8b 00 10 lw r11,(sp+16) 8004c34: 2b 8c 00 0c lw r12,(sp+12) 8004c38: 2b 8d 00 08 lw r13,(sp+8) 8004c3c: 37 9c 00 14 addi sp,sp,20 8004c40: c3 a0 00 00 ret 08004c44 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 8004c44: 37 9c ff f8 addi sp,sp,-8 8004c48: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 8004c4c: 37 82 00 08 addi r2,sp,8 8004c50: fb ff fd 9f calli 80042cc <_Thread_Get> switch ( location ) { 8004c54: 2b 82 00 08 lw r2,(sp+8) 8004c58: 5c 40 00 07 bne r2,r0,8004c74 <_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 ); 8004c5c: f8 00 10 97 calli 8008eb8 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8004c60: 78 01 08 01 mvhi r1,0x801 8004c64: 38 21 c8 24 ori r1,r1,0xc824 8004c68: 28 22 00 00 lw r2,(r1+0) 8004c6c: 34 42 ff ff addi r2,r2,-1 8004c70: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8004c74: 2b 9d 00 04 lw ra,(sp+4) 8004c78: 37 9c 00 08 addi sp,sp,8 8004c7c: c3 a0 00 00 ret 08014140 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8014140: 37 9c ff a4 addi sp,sp,-92 8014144: 5b 8b 00 44 sw (sp+68),r11 8014148: 5b 8c 00 40 sw (sp+64),r12 801414c: 5b 8d 00 3c sw (sp+60),r13 8014150: 5b 8e 00 38 sw (sp+56),r14 8014154: 5b 8f 00 34 sw (sp+52),r15 8014158: 5b 90 00 30 sw (sp+48),r16 801415c: 5b 91 00 2c sw (sp+44),r17 8014160: 5b 92 00 28 sw (sp+40),r18 8014164: 5b 93 00 24 sw (sp+36),r19 8014168: 5b 94 00 20 sw (sp+32),r20 801416c: 5b 95 00 1c sw (sp+28),r21 8014170: 5b 96 00 18 sw (sp+24),r22 8014174: 5b 97 00 14 sw (sp+20),r23 8014178: 5b 98 00 10 sw (sp+16),r24 801417c: 5b 99 00 0c sw (sp+12),r25 8014180: 5b 9b 00 08 sw (sp+8),fp 8014184: 5b 9d 00 04 sw (sp+4),ra static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8014188: 78 11 08 03 mvhi r17,0x803 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 801418c: b8 20 58 00 mv r11,r1 8014190: 37 82 00 54 addi r2,sp,84 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 8014194: 34 01 00 00 mvi r1,0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8014198: 37 96 00 58 addi r22,sp,88 801419c: 37 8e 00 48 addi r14,sp,72 80141a0: 37 92 00 4c addi r18,sp,76 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 80141a4: 78 10 08 03 mvhi r16,0x803 80141a8: 78 0d 08 03 mvhi r13,0x803 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 80141ac: 5b 96 00 54 sw (sp+84),r22 the_chain->permanent_null = NULL; 80141b0: 5b 81 00 58 sw (sp+88),r1 the_chain->last = _Chain_Head(the_chain); 80141b4: 5b 82 00 5c sw (sp+92),r2 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 80141b8: 5b 92 00 48 sw (sp+72),r18 the_chain->permanent_null = NULL; 80141bc: 5b 81 00 4c sw (sp+76),r1 the_chain->last = _Chain_Head(the_chain); 80141c0: 5b 8e 00 50 sw (sp+80),r14 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 80141c4: 3a 31 dd 7c ori r17,r17,0xdd7c static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 80141c8: 3a 10 dc bc ori r16,r16,0xdcbc */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 80141cc: b8 20 a8 00 mv r21,r1 80141d0: 39 ad dc 2c ori r13,r13,0xdc2c */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 80141d4: 35 74 00 30 addi r20,r11,48 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 80141d8: 35 6f 00 68 addi r15,r11,104 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 80141dc: 35 7b 00 08 addi fp,r11,8 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 80141e0: 35 79 00 40 addi r25,r11,64 /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 80141e4: 34 18 00 01 mvi r24,1 Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 80141e8: 34 17 00 03 mvi r23,3 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 80141ec: 34 13 ff fe mvi r19,-2 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 80141f0: 37 81 00 54 addi r1,sp,84 80141f4: 59 61 00 78 sw (r11+120),r1 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 80141f8: 2a 22 00 00 lw r2,(r17+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 80141fc: 29 63 00 3c lw r3,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014200: ba 80 08 00 mv r1,r20 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 8014204: 59 62 00 3c sw (r11+60),r2 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014208: c8 43 10 00 sub r2,r2,r3 801420c: b9 c0 18 00 mv r3,r14 8014210: f8 00 14 36 calli 80192e8 <_Watchdog_Adjust_to_chain> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 8014214: 29 62 00 74 lw r2,(r11+116) static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014218: 2a 0c 00 00 lw r12,(r16+0) /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 801421c: 50 4c 00 06 bgeu r2,r12,8014234 <_Timer_server_Body+0xf4> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014220: c9 82 10 00 sub r2,r12,r2 8014224: b9 e0 08 00 mv r1,r15 8014228: b9 c0 18 00 mv r3,r14 801422c: f8 00 14 2f calli 80192e8 <_Watchdog_Adjust_to_chain> 8014230: e0 00 00 06 bi 8014248 <_Timer_server_Body+0x108> } else if ( snapshot < last_snapshot ) { 8014234: 51 82 00 05 bgeu r12,r2,8014248 <_Timer_server_Body+0x108> /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 8014238: c8 4c 18 00 sub r3,r2,r12 801423c: b9 e0 08 00 mv r1,r15 8014240: 34 02 00 01 mvi r2,1 8014244: f8 00 13 f1 calli 8019208 <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; 8014248: 59 6c 00 74 sw (r11+116),r12 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 801424c: 29 61 00 78 lw r1,(r11+120) 8014250: f8 00 02 ec calli 8014e00 <_Chain_Get> if ( timer == NULL ) { 8014254: 44 20 00 0b be r1,r0,8014280 <_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 ) { 8014258: 28 23 00 38 lw r3,(r1+56) <== NOT EXECUTED 801425c: 5c 78 00 04 bne r3,r24,801426c <_Timer_server_Body+0x12c> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8014260: 34 22 00 10 addi r2,r1,16 <== NOT EXECUTED 8014264: ba 80 08 00 mv r1,r20 <== NOT EXECUTED 8014268: e0 00 00 04 bi 8014278 <_Timer_server_Body+0x138> <== NOT EXECUTED } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 801426c: 5c 77 ff f8 bne r3,r23,801424c <_Timer_server_Body+0x10c> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8014270: 34 22 00 10 addi r2,r1,16 <== NOT EXECUTED 8014274: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8014278: f8 00 14 47 calli 8019394 <_Watchdog_Insert> <== NOT EXECUTED 801427c: e3 ff ff f4 bi 801424c <_Timer_server_Body+0x10c> <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 8014280: 90 00 10 00 rcsr r2,IE 8014284: a0 53 08 00 and r1,r2,r19 8014288: d0 01 00 00 wcsr IE,r1 if ( _Chain_Is_empty( insert_chain ) ) { 801428c: 2b 81 00 54 lw r1,(sp+84) 8014290: 5c 36 00 06 bne r1,r22,80142a8 <_Timer_server_Body+0x168> <== NEVER TAKEN ts->insert_chain = NULL; 8014294: 59 75 00 78 sw (r11+120),r21 _ISR_Enable( level ); 8014298: 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 ) ) { 801429c: 2b 81 00 48 lw r1,(sp+72) 80142a0: 5c 32 00 04 bne r1,r18,80142b0 <_Timer_server_Body+0x170> 80142a4: e0 00 00 17 bi 8014300 <_Timer_server_Body+0x1c0> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 80142a8: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED 80142ac: e3 ff ff d3 bi 80141f8 <_Timer_server_Body+0xb8> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 80142b0: 90 00 10 00 rcsr r2,IE 80142b4: a0 53 08 00 and r1,r2,r19 80142b8: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 80142bc: 2b 84 00 48 lw r4,(sp+72) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 80142c0: 5c 92 00 03 bne r4,r18,80142cc <_Timer_server_Body+0x18c> 80142c4: 34 04 00 00 mvi r4,0 80142c8: e0 00 00 04 bi 80142d8 <_Timer_server_Body+0x198> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 80142cc: 28 83 00 00 lw r3,(r4+0) the_chain->first = new_first; 80142d0: 5b 83 00 48 sw (sp+72),r3 new_first->previous = _Chain_Head(the_chain); 80142d4: 58 6e 00 04 sw (r3+4),r14 watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 80142d8: 44 80 00 08 be r4,r0,80142f8 <_Timer_server_Body+0x1b8> watchdog->state = WATCHDOG_INACTIVE; 80142dc: 58 95 00 08 sw (r4+8),r21 _ISR_Enable( level ); 80142e0: d0 02 00 00 wcsr IE,r2 /* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); 80142e4: 28 82 00 24 lw r2,(r4+36) 80142e8: 28 83 00 1c lw r3,(r4+28) 80142ec: 28 81 00 20 lw r1,(r4+32) 80142f0: d8 60 00 00 call r3 } 80142f4: e3 ff ff ef bi 80142b0 <_Timer_server_Body+0x170> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 80142f8: d0 02 00 00 wcsr IE,r2 80142fc: e3 ff ff bd bi 80141f0 <_Timer_server_Body+0xb0> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 8014300: 34 01 00 00 mvi r1,0 8014304: 31 61 00 7c sb (r11+124),r1 8014308: 29 a1 00 00 lw r1,(r13+0) 801430c: 34 21 00 01 addi r1,r1,1 8014310: 59 a1 00 00 sw (r13+0),r1 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 8014314: 29 61 00 00 lw r1,(r11+0) 8014318: 34 02 00 08 mvi r2,8 801431c: f8 00 10 c3 calli 8018628 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 8014320: b9 60 08 00 mv r1,r11 8014324: fb ff ff 4d calli 8014058 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 8014328: b9 60 08 00 mv r1,r11 801432c: fb ff ff 68 calli 80140cc <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 8014330: f8 00 0d 9e calli 80179a8 <_Thread_Enable_dispatch> ts->active = true; 8014334: 34 01 00 01 mvi r1,1 8014338: 31 61 00 7c sb (r11+124),r1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 801433c: bb 60 08 00 mv r1,fp 8014340: f8 00 14 74 calli 8019510 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8014344: bb 20 08 00 mv r1,r25 8014348: f8 00 14 72 calli 8019510 <_Watchdog_Remove> 801434c: e3 ff ff a9 bi 80141f0 <_Timer_server_Body+0xb0> 08014350 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8014350: 37 9c ff f8 addi sp,sp,-8 8014354: 5b 8b 00 08 sw (sp+8),r11 8014358: 5b 9d 00 04 sw (sp+4),ra 801435c: b8 20 58 00 mv r11,r1 if ( ts->insert_chain == NULL ) { 8014360: 28 21 00 78 lw r1,(r1+120) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8014364: b8 40 20 00 mv r4,r2 if ( ts->insert_chain == NULL ) { 8014368: 5c 20 00 47 bne r1,r0,8014484 <_Timer_server_Schedule_operation_method+0x134><== NEVER TAKEN 801436c: 78 01 08 03 mvhi r1,0x803 8014370: 38 21 dc 2c ori r1,r1,0xdc2c 8014374: 28 22 00 00 lw r2,(r1+0) 8014378: 34 42 00 01 addi r2,r2,1 801437c: 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 ) { 8014380: 28 81 00 38 lw r1,(r4+56) 8014384: 34 02 00 01 mvi r2,1 8014388: 5c 22 00 1d bne r1,r2,80143fc <_Timer_server_Schedule_operation_method+0xac> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 801438c: 90 00 18 00 rcsr r3,IE 8014390: 34 01 ff fe mvi r1,-2 8014394: a0 61 08 00 and r1,r3,r1 8014398: d0 01 00 00 wcsr IE,r1 snapshot = _Watchdog_Ticks_since_boot; 801439c: 78 02 08 03 mvhi r2,0x803 80143a0: 38 42 dd 7c ori r2,r2,0xdd7c */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 80143a4: 29 61 00 30 lw r1,(r11+48) 80143a8: 28 45 00 00 lw r5,(r2+0) last_snapshot = ts->Interval_watchdogs.last_snapshot; 80143ac: 29 62 00 3c lw r2,(r11+60) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 80143b0: 35 66 00 34 addi r6,r11,52 80143b4: 44 26 00 08 be r1,r6,80143d4 <_Timer_server_Schedule_operation_method+0x84> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 80143b8: 28 27 00 10 lw r7,(r1+16) first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 80143bc: c8 a2 10 00 sub r2,r5,r2 delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 80143c0: f4 e2 30 00 cmpgu r6,r7,r2 delta_interval -= delta; 80143c4: c8 e2 10 00 sub r2,r7,r2 * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 80143c8: c8 06 30 00 sub r6,r0,r6 80143cc: a0 46 10 00 and r2,r2,r6 delta_interval -= delta; } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 80143d0: 58 22 00 10 sw (r1+16),r2 } ts->Interval_watchdogs.last_snapshot = snapshot; 80143d4: 59 65 00 3c sw (r11+60),r5 _ISR_Enable( level ); 80143d8: d0 03 00 00 wcsr IE,r3 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 80143dc: 35 61 00 30 addi r1,r11,48 80143e0: 34 82 00 10 addi r2,r4,16 80143e4: f8 00 13 ec calli 8019394 <_Watchdog_Insert> if ( !ts->active ) { 80143e8: 41 61 00 7c lbu r1,(r11+124) 80143ec: 5c 20 00 24 bne r1,r0,801447c <_Timer_server_Schedule_operation_method+0x12c> _Timer_server_Reset_interval_system_watchdog( ts ); 80143f0: b9 60 08 00 mv r1,r11 80143f4: fb ff ff 19 calli 8014058 <_Timer_server_Reset_interval_system_watchdog> 80143f8: e0 00 00 21 bi 801447c <_Timer_server_Schedule_operation_method+0x12c> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 80143fc: 34 02 00 03 mvi r2,3 8014400: 5c 22 00 1f bne r1,r2,801447c <_Timer_server_Schedule_operation_method+0x12c> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8014404: 90 00 38 00 rcsr r7,IE 8014408: 34 01 ff fe mvi r1,-2 801440c: a0 e1 08 00 and r1,r7,r1 8014410: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8014414: 29 62 00 68 lw r2,(r11+104) snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014418: 78 01 08 03 mvhi r1,0x803 last_snapshot = ts->TOD_watchdogs.last_snapshot; 801441c: 29 66 00 74 lw r6,(r11+116) /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014420: 38 21 dc bc ori r1,r1,0xdcbc */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8014424: 35 63 00 6c addi r3,r11,108 8014428: 28 21 00 00 lw r1,(r1+0) 801442c: 44 43 00 0b be r2,r3,8014458 <_Timer_server_Schedule_operation_method+0x108> last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 8014430: 28 45 00 10 lw r5,(r2+16) } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 8014434: b4 a6 18 00 add r3,r5,r6 delta_interval += delta; 8014438: c8 61 18 00 sub r3,r3,r1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 801443c: 50 c1 00 06 bgeu r6,r1,8014454 <_Timer_server_Schedule_operation_method+0x104> /* * We advanced in time. */ delta = snapshot - last_snapshot; 8014440: c8 26 18 00 sub r3,r1,r6 if (delta_interval > delta) { 8014444: f4 a3 30 00 cmpgu r6,r5,r3 delta_interval -= delta; 8014448: c8 a3 18 00 sub r3,r5,r3 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 801444c: c8 06 28 00 sub r5,r0,r6 8014450: a0 65 18 00 and r3,r3,r5 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 8014454: 58 43 00 10 sw (r2+16),r3 } ts->TOD_watchdogs.last_snapshot = snapshot; 8014458: 59 61 00 74 sw (r11+116),r1 _ISR_Enable( level ); 801445c: d0 07 00 00 wcsr IE,r7 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8014460: 35 61 00 68 addi r1,r11,104 8014464: 34 82 00 10 addi r2,r4,16 8014468: f8 00 13 cb calli 8019394 <_Watchdog_Insert> if ( !ts->active ) { 801446c: 41 61 00 7c lbu r1,(r11+124) 8014470: 5c 20 00 03 bne r1,r0,801447c <_Timer_server_Schedule_operation_method+0x12c> _Timer_server_Reset_tod_system_watchdog( ts ); 8014474: b9 60 08 00 mv r1,r11 8014478: fb ff ff 15 calli 80140cc <_Timer_server_Reset_tod_system_watchdog> } } _Thread_Enable_dispatch(); 801447c: f8 00 0d 4b calli 80179a8 <_Thread_Enable_dispatch> 8014480: e0 00 00 03 bi 801448c <_Timer_server_Schedule_operation_method+0x13c> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 8014484: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED 8014488: f8 00 02 52 calli 8014dd0 <_Chain_Append> <== NOT EXECUTED } } 801448c: 2b 9d 00 04 lw ra,(sp+4) 8014490: 2b 8b 00 08 lw r11,(sp+8) 8014494: 37 9c 00 08 addi sp,sp,8 8014498: c3 a0 00 00 ret 0803d0a0 <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) 803d0a0: 28 24 00 00 lw r4,(r1+0) 803d0a4: 28 43 00 00 lw r3,(r2+0) 803d0a8: 4c 64 00 03 bge r3,r4,803d0b4 <_Timespec_Greater_than+0x14> 803d0ac: 34 01 00 01 mvi r1,1 803d0b0: c3 a0 00 00 ret return true; if ( lhs->tv_sec < rhs->tv_sec ) 803d0b4: 4c 83 00 03 bge r4,r3,803d0c0 <_Timespec_Greater_than+0x20><== ALWAYS TAKEN 803d0b8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 803d0bc: c3 a0 00 00 ret <== NOT EXECUTED #include #include #include bool _Timespec_Greater_than( 803d0c0: 28 23 00 04 lw r3,(r1+4) 803d0c4: 28 41 00 04 lw r1,(r2+4) 803d0c8: e8 61 08 00 cmpg r1,r3,r1 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 803d0cc: c3 a0 00 00 ret 080078c4 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 80078c4: 37 9c ff e4 addi sp,sp,-28 80078c8: 5b 8b 00 1c sw (sp+28),r11 80078cc: 5b 8c 00 18 sw (sp+24),r12 80078d0: 5b 8d 00 14 sw (sp+20),r13 80078d4: 5b 8e 00 10 sw (sp+16),r14 80078d8: 5b 8f 00 0c sw (sp+12),r15 80078dc: 5b 90 00 08 sw (sp+8),r16 80078e0: 5b 9d 00 04 sw (sp+4),ra 80078e4: b8 20 60 00 mv r12,r1 80078e8: b8 40 20 00 mv r4,r2 80078ec: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 80078f0: 90 00 10 00 rcsr r2,IE 80078f4: 34 01 ff fe mvi r1,-2 80078f8: a0 41 08 00 and r1,r2,r1 80078fc: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8007900: 29 81 00 00 lw r1,(r12+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8007904: 35 8e 00 04 addi r14,r12,4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 8007908: 44 2e 00 1d be r1,r14,800797c <_Watchdog_Adjust+0xb8> switch ( direction ) { 800790c: 44 80 00 04 be r4,r0,800791c <_Watchdog_Adjust+0x58> 8007910: 34 03 00 01 mvi r3,1 8007914: 5c 83 00 1a bne r4,r3,800797c <_Watchdog_Adjust+0xb8> <== NEVER TAKEN 8007918: e0 00 00 04 bi 8007928 <_Watchdog_Adjust+0x64> 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; 800791c: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8007920: 34 0f ff fe mvi r15,-2 8007924: e0 00 00 15 bi 8007978 <_Watchdog_Adjust+0xb4> * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 8007928: 28 23 00 10 lw r3,(r1+16) 800792c: b4 6b 58 00 add r11,r3,r11 8007930: e0 00 00 05 bi 8007944 <_Watchdog_Adjust+0x80> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 8007934: 29 81 00 00 lw r1,(r12+0) break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 8007938: 28 2d 00 10 lw r13,(r1+16) 800793c: 51 6d 00 04 bgeu r11,r13,800794c <_Watchdog_Adjust+0x88> _Watchdog_First( header )->delta_interval -= units; 8007940: c9 ab 58 00 sub r11,r13,r11 8007944: 58 2b 00 10 sw (r1+16),r11 break; 8007948: e0 00 00 0d bi 800797c <_Watchdog_Adjust+0xb8> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 800794c: 58 30 00 10 sw (r1+16),r16 _ISR_Enable( level ); 8007950: d0 02 00 00 wcsr IE,r2 _Watchdog_Tickle( header ); 8007954: b9 80 08 00 mv r1,r12 8007958: f8 00 00 9e calli 8007bd0 <_Watchdog_Tickle> _ISR_Disable( level ); 800795c: 90 00 08 00 rcsr r1,IE 8007960: a0 2f 10 00 and r2,r1,r15 8007964: d0 02 00 00 wcsr IE,r2 if ( _Chain_Is_empty( header ) ) 8007968: 29 83 00 00 lw r3,(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; 800796c: c9 6d 58 00 sub r11,r11,r13 8007970: b8 20 10 00 mv r2,r1 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 8007974: 44 6e 00 02 be r3,r14,800797c <_Watchdog_Adjust+0xb8> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 8007978: 5d 60 ff ef bne r11,r0,8007934 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 800797c: d0 02 00 00 wcsr IE,r2 } 8007980: 2b 9d 00 04 lw ra,(sp+4) 8007984: 2b 8b 00 1c lw r11,(sp+28) 8007988: 2b 8c 00 18 lw r12,(sp+24) 800798c: 2b 8d 00 14 lw r13,(sp+20) 8007990: 2b 8e 00 10 lw r14,(sp+16) 8007994: 2b 8f 00 0c lw r15,(sp+12) 8007998: 2b 90 00 08 lw r16,(sp+8) 800799c: 37 9c 00 1c addi sp,sp,28 80079a0: c3 a0 00 00 ret 0800574c <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 800574c: 90 00 20 00 rcsr r4,IE 8005750: 34 02 ff fe mvi r2,-2 8005754: a0 82 10 00 and r2,r4,r2 8005758: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 800575c: 28 22 00 08 lw r2,(r1+8) switch ( previous_state ) { 8005760: 34 03 00 01 mvi r3,1 8005764: 44 43 00 05 be r2,r3,8005778 <_Watchdog_Remove+0x2c> <== NEVER TAKEN 8005768: 44 40 00 1e be r2,r0,80057e0 <_Watchdog_Remove+0x94> 800576c: 34 03 00 03 mvi r3,3 8005770: 54 43 00 1c bgu r2,r3,80057e0 <_Watchdog_Remove+0x94> <== NEVER TAKEN 8005774: e0 00 00 04 bi 8005784 <_Watchdog_Remove+0x38> /* * 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; 8005778: 34 03 00 00 mvi r3,0 800577c: 58 23 00 08 sw (r1+8),r3 break; 8005780: e0 00 00 18 bi 80057e0 <_Watchdog_Remove+0x94> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 8005784: 28 23 00 00 lw r3,(r1+0) case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 8005788: 34 05 00 00 mvi r5,0 800578c: 58 25 00 08 sw (r1+8),r5 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 8005790: 28 65 00 00 lw r5,(r3+0) 8005794: 44 a0 00 05 be r5,r0,80057a8 <_Watchdog_Remove+0x5c> next_watchdog->delta_interval += the_watchdog->delta_interval; 8005798: 28 66 00 10 lw r6,(r3+16) 800579c: 28 25 00 10 lw r5,(r1+16) 80057a0: b4 c5 28 00 add r5,r6,r5 80057a4: 58 65 00 10 sw (r3+16),r5 if ( _Watchdog_Sync_count ) 80057a8: 78 03 08 01 mvhi r3,0x801 80057ac: 38 63 c9 70 ori r3,r3,0xc970 80057b0: 28 63 00 00 lw r3,(r3+0) 80057b4: 44 60 00 07 be r3,r0,80057d0 <_Watchdog_Remove+0x84> _Watchdog_Sync_level = _ISR_Nest_level; 80057b8: 78 03 08 01 mvhi r3,0x801 80057bc: 38 63 c8 bc ori r3,r3,0xc8bc 80057c0: 28 65 00 00 lw r5,(r3+0) 80057c4: 78 03 08 01 mvhi r3,0x801 80057c8: 38 63 c8 dc ori r3,r3,0xc8dc 80057cc: 58 65 00 00 sw (r3+0),r5 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 80057d0: 28 23 00 00 lw r3,(r1+0) previous = the_node->previous; 80057d4: 28 25 00 04 lw r5,(r1+4) next->previous = previous; previous->next = next; 80057d8: 58 a3 00 00 sw (r5+0),r3 Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 80057dc: 58 65 00 04 sw (r3+4),r5 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 80057e0: 78 03 08 01 mvhi r3,0x801 80057e4: 38 63 c9 74 ori r3,r3,0xc974 80057e8: 28 63 00 00 lw r3,(r3+0) 80057ec: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 80057f0: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 80057f4: b8 40 08 00 mv r1,r2 80057f8: c3 a0 00 00 ret 080075b4 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 80075b4: 37 9c ff ec addi sp,sp,-20 80075b8: 5b 8b 00 14 sw (sp+20),r11 80075bc: 5b 8c 00 10 sw (sp+16),r12 80075c0: 5b 8d 00 0c sw (sp+12),r13 80075c4: 5b 8e 00 08 sw (sp+8),r14 80075c8: 5b 9d 00 04 sw (sp+4),ra 80075cc: b8 20 70 00 mv r14,r1 80075d0: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 80075d4: 90 00 68 00 rcsr r13,IE 80075d8: 34 01 ff fe mvi r1,-2 80075dc: a1 a1 08 00 and r1,r13,r1 80075e0: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 80075e4: 78 01 08 01 mvhi r1,0x801 80075e8: b9 80 18 00 mv r3,r12 80075ec: 38 21 f8 48 ori r1,r1,0xf848 80075f0: b9 c0 10 00 mv r2,r14 80075f4: fb ff ed 2a calli 8002a9c */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 80075f8: 29 8b 00 00 lw r11,(r12+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 80075fc: 35 8c 00 04 addi r12,r12,4 if ( !_Chain_Is_empty( header ) ) { 8007600: 45 6c 00 0b be r11,r12,800762c <_Watchdog_Report_chain+0x78> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 8007604: b9 60 10 00 mv r2,r11 8007608: 34 01 00 00 mvi r1,0 800760c: f8 00 00 13 calli 8007658 <_Watchdog_Report> _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; node != _Chain_Tail(header) ; node = node->next ) 8007610: 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 = header->first ; 8007614: 5d 6c ff fc bne r11,r12,8007604 <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 8007618: 78 01 08 01 mvhi r1,0x801 800761c: 38 21 f8 60 ori r1,r1,0xf860 8007620: b9 c0 10 00 mv r2,r14 8007624: fb ff ed 1e calli 8002a9c 8007628: e0 00 00 04 bi 8007638 <_Watchdog_Report_chain+0x84> } else { printk( "Chain is empty\n" ); 800762c: 78 01 08 01 mvhi r1,0x801 8007630: 38 21 f8 70 ori r1,r1,0xf870 8007634: fb ff ed 1a calli 8002a9c } _ISR_Enable( level ); 8007638: d0 0d 00 00 wcsr IE,r13 } 800763c: 2b 9d 00 04 lw ra,(sp+4) 8007640: 2b 8b 00 14 lw r11,(sp+20) 8007644: 2b 8c 00 10 lw r12,(sp+16) 8007648: 2b 8d 00 0c lw r13,(sp+12) 800764c: 2b 8e 00 08 lw r14,(sp+8) 8007650: 37 9c 00 14 addi sp,sp,20 8007654: c3 a0 00 00 ret 080057fc <_Watchdog_Tickle>: */ void _Watchdog_Tickle( Chain_Control *header ) { 80057fc: 37 9c ff e4 addi sp,sp,-28 8005800: 5b 8b 00 1c sw (sp+28),r11 8005804: 5b 8c 00 18 sw (sp+24),r12 8005808: 5b 8d 00 14 sw (sp+20),r13 800580c: 5b 8e 00 10 sw (sp+16),r14 8005810: 5b 8f 00 0c sw (sp+12),r15 8005814: 5b 90 00 08 sw (sp+8),r16 8005818: 5b 9d 00 04 sw (sp+4),ra 800581c: 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 ); 8005820: 90 00 08 00 rcsr r1,IE 8005824: 34 02 ff fe mvi r2,-2 8005828: a0 22 10 00 and r2,r1,r2 800582c: d0 02 00 00 wcsr IE,r2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8005830: 29 8b 00 00 lw r11,(r12+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8005834: 35 8e 00 04 addi r14,r12,4 if ( _Chain_Is_empty( header ) ) 8005838: 45 6e 00 1a be r11,r14,80058a0 <_Watchdog_Tickle+0xa4> * 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) { 800583c: 29 62 00 10 lw r2,(r11+16) 8005840: 44 40 00 04 be r2,r0,8005850 <_Watchdog_Tickle+0x54> the_watchdog->delta_interval--; 8005844: 34 42 ff ff addi r2,r2,-1 8005848: 59 62 00 10 sw (r11+16),r2 if ( the_watchdog->delta_interval != 0 ) 800584c: 5c 40 00 15 bne r2,r0,80058a0 <_Watchdog_Tickle+0xa4> 8005850: b8 20 68 00 mv r13,r1 do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 8005854: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8005858: 34 0f ff fe mvi r15,-2 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 800585c: b9 60 08 00 mv r1,r11 8005860: fb ff ff bb calli 800574c <_Watchdog_Remove> _ISR_Enable( level ); 8005864: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 8005868: 5c 30 00 05 bne r1,r16,800587c <_Watchdog_Tickle+0x80> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 800586c: 29 62 00 24 lw r2,(r11+36) 8005870: 29 63 00 1c lw r3,(r11+28) 8005874: 29 61 00 20 lw r1,(r11+32) 8005878: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 800587c: 90 00 08 00 rcsr r1,IE 8005880: a0 2f 10 00 and r2,r1,r15 8005884: d0 02 00 00 wcsr IE,r2 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 8005888: 29 82 00 00 lw r2,(r12+0) 800588c: b8 20 68 00 mv r13,r1 8005890: b8 40 58 00 mv r11,r2 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 8005894: 44 4e 00 03 be r2,r14,80058a0 <_Watchdog_Tickle+0xa4> 8005898: 28 42 00 10 lw r2,(r2+16) 800589c: 44 40 ff f0 be r2,r0,800585c <_Watchdog_Tickle+0x60> leave: _ISR_Enable(level); 80058a0: d0 01 00 00 wcsr IE,r1 } 80058a4: 2b 9d 00 04 lw ra,(sp+4) 80058a8: 2b 8b 00 1c lw r11,(sp+28) 80058ac: 2b 8c 00 18 lw r12,(sp+24) 80058b0: 2b 8d 00 14 lw r13,(sp+20) 80058b4: 2b 8e 00 10 lw r14,(sp+16) 80058b8: 2b 8f 00 0c lw r15,(sp+12) 80058bc: 2b 90 00 08 lw r16,(sp+8) 80058c0: 37 9c 00 1c addi sp,sp,28 80058c4: c3 a0 00 00 ret 080058c8 <_Workspace_Allocate_or_fatal_error>: * _Workspace_Allocate_or_fatal_error */ void *_Workspace_Allocate_or_fatal_error( size_t size ) { 80058c8: 37 9c ff fc addi sp,sp,-4 80058cc: 5b 9d 00 04 sw (sp+4),ra * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 80058d0: 34 03 00 00 mvi r3,0 80058d4: b8 20 10 00 mv r2,r1 80058d8: 78 01 08 01 mvhi r1,0x801 80058dc: 38 21 c8 48 ori r1,r1,0xc848 80058e0: b8 60 20 00 mv r4,r3 80058e4: f8 00 0a cb calli 8008410 <_Heap_Allocate_aligned_with_boundary> __builtin_return_address( 1 ), memory ); #endif if ( memory == NULL ) 80058e8: 5c 20 00 04 bne r1,r0,80058f8 <_Workspace_Allocate_or_fatal_error+0x30><== ALWAYS TAKEN _Internal_error_Occurred( 80058ec: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80058f0: 34 03 00 04 mvi r3,4 <== NOT EXECUTED 80058f4: fb ff f6 aa calli 800339c <_Internal_error_Occurred> <== NOT EXECUTED true, INTERNAL_ERROR_WORKSPACE_ALLOCATION ); return memory; } 80058f8: 2b 9d 00 04 lw ra,(sp+4) 80058fc: 37 9c 00 04 addi sp,sp,4 8005900: c3 a0 00 00 ret 0800355c : #include rtems_status_code rtems_clock_get_tod( rtems_time_of_day *time_buffer ) { 800355c: 37 9c ff c0 addi sp,sp,-64 8003560: 5b 8b 00 0c sw (sp+12),r11 8003564: 5b 8c 00 08 sw (sp+8),r12 8003568: 5b 9d 00 04 sw (sp+4),ra 800356c: b8 20 58 00 mv r11,r1 rtems_time_of_day *tmbuf = time_buffer; struct tm time; struct timeval now; if ( !time_buffer ) 8003570: 34 01 00 09 mvi r1,9 8003574: 45 60 00 2b be r11,r0,8003620 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set ) 8003578: 78 01 08 02 mvhi r1,0x802 800357c: 38 21 a6 30 ori r1,r1,0xa630 8003580: 40 22 00 00 lbu r2,(r1+0) 8003584: 34 01 00 0b mvi r1,11 8003588: 44 40 00 26 be r2,r0,8003620 <== NEVER TAKEN { ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); 800358c: 90 00 60 00 rcsr r12,IE 8003590: 34 01 ff fe mvi r1,-2 8003594: a1 81 08 00 and r1,r12,r1 8003598: d0 01 00 00 wcsr IE,r1 _TOD_Get( &now ); 800359c: 37 81 00 34 addi r1,sp,52 80035a0: f8 00 05 3a calli 8004a88 <_TOD_Get> _ISR_Enable(level); 80035a4: d0 0c 00 00 wcsr IE,r12 useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; 80035a8: 2b 81 00 34 lw r1,(sp+52) time->tv_usec = useconds; 80035ac: 34 02 03 e8 mvi r2,1000 _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; 80035b0: 5b 81 00 3c sw (sp+60),r1 time->tv_usec = useconds; 80035b4: 2b 81 00 38 lw r1,(sp+56) 80035b8: f8 00 6a 72 calli 801df80 <__divsi3> 80035bc: 5b 81 00 40 sw (sp+64),r1 /* Obtain the current time */ _TOD_Get_timeval( &now ); /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); 80035c0: 37 82 00 10 addi r2,sp,16 80035c4: 37 81 00 3c addi r1,sp,60 80035c8: f8 00 29 23 calli 800da54 /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; tmbuf->month = time.tm_mon + 1; tmbuf->day = time.tm_mday; 80035cc: 2b 81 00 1c lw r1,(sp+28) /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; 80035d0: 2b 83 00 24 lw r3,(sp+36) tmbuf->month = time.tm_mon + 1; 80035d4: 2b 82 00 20 lw r2,(sp+32) tmbuf->day = time.tm_mday; 80035d8: 59 61 00 08 sw (r11+8),r1 tmbuf->hour = time.tm_hour; 80035dc: 2b 81 00 18 lw r1,(sp+24) /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; 80035e0: 34 63 07 6c addi r3,r3,1900 tmbuf->month = time.tm_mon + 1; 80035e4: 34 42 00 01 addi r2,r2,1 tmbuf->day = time.tm_mday; tmbuf->hour = time.tm_hour; 80035e8: 59 61 00 0c sw (r11+12),r1 tmbuf->minute = time.tm_min; 80035ec: 2b 81 00 14 lw r1,(sp+20) /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; 80035f0: 59 63 00 00 sw (r11+0),r3 tmbuf->month = time.tm_mon + 1; 80035f4: 59 62 00 04 sw (r11+4),r2 tmbuf->day = time.tm_mday; tmbuf->hour = time.tm_hour; tmbuf->minute = time.tm_min; 80035f8: 59 61 00 10 sw (r11+16),r1 tmbuf->second = time.tm_sec; 80035fc: 2b 81 00 10 lw r1,(sp+16) 8003600: 59 61 00 14 sw (r11+20),r1 tmbuf->ticks = now.tv_usec / 8003604: 78 01 08 02 mvhi r1,0x802 8003608: 38 21 20 c4 ori r1,r1,0x20c4 800360c: 28 22 00 0c lw r2,(r1+12) 8003610: 2b 81 00 40 lw r1,(sp+64) 8003614: f8 00 6a ba calli 801e0fc <__udivsi3> 8003618: 59 61 00 18 sw (r11+24),r1 800361c: 34 01 00 00 mvi r1,0 rtems_configuration_get_microseconds_per_tick(); return RTEMS_SUCCESSFUL; } 8003620: 2b 9d 00 04 lw ra,(sp+4) 8003624: 2b 8b 00 0c lw r11,(sp+12) 8003628: 2b 8c 00 08 lw r12,(sp+8) 800362c: 37 9c 00 40 addi sp,sp,64 8003630: c3 a0 00 00 ret 0801013c : * error code - if unsuccessful */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { 801013c: b8 20 18 00 mv r3,r1 if ( !routine ) 8010140: 34 01 00 09 mvi r1,9 8010144: 44 60 00 05 be r3,r0,8010158 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _Watchdog_Nanoseconds_since_tick_handler = routine; 8010148: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED 801014c: 38 42 dd cc ori r2,r2,0xddcc <== NOT EXECUTED 8010150: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED 8010154: 34 01 00 00 mvi r1,0 <== NOT EXECUTED return RTEMS_SUCCESSFUL; } 8010158: c3 a0 00 00 ret 08005284 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 8005284: 37 9c ff e4 addi sp,sp,-28 8005288: 5b 8b 00 1c sw (sp+28),r11 800528c: 5b 8c 00 18 sw (sp+24),r12 8005290: 5b 8d 00 14 sw (sp+20),r13 8005294: 5b 8e 00 10 sw (sp+16),r14 8005298: 5b 8f 00 0c sw (sp+12),r15 800529c: 5b 90 00 08 sw (sp+8),r16 80052a0: 5b 9d 00 04 sw (sp+4),ra 80052a4: b8 20 78 00 mv r15,r1 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 80052a8: 44 20 00 17 be r1,r0,8005304 <== NEVER TAKEN 80052ac: 78 0b 08 02 mvhi r11,0x802 80052b0: 39 6b a5 b8 ori r11,r11,0xa5b8 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 80052b4: 35 70 00 10 addi r16,r11,16 if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 80052b8: 29 61 00 00 lw r1,(r11+0) 80052bc: 44 20 00 10 be r1,r0,80052fc continue; information = _Objects_Information_table[ api_index ][ 1 ]; 80052c0: 28 2c 00 04 lw r12,(r1+4) if ( !information ) 80052c4: 34 0e 00 04 mvi r14,4 80052c8: 34 0d 00 01 mvi r13,1 80052cc: 5d 80 00 0a bne r12,r0,80052f4 80052d0: e0 00 00 0b bi 80052fc continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 80052d4: 29 81 00 1c lw r1,(r12+28) information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 80052d8: 35 ad 00 01 addi r13,r13,1 the_thread = (Thread_Control *)information->local_table[ i ]; 80052dc: b4 2e 08 00 add r1,r1,r14 80052e0: 28 22 00 00 lw r2,(r1+0) information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 80052e4: 35 ce 00 04 addi r14,r14,4 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) continue; (*routine)(the_thread); 80052e8: 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 ) 80052ec: 44 40 00 02 be r2,r0,80052f4 <== NEVER TAKEN continue; (*routine)(the_thread); 80052f0: d9 e0 00 00 call r15 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 80052f4: 2d 81 00 10 lhu r1,(r12+16) 80052f8: 50 2d ff f7 bgeu r1,r13,80052d4 80052fc: 35 6b 00 04 addi r11,r11,4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 8005300: 5d 70 ff ee bne r11,r16,80052b8 (*routine)(the_thread); } } } 8005304: 2b 9d 00 04 lw ra,(sp+4) 8005308: 2b 8b 00 1c lw r11,(sp+28) 800530c: 2b 8c 00 18 lw r12,(sp+24) 8005310: 2b 8d 00 14 lw r13,(sp+20) 8005314: 2b 8e 00 10 lw r14,(sp+16) 8005318: 2b 8f 00 0c lw r15,(sp+12) 800531c: 2b 90 00 08 lw r16,(sp+8) 8005320: 37 9c 00 1c addi sp,sp,28 8005324: c3 a0 00 00 ret 08011088 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 8011088: 37 9c ff dc addi sp,sp,-36 801108c: 5b 8b 00 24 sw (sp+36),r11 8011090: 5b 8c 00 20 sw (sp+32),r12 8011094: 5b 8d 00 1c sw (sp+28),r13 8011098: 5b 8e 00 18 sw (sp+24),r14 801109c: 5b 8f 00 14 sw (sp+20),r15 80110a0: 5b 90 00 10 sw (sp+16),r16 80110a4: 5b 91 00 0c sw (sp+12),r17 80110a8: 5b 92 00 08 sw (sp+8),r18 80110ac: 5b 9d 00 04 sw (sp+4),ra register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 80110b0: 34 07 00 03 mvi r7,3 uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 80110b4: b8 20 88 00 mv r17,r1 80110b8: b8 40 70 00 mv r14,r2 80110bc: b8 60 78 00 mv r15,r3 80110c0: b8 80 60 00 mv r12,r4 80110c4: b8 a0 90 00 mv r18,r5 80110c8: b8 c0 80 00 mv r16,r6 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 80110cc: 44 20 00 38 be r1,r0,80111ac return RTEMS_INVALID_NAME; if ( !starting_address ) 80110d0: 44 40 00 34 be r2,r0,80111a0 return RTEMS_INVALID_ADDRESS; if ( !id ) 80110d4: 44 c0 00 33 be r6,r0,80111a0 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 80110d8: 64 82 00 00 cmpei r2,r4,0 80110dc: 64 61 00 00 cmpei r1,r3,0 80110e0: b8 41 08 00 or r1,r2,r1 80110e4: 5c 20 00 31 bne r1,r0,80111a8 80110e8: 54 83 00 30 bgu r4,r3,80111a8 80110ec: 20 81 00 07 andi r1,r4,0x7 80110f0: 5c 20 00 2e bne r1,r0,80111a8 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 80110f4: 21 cd 00 07 andi r13,r14,0x7 80110f8: 5d a1 00 2a bne r13,r1,80111a0 80110fc: 78 02 08 03 mvhi r2,0x803 8011100: 38 42 dc 2c ori r2,r2,0xdc2c 8011104: 28 41 00 00 lw r1,(r2+0) 8011108: 34 21 00 01 addi r1,r1,1 801110c: 58 41 00 00 sw (r2+0),r1 * 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 ); 8011110: 78 01 08 03 mvhi r1,0x803 8011114: 38 21 da 74 ori r1,r1,0xda74 8011118: f8 00 15 86 calli 8016730 <_Objects_Allocate> 801111c: b8 20 58 00 mv r11,r1 _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 8011120: 5c 2d 00 04 bne r1,r13,8011130 _Thread_Enable_dispatch(); 8011124: f8 00 1a 21 calli 80179a8 <_Thread_Enable_dispatch> 8011128: 34 07 00 05 mvi r7,5 return RTEMS_TOO_MANY; 801112c: e0 00 00 20 bi 80111ac _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 8011130: 58 2e 00 10 sw (r1+16),r14 the_partition->length = length; 8011134: 58 2f 00 14 sw (r1+20),r15 the_partition->buffer_size = buffer_size; 8011138: 58 2c 00 18 sw (r1+24),r12 the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 801113c: b9 80 10 00 mv r2,r12 #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 8011140: 58 32 00 1c sw (r1+28),r18 the_partition->number_of_used_blocks = 0; 8011144: 58 2d 00 20 sw (r1+32),r13 _Chain_Initialize( &the_partition->Memory, starting_address, 8011148: b9 e0 08 00 mv r1,r15 801114c: f8 00 77 73 calli 802ef18 <__udivsi3> 8011150: 35 6f 00 24 addi r15,r11,36 8011154: b8 20 18 00 mv r3,r1 8011158: b9 80 20 00 mv r4,r12 801115c: b9 c0 10 00 mv r2,r14 8011160: b9 e0 08 00 mv r1,r15 8011164: f8 00 0f 36 calli 8014e3c <_Chain_Initialize> 8011168: 78 02 08 03 mvhi r2,0x803 801116c: 29 6c 00 08 lw r12,(r11+8) 8011170: 38 42 da 74 ori r2,r2,0xda74 8011174: 28 4e 00 1c lw r14,(r2+28) 8011178: 21 81 ff ff andi r1,r12,0xffff 801117c: 34 02 00 02 mvi r2,2 8011180: fb ff f3 46 calli 800de98 <__ashlsi3> 8011184: b5 c1 08 00 add r1,r14,r1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 8011188: 59 71 00 0c sw (r11+12),r17 &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 801118c: 5a 0c 00 00 sw (r16+0),r12 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8011190: 58 2b 00 00 sw (r1+0),r11 name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 8011194: f8 00 1a 05 calli 80179a8 <_Thread_Enable_dispatch> 8011198: b9 a0 38 00 mv r7,r13 return RTEMS_SUCCESSFUL; 801119c: e0 00 00 04 bi 80111ac 80111a0: 34 07 00 09 mvi r7,9 80111a4: e0 00 00 02 bi 80111ac 80111a8: 34 07 00 08 mvi r7,8 } 80111ac: b8 e0 08 00 mv r1,r7 80111b0: 2b 9d 00 04 lw ra,(sp+4) 80111b4: 2b 8b 00 24 lw r11,(sp+36) 80111b8: 2b 8c 00 20 lw r12,(sp+32) 80111bc: 2b 8d 00 1c lw r13,(sp+28) 80111c0: 2b 8e 00 18 lw r14,(sp+24) 80111c4: 2b 8f 00 14 lw r15,(sp+20) 80111c8: 2b 90 00 10 lw r16,(sp+16) 80111cc: 2b 91 00 0c lw r17,(sp+12) 80111d0: 2b 92 00 08 lw r18,(sp+8) 80111d4: 37 9c 00 24 addi sp,sp,36 80111d8: c3 a0 00 00 ret 0803c628 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 803c628: 37 9c ff e8 addi sp,sp,-24 803c62c: 5b 8b 00 14 sw (sp+20),r11 803c630: 5b 8c 00 10 sw (sp+16),r12 803c634: 5b 8d 00 0c sw (sp+12),r13 803c638: 5b 8e 00 08 sw (sp+8),r14 803c63c: 5b 9d 00 04 sw (sp+4),ra 803c640: b8 20 70 00 mv r14,r1 803c644: 78 01 08 06 mvhi r1,0x806 803c648: b8 40 60 00 mv r12,r2 803c64c: 38 21 f4 9c ori r1,r1,0xf49c 803c650: b9 c0 10 00 mv r2,r14 803c654: 37 83 00 18 addi r3,sp,24 803c658: fb ff 37 e1 calli 800a5dc <_Objects_Get> 803c65c: 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 ) { 803c660: 2b 81 00 18 lw r1,(sp+24) 803c664: 5c 20 00 61 bne r1,r0,803c7e8 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 803c668: 78 03 08 06 mvhi r3,0x806 803c66c: 38 63 f0 e0 ori r3,r3,0xf0e0 803c670: 28 61 00 00 lw r1,(r3+0) 803c674: 29 62 00 40 lw r2,(r11+64) 803c678: 44 41 00 04 be r2,r1,803c688 _Thread_Enable_dispatch(); 803c67c: fb ff 3a 83 calli 800b088 <_Thread_Enable_dispatch> 803c680: 34 0b 00 17 mvi r11,23 return RTEMS_NOT_OWNER_OF_RESOURCE; 803c684: e0 00 00 5a bi 803c7ec } if ( length == RTEMS_PERIOD_STATUS ) { 803c688: 5d 80 00 0d bne r12,r0,803c6bc switch ( the_period->state ) { 803c68c: 29 61 00 38 lw r1,(r11+56) 803c690: 34 02 00 04 mvi r2,4 803c694: 50 41 00 03 bgeu r2,r1,803c6a0 <== ALWAYS TAKEN 803c698: b9 80 58 00 mv r11,r12 <== NOT EXECUTED 803c69c: e0 00 00 51 bi 803c7e0 <== NOT EXECUTED 803c6a0: 78 0b 08 06 mvhi r11,0x806 803c6a4: 34 02 00 02 mvi r2,2 803c6a8: 39 6b 86 f4 ori r11,r11,0x86f4 803c6ac: fb ff 12 a3 calli 8001138 <__ashlsi3> 803c6b0: b5 61 08 00 add r1,r11,r1 803c6b4: 28 2b 00 00 lw r11,(r1+0) 803c6b8: e0 00 00 4a bi 803c7e0 } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 803c6bc: 90 00 68 00 rcsr r13,IE 803c6c0: 34 01 ff fe mvi r1,-2 803c6c4: a1 a1 08 00 and r1,r13,r1 803c6c8: d0 01 00 00 wcsr IE,r1 switch ( the_period->state ) { 803c6cc: 29 63 00 38 lw r3,(r11+56) 803c6d0: 34 01 00 02 mvi r1,2 803c6d4: 44 61 00 18 be r3,r1,803c734 803c6d8: 34 01 00 04 mvi r1,4 803c6dc: 44 61 00 35 be r3,r1,803c7b0 803c6e0: 5c 60 00 42 bne r3,r0,803c7e8 <== NEVER TAKEN case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 803c6e4: d0 0d 00 00 wcsr IE,r13 /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 803c6e8: b9 60 08 00 mv r1,r11 803c6ec: fb ff ff 31 calli 803c3b0 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 803c6f0: 78 03 08 03 mvhi r3,0x803 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 803c6f4: 34 0d 00 00 mvi r13,0 the_watchdog->routine = routine; 803c6f8: 38 63 c8 0c ori r3,r3,0xc80c the_period->state = RATE_MONOTONIC_ACTIVE; 803c6fc: 34 02 00 02 mvi r2,2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803c700: 78 01 08 06 mvhi r1,0x806 803c704: 59 62 00 38 sw (r11+56),r2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 803c708: 59 63 00 2c sw (r11+44),r3 the_watchdog->id = id; 803c70c: 59 6e 00 30 sw (r11+48),r14 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 803c710: 59 6c 00 1c sw (r11+28),r12 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803c714: 35 62 00 10 addi r2,r11,16 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 803c718: 59 6d 00 18 sw (r11+24),r13 the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 803c71c: 59 6d 00 34 sw (r11+52),r13 _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 803c720: 59 6c 00 3c sw (r11+60),r12 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803c724: 38 21 f1 00 ori r1,r1,0xf100 803c728: fb ff 3f 37 calli 800c404 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 803c72c: b9 a0 58 00 mv r11,r13 803c730: e0 00 00 2c bi 803c7e0 case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 803c734: b9 60 08 00 mv r1,r11 803c738: fb ff ff 7c calli 803c528 <_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; 803c73c: 34 01 00 01 mvi r1,1 the_period->next_length = length; 803c740: 59 6c 00 3c sw (r11+60),r12 /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 803c744: 59 61 00 38 sw (r11+56),r1 the_period->next_length = length; _ISR_Enable( level ); 803c748: d0 0d 00 00 wcsr IE,r13 _Thread_Executing->Wait.id = the_period->Object.id; 803c74c: 78 01 08 06 mvhi r1,0x806 803c750: 38 21 f0 e0 ori r1,r1,0xf0e0 803c754: 28 21 00 00 lw r1,(r1+0) 803c758: 29 63 00 08 lw r3,(r11+8) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 803c75c: 34 02 40 00 mvi r2,16384 the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; the_period->next_length = length; _ISR_Enable( level ); _Thread_Executing->Wait.id = the_period->Object.id; 803c760: 58 23 00 20 sw (r1+32),r3 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 803c764: fb ff 3d 01 calli 800bb68 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 803c768: 90 00 08 00 rcsr r1,IE 803c76c: 34 02 ff fe mvi r2,-2 803c770: a0 22 10 00 and r2,r1,r2 803c774: d0 02 00 00 wcsr IE,r2 local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 803c778: 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; 803c77c: 29 62 00 38 lw r2,(r11+56) the_period->state = RATE_MONOTONIC_ACTIVE; 803c780: 59 63 00 38 sw (r11+56),r3 _ISR_Enable( level ); 803c784: 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 ) 803c788: 34 01 00 03 mvi r1,3 803c78c: 5c 41 00 06 bne r2,r1,803c7a4 <== ALWAYS TAKEN _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 803c790: 78 01 08 06 mvhi r1,0x806 <== NOT EXECUTED 803c794: 38 21 f0 e0 ori r1,r1,0xf0e0 <== NOT EXECUTED 803c798: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 803c79c: 34 02 40 00 mvi r2,16384 <== NOT EXECUTED 803c7a0: fb ff ba 6f calli 802b15c <_Thread_Clear_state> <== NOT EXECUTED _Thread_Enable_dispatch(); 803c7a4: fb ff 3a 39 calli 800b088 <_Thread_Enable_dispatch> 803c7a8: 34 0b 00 00 mvi r11,0 return RTEMS_SUCCESSFUL; 803c7ac: e0 00 00 10 bi 803c7ec case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 803c7b0: b9 60 08 00 mv r1,r11 803c7b4: fb ff ff 5d calli 803c528 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 803c7b8: d0 0d 00 00 wcsr IE,r13 the_period->state = RATE_MONOTONIC_ACTIVE; 803c7bc: 34 02 00 02 mvi r2,2 803c7c0: 78 01 08 06 mvhi r1,0x806 803c7c4: 59 62 00 38 sw (r11+56),r2 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 803c7c8: 59 6c 00 1c sw (r11+28),r12 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 803c7cc: 35 62 00 10 addi r2,r11,16 the_period->next_length = length; 803c7d0: 59 6c 00 3c sw (r11+60),r12 803c7d4: 38 21 f1 00 ori r1,r1,0xf100 803c7d8: fb ff 3f 0b calli 800c404 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 803c7dc: 34 0b 00 06 mvi r11,6 803c7e0: fb ff 3a 2a calli 800b088 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 803c7e4: e0 00 00 02 bi 803c7ec 803c7e8: 34 0b 00 04 mvi r11,4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 803c7ec: b9 60 08 00 mv r1,r11 803c7f0: 2b 9d 00 04 lw ra,(sp+4) 803c7f4: 2b 8b 00 14 lw r11,(sp+20) 803c7f8: 2b 8c 00 10 lw r12,(sp+16) 803c7fc: 2b 8d 00 0c lw r13,(sp+12) 803c800: 2b 8e 00 08 lw r14,(sp+8) 803c804: 37 9c 00 18 addi sp,sp,24 803c808: c3 a0 00 00 ret 08029890 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 8029890: 37 9c ff 5c addi sp,sp,-164 8029894: 5b 8b 00 44 sw (sp+68),r11 8029898: 5b 8c 00 40 sw (sp+64),r12 802989c: 5b 8d 00 3c sw (sp+60),r13 80298a0: 5b 8e 00 38 sw (sp+56),r14 80298a4: 5b 8f 00 34 sw (sp+52),r15 80298a8: 5b 90 00 30 sw (sp+48),r16 80298ac: 5b 91 00 2c sw (sp+44),r17 80298b0: 5b 92 00 28 sw (sp+40),r18 80298b4: 5b 93 00 24 sw (sp+36),r19 80298b8: 5b 94 00 20 sw (sp+32),r20 80298bc: 5b 95 00 1c sw (sp+28),r21 80298c0: 5b 96 00 18 sw (sp+24),r22 80298c4: 5b 97 00 14 sw (sp+20),r23 80298c8: 5b 98 00 10 sw (sp+16),r24 80298cc: 5b 99 00 0c sw (sp+12),r25 80298d0: 5b 9b 00 08 sw (sp+8),fp 80298d4: 5b 9d 00 04 sw (sp+4),ra 80298d8: b8 40 58 00 mv r11,r2 80298dc: b8 20 60 00 mv r12,r1 rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 80298e0: 44 40 00 73 be r2,r0,8029aac <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 80298e4: 78 02 08 06 mvhi r2,0x806 80298e8: 38 42 4e d4 ori r2,r2,0x4ed4 80298ec: d9 60 00 00 call r11 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 80298f0: 78 02 08 06 mvhi r2,0x806 80298f4: 38 42 4e f4 ori r2,r2,0x4ef4 80298f8: b9 80 08 00 mv r1,r12 80298fc: d9 60 00 00 call r11 (*print)( context, "--- Wall times are in seconds ---\n" ); 8029900: 78 02 08 06 mvhi r2,0x806 8029904: 38 42 4f 18 ori r2,r2,0x4f18 8029908: b9 80 08 00 mv r1,r12 802990c: d9 60 00 00 call r11 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 8029910: 78 02 08 06 mvhi r2,0x806 8029914: 38 42 4f 3c ori r2,r2,0x4f3c 8029918: b9 80 08 00 mv r1,r12 802991c: d9 60 00 00 call r11 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 8029920: 78 02 08 06 mvhi r2,0x806 8029924: b9 80 08 00 mv r1,r12 8029928: 38 42 4f 88 ori r2,r2,0x4f88 802992c: d9 60 00 00 call r11 /* * 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 ; 8029930: 78 01 08 06 mvhi r1,0x806 8029934: 38 21 f4 9c ori r1,r1,0xf49c 8029938: b8 20 80 00 mv r16,r1 802993c: 28 2d 00 08 lw r13,(r1+8) id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 8029940: 37 99 00 48 addi r25,sp,72 if ( status != RTEMS_SUCCESSFUL ) continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 8029944: 37 98 00 80 addi r24,sp,128 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 8029948: 37 8f 00 a0 addi r15,sp,160 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 802994c: 78 17 08 06 mvhi r23,0x806 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 ); 8029950: 37 96 00 60 addi r22,sp,96 8029954: 37 8e 00 98 addi r14,sp,152 (*print)( context, 8029958: 78 15 08 06 mvhi r21,0x806 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); 802995c: 37 94 00 78 addi r20,sp,120 (*print)( context, 8029960: 78 13 08 06 mvhi r19,0x806 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 8029964: 78 12 08 06 mvhi r18,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 ; 8029968: e0 00 00 4d bi 8029a9c id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 802996c: f8 00 4a 2f calli 803c228 8029970: b8 20 88 00 mv r17,r1 if ( status != RTEMS_SUCCESSFUL ) 8029974: 5c 20 00 49 bne r1,r0,8029a98 continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 8029978: bb 00 10 00 mv r2,r24 802997c: b9 a0 08 00 mv r1,r13 8029980: f8 00 4a 5d calli 803c2f4 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 8029984: 2b 81 00 80 lw r1,(sp+128) 8029988: b9 e0 18 00 mv r3,r15 802998c: 34 02 00 05 mvi r2,5 8029990: fb ff 7a b2 calli 8008458 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 8029994: 2b 85 00 48 lw r5,(sp+72) 8029998: 2b 86 00 4c lw r6,(sp+76) 802999c: ba e0 10 00 mv r2,r23 80299a0: b9 a0 18 00 mv r3,r13 80299a4: 38 42 4f d4 ori r2,r2,0x4fd4 80299a8: b9 80 08 00 mv r1,r12 80299ac: b9 e0 20 00 mv r4,r15 80299b0: d9 60 00 00 call r11 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 80299b4: 2b 85 00 48 lw r5,(sp+72) (*print)( context, "\n" ); 80299b8: ba 40 10 00 mv r2,r18 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 ); 80299bc: b9 c0 18 00 mv r3,r14 80299c0: ba c0 08 00 mv r1,r22 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 80299c4: 38 42 66 80 ori r2,r2,0x6680 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 80299c8: 5c b1 00 04 bne r5,r17,80299d8 (*print)( context, "\n" ); 80299cc: b9 80 08 00 mv r1,r12 80299d0: d9 60 00 00 call r11 continue; 80299d4: e0 00 00 31 bi 8029a98 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 ); 80299d8: b8 a0 10 00 mv r2,r5 80299dc: f8 00 07 9a calli 802b844 <_Timespec_Divide_by_integer> (*print)( context, 80299e0: 2b 81 00 54 lw r1,(sp+84) 80299e4: 34 02 03 e8 mvi r2,1000 80299e8: f8 00 d5 25 calli 805ee7c <__divsi3> 80299ec: b8 20 d8 00 mv fp,r1 80299f0: 2b 81 00 5c lw r1,(sp+92) 80299f4: 34 02 03 e8 mvi r2,1000 80299f8: f8 00 d5 21 calli 805ee7c <__divsi3> 80299fc: b8 20 88 00 mv r17,r1 8029a00: 2b 81 00 9c lw r1,(sp+156) 8029a04: 34 02 03 e8 mvi r2,1000 8029a08: f8 00 d5 1d calli 805ee7c <__divsi3> 8029a0c: 2b 85 00 58 lw r5,(sp+88) 8029a10: 2b 87 00 98 lw r7,(sp+152) 8029a14: 2b 83 00 50 lw r3,(sp+80) 8029a18: ba a0 10 00 mv r2,r21 8029a1c: b8 20 40 00 mv r8,r1 8029a20: bb 60 20 00 mv r4,fp 8029a24: ba 20 30 00 mv r6,r17 8029a28: 38 42 4f ec ori r2,r2,0x4fec 8029a2c: b9 80 08 00 mv r1,r12 8029a30: d9 60 00 00 call r11 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); 8029a34: 2b 82 00 48 lw r2,(sp+72) 8029a38: b9 c0 18 00 mv r3,r14 8029a3c: ba 80 08 00 mv r1,r20 8029a40: f8 00 07 81 calli 802b844 <_Timespec_Divide_by_integer> (*print)( context, 8029a44: 2b 81 00 6c lw r1,(sp+108) 8029a48: 34 02 03 e8 mvi r2,1000 8029a4c: f8 00 d5 0c calli 805ee7c <__divsi3> 8029a50: b8 20 d8 00 mv fp,r1 8029a54: 2b 81 00 74 lw r1,(sp+116) 8029a58: 34 02 03 e8 mvi r2,1000 8029a5c: f8 00 d5 08 calli 805ee7c <__divsi3> 8029a60: b8 20 88 00 mv r17,r1 8029a64: 2b 81 00 9c lw r1,(sp+156) 8029a68: 34 02 03 e8 mvi r2,1000 8029a6c: f8 00 d5 04 calli 805ee7c <__divsi3> 8029a70: 2b 83 00 68 lw r3,(sp+104) 8029a74: 2b 85 00 70 lw r5,(sp+112) 8029a78: 2b 87 00 98 lw r7,(sp+152) 8029a7c: ba 60 10 00 mv r2,r19 8029a80: b8 20 40 00 mv r8,r1 8029a84: bb 60 20 00 mv r4,fp 8029a88: b9 80 08 00 mv r1,r12 8029a8c: ba 20 30 00 mv r6,r17 8029a90: 38 42 50 0c ori r2,r2,0x500c 8029a94: d9 60 00 00 call r11 * 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 ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 8029a98: 35 ad 00 01 addi r13,r13,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 ; 8029a9c: 2a 03 00 0c lw r3,(r16+12) id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 8029aa0: b9 a0 08 00 mv r1,r13 8029aa4: bb 20 10 00 mv r2,r25 /* * 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 ; 8029aa8: 50 6d ff b1 bgeu r3,r13,802996c the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 8029aac: 2b 9d 00 04 lw ra,(sp+4) 8029ab0: 2b 8b 00 44 lw r11,(sp+68) 8029ab4: 2b 8c 00 40 lw r12,(sp+64) 8029ab8: 2b 8d 00 3c lw r13,(sp+60) 8029abc: 2b 8e 00 38 lw r14,(sp+56) 8029ac0: 2b 8f 00 34 lw r15,(sp+52) 8029ac4: 2b 90 00 30 lw r16,(sp+48) 8029ac8: 2b 91 00 2c lw r17,(sp+44) 8029acc: 2b 92 00 28 lw r18,(sp+40) 8029ad0: 2b 93 00 24 lw r19,(sp+36) 8029ad4: 2b 94 00 20 lw r20,(sp+32) 8029ad8: 2b 95 00 1c lw r21,(sp+28) 8029adc: 2b 96 00 18 lw r22,(sp+24) 8029ae0: 2b 97 00 14 lw r23,(sp+20) 8029ae4: 2b 98 00 10 lw r24,(sp+16) 8029ae8: 2b 99 00 0c lw r25,(sp+12) 8029aec: 2b 9b 00 08 lw fp,(sp+8) 8029af0: 37 9c 00 a4 addi sp,sp,164 8029af4: c3 a0 00 00 ret 08012b50 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 8012b50: 37 9c ff f4 addi sp,sp,-12 8012b54: 5b 8b 00 08 sw (sp+8),r11 8012b58: 5b 9d 00 04 sw (sp+4),ra register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 8012b5c: 34 03 00 0a mvi r3,10 rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 8012b60: 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 ) 8012b64: 44 40 00 2e be r2,r0,8012c1c return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 8012b68: 37 82 00 0c addi r2,sp,12 8012b6c: f8 00 13 af calli 8017a28 <_Thread_Get> switch ( location ) { 8012b70: 2b 82 00 0c lw r2,(sp+12) 8012b74: 34 03 00 04 mvi r3,4 8012b78: 5c 40 00 29 bne r2,r0,8012c1c case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 8012b7c: 28 23 01 24 lw r3,(r1+292) asr = &api->Signal; 8012b80: 28 64 00 0c lw r4,(r3+12) 8012b84: 44 82 00 24 be r4,r2,8012c14 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 8012b88: 40 62 00 08 lbu r2,(r3+8) 8012b8c: 44 40 00 17 be r2,r0,8012be8 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 8012b90: 90 00 10 00 rcsr r2,IE 8012b94: 34 04 ff fe mvi r4,-2 8012b98: a0 44 20 00 and r4,r2,r4 8012b9c: d0 04 00 00 wcsr IE,r4 *signal_set |= signals; 8012ba0: 28 64 00 14 lw r4,(r3+20) 8012ba4: b8 8b 58 00 or r11,r4,r11 8012ba8: 58 6b 00 14 sw (r3+20),r11 _ISR_Enable( _level ); 8012bac: d0 02 00 00 wcsr IE,r2 _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 8012bb0: 78 02 08 03 mvhi r2,0x803 8012bb4: 38 42 dc c4 ori r2,r2,0xdcc4 8012bb8: 28 42 00 00 lw r2,(r2+0) if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; 8012bbc: 34 03 00 01 mvi r3,1 8012bc0: 30 23 00 74 sb (r1+116),r3 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 8012bc4: 44 40 00 11 be r2,r0,8012c08 8012bc8: 78 02 08 03 mvhi r2,0x803 8012bcc: 38 42 dc e8 ori r2,r2,0xdce8 8012bd0: 28 42 00 00 lw r2,(r2+0) 8012bd4: 5c 22 00 0d bne r1,r2,8012c08 <== NEVER TAKEN _ISR_Signals_to_thread_executing = true; 8012bd8: 78 01 08 03 mvhi r1,0x803 8012bdc: 38 21 dd 80 ori r1,r1,0xdd80 8012be0: 30 23 00 00 sb (r1+0),r3 8012be4: e0 00 00 09 bi 8012c08 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 8012be8: 90 00 08 00 rcsr r1,IE 8012bec: 34 02 ff fe mvi r2,-2 8012bf0: a0 22 10 00 and r2,r1,r2 8012bf4: d0 02 00 00 wcsr IE,r2 *signal_set |= signals; 8012bf8: 28 62 00 18 lw r2,(r3+24) 8012bfc: b8 4b 58 00 or r11,r2,r11 8012c00: 58 6b 00 18 sw (r3+24),r11 _ISR_Enable( _level ); 8012c04: d0 01 00 00 wcsr IE,r1 } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 8012c08: f8 00 13 68 calli 80179a8 <_Thread_Enable_dispatch> 8012c0c: 34 03 00 00 mvi r3,0 return RTEMS_SUCCESSFUL; 8012c10: e0 00 00 03 bi 8012c1c } _Thread_Enable_dispatch(); 8012c14: f8 00 13 65 calli 80179a8 <_Thread_Enable_dispatch> 8012c18: 34 03 00 0b mvi r3,11 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8012c1c: b8 60 08 00 mv r1,r3 8012c20: 2b 9d 00 04 lw ra,(sp+4) 8012c24: 2b 8b 00 08 lw r11,(sp+8) 8012c28: 37 9c 00 0c addi sp,sp,12 8012c2c: c3 a0 00 00 ret 0800a2b0 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 800a2b0: 37 9c ff e0 addi sp,sp,-32 800a2b4: 5b 8b 00 20 sw (sp+32),r11 800a2b8: 5b 8c 00 1c sw (sp+28),r12 800a2bc: 5b 8d 00 18 sw (sp+24),r13 800a2c0: 5b 8e 00 14 sw (sp+20),r14 800a2c4: 5b 8f 00 10 sw (sp+16),r15 800a2c8: 5b 90 00 0c sw (sp+12),r16 800a2cc: 5b 91 00 08 sw (sp+8),r17 800a2d0: 5b 9d 00 04 sw (sp+4),ra ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 800a2d4: 34 04 00 09 mvi r4,9 rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 800a2d8: b8 60 80 00 mv r16,r3 800a2dc: b8 20 68 00 mv r13,r1 800a2e0: b8 40 70 00 mv r14,r2 ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 800a2e4: 44 60 00 51 be r3,r0,800a428 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 800a2e8: 78 01 08 01 mvhi r1,0x801 800a2ec: 38 21 c8 e0 ori r1,r1,0xc8e0 800a2f0: 28 2b 00 00 lw r11,(r1+0) api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800a2f4: 34 0f 00 00 mvi r15,0 800a2f8: 41 61 00 75 lbu r1,(r11+117) if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 800a2fc: 29 6c 01 24 lw r12,(r11+292) asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800a300: 5c 2f 00 02 bne r1,r15,800a308 800a304: 34 0f 01 00 mvi r15,256 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800a308: 29 61 00 7c lw r1,(r11+124) 800a30c: 44 20 00 02 be r1,r0,800a314 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 800a310: 39 ef 02 00 ori r15,r15,0x200 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 800a314: 41 81 00 08 lbu r1,(r12+8) 800a318: 34 11 00 00 mvi r17,0 800a31c: 5c 31 00 02 bne r1,r17,800a324 800a320: 34 11 04 00 mvi r17,1024 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); 800a324: fb ff ee 0e calli 8005b5c <_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; 800a328: ba 21 88 00 or r17,r17,r1 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 800a32c: ba 2f 88 00 or r17,r17,r15 800a330: 5a 11 00 00 sw (r16+0),r17 /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 800a334: 21 c1 01 00 andi r1,r14,0x100 800a338: 44 20 00 07 be r1,r0,800a354 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 800a33c: b9 a0 08 00 mv r1,r13 800a340: 34 02 00 08 mvi r2,8 800a344: fb ff d7 d3 calli 8000290 <__lshrsi3> 800a348: 18 21 00 01 xori r1,r1,0x1 800a34c: 20 21 00 01 andi r1,r1,0x1 800a350: 31 61 00 75 sb (r11+117),r1 if ( mask & RTEMS_TIMESLICE_MASK ) { 800a354: 21 c1 02 00 andi r1,r14,0x200 800a358: 44 20 00 0b be r1,r0,800a384 if ( _Modes_Is_timeslice(mode_set) ) { 800a35c: 21 a1 02 00 andi r1,r13,0x200 800a360: 44 20 00 08 be r1,r0,800a380 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800a364: 78 01 08 01 mvhi r1,0x801 800a368: 38 21 c7 b4 ori r1,r1,0xc7b4 800a36c: 28 21 00 00 lw r1,(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; 800a370: 34 02 00 01 mvi r2,1 800a374: 59 62 00 7c sw (r11+124),r2 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800a378: 59 61 00 78 sw (r11+120),r1 800a37c: e0 00 00 02 bi 800a384 } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800a380: 59 61 00 7c sw (r11+124),r1 /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 800a384: 21 c1 00 01 andi r1,r14,0x1 800a388: 44 20 00 04 be r1,r0,800a398 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 800a38c: 19 a1 00 01 xori r1,r13,0x1 800a390: 20 21 00 01 andi r1,r1,0x1 800a394: d0 01 00 00 wcsr IE,r1 */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 800a398: 21 ce 04 00 andi r14,r14,0x400 800a39c: 45 c0 00 18 be r14,r0,800a3fc * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 800a3a0: 34 02 00 0a mvi r2,10 800a3a4: b9 a0 08 00 mv r1,r13 800a3a8: fb ff d7 ba calli 8000290 <__lshrsi3> if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 800a3ac: 41 82 00 08 lbu r2,(r12+8) * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 800a3b0: 18 21 00 01 xori r1,r1,0x1 800a3b4: 20 21 00 01 andi r1,r1,0x1 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 800a3b8: 44 41 00 11 be r2,r1,800a3fc 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 ) { asr->is_enabled = is_asr_enabled; 800a3bc: 31 81 00 08 sb (r12+8),r1 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 800a3c0: 90 00 08 00 rcsr r1,IE 800a3c4: 34 02 ff fe mvi r2,-2 800a3c8: a0 22 10 00 and r2,r1,r2 800a3cc: d0 02 00 00 wcsr IE,r2 _signals = information->signals_pending; 800a3d0: 29 82 00 18 lw r2,(r12+24) information->signals_pending = information->signals_posted; 800a3d4: 29 83 00 14 lw r3,(r12+20) information->signals_posted = _signals; 800a3d8: 59 82 00 14 sw (r12+20),r2 rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; 800a3dc: 59 83 00 18 sw (r12+24),r3 information->signals_posted = _signals; _ISR_Enable( _level ); 800a3e0: d0 01 00 00 wcsr IE,r1 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 800a3e4: 29 81 00 14 lw r1,(r12+20) 800a3e8: 44 20 00 05 be r1,r0,800a3fc if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { needs_asr_dispatching = true; executing->do_post_task_switch_extension = true; 800a3ec: 34 01 00 01 mvi r1,1 800a3f0: 31 61 00 74 sb (r11+116),r1 800a3f4: b8 20 58 00 mv r11,r1 800a3f8: e0 00 00 02 bi 800a400 800a3fc: 34 0b 00 00 mvi r11,0 } } } if ( _System_state_Is_up( _System_state_Get() ) ) 800a400: 78 01 08 01 mvhi r1,0x801 800a404: 38 21 c9 c0 ori r1,r1,0xc9c0 800a408: 28 22 00 00 lw r2,(r1+0) 800a40c: 34 01 00 03 mvi r1,3 800a410: 5c 41 00 05 bne r2,r1,800a424 <== NEVER TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 800a414: f8 00 01 0f calli 800a850 <_Thread_Evaluate_mode> 800a418: 5c 20 00 02 bne r1,r0,800a420 800a41c: 45 61 00 02 be r11,r1,800a424 _Thread_Dispatch(); 800a420: fb ff e7 2a calli 80040c8 <_Thread_Dispatch> 800a424: 34 04 00 00 mvi r4,0 return RTEMS_SUCCESSFUL; } 800a428: b8 80 08 00 mv r1,r4 800a42c: 2b 9d 00 04 lw ra,(sp+4) 800a430: 2b 8b 00 20 lw r11,(sp+32) 800a434: 2b 8c 00 1c lw r12,(sp+28) 800a438: 2b 8d 00 18 lw r13,(sp+24) 800a43c: 2b 8e 00 14 lw r14,(sp+20) 800a440: 2b 8f 00 10 lw r15,(sp+16) 800a444: 2b 90 00 0c lw r16,(sp+12) 800a448: 2b 91 00 08 lw r17,(sp+8) 800a44c: 37 9c 00 20 addi sp,sp,32 800a450: c3 a0 00 00 ret 08008674 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 8008674: 37 9c ff f0 addi sp,sp,-16 8008678: 5b 8b 00 0c sw (sp+12),r11 800867c: 5b 8c 00 08 sw (sp+8),r12 8008680: 5b 9d 00 04 sw (sp+4),ra 8008684: b8 40 58 00 mv r11,r2 8008688: b8 60 60 00 mv r12,r3 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 800868c: 44 40 00 07 be r2,r0,80086a8 8008690: 78 02 08 02 mvhi r2,0x802 8008694: 38 42 40 c0 ori r2,r2,0x40c0 8008698: 40 42 00 00 lbu r2,(r2+0) 800869c: 50 4b 00 03 bgeu r2,r11,80086a8 80086a0: 34 02 00 13 mvi r2,19 80086a4: e0 00 00 15 bi 80086f8 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 80086a8: 34 02 00 09 mvi r2,9 80086ac: 45 80 00 13 be r12,r0,80086f8 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 80086b0: 37 82 00 10 addi r2,sp,16 80086b4: f8 00 09 8d calli 800ace8 <_Thread_Get> switch ( location ) { 80086b8: 2b 84 00 10 lw r4,(sp+16) 80086bc: 34 02 00 04 mvi r2,4 80086c0: 5c 80 00 0e bne r4,r0,80086f8 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 80086c4: 28 22 00 14 lw r2,(r1+20) 80086c8: 59 82 00 00 sw (r12+0),r2 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 80086cc: 45 64 00 09 be r11,r4,80086f0 the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 80086d0: 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; 80086d4: 58 2b 00 18 sw (r1+24),r11 if ( the_thread->resource_count == 0 || 80086d8: 44 40 00 03 be r2,r0,80086e4 the_thread->current_priority > new_priority ) 80086dc: 28 22 00 14 lw r2,(r1+20) 80086e0: 51 62 00 04 bgeu r11,r2,80086f0 <== ALWAYS TAKEN _Thread_Change_priority( the_thread, new_priority, false ); 80086e4: b9 60 10 00 mv r2,r11 80086e8: 34 03 00 00 mvi r3,0 80086ec: f8 00 07 bb calli 800a5d8 <_Thread_Change_priority> } _Thread_Enable_dispatch(); 80086f0: f8 00 09 5e calli 800ac68 <_Thread_Enable_dispatch> 80086f4: 34 02 00 00 mvi r2,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80086f8: b8 40 08 00 mv r1,r2 80086fc: 2b 9d 00 04 lw ra,(sp+4) 8008700: 2b 8b 00 0c lw r11,(sp+12) 8008704: 2b 8c 00 08 lw r12,(sp+8) 8008708: 37 9c 00 10 addi sp,sp,16 800870c: c3 a0 00 00 ret 08013728 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 8013728: 37 9c ff f8 addi sp,sp,-8 801372c: 5b 9d 00 04 sw (sp+4),ra 8013730: b8 20 10 00 mv r2,r1 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 8013734: 78 01 08 03 mvhi r1,0x803 8013738: 37 83 00 08 addi r3,sp,8 801373c: 38 21 de 78 ori r1,r1,0xde78 8013740: f8 00 0d b6 calli 8016e18 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8013744: 2b 83 00 08 lw r3,(sp+8) 8013748: 34 02 00 04 mvi r2,4 801374c: 5c 60 00 07 bne r3,r0,8013768 case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 8013750: 28 23 00 38 lw r3,(r1+56) 8013754: 44 62 00 03 be r3,r2,8013760 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 8013758: 34 21 00 10 addi r1,r1,16 801375c: f8 00 17 6d calli 8019510 <_Watchdog_Remove> _Thread_Enable_dispatch(); 8013760: f8 00 10 92 calli 80179a8 <_Thread_Enable_dispatch> 8013764: 34 02 00 00 mvi r2,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8013768: b8 40 08 00 mv r1,r2 801376c: 2b 9d 00 04 lw ra,(sp+4) 8013770: 37 9c 00 08 addi sp,sp,8 8013774: c3 a0 00 00 ret 08013d68 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 8013d68: 37 9c ff d8 addi sp,sp,-40 8013d6c: 5b 8b 00 24 sw (sp+36),r11 8013d70: 5b 8c 00 20 sw (sp+32),r12 8013d74: 5b 8d 00 1c sw (sp+28),r13 8013d78: 5b 8e 00 18 sw (sp+24),r14 8013d7c: 5b 8f 00 14 sw (sp+20),r15 8013d80: 5b 90 00 10 sw (sp+16),r16 8013d84: 5b 91 00 0c sw (sp+12),r17 8013d88: 5b 92 00 08 sw (sp+8),r18 8013d8c: 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; 8013d90: 78 05 08 03 mvhi r5,0x803 8013d94: 38 a5 de b8 ori r5,r5,0xdeb8 8013d98: 28 ae 00 00 lw r14,(r5+0) rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 8013d9c: b8 20 88 00 mv r17,r1 8013da0: b8 40 58 00 mv r11,r2 8013da4: b8 60 78 00 mv r15,r3 8013da8: b8 80 90 00 mv r18,r4 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 8013dac: 34 05 00 0e mvi r5,14 8013db0: 45 c0 00 2e be r14,r0,8013e68 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 8013db4: 78 05 08 03 mvhi r5,0x803 8013db8: 38 a5 dc 40 ori r5,r5,0xdc40 8013dbc: 40 a1 00 00 lbu r1,(r5+0) 8013dc0: 34 05 00 0b mvi r5,11 8013dc4: 44 20 00 29 be r1,r0,8013e68 <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) 8013dc8: 34 05 00 09 mvi r5,9 8013dcc: 44 60 00 27 be r3,r0,8013e68 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 8013dd0: b8 40 08 00 mv r1,r2 8013dd4: fb ff f1 58 calli 8010334 <_TOD_Validate> 8013dd8: 44 20 00 23 be r1,r0,8013e64 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) 8013ddc: 78 0c 08 03 mvhi r12,0x803 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8013de0: b9 60 08 00 mv r1,r11 8013de4: fb ff f1 14 calli 8010234 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 8013de8: 39 8c dc bc ori r12,r12,0xdcbc return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8013dec: b8 20 80 00 mv r16,r1 if ( seconds <= _TOD_Seconds_since_epoch() ) 8013df0: 29 81 00 00 lw r1,(r12+0) 8013df4: 50 30 00 1c bgeu r1,r16,8013e64 8013df8: 78 01 08 03 mvhi r1,0x803 8013dfc: 38 21 de 78 ori r1,r1,0xde78 8013e00: ba 20 10 00 mv r2,r17 8013e04: 37 83 00 28 addi r3,sp,40 8013e08: f8 00 0c 04 calli 8016e18 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8013e0c: 2b 8d 00 28 lw r13,(sp+40) 8013e10: b8 20 58 00 mv r11,r1 8013e14: 34 05 00 04 mvi r5,4 8013e18: 5d a0 00 14 bne r13,r0,8013e68 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 8013e1c: 34 21 00 10 addi r1,r1,16 8013e20: f8 00 15 bc calli 8019510 <_Watchdog_Remove> void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 8013e24: 59 71 00 30 sw (r11+48),r17 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(); 8013e28: 29 81 00 00 lw r1,(r12+0) (*timer_server->schedule_operation)( timer_server, the_timer ); 8013e2c: 29 c3 00 04 lw r3,(r14+4) 8013e30: b9 60 10 00 mv r2,r11 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(); 8013e34: ca 01 80 00 sub r16,r16,r1 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 8013e38: 34 01 00 03 mvi r1,3 8013e3c: 59 61 00 38 sw (r11+56),r1 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8013e40: 59 6f 00 2c sw (r11+44),r15 _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 ); 8013e44: b9 c0 08 00 mv r1,r14 the_watchdog->id = id; the_watchdog->user_data = user_data; 8013e48: 59 72 00 34 sw (r11+52),r18 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(); 8013e4c: 59 70 00 1c sw (r11+28),r16 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8013e50: 59 6d 00 18 sw (r11+24),r13 (*timer_server->schedule_operation)( timer_server, the_timer ); 8013e54: d8 60 00 00 call r3 _Thread_Enable_dispatch(); 8013e58: f8 00 0e d4 calli 80179a8 <_Thread_Enable_dispatch> 8013e5c: b9 a0 28 00 mv r5,r13 return RTEMS_SUCCESSFUL; 8013e60: e0 00 00 02 bi 8013e68 8013e64: 34 05 00 14 mvi r5,20 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8013e68: b8 a0 08 00 mv r1,r5 8013e6c: 2b 9d 00 04 lw ra,(sp+4) 8013e70: 2b 8b 00 24 lw r11,(sp+36) 8013e74: 2b 8c 00 20 lw r12,(sp+32) 8013e78: 2b 8d 00 1c lw r13,(sp+28) 8013e7c: 2b 8e 00 18 lw r14,(sp+24) 8013e80: 2b 8f 00 14 lw r15,(sp+20) 8013e84: 2b 90 00 10 lw r16,(sp+16) 8013e88: 2b 91 00 0c lw r17,(sp+12) 8013e8c: 2b 92 00 08 lw r18,(sp+8) 8013e90: 37 9c 00 28 addi sp,sp,40 8013e94: c3 a0 00 00 ret