08002bd0 <_API_extensions_Run_postdriver>: * * _API_extensions_Run_postdriver */ void _API_extensions_Run_postdriver( void ) { 8002bd0: 37 9c ff f4 addi sp,sp,-12 8002bd4: 5b 8b 00 0c sw (sp+12),r11 8002bd8: 5b 8c 00 08 sw (sp+8),r12 8002bdc: 5b 9d 00 04 sw (sp+4),ra Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 8002be0: 78 0c 08 01 mvhi r12,0x801 8002be4: 39 8c ea 58 ori r12,r12,0xea58 8002be8: 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; 8002bec: 35 8c 00 04 addi r12,r12,4 8002bf0: 45 6c 00 05 be r11,r12,8002c04 <_API_extensions_Run_postdriver+0x34><== NEVER TAKEN * Currently all APIs configure this hook so it is always non-NULL. */ #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); 8002bf4: 29 61 00 08 lw r1,(r11+8) 8002bf8: d8 20 00 00 call r1 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 8002bfc: 29 6b 00 00 lw r11,(r11+0) void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 8002c00: 5d 6c ff fd bne r11,r12,8002bf4 <_API_extensions_Run_postdriver+0x24> #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 8002c04: 2b 9d 00 04 lw ra,(sp+4) 8002c08: 2b 8b 00 0c lw r11,(sp+12) 8002c0c: 2b 8c 00 08 lw r12,(sp+8) 8002c10: 37 9c 00 0c addi sp,sp,12 8002c14: c3 a0 00 00 ret 08002c18 <_API_extensions_Run_postswitch>: * * _API_extensions_Run_postswitch */ void _API_extensions_Run_postswitch( void ) { 8002c18: 37 9c ff f0 addi sp,sp,-16 8002c1c: 5b 8b 00 10 sw (sp+16),r11 8002c20: 5b 8c 00 0c sw (sp+12),r12 8002c24: 5b 8d 00 08 sw (sp+8),r13 8002c28: 5b 9d 00 04 sw (sp+4),ra Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 8002c2c: 78 0d 08 01 mvhi r13,0x801 8002c30: 39 ad ea 58 ori r13,r13,0xea58 8002c34: 29 ab 00 00 lw r11,(r13+0) 8002c38: 35 ad 00 04 addi r13,r13,4 8002c3c: 45 6d 00 08 be r11,r13,8002c5c <_API_extensions_Run_postswitch+0x44><== NEVER TAKEN 8002c40: 78 0c 08 01 mvhi r12,0x801 8002c44: 39 8c e9 60 ori r12,r12,0xe960 * provide this hook. */ #if defined(RTEMS_ITRON_API) if ( the_extension->postswitch_hook ) #endif (*the_extension->postswitch_hook)( _Thread_Executing ); 8002c48: 29 62 00 0c lw r2,(r11+12) 8002c4c: 29 81 00 00 lw r1,(r12+0) 8002c50: d8 40 00 00 call r2 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 8002c54: 29 6b 00 00 lw r11,(r11+0) void _API_extensions_Run_postswitch( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 8002c58: 5d 6d ff fc bne r11,r13,8002c48 <_API_extensions_Run_postswitch+0x30> #if defined(RTEMS_ITRON_API) if ( the_extension->postswitch_hook ) #endif (*the_extension->postswitch_hook)( _Thread_Executing ); } } 8002c5c: 2b 9d 00 04 lw ra,(sp+4) 8002c60: 2b 8b 00 10 lw r11,(sp+16) 8002c64: 2b 8c 00 0c lw r12,(sp+12) 8002c68: 2b 8d 00 08 lw r13,(sp+8) 8002c6c: 37 9c 00 10 addi sp,sp,16 8002c70: c3 a0 00 00 ret 08005a30 <_CORE_RWLock_Obtain_for_reading>: Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 8005a30: 37 9c ff e4 addi sp,sp,-28 8005a34: 5b 8b 00 14 sw (sp+20),r11 8005a38: 5b 8c 00 10 sw (sp+16),r12 8005a3c: 5b 8d 00 0c sw (sp+12),r13 8005a40: 5b 8e 00 08 sw (sp+8),r14 8005a44: 5b 9d 00 04 sw (sp+4),ra ISR_Level level; Thread_Control *executing = _Thread_Executing; 8005a48: 78 05 08 02 mvhi r5,0x802 8005a4c: 38 a5 29 30 ori r5,r5,0x2930 8005a50: 28 ac 00 00 lw r12,(r5+0) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 8005a54: b8 20 58 00 mv r11,r1 8005a58: 20 6e 00 ff andi r14,r3,0xff * If unlocked, then OK to read. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 8005a5c: 90 00 68 00 rcsr r13,IE 8005a60: 34 01 ff fe mvi r1,-2 8005a64: a1 a1 08 00 and r1,r13,r1 8005a68: d0 01 00 00 wcsr IE,r1 switch ( the_rwlock->current_state ) { 8005a6c: 29 61 00 44 lw r1,(r11+68) 8005a70: 44 20 00 30 be r1,r0,8005b30 <_CORE_RWLock_Obtain_for_reading+0x100> 8005a74: 34 03 00 01 mvi r3,1 8005a78: 44 23 00 20 be r1,r3,8005af8 <_CORE_RWLock_Obtain_for_reading+0xc8> /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 8005a7c: 34 01 00 00 mvi r1,0 8005a80: 5d c1 00 0b bne r14,r1,8005aac <_CORE_RWLock_Obtain_for_reading+0x7c> _ISR_Enable( level ); 8005a84: d0 0d 00 00 wcsr IE,r13 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 8005a88: 34 01 00 02 mvi r1,2 8005a8c: 59 81 00 34 sw (r12+52),r1 timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 8005a90: 2b 9d 00 04 lw ra,(sp+4) 8005a94: 2b 8b 00 14 lw r11,(sp+20) 8005a98: 2b 8c 00 10 lw r12,(sp+16) 8005a9c: 2b 8d 00 0c lw r13,(sp+12) 8005aa0: 2b 8e 00 08 lw r14,(sp+8) 8005aa4: 37 9c 00 1c addi sp,sp,28 8005aa8: c3 a0 00 00 ret 8005aac: 34 03 00 01 mvi r3,1 _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 8005ab0: 59 81 00 34 sw (r12+52),r1 8005ab4: 59 63 00 30 sw (r11+48),r3 * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; executing->Wait.id = id; 8005ab8: 59 82 00 20 sw (r12+32),r2 /* * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; 8005abc: 59 8b 00 44 sw (r12+68),r11 executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 8005ac0: 59 81 00 30 sw (r12+48),r1 executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); 8005ac4: d0 0d 00 00 wcsr IE,r13 _Thread_queue_Enqueue_with_handler( 8005ac8: 78 03 08 00 mvhi r3,0x800 8005acc: b9 60 08 00 mv r1,r11 8005ad0: b8 80 10 00 mv r2,r4 8005ad4: 38 63 5d 34 ori r3,r3,0x5d34 8005ad8: f8 00 07 a8 calli 8007978 <_Thread_queue_Enqueue_with_handler> timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 8005adc: 2b 9d 00 04 lw ra,(sp+4) 8005ae0: 2b 8b 00 14 lw r11,(sp+20) 8005ae4: 2b 8c 00 10 lw r12,(sp+16) 8005ae8: 2b 8d 00 0c lw r13,(sp+12) 8005aec: 2b 8e 00 08 lw r14,(sp+8) 8005af0: 37 9c 00 1c addi sp,sp,28 8005af4: c3 a0 00 00 ret executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; return; case CORE_RWLOCK_LOCKED_FOR_READING: { Thread_Control *waiter; waiter = _Thread_queue_First( &the_rwlock->Wait_queue ); 8005af8: b9 60 08 00 mv r1,r11 8005afc: 5b 82 00 1c sw (sp+28),r2 8005b00: 5b 84 00 18 sw (sp+24),r4 8005b04: f8 00 08 b0 calli 8007dc4 <_Thread_queue_First> if ( !waiter ) { 8005b08: 2b 82 00 1c lw r2,(sp+28) 8005b0c: 2b 84 00 18 lw r4,(sp+24) 8005b10: 5c 20 ff db bne r1,r0,8005a7c <_CORE_RWLock_Obtain_for_reading+0x4c><== NEVER TAKEN the_rwlock->number_of_readers += 1; 8005b14: 29 61 00 48 lw r1,(r11+72) 8005b18: 34 21 00 01 addi r1,r1,1 8005b1c: 59 61 00 48 sw (r11+72),r1 _ISR_Enable( level ); 8005b20: d0 0d 00 00 wcsr IE,r13 executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 8005b24: 34 01 00 00 mvi r1,0 8005b28: 59 81 00 34 sw (r12+52),r1 return; 8005b2c: e3 ff ff d9 bi 8005a90 <_CORE_RWLock_Obtain_for_reading+0x60> _ISR_Disable( level ); switch ( the_rwlock->current_state ) { case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; the_rwlock->number_of_readers += 1; 8005b30: 29 61 00 48 lw r1,(r11+72) */ _ISR_Disable( level ); switch ( the_rwlock->current_state ) { case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 8005b34: 34 02 00 01 mvi r2,1 8005b38: 59 62 00 44 sw (r11+68),r2 the_rwlock->number_of_readers += 1; 8005b3c: b4 22 08 00 add r1,r1,r2 8005b40: 59 61 00 48 sw (r11+72),r1 _ISR_Enable( level ); 8005b44: d0 0d 00 00 wcsr IE,r13 executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 8005b48: 34 01 00 00 mvi r1,0 8005b4c: 59 81 00 34 sw (r12+52),r1 timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 8005b50: 2b 9d 00 04 lw ra,(sp+4) 8005b54: 2b 8b 00 14 lw r11,(sp+20) 8005b58: 2b 8c 00 10 lw r12,(sp+16) 8005b5c: 2b 8d 00 0c lw r13,(sp+12) 8005b60: 2b 8e 00 08 lw r14,(sp+8) 8005b64: 37 9c 00 1c addi sp,sp,28 8005b68: c3 a0 00 00 ret 08005c14 <_CORE_RWLock_Release>: */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 8005c14: 37 9c ff f4 addi sp,sp,-12 8005c18: 5b 8b 00 0c sw (sp+12),r11 8005c1c: 5b 8c 00 08 sw (sp+8),r12 8005c20: 5b 9d 00 04 sw (sp+4),ra ISR_Level level; Thread_Control *executing = _Thread_Executing; 8005c24: 78 02 08 02 mvhi r2,0x802 8005c28: 38 42 29 30 ori r2,r2,0x2930 8005c2c: 28 43 00 00 lw r3,(r2+0) */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 8005c30: b8 20 58 00 mv r11,r1 * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 8005c34: 90 00 08 00 rcsr r1,IE 8005c38: 34 02 ff fe mvi r2,-2 8005c3c: a0 22 10 00 and r2,r1,r2 8005c40: d0 02 00 00 wcsr IE,r2 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 8005c44: 29 62 00 44 lw r2,(r11+68) 8005c48: 44 40 00 2f be r2,r0,8005d04 <_CORE_RWLock_Release+0xf0> _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 8005c4c: 34 04 00 01 mvi r4,1 8005c50: 44 44 00 22 be r2,r4,8005cd8 <_CORE_RWLock_Release+0xc4> return CORE_RWLOCK_SUCCESSFUL; } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 8005c54: 34 02 00 00 mvi r2,0 8005c58: 58 62 00 34 sw (r3+52),r2 /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 8005c5c: 59 62 00 44 sw (r11+68),r2 _ISR_Enable( level ); 8005c60: d0 01 00 00 wcsr IE,r1 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 8005c64: b9 60 08 00 mv r1,r11 8005c68: f8 00 06 d0 calli 80077a8 <_Thread_queue_Dequeue> if ( next ) { 8005c6c: 44 20 00 15 be r1,r0,8005cc0 <_CORE_RWLock_Release+0xac> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 8005c70: 28 21 00 30 lw r1,(r1+48) 8005c74: 34 0c 00 01 mvi r12,1 8005c78: 44 2c 00 2c be r1,r12,8005d28 <_CORE_RWLock_Release+0x114> } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 8005c7c: 29 61 00 48 lw r1,(r11+72) the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 8005c80: 59 6c 00 44 sw (r11+68),r12 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 8005c84: 34 21 00 01 addi r1,r1,1 8005c88: 59 61 00 48 sw (r11+72),r1 8005c8c: e0 00 00 07 bi 8005ca8 <_CORE_RWLock_Release+0x94> * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); if ( !next || next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) 8005c90: 28 63 00 30 lw r3,(r3+48) 8005c94: 44 6c 00 0b be r3,r12,8005cc0 <_CORE_RWLock_Release+0xac> <== NEVER TAKEN return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 8005c98: 29 63 00 48 lw r3,(r11+72) 8005c9c: 34 63 00 01 addi r3,r3,1 8005ca0: 59 63 00 48 sw (r11+72),r3 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 8005ca4: f8 00 07 f7 calli 8007c80 <_Thread_queue_Extract> /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 8005ca8: b9 60 08 00 mv r1,r11 8005cac: f8 00 08 46 calli 8007dc4 <_Thread_queue_First> 8005cb0: b8 20 18 00 mv r3,r1 if ( !next || next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 8005cb4: b8 20 10 00 mv r2,r1 8005cb8: b9 60 08 00 mv r1,r11 /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); if ( !next || 8005cbc: 5c 60 ff f5 bne r3,r0,8005c90 <_CORE_RWLock_Release+0x7c> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 8005cc0: 34 01 00 00 mvi r1,0 8005cc4: 2b 9d 00 04 lw ra,(sp+4) 8005cc8: 2b 8b 00 0c lw r11,(sp+12) 8005ccc: 2b 8c 00 08 lw r12,(sp+8) 8005cd0: 37 9c 00 0c addi sp,sp,12 8005cd4: c3 a0 00 00 ret _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { the_rwlock->number_of_readers -= 1; 8005cd8: 29 62 00 48 lw r2,(r11+72) 8005cdc: 34 42 ff ff addi r2,r2,-1 8005ce0: 59 62 00 48 sw (r11+72),r2 if ( the_rwlock->number_of_readers != 0 ) { 8005ce4: 44 40 ff dc be r2,r0,8005c54 <_CORE_RWLock_Release+0x40> /* must be unlocked again */ _ISR_Enable( level ); 8005ce8: d0 01 00 00 wcsr IE,r1 } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 8005cec: 34 01 00 00 mvi r1,0 8005cf0: 2b 9d 00 04 lw ra,(sp+4) 8005cf4: 2b 8b 00 0c lw r11,(sp+12) 8005cf8: 2b 8c 00 08 lw r12,(sp+8) 8005cfc: 37 9c 00 0c addi sp,sp,12 8005d00: c3 a0 00 00 ret * If any thread is waiting, then we wait. */ _ISR_Disable( level ); if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ _ISR_Enable( level ); 8005d04: d0 01 00 00 wcsr IE,r1 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 8005d08: 34 01 00 02 mvi r1,2 8005d0c: 58 61 00 34 sw (r3+52),r1 } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 8005d10: 34 01 00 00 mvi r1,0 8005d14: 2b 9d 00 04 lw ra,(sp+4) 8005d18: 2b 8b 00 0c lw r11,(sp+12) 8005d1c: 2b 8c 00 08 lw r12,(sp+8) 8005d20: 37 9c 00 0c addi sp,sp,12 8005d24: c3 a0 00 00 ret next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); if ( next ) { if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 8005d28: 34 01 00 02 mvi r1,2 8005d2c: 59 61 00 44 sw (r11+68),r1 return CORE_RWLOCK_SUCCESSFUL; 8005d30: e3 ff ff e4 bi 8005cc0 <_CORE_RWLock_Release+0xac> 08005d34 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 8005d34: 37 9c ff f8 addi sp,sp,-8 8005d38: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 8005d3c: 37 82 00 08 addi r2,sp,8 8005d40: f8 00 05 6e calli 80072f8 <_Thread_Get> switch ( location ) { 8005d44: 2b 82 00 08 lw r2,(sp+8) 8005d48: 5c 40 00 07 bne r2,r0,8005d64 <_CORE_RWLock_Timeout+0x30> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 8005d4c: f8 00 08 5f calli 8007ec8 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8005d50: 78 01 08 02 mvhi r1,0x802 8005d54: 38 21 28 74 ori r1,r1,0x2874 8005d58: 28 22 00 00 lw r2,(r1+0) 8005d5c: 34 42 ff ff addi r2,r2,-1 8005d60: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8005d64: 2b 9d 00 04 lw ra,(sp+4) 8005d68: 37 9c 00 08 addi sp,sp,8 8005d6c: c3 a0 00 00 ret 080157d8 <_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 ) { 80157d8: 37 9c ff e4 addi sp,sp,-28 80157dc: 5b 8b 00 1c sw (sp+28),r11 80157e0: 5b 8c 00 18 sw (sp+24),r12 80157e4: 5b 8d 00 14 sw (sp+20),r13 80157e8: 5b 8e 00 10 sw (sp+16),r14 80157ec: 5b 8f 00 0c sw (sp+12),r15 80157f0: 5b 90 00 08 sw (sp+8),r16 80157f4: 5b 9d 00 04 sw (sp+4),ra 80157f8: b8 20 70 00 mv r14,r1 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 80157fc: 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 ) { 8015800: b8 60 60 00 mv r12,r3 8015804: b8 40 78 00 mv r15,r2 8015808: b8 c0 80 00 mv r16,r6 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 801580c: 50 23 00 0b bgeu r1,r3,8015838 <_CORE_message_queue_Broadcast+0x60><== ALWAYS TAKEN 8015810: 34 01 00 01 mvi r1,1 <== NOT EXECUTED #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 8015814: 2b 9d 00 04 lw ra,(sp+4) 8015818: 2b 8b 00 1c lw r11,(sp+28) 801581c: 2b 8c 00 18 lw r12,(sp+24) 8015820: 2b 8d 00 14 lw r13,(sp+20) 8015824: 2b 8e 00 10 lw r14,(sp+16) 8015828: 2b 8f 00 0c lw r15,(sp+12) 801582c: 2b 90 00 08 lw r16,(sp+8) 8015830: 37 9c 00 1c addi sp,sp,28 8015834: c3 a0 00 00 ret * 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 ) { 8015838: 29 c2 00 48 lw r2,(r14+72) 801583c: 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))) { 8015840: b8 40 68 00 mv r13,r2 * 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 ) { 8015844: 44 41 00 08 be r2,r1,8015864 <_CORE_message_queue_Broadcast+0x8c> *count = 0; 8015848: 58 c1 00 00 sw (r6+0),r1 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 801584c: e3 ff ff f2 bi 8015814 <_CORE_message_queue_Broadcast+0x3c> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 8015850: 29 61 00 2c lw r1,(r11+44) */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 8015854: 35 ad 00 01 addi r13,r13,1 8015858: f8 00 2f 2e calli 8021510 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 801585c: 29 61 00 28 lw r1,(r11+40) 8015860: 58 2c 00 00 sw (r1+0),r12 * 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))) { 8015864: b9 c0 08 00 mv r1,r14 8015868: f8 00 0c d1 calli 8018bac <_Thread_queue_Dequeue> 801586c: b8 20 58 00 mv r11,r1 8015870: b9 e0 10 00 mv r2,r15 8015874: b9 80 18 00 mv r3,r12 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 8015878: 5c 20 ff f6 bne r1,r0,8015850 <_CORE_message_queue_Broadcast+0x78> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 801587c: 5a 0d 00 00 sw (r16+0),r13 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 8015880: e3 ff ff e5 bi 8015814 <_CORE_message_queue_Broadcast+0x3c> 0800e91c <_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 ) { 800e91c: 37 9c ff e8 addi sp,sp,-24 800e920: 5b 8b 00 18 sw (sp+24),r11 800e924: 5b 8c 00 14 sw (sp+20),r12 800e928: 5b 8d 00 10 sw (sp+16),r13 800e92c: 5b 8e 00 0c sw (sp+12),r14 800e930: 5b 8f 00 08 sw (sp+8),r15 800e934: 5b 9d 00 04 sw (sp+4),ra 800e938: 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; 800e93c: 34 01 00 00 mvi r1,0 CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; the_message_queue->notify_argument = the_argument; 800e940: 59 61 00 64 sw (r11+100),r1 800e944: 59 61 00 48 sw (r11+72),r1 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 800e948: 59 61 00 60 sw (r11+96),r1 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 800e94c: 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; 800e950: 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)) { 800e954: 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 ) { 800e958: b8 60 68 00 mv r13,r3 800e95c: 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)) { 800e960: b8 80 60 00 mv r12,r4 800e964: 44 20 00 05 be r1,r0,800e978 <_CORE_message_queue_Initialize+0x5c> allocated_message_size += sizeof(uint32_t); 800e968: 34 8c 00 04 addi r12,r4,4 allocated_message_size &= ~(sizeof(uint32_t) - 1); 800e96c: 34 01 ff fc mvi r1,-4 800e970: a1 81 60 00 and r12,r12,r1 } if (allocated_message_size < maximum_message_size) 800e974: 54 8c 00 23 bgu r4,r12,800ea00 <_CORE_message_queue_Initialize+0xe4><== 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)); 800e978: 35 8e 00 14 addi r14,r12,20 /* * 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 * 800e97c: b9 c0 08 00 mv r1,r14 800e980: b9 a0 10 00 mv r2,r13 800e984: f8 00 6d 22 calli 8029e0c <__mulsi3> (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 800e988: 55 81 00 1e bgu r12,r1,800ea00 <_CORE_message_queue_Initialize+0xe4><== NEVER TAKEN return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 800e98c: f8 00 0e e9 calli 8012530 <_Workspace_Allocate> 800e990: 59 61 00 5c sw (r11+92),r1 _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 800e994: 44 20 00 1b be r1,r0,800ea00 <_CORE_message_queue_Initialize+0xe4> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 800e998: b8 20 10 00 mv r2,r1 800e99c: b9 a0 18 00 mv r3,r13 800e9a0: b9 c0 20 00 mv r4,r14 800e9a4: 35 61 00 68 addi r1,r11,104 800e9a8: f8 00 1a 28 calli 8015248 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 800e9ac: 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); 800e9b0: 35 63 00 54 addi r3,r11,84 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 800e9b4: 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); 800e9b8: 59 63 00 50 sw (r11+80),r3 800e9bc: 64 42 00 01 cmpei r2,r2,1 the_chain->permanent_null = NULL; 800e9c0: 34 03 00 00 mvi r3,0 800e9c4: 59 63 00 54 sw (r11+84),r3 the_chain->last = _Chain_Head(the_chain); 800e9c8: 59 61 00 58 sw (r11+88),r1 800e9cc: 34 03 00 80 mvi r3,128 800e9d0: b9 60 08 00 mv r1,r11 800e9d4: 34 04 00 06 mvi r4,6 800e9d8: f8 00 0b 20 calli 8011658 <_Thread_queue_Initialize> 800e9dc: 34 01 00 01 mvi r1,1 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 800e9e0: 2b 9d 00 04 lw ra,(sp+4) 800e9e4: 2b 8b 00 18 lw r11,(sp+24) 800e9e8: 2b 8c 00 14 lw r12,(sp+20) 800e9ec: 2b 8d 00 10 lw r13,(sp+16) 800e9f0: 2b 8e 00 0c lw r14,(sp+12) 800e9f4: 2b 8f 00 08 lw r15,(sp+8) 800e9f8: 37 9c 00 18 addi sp,sp,24 800e9fc: c3 a0 00 00 ret THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 800ea00: 34 01 00 00 mvi r1,0 } 800ea04: 2b 9d 00 04 lw ra,(sp+4) 800ea08: 2b 8b 00 18 lw r11,(sp+24) 800ea0c: 2b 8c 00 14 lw r12,(sp+20) 800ea10: 2b 8d 00 10 lw r13,(sp+16) 800ea14: 2b 8e 00 0c lw r14,(sp+12) 800ea18: 2b 8f 00 08 lw r15,(sp+8) 800ea1c: 37 9c 00 18 addi sp,sp,24 800ea20: c3 a0 00 00 ret 08002f64 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8002f64: 37 9c ff e4 addi sp,sp,-28 8002f68: 5b 8b 00 18 sw (sp+24),r11 8002f6c: 5b 8c 00 14 sw (sp+20),r12 8002f70: 5b 8d 00 10 sw (sp+16),r13 8002f74: 5b 8e 00 0c sw (sp+12),r14 8002f78: 5b 8f 00 08 sw (sp+8),r15 8002f7c: 5b 9d 00 04 sw (sp+4),ra _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 8002f80: 78 0b 08 01 mvhi r11,0x801 8002f84: 39 6b e8 a4 ori r11,r11,0xe8a4 8002f88: 29 66 00 00 lw r6,(r11+0) Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8002f8c: 5b 85 00 1c sw (sp+28),r5 8002f90: b8 20 60 00 mv r12,r1 8002f94: b8 40 78 00 mv r15,r2 8002f98: b8 80 70 00 mv r14,r4 8002f9c: 20 6d 00 ff andi r13,r3,0xff _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 8002fa0: 44 c0 00 02 be r6,r0,8002fa8 <_CORE_mutex_Seize+0x44> 8002fa4: 5d a0 00 15 bne r13,r0,8002ff8 <_CORE_mutex_Seize+0x94> <== ALWAYS TAKEN 8002fa8: b9 80 08 00 mv r1,r12 8002fac: 37 82 00 1c addi r2,sp,28 8002fb0: f8 00 19 1c calli 8009420 <_CORE_mutex_Seize_interrupt_trylock> 8002fb4: 44 20 00 09 be r1,r0,8002fd8 <_CORE_mutex_Seize+0x74> 8002fb8: 5d a0 00 19 bne r13,r0,800301c <_CORE_mutex_Seize+0xb8> 8002fbc: 2b 81 00 1c lw r1,(sp+28) 8002fc0: d0 01 00 00 wcsr IE,r1 8002fc4: 78 01 08 01 mvhi r1,0x801 8002fc8: 38 21 e9 60 ori r1,r1,0xe960 8002fcc: 28 21 00 00 lw r1,(r1+0) 8002fd0: 34 02 00 01 mvi r2,1 8002fd4: 58 22 00 34 sw (r1+52),r2 } 8002fd8: 2b 9d 00 04 lw ra,(sp+4) 8002fdc: 2b 8b 00 18 lw r11,(sp+24) 8002fe0: 2b 8c 00 14 lw r12,(sp+20) 8002fe4: 2b 8d 00 10 lw r13,(sp+16) 8002fe8: 2b 8e 00 0c lw r14,(sp+12) 8002fec: 2b 8f 00 08 lw r15,(sp+8) 8002ff0: 37 9c 00 1c addi sp,sp,28 8002ff4: c3 a0 00 00 ret bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 8002ff8: 78 01 08 01 mvhi r1,0x801 8002ffc: 38 21 ea 40 ori r1,r1,0xea40 8003000: 28 21 00 00 lw r1,(r1+0) 8003004: 34 02 00 01 mvi r2,1 8003008: 50 41 ff e8 bgeu r2,r1,8002fa8 <_CORE_mutex_Seize+0x44> 800300c: 34 01 00 00 mvi r1,0 8003010: b8 20 10 00 mv r2,r1 8003014: 34 03 00 13 mvi r3,19 8003018: f8 00 01 cf calli 8003754 <_Internal_error_Occurred> 800301c: 78 01 08 01 mvhi r1,0x801 8003020: 38 21 e9 60 ori r1,r1,0xe960 8003024: 28 21 00 00 lw r1,(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; 8003028: 34 02 00 01 mvi r2,1 800302c: 59 82 00 30 sw (r12+48),r2 8003030: 58 2f 00 20 sw (r1+32),r15 8003034: 29 62 00 00 lw r2,(r11+0) 8003038: 58 2c 00 44 sw (r1+68),r12 800303c: 34 41 00 01 addi r1,r2,1 8003040: 59 61 00 00 sw (r11+0),r1 8003044: 2b 81 00 1c lw r1,(sp+28) 8003048: d0 01 00 00 wcsr IE,r1 800304c: b9 80 08 00 mv r1,r12 8003050: b9 c0 10 00 mv r2,r14 8003054: fb ff ff a3 calli 8002ee0 <_CORE_mutex_Seize_interrupt_blocking> } 8003058: 2b 9d 00 04 lw ra,(sp+4) 800305c: 2b 8b 00 18 lw r11,(sp+24) 8003060: 2b 8c 00 14 lw r12,(sp+20) 8003064: 2b 8d 00 10 lw r13,(sp+16) 8003068: 2b 8e 00 0c lw r14,(sp+12) 800306c: 2b 8f 00 08 lw r15,(sp+8) 8003070: 37 9c 00 1c addi sp,sp,28 8003074: c3 a0 00 00 ret 0800959c <_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 ) { 800959c: 37 9c ff f8 addi sp,sp,-8 80095a0: 5b 8b 00 08 sw (sp+8),r11 80095a4: 5b 9d 00 04 sw (sp+4),ra 80095a8: 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)) ) { 80095ac: fb ff ed 98 calli 8004c0c <_Thread_queue_Dequeue> 80095b0: 34 02 00 00 mvi r2,0 80095b4: 44 22 00 06 be r1,r2,80095cc <_CORE_semaphore_Surrender+0x30> status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 80095b8: b8 40 08 00 mv r1,r2 80095bc: 2b 9d 00 04 lw ra,(sp+4) 80095c0: 2b 8b 00 08 lw r11,(sp+8) 80095c4: 37 9c 00 08 addi sp,sp,8 80095c8: c3 a0 00 00 ret if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 80095cc: 90 00 08 00 rcsr r1,IE 80095d0: 34 02 ff fe mvi r2,-2 80095d4: a0 22 10 00 and r2,r1,r2 80095d8: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 80095dc: 29 62 00 48 lw r2,(r11+72) 80095e0: 29 63 00 40 lw r3,(r11+64) 80095e4: 54 62 00 08 bgu r3,r2,8009604 <_CORE_semaphore_Surrender+0x68><== ALWAYS TAKEN 80095e8: 34 02 00 04 mvi r2,4 <== NOT EXECUTED the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 80095ec: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED } return status; } 80095f0: b8 40 08 00 mv r1,r2 80095f4: 2b 9d 00 04 lw ra,(sp+4) 80095f8: 2b 8b 00 08 lw r11,(sp+8) 80095fc: 37 9c 00 08 addi sp,sp,8 8009600: c3 a0 00 00 ret #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 8009604: 34 42 00 01 addi r2,r2,1 8009608: 59 62 00 48 sw (r11+72),r2 800960c: 34 02 00 00 mvi r2,0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 8009610: d0 01 00 00 wcsr IE,r1 8009614: e3 ff ff f7 bi 80095f0 <_CORE_semaphore_Surrender+0x54> 080093d0 <_Chain_Initialize>: Chain_Node *current; Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; 80093d0: 34 05 00 00 mvi r5,0 80093d4: 58 25 00 04 sw (r1+4),r5 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 80093d8: b8 20 28 00 mv r5,r1 next = starting_address; while ( count-- ) { 80093dc: 44 60 00 07 be r3,r0,80093f8 <_Chain_Initialize+0x28> <== NEVER TAKEN current->next = next; next->previous = current; 80093e0: 58 45 00 04 sw (r2+4),r5 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { current->next = next; 80093e4: 58 a2 00 00 sw (r5+0),r2 next->previous = current; current = next; next = (Chain_Node *) 80093e8: 34 63 ff ff addi r3,r3,-1 80093ec: b8 40 28 00 mv r5,r2 80093f0: b4 44 10 00 add r2,r2,r4 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { 80093f4: 5c 60 ff fb bne r3,r0,80093e0 <_Chain_Initialize+0x10> next->previous = current; current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = _Chain_Tail( the_chain ); 80093f8: 34 22 00 04 addi r2,r1,4 80093fc: 58 a2 00 00 sw (r5+0),r2 the_chain->last = current; 8009400: 58 25 00 08 sw (r1+8),r5 } 8009404: c3 a0 00 00 ret 0800ef28 <_Event_Seize>: rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 800ef28: 37 9c ff f4 addi sp,sp,-12 800ef2c: 5b 8b 00 0c sw (sp+12),r11 800ef30: 5b 8c 00 08 sw (sp+8),r12 800ef34: 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; 800ef38: 78 05 08 02 mvhi r5,0x802 800ef3c: 38 a5 6a 00 ori r5,r5,0x6a00 800ef40: 28 ab 00 00 lw r11,(r5+0) executing->Wait.return_code = RTEMS_SUCCESSFUL; 800ef44: 34 05 00 00 mvi r5,0 800ef48: 59 65 00 34 sw (r11+52),r5 api = executing->API_Extensions[ THREAD_API_RTEMS ]; 800ef4c: 29 67 01 28 lw r7,(r11+296) _ISR_Disable( level ); 800ef50: 90 00 30 00 rcsr r6,IE 800ef54: 34 05 ff fe mvi r5,-2 800ef58: a0 c5 28 00 and r5,r6,r5 800ef5c: d0 05 00 00 wcsr IE,r5 pending_events = api->pending_events; 800ef60: 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 ); 800ef64: a0 28 28 00 and r5,r1,r8 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 800ef68: 44 a0 00 04 be r5,r0,800ef78 <_Event_Seize+0x50> 800ef6c: 44 25 00 2b be r1,r5,800f018 <_Event_Seize+0xf0> 800ef70: 20 49 00 02 andi r9,r2,0x2 800ef74: 5d 20 00 29 bne r9,r0,800f018 <_Event_Seize+0xf0> <== ALWAYS TAKEN _ISR_Enable( level ); *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 800ef78: 20 47 00 01 andi r7,r2,0x1 800ef7c: 5c e0 00 1e bne r7,r0,800eff4 <_Event_Seize+0xcc> */ 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; 800ef80: 78 0c 08 02 mvhi r12,0x802 800ef84: 39 8c 72 ec ori r12,r12,0x72ec * * 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; executing->Wait.count = (uint32_t) event_in; 800ef88: 59 61 00 24 sw (r11+36),r1 executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800ef8c: 34 01 00 01 mvi r1,1 * 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; 800ef90: 59 62 00 30 sw (r11+48),r2 executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; 800ef94: 59 64 00 28 sw (r11+40),r4 _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800ef98: 59 81 00 00 sw (r12+0),r1 _ISR_Enable( level ); 800ef9c: d0 06 00 00 wcsr IE,r6 if ( ticks ) { 800efa0: 34 04 00 00 mvi r4,0 800efa4: 5c 64 00 2d bne r3,r4,800f058 <_Event_Seize+0x130> NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 800efa8: b9 60 08 00 mv r1,r11 800efac: 34 02 01 00 mvi r2,256 800efb0: fb ff e2 bc calli 8007aa0 <_Thread_Set_state> _ISR_Disable( level ); 800efb4: 90 00 18 00 rcsr r3,IE 800efb8: 34 01 ff fe mvi r1,-2 800efbc: a0 61 08 00 and r1,r3,r1 800efc0: d0 01 00 00 wcsr IE,r1 sync_state = _Event_Sync_state; 800efc4: 29 81 00 00 lw r1,(r12+0) _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 800efc8: 34 02 00 00 mvi r2,0 800efcc: 59 82 00 00 sw (r12+0),r2 if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 800efd0: 34 02 00 01 mvi r2,1 800efd4: 44 22 00 1b be r1,r2,800f040 <_Event_Seize+0x118> * 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 ); 800efd8: b9 60 10 00 mv r2,r11 800efdc: f8 00 06 13 calli 8010828 <_Thread_blocking_operation_Cancel> } 800efe0: 2b 9d 00 04 lw ra,(sp+4) 800efe4: 2b 8b 00 0c lw r11,(sp+12) 800efe8: 2b 8c 00 08 lw r12,(sp+8) 800efec: 37 9c 00 0c addi sp,sp,12 800eff0: c3 a0 00 00 ret *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { _ISR_Enable( level ); 800eff4: d0 06 00 00 wcsr IE,r6 executing->Wait.return_code = RTEMS_UNSATISFIED; 800eff8: 34 01 00 0d mvi r1,13 800effc: 59 61 00 34 sw (r11+52),r1 *event_out = seized_events; 800f000: 58 85 00 00 sw (r4+0),r5 * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 800f004: 2b 9d 00 04 lw ra,(sp+4) 800f008: 2b 8b 00 0c lw r11,(sp+12) 800f00c: 2b 8c 00 08 lw r12,(sp+8) 800f010: 37 9c 00 0c addi sp,sp,12 800f014: c3 a0 00 00 ret pending_events = api->pending_events; seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 800f018: a4 a0 08 00 not r1,r5 800f01c: a0 28 40 00 and r8,r1,r8 800f020: 58 e8 00 00 sw (r7+0),r8 _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 800f024: d0 06 00 00 wcsr IE,r6 *event_out = seized_events; 800f028: 58 85 00 00 sw (r4+0),r5 * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 800f02c: 2b 9d 00 04 lw ra,(sp+4) 800f030: 2b 8b 00 0c lw r11,(sp+12) 800f034: 2b 8c 00 08 lw r12,(sp+8) 800f038: 37 9c 00 0c addi sp,sp,12 800f03c: c3 a0 00 00 ret _ISR_Disable( level ); sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { _ISR_Enable( level ); 800f040: d0 03 00 00 wcsr IE,r3 * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 800f044: 2b 9d 00 04 lw ra,(sp+4) 800f048: 2b 8b 00 0c lw r11,(sp+12) 800f04c: 2b 8c 00 08 lw r12,(sp+8) 800f050: 37 9c 00 0c addi sp,sp,12 800f054: c3 a0 00 00 ret _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; _ISR_Enable( level ); if ( ticks ) { _Watchdog_Initialize( 800f058: 29 65 00 08 lw r5,(r11+8) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 800f05c: 78 02 08 00 mvhi r2,0x800 800f060: 38 42 f2 60 ori r2,r2,0xf260 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800f064: 78 01 08 02 mvhi r1,0x802 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 800f068: 59 62 00 64 sw (r11+100),r2 the_watchdog->id = id; 800f06c: 59 65 00 68 sw (r11+104),r5 the_watchdog->user_data = user_data; 800f070: 59 64 00 6c sw (r11+108),r4 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800f074: 59 63 00 54 sw (r11+84),r3 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 800f078: 59 64 00 50 sw (r11+80),r4 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800f07c: 38 21 6a 20 ori r1,r1,0x6a20 800f080: 35 62 00 48 addi r2,r11,72 800f084: fb ff e4 98 calli 80082e4 <_Watchdog_Insert> 800f088: e3 ff ff c8 bi 800efa8 <_Event_Seize+0x80> 0800f0f4 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 800f0f4: 37 9c ff f8 addi sp,sp,-8 800f0f8: 5b 8b 00 08 sw (sp+8),r11 800f0fc: 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 ]; 800f100: 28 25 01 28 lw r5,(r1+296) option_set = (rtems_option) the_thread->Wait.option; 800f104: 28 28 00 30 lw r8,(r1+48) */ void _Event_Surrender( Thread_Control *the_thread ) { 800f108: 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 ); 800f10c: 90 00 08 00 rcsr r1,IE 800f110: 34 07 ff fe mvi r7,-2 800f114: a0 27 38 00 and r7,r1,r7 800f118: d0 07 00 00 wcsr IE,r7 pending_events = api->pending_events; 800f11c: 28 a6 00 00 lw r6,(r5+0) event_condition = (rtems_event_set) the_thread->Wait.count; 800f120: 29 64 00 24 lw r4,(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 ); 800f124: a0 86 10 00 and r2,r4,r6 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 800f128: 44 40 00 29 be r2,r0,800f1cc <_Event_Surrender+0xd8> /* * 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() && 800f12c: 78 03 08 02 mvhi r3,0x802 800f130: 38 63 69 dc ori r3,r3,0x69dc 800f134: 28 63 00 00 lw r3,(r3+0) 800f138: 44 60 00 05 be r3,r0,800f14c <_Event_Surrender+0x58> 800f13c: 78 03 08 02 mvhi r3,0x802 800f140: 38 63 6a 00 ori r3,r3,0x6a00 800f144: 28 63 00 00 lw r3,(r3+0) 800f148: 45 63 00 30 be r11,r3,800f208 <_Event_Surrender+0x114> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 800f14c: 29 63 00 10 lw r3,(r11+16) 800f150: 20 63 01 00 andi r3,r3,0x100 800f154: 44 60 00 19 be r3,r0,800f1b8 <_Event_Surrender+0xc4> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 800f158: 44 82 00 03 be r4,r2,800f164 <_Event_Surrender+0x70> 800f15c: 21 08 00 02 andi r8,r8,0x2 800f160: 45 00 00 16 be r8,r0,800f1b8 <_Event_Surrender+0xc4> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 800f164: a4 40 18 00 not r3,r2 800f168: a0 66 30 00 and r6,r3,r6 the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800f16c: 29 64 00 28 lw r4,(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 ); 800f170: 58 a6 00 00 sw (r5+0),r6 the_thread->Wait.count = 0; 800f174: 34 03 00 00 mvi r3,0 800f178: 59 63 00 24 sw (r11+36),r3 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800f17c: 58 82 00 00 sw (r4+0),r2 _ISR_Flash( level ); 800f180: d0 01 00 00 wcsr IE,r1 800f184: d0 07 00 00 wcsr IE,r7 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 800f188: 29 63 00 50 lw r3,(r11+80) 800f18c: 34 02 00 02 mvi r2,2 800f190: 44 62 00 14 be r3,r2,800f1e0 <_Event_Surrender+0xec> _ISR_Enable( level ); 800f194: d0 01 00 00 wcsr IE,r1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800f198: 78 02 10 03 mvhi r2,0x1003 800f19c: b9 60 08 00 mv r1,r11 800f1a0: 38 42 ff f8 ori r2,r2,0xfff8 800f1a4: f8 00 05 b9 calli 8010888 <_Thread_Clear_state> } return; } } _ISR_Enable( level ); } 800f1a8: 2b 9d 00 04 lw ra,(sp+4) 800f1ac: 2b 8b 00 08 lw r11,(sp+8) 800f1b0: 37 9c 00 08 addi sp,sp,8 800f1b4: c3 a0 00 00 ret _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 800f1b8: d0 01 00 00 wcsr IE,r1 } 800f1bc: 2b 9d 00 04 lw ra,(sp+4) 800f1c0: 2b 8b 00 08 lw r11,(sp+8) 800f1c4: 37 9c 00 08 addi sp,sp,8 800f1c8: c3 a0 00 00 ret /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { _ISR_Enable( level ); 800f1cc: d0 01 00 00 wcsr IE,r1 } return; } } _ISR_Enable( level ); } 800f1d0: 2b 9d 00 04 lw ra,(sp+4) 800f1d4: 2b 8b 00 08 lw r11,(sp+8) 800f1d8: 37 9c 00 08 addi sp,sp,8 800f1dc: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800f1e0: 34 02 00 03 mvi r2,3 800f1e4: 59 62 00 50 sw (r11+80),r2 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800f1e8: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 800f1ec: 35 61 00 48 addi r1,r11,72 800f1f0: fb ff e4 a4 calli 8008480 <_Watchdog_Remove> 800f1f4: 78 02 10 03 mvhi r2,0x1003 800f1f8: b9 60 08 00 mv r1,r11 800f1fc: 38 42 ff f8 ori r2,r2,0xfff8 800f200: f8 00 05 a2 calli 8010888 <_Thread_Clear_state> 800f204: e3 ff ff ee bi 800f1bc <_Event_Surrender+0xc8> * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800f208: 78 03 08 02 mvhi r3,0x802 800f20c: 38 63 72 ec ori r3,r3,0x72ec 800f210: 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() && 800f214: 34 09 00 02 mvi r9,2 800f218: 45 49 00 04 be r10,r9,800f228 <_Event_Surrender+0x134> <== NEVER TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 800f21c: 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() && 800f220: 34 09 00 01 mvi r9,1 800f224: 5d 49 ff ca bne r10,r9,800f14c <_Event_Surrender+0x58> <== 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) ) { 800f228: 44 82 00 03 be r4,r2,800f234 <_Event_Surrender+0x140> <== ALWAYS TAKEN 800f22c: 21 08 00 02 andi r8,r8,0x2 <== NOT EXECUTED 800f230: 45 00 00 0a be r8,r0,800f258 <_Event_Surrender+0x164> <== NOT EXECUTED api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 800f234: a4 40 20 00 not r4,r2 800f238: a0 86 30 00 and r6,r4,r6 the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800f23c: 29 64 00 28 lw r4,(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 ); 800f240: 58 a6 00 00 sw (r5+0),r6 the_thread->Wait.count = 0; 800f244: 34 05 00 00 mvi r5,0 800f248: 59 65 00 24 sw (r11+36),r5 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800f24c: 58 82 00 00 sw (r4+0),r2 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 800f250: 34 02 00 03 mvi r2,3 800f254: 58 62 00 00 sw (r3+0),r2 } _ISR_Enable( level ); 800f258: d0 01 00 00 wcsr IE,r1 return; 800f25c: e3 ff ff d8 bi 800f1bc <_Event_Surrender+0xc8> 0800f260 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 800f260: 37 9c ff f8 addi sp,sp,-8 800f264: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 800f268: 37 82 00 08 addi r2,sp,8 800f26c: fb ff df 1f calli 8006ee8 <_Thread_Get> switch ( location ) { 800f270: 2b 82 00 08 lw r2,(sp+8) 800f274: 44 40 00 04 be r2,r0,800f284 <_Event_Timeout+0x24> <== ALWAYS TAKEN case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800f278: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800f27c: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 800f280: c3 a0 00 00 ret <== NOT EXECUTED * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 800f284: 90 00 18 00 rcsr r3,IE 800f288: 34 02 ff fe mvi r2,-2 800f28c: a0 62 10 00 and r2,r3,r2 800f290: d0 02 00 00 wcsr IE,r2 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800f294: 78 02 08 02 mvhi r2,0x802 800f298: 38 42 6a 00 ori r2,r2,0x6a00 800f29c: 28 42 00 00 lw r2,(r2+0) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800f2a0: 34 04 00 00 mvi r4,0 800f2a4: 58 24 00 24 sw (r1+36),r4 if ( _Thread_Is_executing( the_thread ) ) { 800f2a8: 44 22 00 0f be r1,r2,800f2e4 <_Event_Timeout+0x84> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800f2ac: 34 02 00 06 mvi r2,6 800f2b0: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800f2b4: d0 03 00 00 wcsr IE,r3 800f2b8: 78 02 10 03 mvhi r2,0x1003 800f2bc: 38 42 ff f8 ori r2,r2,0xfff8 800f2c0: f8 00 05 72 calli 8010888 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800f2c4: 78 01 08 02 mvhi r1,0x802 800f2c8: 38 21 69 44 ori r1,r1,0x6944 800f2cc: 28 22 00 00 lw r2,(r1+0) 800f2d0: 34 42 ff ff addi r2,r2,-1 800f2d4: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800f2d8: 2b 9d 00 04 lw ra,(sp+4) 800f2dc: 37 9c 00 08 addi sp,sp,8 800f2e0: c3 a0 00 00 ret } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800f2e4: 78 02 08 02 mvhi r2,0x802 800f2e8: 38 42 72 ec ori r2,r2,0x72ec 800f2ec: 28 45 00 00 lw r5,(r2+0) 800f2f0: 34 04 00 01 mvi r4,1 800f2f4: 5c a4 ff ee bne r5,r4,800f2ac <_Event_Timeout+0x4c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800f2f8: 34 04 00 02 mvi r4,2 800f2fc: 58 44 00 00 sw (r2+0),r4 800f300: e3 ff ff eb bi 800f2ac <_Event_Timeout+0x4c> 08009748 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 8009748: 37 9c ff bc addi sp,sp,-68 800974c: 5b 8b 00 44 sw (sp+68),r11 8009750: 5b 8c 00 40 sw (sp+64),r12 8009754: 5b 8d 00 3c sw (sp+60),r13 8009758: 5b 8e 00 38 sw (sp+56),r14 800975c: 5b 8f 00 34 sw (sp+52),r15 8009760: 5b 90 00 30 sw (sp+48),r16 8009764: 5b 91 00 2c sw (sp+44),r17 8009768: 5b 92 00 28 sw (sp+40),r18 800976c: 5b 93 00 24 sw (sp+36),r19 8009770: 5b 94 00 20 sw (sp+32),r20 8009774: 5b 95 00 1c sw (sp+28),r21 8009778: 5b 96 00 18 sw (sp+24),r22 800977c: 5b 97 00 14 sw (sp+20),r23 8009780: 5b 98 00 10 sw (sp+16),r24 8009784: 5b 99 00 0c sw (sp+12),r25 8009788: 5b 9b 00 08 sw (sp+8),fp 800978c: 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; 8009790: 34 53 00 04 addi r19,r2,4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 8009794: b8 40 68 00 mv r13,r2 8009798: b8 20 78 00 mv r15,r1 800979c: b8 60 88 00 mv r17,r3 80097a0: 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; 80097a4: 28 2b 00 08 lw r11,(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; 80097a8: 28 35 00 10 lw r21,(r1+16) uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 80097ac: 54 53 00 6a bgu r2,r19,8009954 <_Heap_Allocate_aligned_with_boundary+0x20c> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 80097b0: 5c 80 00 6b bne r4,r0,800995c <_Heap_Allocate_aligned_with_boundary+0x214> if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 80097b4: 34 10 00 00 mvi r16,0 80097b8: 45 eb 00 0d be r15,r11,80097ec <_Heap_Allocate_aligned_with_boundary+0xa4> 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; 80097bc: 34 1b 00 04 mvi fp,4 80097c0: cb 6d d8 00 sub fp,fp,r13 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; 80097c4: 34 19 ff fe mvi r25,-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; 80097c8: 36 b8 00 07 addi r24,r21,7 /* * 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 ) { 80097cc: 29 61 00 04 lw r1,(r11+4) while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 80097d0: 36 10 00 01 addi r16,r16,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 ) { 80097d4: 52 61 00 04 bgeu r19,r1,80097e4 <_Heap_Allocate_aligned_with_boundary+0x9c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 80097d8: 35 6c 00 08 addi r12,r11,8 if ( alignment == 0 ) { 80097dc: 5e 20 00 1b bne r17,r0,8009848 <_Heap_Allocate_aligned_with_boundary+0x100> boundary ); } } if ( alloc_begin != 0 ) { 80097e0: 5d 80 00 53 bne r12,r0,800992c <_Heap_Allocate_aligned_with_boundary+0x1e4><== ALWAYS TAKEN break; } block = block->next; 80097e4: 29 6b 00 08 lw r11,(r11+8) if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 80097e8: 5d eb ff f9 bne r15,r11,80097cc <_Heap_Allocate_aligned_with_boundary+0x84> 80097ec: 34 01 00 00 mvi r1,0 uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 80097f0: 29 e2 00 44 lw r2,(r15+68) 80097f4: 50 50 00 02 bgeu r2,r16,80097fc <_Heap_Allocate_aligned_with_boundary+0xb4> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 80097f8: 59 f0 00 44 sw (r15+68),r16 } return (void *) alloc_begin; } 80097fc: 2b 9d 00 04 lw ra,(sp+4) 8009800: 2b 8b 00 44 lw r11,(sp+68) 8009804: 2b 8c 00 40 lw r12,(sp+64) 8009808: 2b 8d 00 3c lw r13,(sp+60) 800980c: 2b 8e 00 38 lw r14,(sp+56) 8009810: 2b 8f 00 34 lw r15,(sp+52) 8009814: 2b 90 00 30 lw r16,(sp+48) 8009818: 2b 91 00 2c lw r17,(sp+44) 800981c: 2b 92 00 28 lw r18,(sp+40) 8009820: 2b 93 00 24 lw r19,(sp+36) 8009824: 2b 94 00 20 lw r20,(sp+32) 8009828: 2b 95 00 1c lw r21,(sp+28) 800982c: 2b 96 00 18 lw r22,(sp+24) 8009830: 2b 97 00 14 lw r23,(sp+20) 8009834: 2b 98 00 10 lw r24,(sp+16) 8009838: 2b 99 00 0c lw r25,(sp+12) 800983c: 2b 9b 00 08 lw fp,(sp+8) 8009840: 37 9c 00 44 addi sp,sp,68 8009844: c3 a0 00 00 ret 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; 8009848: a0 39 70 00 and r14,r1,r25 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 800984c: 29 f6 00 14 lw r22,(r15+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; 8009850: b5 6e 70 00 add r14,r11,r14 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; 8009854: b7 6e 60 00 add r12,fp,r14 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; 8009858: cb 16 18 00 sub r3,r24,r22 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800985c: b9 80 08 00 mv r1,r12 8009860: ba 20 10 00 mv r2,r17 8009864: b4 6e 70 00 add r14,r3,r14 8009868: f8 00 47 2b calli 801b514 <__umodsi3> 800986c: c9 81 60 00 sub r12,r12,r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 8009870: 35 77 00 08 addi r23,r11,8 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 8009874: 51 cc 00 05 bgeu r14,r12,8009888 <_Heap_Allocate_aligned_with_boundary+0x140> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009878: b9 c0 08 00 mv r1,r14 800987c: ba 20 10 00 mv r2,r17 8009880: f8 00 47 25 calli 801b514 <__umodsi3> 8009884: c9 c1 60 00 sub r12,r14,r1 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 8009888: 46 40 00 1c be r18,r0,80098f8 <_Heap_Allocate_aligned_with_boundary+0x1b0> /* 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; 800988c: b5 8d 70 00 add r14,r12,r13 8009890: b9 c0 08 00 mv r1,r14 8009894: ba 40 10 00 mv r2,r18 8009898: f8 00 47 1f calli 801b514 <__umodsi3> 800989c: c9 c1 28 00 sub r5,r14,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 ) { 80098a0: f5 c5 70 00 cmpgu r14,r14,r5 80098a4: f4 ac 08 00 cmpgu r1,r5,r12 80098a8: a1 c1 70 00 and r14,r14,r1 80098ac: 45 c0 00 13 be r14,r0,80098f8 <_Heap_Allocate_aligned_with_boundary+0x1b0> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 80098b0: b6 ed a0 00 add r20,r23,r13 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 80098b4: 56 85 ff cc bgu r20,r5,80097e4 <_Heap_Allocate_aligned_with_boundary+0x9c> 80098b8: e0 00 00 02 bi 80098c0 <_Heap_Allocate_aligned_with_boundary+0x178> 80098bc: 56 85 ff ca bgu r20,r5,80097e4 <_Heap_Allocate_aligned_with_boundary+0x9c><== NEVER TAKEN return 0; } alloc_begin = boundary_line - alloc_size; 80098c0: c8 ad 60 00 sub r12,r5,r13 80098c4: ba 20 10 00 mv r2,r17 80098c8: b9 80 08 00 mv r1,r12 80098cc: f8 00 47 12 calli 801b514 <__umodsi3> 80098d0: c9 81 60 00 sub r12,r12,r1 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 80098d4: b5 8d 70 00 add r14,r12,r13 80098d8: b9 c0 08 00 mv r1,r14 80098dc: ba 40 10 00 mv r2,r18 80098e0: f8 00 47 0d calli 801b514 <__umodsi3> 80098e4: c9 c1 28 00 sub r5,r14,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 ) { 80098e8: f5 c5 70 00 cmpgu r14,r14,r5 80098ec: f4 ac 08 00 cmpgu r1,r5,r12 80098f0: a1 c1 70 00 and r14,r14,r1 80098f4: 5d c0 ff f2 bne r14,r0,80098bc <_Heap_Allocate_aligned_with_boundary+0x174> 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 ) { 80098f8: 56 ec ff bb bgu r23,r12,80097e4 <_Heap_Allocate_aligned_with_boundary+0x9c> 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; 80098fc: 34 01 ff f8 mvi r1,-8 8009900: c8 2b 70 00 sub r14,r1,r11 8009904: ba a0 10 00 mv r2,r21 8009908: b9 80 08 00 mv r1,r12 800990c: b5 cc 70 00 add r14,r14,r12 8009910: f8 00 47 01 calli 801b514 <__umodsi3> 8009914: c9 c1 08 00 sub r1,r14,r1 if ( free_size >= min_block_size || free_size == 0 ) { 8009918: f0 36 b0 00 cmpgeu r22,r1,r22 800991c: 64 21 00 00 cmpei r1,r1,0 8009920: b8 36 08 00 or r1,r1,r22 8009924: 44 20 ff b0 be r1,r0,80097e4 <_Heap_Allocate_aligned_with_boundary+0x9c> boundary ); } } if ( alloc_begin != 0 ) { 8009928: 45 80 ff af be r12,r0,80097e4 <_Heap_Allocate_aligned_with_boundary+0x9c><== NEVER TAKEN block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 800992c: 29 e1 00 4c lw r1,(r15+76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 8009930: b9 60 10 00 mv r2,r11 8009934: b9 a0 20 00 mv r4,r13 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 8009938: b4 30 08 00 add r1,r1,r16 800993c: 59 e1 00 4c sw (r15+76),r1 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 8009940: b9 80 18 00 mv r3,r12 8009944: b9 e0 08 00 mv r1,r15 8009948: fb ff e7 21 calli 80035cc <_Heap_Block_allocate> 800994c: b9 80 08 00 mv r1,r12 8009950: e3 ff ff a8 bi 80097f0 <_Heap_Allocate_aligned_with_boundary+0xa8> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 8009954: 34 01 00 00 mvi r1,0 8009958: e3 ff ff a9 bi 80097fc <_Heap_Allocate_aligned_with_boundary+0xb4> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 800995c: 54 44 ff fe bgu r2,r4,8009954 <_Heap_Allocate_aligned_with_boundary+0x20c> return NULL; } if ( alignment == 0 ) { 8009960: 5c 60 ff 95 bne r3,r0,80097b4 <_Heap_Allocate_aligned_with_boundary+0x6c> 8009964: ba a0 88 00 mv r17,r21 8009968: e3 ff ff 93 bi 80097b4 <_Heap_Allocate_aligned_with_boundary+0x6c> 0800fa84 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800fa84: 37 9c ff e8 addi sp,sp,-24 800fa88: 5b 8b 00 14 sw (sp+20),r11 800fa8c: 5b 8c 00 10 sw (sp+16),r12 800fa90: 5b 8d 00 0c sw (sp+12),r13 800fa94: 5b 8e 00 08 sw (sp+8),r14 800fa98: 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; 800fa9c: 28 2c 00 18 lw r12,(r1+24) uintptr_t const heap_area_end = heap->area_end; 800faa0: 28 25 00 1c lw r5,(r1+28) Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 800faa4: 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; 800faa8: f0 4c 60 00 cmpgeu r12,r2,r12 * 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 ) { 800faac: f4 a2 08 00 cmpgu r1,r5,r2 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; uintptr_t extend_size = 0; Heap_Block *const last_block = heap->last_block; 800fab0: 29 6d 00 24 lw r13,(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; 800fab4: a0 2c 60 00 and r12,r1,r12 800fab8: 34 01 00 01 mvi r1,1 800fabc: 5d 80 00 03 bne r12,r0,800fac8 <_Heap_Extend+0x44> * 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 ) { 800fac0: 34 01 00 02 mvi r1,2 800fac4: 44 45 00 08 be r2,r5,800fae4 <_Heap_Extend+0x60> _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); } return HEAP_EXTEND_SUCCESSFUL; } 800fac8: 2b 9d 00 04 lw ra,(sp+4) 800facc: 2b 8b 00 14 lw r11,(sp+20) 800fad0: 2b 8c 00 10 lw r12,(sp+16) 800fad4: 2b 8d 00 0c lw r13,(sp+12) 800fad8: 2b 8e 00 08 lw r14,(sp+8) 800fadc: 37 9c 00 18 addi sp,sp,24 800fae0: c3 a0 00 00 ret { 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; 800fae4: b4 43 18 00 add r3,r2,r3 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 800fae8: c8 6d 70 00 sub r14,r3,r13 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800faec: 29 62 00 10 lw r2,(r11+16) 800faf0: 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; 800faf4: 59 63 00 1c sw (r11+28),r3 800faf8: b9 c0 08 00 mv r1,r14 800fafc: 5b 84 00 18 sw (sp+24),r4 800fb00: fb ff d2 99 calli 8004564 <__umodsi3> 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; 800fb04: 2b 84 00 18 lw r4,(sp+24) 800fb08: c9 c1 08 00 sub r1,r14,r1 800fb0c: 58 81 00 00 sw (r4+0),r1 if( extend_size >= heap->min_block_size ) { 800fb10: 29 62 00 14 lw r2,(r11+20) 800fb14: 50 22 00 09 bgeu r1,r2,800fb38 <_Heap_Extend+0xb4> <== ALWAYS TAKEN /* Statistics */ stats->size += extend_size; ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 800fb18: b9 80 08 00 mv r1,r12 <== NOT EXECUTED } return HEAP_EXTEND_SUCCESSFUL; } 800fb1c: 2b 9d 00 04 lw ra,(sp+4) 800fb20: 2b 8b 00 14 lw r11,(sp+20) 800fb24: 2b 8c 00 10 lw r12,(sp+16) 800fb28: 2b 8d 00 0c lw r13,(sp+12) 800fb2c: 2b 8e 00 08 lw r14,(sp+8) 800fb30: 37 9c 00 18 addi sp,sp,24 800fb34: c3 a0 00 00 ret uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 800fb38: 29 a4 00 04 lw r4,(r13+4) if( extend_size >= heap->min_block_size ) { 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 = 800fb3c: 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); 800fb40: b4 2d 10 00 add r2,r1,r13 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 800fb44: 20 84 00 01 andi r4,r4,0x1 800fb48: b8 24 20 00 or r4,r1,r4 800fb4c: c8 62 18 00 sub r3,r3,r2 800fb50: 59 a4 00 04 sw (r13+4),r4 800fb54: 38 63 00 01 ori r3,r3,0x1 800fb58: 58 43 00 04 sw (r2+4),r3 | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 800fb5c: 29 65 00 2c lw r5,(r11+44) ++stats->used_blocks; 800fb60: 29 64 00 40 lw r4,(r11+64) --stats->frees; /* Do not count subsequent call as actual free() */ 800fb64: 29 63 00 50 lw r3,(r11+80) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 800fb68: b4 a1 08 00 add r1,r5,r1 ++stats->used_blocks; 800fb6c: 34 84 00 01 addi r4,r4,1 --stats->frees; /* Do not count subsequent call as actual free() */ 800fb70: 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; 800fb74: 59 62 00 24 sw (r11+36),r2 /* Statistics */ stats->size += extend_size; 800fb78: 59 61 00 2c sw (r11+44),r1 ++stats->used_blocks; 800fb7c: 59 64 00 40 sw (r11+64),r4 --stats->frees; /* Do not count subsequent call as actual free() */ 800fb80: 59 63 00 50 sw (r11+80),r3 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 800fb84: b9 60 08 00 mv r1,r11 800fb88: 35 a2 00 08 addi r2,r13,8 800fb8c: fb ff e3 6f calli 8008948 <_Heap_Free> 800fb90: b9 80 08 00 mv r1,r12 800fb94: e3 ff ff e2 bi 800fb1c <_Heap_Extend+0x98> 0800996c <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 800996c: 37 9c ff f4 addi sp,sp,-12 8009970: 5b 8b 00 0c sw (sp+12),r11 8009974: 5b 8c 00 08 sw (sp+8),r12 8009978: 5b 9d 00 04 sw (sp+4),ra 800997c: 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 ) 8009980: 28 22 00 10 lw r2,(r1+16) 8009984: b8 20 58 00 mv r11,r1 8009988: b8 60 08 00 mv r1,r3 800998c: 34 6c ff f8 addi r12,r3,-8 8009990: f8 00 46 e1 calli 801b514 <__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; 8009994: 29 64 00 20 lw r4,(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 ) 8009998: 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 800999c: 54 81 00 2b bgu r4,r1,8009a48 <_Heap_Free+0xdc> && (uintptr_t) block <= (uintptr_t) heap->last_block; 80099a0: 29 63 00 24 lw r3,(r11+36) 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 80099a4: 54 23 00 29 bgu r1,r3,8009a48 <_Heap_Free+0xdc> - 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; 80099a8: 28 28 00 04 lw r8,(r1+4) 80099ac: 34 06 ff fe mvi r6,-2 80099b0: a1 06 28 00 and r5,r8,r6 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 80099b4: b4 25 10 00 add r2,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 80099b8: 54 82 00 24 bgu r4,r2,8009a48 <_Heap_Free+0xdc> <== NEVER TAKEN 80099bc: 54 43 00 23 bgu r2,r3,8009a48 <_Heap_Free+0xdc> <== 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; 80099c0: 28 47 00 04 lw r7,(r2+4) if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 80099c4: 20 e9 00 01 andi r9,r7,0x1 80099c8: 45 20 00 20 be r9,r0,8009a48 <_Heap_Free+0xdc> <== NEVER TAKEN - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 80099cc: a0 e6 38 00 and r7,r7,r6 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 80099d0: 34 06 00 00 mvi r6,0 80099d4: 44 62 00 05 be r3,r2,80099e8 <_Heap_Free+0x7c> #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 80099d8: b4 47 30 00 add r6,r2,r7 80099dc: 28 c6 00 04 lw r6,(r6+4) 80099e0: 20 c6 00 01 andi r6,r6,0x1 80099e4: 18 c6 00 01 xori r6,r6,0x1 next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 80099e8: 21 08 00 01 andi r8,r8,0x1 80099ec: 5d 00 00 1d bne r8,r0,8009a60 <_Heap_Free+0xf4> uintptr_t const prev_size = block->prev_size; 80099f0: 28 28 00 00 lw r8,(r1+0) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 80099f4: c8 28 08 00 sub r1,r1,r8 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 80099f8: 54 81 00 14 bgu r4,r1,8009a48 <_Heap_Free+0xdc> <== NEVER TAKEN 80099fc: 54 23 00 13 bgu r1,r3,8009a48 <_Heap_Free+0xdc> <== 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) ) { 8009a00: 28 23 00 04 lw r3,(r1+4) 8009a04: 20 63 00 01 andi r3,r3,0x1 8009a08: 44 60 00 10 be r3,r0,8009a48 <_Heap_Free+0xdc> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 8009a0c: 44 c0 00 43 be r6,r0,8009b18 <_Heap_Free+0x1ac> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 8009a10: 29 64 00 38 lw r4,(r11+56) } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 8009a14: 28 43 00 0c lw r3,(r2+12) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 8009a18: b4 a7 38 00 add r7,r5,r7 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 8009a1c: 28 42 00 08 lw r2,(r2+8) 8009a20: b4 e8 40 00 add r8,r7,r8 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 8009a24: 34 84 ff ff addi r4,r4,-1 8009a28: 59 64 00 38 sw (r11+56),r4 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; 8009a2c: b4 28 30 00 add r6,r1,r8 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; 8009a30: 39 04 00 01 ori r4,r8,0x1 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 8009a34: 58 43 00 0c sw (r2+12),r3 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 8009a38: 58 c8 00 00 sw (r6+0),r8 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; 8009a3c: 58 24 00 04 sw (r1+4),r4 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 8009a40: 58 62 00 08 sw (r3+8),r2 8009a44: e0 00 00 13 bi 8009a90 <_Heap_Free+0x124> /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); 8009a48: 34 01 00 00 mvi r1,0 } 8009a4c: 2b 9d 00 04 lw ra,(sp+4) 8009a50: 2b 8b 00 0c lw r11,(sp+12) 8009a54: 2b 8c 00 08 lw r12,(sp+8) 8009a58: 37 9c 00 0c addi sp,sp,12 8009a5c: c3 a0 00 00 ret uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 8009a60: 44 c0 00 1b be r6,r0,8009acc <_Heap_Free+0x160> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 8009a64: 28 43 00 0c lw r3,(r2+12) RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 8009a68: 28 42 00 08 lw r2,(r2+8) uintptr_t const size = block_size + next_block_size; 8009a6c: b4 e5 38 00 add r7,r7,r5 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; 8009a70: 58 23 00 0c sw (r1+12),r3 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 8009a74: 58 22 00 08 sw (r1+8),r2 _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; 8009a78: b4 27 30 00 add r6,r1,r7 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; 8009a7c: 38 e4 00 01 ori r4,r7,0x1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 8009a80: 58 c7 00 00 sw (r6+0),r7 new_block->prev = prev; next->prev = new_block; 8009a84: 58 41 00 0c sw (r2+12),r1 prev->next = new_block; 8009a88: 58 61 00 08 sw (r3+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; 8009a8c: 58 24 00 04 sw (r1+4),r4 } } /* Statistics */ --stats->used_blocks; ++stats->frees; 8009a90: 29 61 00 50 lw r1,(r11+80) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 8009a94: 29 62 00 40 lw r2,(r11+64) ++stats->frees; stats->free_size += block_size; 8009a98: 29 63 00 30 lw r3,(r11+48) } } /* Statistics */ --stats->used_blocks; ++stats->frees; 8009a9c: 34 21 00 01 addi r1,r1,1 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 8009aa0: 34 42 ff ff addi r2,r2,-1 ++stats->frees; stats->free_size += block_size; 8009aa4: b4 65 28 00 add r5,r3,r5 } } /* Statistics */ --stats->used_blocks; ++stats->frees; 8009aa8: 59 61 00 50 sw (r11+80),r1 stats->free_size += block_size; 8009aac: 34 01 00 01 mvi r1,1 8009ab0: 59 65 00 30 sw (r11+48),r5 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 8009ab4: 59 62 00 40 sw (r11+64),r2 ++stats->frees; stats->free_size += block_size; return( true ); } 8009ab8: 2b 9d 00 04 lw ra,(sp+4) 8009abc: 2b 8b 00 0c lw r11,(sp+12) 8009ac0: 2b 8c 00 08 lw r12,(sp+8) 8009ac4: 37 9c 00 0c addi sp,sp,12 8009ac8: c3 a0 00 00 ret next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 8009acc: 38 a3 00 01 ori r3,r5,0x1 8009ad0: 58 23 00 04 sw (r1+4),r3 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8009ad4: 28 44 00 04 lw r4,(r2+4) 8009ad8: 34 03 ff fe mvi r3,-2 next_block->prev_size = block_size; 8009adc: 58 45 00 00 sw (r2+0),r5 } 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; 8009ae0: a0 83 18 00 and r3,r4,r3 8009ae4: 58 43 00 04 sw (r2+4),r3 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 8009ae8: 29 62 00 38 lw r2,(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; 8009aec: 29 63 00 08 lw r3,(r11+8) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 8009af0: 29 64 00 3c lw r4,(r11+60) new_block->next = next; new_block->prev = block_before; 8009af4: 58 2b 00 0c sw (r1+12),r11 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 8009af8: 58 23 00 08 sw (r1+8),r3 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; 8009afc: 34 42 00 01 addi r2,r2,1 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 8009b00: 58 61 00 0c sw (r3+12),r1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 8009b04: 59 61 00 08 sw (r11+8),r1 8009b08: 59 62 00 38 sw (r11+56),r2 #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 8009b0c: 50 82 ff e1 bgeu r4,r2,8009a90 <_Heap_Free+0x124> 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; 8009b10: 59 62 00 3c sw (r11+60),r2 8009b14: e3 ff ff df bi 8009a90 <_Heap_Free+0x124> prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 8009b18: b4 a8 40 00 add r8,r5,r8 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8009b1c: 39 03 00 01 ori r3,r8,0x1 8009b20: 58 23 00 04 sw (r1+4),r3 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8009b24: 28 43 00 04 lw r3,(r2+4) 8009b28: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 8009b2c: 58 48 00 00 sw (r2+0),r8 _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; 8009b30: a0 61 08 00 and r1,r3,r1 8009b34: 58 41 00 04 sw (r2+4),r1 8009b38: e3 ff ff d6 bi 8009a90 <_Heap_Free+0x124> 0802e7c0 <_Heap_Get_free_information>: return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 802e7c0: 28 23 00 08 lw r3,(r1+8) ) { Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; 802e7c4: 34 07 00 00 mvi r7,0 802e7c8: 58 47 00 00 sw (r2+0),r7 info->largest = 0; 802e7cc: 58 47 00 04 sw (r2+4),r7 info->total = 0; 802e7d0: 58 47 00 08 sw (r2+8),r7 for(the_block = _Heap_Free_list_first(the_heap); 802e7d4: 44 23 00 10 be r1,r3,802e814 <_Heap_Get_free_information+0x54><== NEVER TAKEN 802e7d8: 34 05 00 01 mvi r5,1 802e7dc: b8 e0 30 00 mv r6,r7 - 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; 802e7e0: 34 09 ff fe mvi r9,-2 802e7e4: 28 64 00 04 lw r4,(r3+4) the_block != tail; the_block = the_block->next) 802e7e8: b8 a0 40 00 mv r8,r5 802e7ec: 34 a5 00 01 addi r5,r5,1 802e7f0: a0 89 20 00 and r4,r4,r9 /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; info->total += the_size; 802e7f4: b4 c4 30 00 add r6,r6,r4 802e7f8: 50 e4 00 02 bgeu r7,r4,802e800 <_Heap_Get_free_information+0x40> 802e7fc: b8 80 38 00 mv r7,r4 info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) 802e800: 28 63 00 08 lw r3,(r3+8) info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); 802e804: 5c 23 ff f8 bne r1,r3,802e7e4 <_Heap_Get_free_information+0x24> 802e808: 58 47 00 04 sw (r2+4),r7 802e80c: 58 48 00 00 sw (r2+0),r8 802e810: 58 46 00 08 sw (r2+8),r6 802e814: c3 a0 00 00 ret 080428d8 <_Heap_Get_information>: void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 80428d8: 37 9c ff f8 addi sp,sp,-8 80428dc: 5b 8b 00 08 sw (sp+8),r11 80428e0: 5b 8c 00 04 sw (sp+4),r12 Heap_Block *the_block = the_heap->first_block; Heap_Block *const end = the_heap->last_block; 80428e4: 28 29 00 24 lw r9,(r1+36) void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { Heap_Block *the_block = the_heap->first_block; 80428e8: 28 26 00 20 lw r6,(r1+32) Heap_Block *const end = the_heap->last_block; _HAssert(the_block->prev_size == the_heap->page_size); _HAssert(_Heap_Is_prev_used(the_block)); the_info->Free.number = 0; 80428ec: 34 01 00 00 mvi r1,0 the_info->Free.total = 0; the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; 80428f0: 58 41 00 10 sw (r2+16),r1 Heap_Block *const end = the_heap->last_block; _HAssert(the_block->prev_size == the_heap->page_size); _HAssert(_Heap_Is_prev_used(the_block)); the_info->Free.number = 0; 80428f4: 58 41 00 00 sw (r2+0),r1 the_info->Free.total = 0; 80428f8: 58 41 00 08 sw (r2+8),r1 the_info->Free.largest = 0; 80428fc: 58 41 00 04 sw (r2+4),r1 the_info->Used.number = 0; 8042900: 58 41 00 0c sw (r2+12),r1 the_info->Used.total = 0; 8042904: 58 41 00 14 sw (r2+20),r1 the_info->Used.largest = 0; while ( the_block != end ) { 8042908: 34 01 00 08 mvi r1,8 804290c: 44 c9 00 18 be r6,r9,804296c <_Heap_Get_information+0x94> <== NEVER TAKEN 8042910: 28 c5 00 04 lw r5,(r6+4) uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) info = &the_info->Used; 8042914: 34 4b 00 0c addi r11,r2,12 - 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; 8042918: 34 0a ff fe mvi r10,-2 804291c: a0 aa 18 00 and r3,r5,r10 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8042920: b4 c3 20 00 add r4,r6,r3 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; 8042924: 28 85 00 04 lw r5,(r4+4) while ( the_block != end ) { uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) 8042928: b9 60 08 00 mv r1,r11 info = &the_info->Free; info->number++; info->total += the_size; if ( info->largest < the_size ) info->largest = the_size; 804292c: b8 80 30 00 mv r6,r4 while ( the_block != end ) { uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) 8042930: 20 a7 00 01 andi r7,r5,0x1 8042934: 5c e0 00 02 bne r7,r0,804293c <_Heap_Get_information+0x64> 8042938: b8 40 08 00 mv r1,r2 info = &the_info->Used; else info = &the_info->Free; info->number++; 804293c: 28 28 00 00 lw r8,(r1+0) info->total += the_size; 8042940: 28 27 00 08 lw r7,(r1+8) if ( info->largest < the_size ) 8042944: 28 2c 00 04 lw r12,(r1+4) if ( _Heap_Is_prev_used(next_block) ) info = &the_info->Used; else info = &the_info->Free; info->number++; 8042948: 35 08 00 01 addi r8,r8,1 info->total += the_size; 804294c: b4 e3 38 00 add r7,r7,r3 if ( _Heap_Is_prev_used(next_block) ) info = &the_info->Used; else info = &the_info->Free; info->number++; 8042950: 58 28 00 00 sw (r1+0),r8 info->total += the_size; 8042954: 58 27 00 08 sw (r1+8),r7 if ( info->largest < the_size ) 8042958: 51 83 00 02 bgeu r12,r3,8042960 <_Heap_Get_information+0x88> info->largest = the_size; 804295c: 58 23 00 04 sw (r1+4),r3 the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 8042960: 5d 24 ff ef bne r9,r4,804291c <_Heap_Get_information+0x44> 8042964: 28 41 00 14 lw r1,(r2+20) 8042968: 34 21 00 08 addi r1,r1,8 /* * Handle the last dummy block. Don't consider this block to be * "used" as client never allocated it. Make 'Used.total' contain this * blocks' overhead though. */ the_info->Used.total += HEAP_BLOCK_HEADER_SIZE; 804296c: 58 41 00 14 sw (r2+20),r1 } 8042970: 2b 8b 00 08 lw r11,(sp+8) 8042974: 2b 8c 00 04 lw r12,(sp+4) 8042978: 37 9c 00 08 addi sp,sp,8 804297c: c3 a0 00 00 ret 0801bf9c <_Heap_Resize_block>: void *alloc_begin_ptr, uintptr_t new_alloc_size, uintptr_t *old_size, uintptr_t *new_size ) { 801bf9c: 37 9c ff e8 addi sp,sp,-24 801bfa0: 5b 8b 00 18 sw (sp+24),r11 801bfa4: 5b 8c 00 14 sw (sp+20),r12 801bfa8: 5b 8d 00 10 sw (sp+16),r13 801bfac: 5b 8e 00 0c sw (sp+12),r14 801bfb0: 5b 8f 00 08 sw (sp+8),r15 801bfb4: 5b 9d 00 04 sw (sp+4),ra 801bfb8: 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 ) 801bfbc: 28 22 00 10 lw r2,(r1+16) 801bfc0: b8 20 58 00 mv r11,r1 801bfc4: b9 80 08 00 mv r1,r12 801bfc8: b8 80 70 00 mv r14,r4 801bfcc: b8 a0 68 00 mv r13,r5 801bfd0: b8 60 78 00 mv r15,r3 801bfd4: fb ff fd 50 calli 801b514 <__umodsi3> uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *const block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); *old_size = 0; 801bfd8: 34 02 00 00 mvi r2,0 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 801bfdc: 29 63 00 20 lw r3,(r11+32) 801bfe0: 59 c2 00 00 sw (r14+0),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 ) 801bfe4: 35 86 ff f8 addi r6,r12,-8 801bfe8: c8 c1 30 00 sub r6,r6,r1 *new_size = 0; 801bfec: 59 a2 00 00 sw (r13+0),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 801bff0: 54 66 00 1b bgu r3,r6,801c05c <_Heap_Resize_block+0xc0> <== NEVER TAKEN 801bff4: 29 61 00 24 lw r1,(r11+36) 801bff8: 54 c1 00 19 bgu r6,r1,801c05c <_Heap_Resize_block+0xc0> <== NEVER TAKEN - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 801bffc: 28 c5 00 04 lw r5,(r6+4) 801c000: 34 03 ff fe mvi r3,-2 801c004: a0 a3 28 00 and r5,r5,r3 { Heap_Statistics *const stats = &heap->stats; uintptr_t const block_begin = (uintptr_t) block; uintptr_t block_size = _Heap_Block_size( block ); uintptr_t block_end = block_begin + block_size; 801c008: b4 c5 10 00 add r2,r6,r5 801c00c: 28 44 00 04 lw r4,(r2+4) uintptr_t alloc_size = block_end - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 801c010: c8 4c 08 00 sub r1,r2,r12 801c014: 34 21 00 04 addi r1,r1,4 801c018: a0 83 18 00 and r3,r4,r3 RTEMS_INLINE_ROUTINE bool _Heap_Is_free( const Heap_Block *block ) { return !_Heap_Is_used( block ); 801c01c: b4 43 20 00 add r4,r2,r3 801c020: 28 84 00 04 lw r4,(r4+4) bool next_block_is_free = _Heap_Is_free( next_block );; _HAssert( _Heap_Is_block_in_heap( heap, next_block ) ); _HAssert( _Heap_Is_prev_used( next_block ) ); *old_size = alloc_size; 801c024: 59 c1 00 00 sw (r14+0),r1 801c028: 20 84 00 01 andi r4,r4,0x1 801c02c: 18 84 00 01 xori r4,r4,0x1 if ( next_block_is_free ) { 801c030: 5c 80 00 14 bne r4,r0,801c080 <_Heap_Resize_block+0xe4> block_size += next_block_size; alloc_size += next_block_size; } if ( new_alloc_size > alloc_size ) { 801c034: 50 2f 00 16 bgeu r1,r15,801c08c <_Heap_Resize_block+0xf0> 801c038: 34 01 00 01 mvi r1,1 new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; } } 801c03c: 2b 9d 00 04 lw ra,(sp+4) 801c040: 2b 8b 00 18 lw r11,(sp+24) 801c044: 2b 8c 00 14 lw r12,(sp+20) 801c048: 2b 8d 00 10 lw r13,(sp+16) 801c04c: 2b 8e 00 0c lw r14,(sp+12) 801c050: 2b 8f 00 08 lw r15,(sp+8) 801c054: 37 9c 00 18 addi sp,sp,24 801c058: c3 a0 00 00 ret block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; /* Statistics */ ++stats->resizes; 801c05c: 34 01 00 02 mvi r1,2 new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; } } 801c060: 2b 9d 00 04 lw ra,(sp+4) 801c064: 2b 8b 00 18 lw r11,(sp+24) 801c068: 2b 8c 00 14 lw r12,(sp+20) 801c06c: 2b 8d 00 10 lw r13,(sp+16) 801c070: 2b 8e 00 0c lw r14,(sp+12) 801c074: 2b 8f 00 08 lw r15,(sp+8) 801c078: 37 9c 00 18 addi sp,sp,24 801c07c: c3 a0 00 00 ret _HAssert( _Heap_Is_prev_used( next_block ) ); *old_size = alloc_size; if ( next_block_is_free ) { block_size += next_block_size; 801c080: b4 a3 28 00 add r5,r5,r3 alloc_size += next_block_size; 801c084: b4 23 08 00 add r1,r1,r3 801c088: e3 ff ff eb bi 801c034 <_Heap_Resize_block+0x98> if ( new_alloc_size > alloc_size ) { return HEAP_RESIZE_UNSATISFIED; } if ( next_block_is_free ) { 801c08c: 44 80 00 13 be r4,r0,801c0d8 <_Heap_Resize_block+0x13c> uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 801c090: 28 c7 00 04 lw r7,(r6+4) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 801c094: b4 a6 08 00 add r1,r5,r6 } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 801c098: 28 44 00 0c lw r4,(r2+12) uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 801c09c: 20 e7 00 01 andi r7,r7,0x1 801c0a0: b8 a7 28 00 or r5,r5,r7 801c0a4: 58 c5 00 04 sw (r6+4),r5 _Heap_Block_set_size( block, block_size ); _Heap_Free_list_remove( next_block ); next_block = _Heap_Block_at( block, block_size ); next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 801c0a8: 28 25 00 04 lw r5,(r1+4) return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 801c0ac: 28 42 00 08 lw r2,(r2+8) 801c0b0: 38 a5 00 01 ori r5,r5,0x1 801c0b4: 58 25 00 04 sw (r1+4),r5 /* Statistics */ --stats->free_blocks; 801c0b8: 29 61 00 38 lw r1,(r11+56) stats->free_size -= next_block_size; 801c0bc: 29 65 00 30 lw r5,(r11+48) Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 801c0c0: 58 44 00 0c sw (r2+12),r4 next_block = _Heap_Block_at( block, block_size ); next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; /* Statistics */ --stats->free_blocks; 801c0c4: 34 21 ff ff addi r1,r1,-1 stats->free_size -= next_block_size; 801c0c8: c8 a3 18 00 sub r3,r5,r3 next_block = _Heap_Block_at( block, block_size ); next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; /* Statistics */ --stats->free_blocks; 801c0cc: 59 61 00 38 sw (r11+56),r1 stats->free_size -= next_block_size; 801c0d0: 59 63 00 30 sw (r11+48),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; 801c0d4: 58 82 00 08 sw (r4+8),r2 } block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); 801c0d8: b8 c0 10 00 mv r2,r6 801c0dc: b9 e0 20 00 mv r4,r15 801c0e0: b9 80 18 00 mv r3,r12 801c0e4: b9 60 08 00 mv r1,r11 801c0e8: fb ff 9d 39 calli 80035cc <_Heap_Block_allocate> block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 801c0ec: 28 24 00 04 lw r4,(r1+4) 801c0f0: 34 03 ff fe mvi r3,-2 /* Statistics */ --stats->free_blocks; stats->free_size -= next_block_size; } block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); 801c0f4: b8 20 10 00 mv r2,r1 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 801c0f8: a0 83 18 00 and r3,r4,r3 801c0fc: 34 63 00 04 addi r3,r3,4 801c100: c8 6c 60 00 sub r12,r3,r12 801c104: b4 4c 10 00 add r2,r2,r12 801c108: 59 a2 00 00 sw (r13+0),r2 /* Statistics */ ++stats->resizes; 801c10c: 29 62 00 54 lw r2,(r11+84) 801c110: 34 01 00 00 mvi r1,0 801c114: 34 42 00 01 addi r2,r2,1 801c118: 59 62 00 54 sw (r11+84),r2 new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; } } 801c11c: 2b 9d 00 04 lw ra,(sp+4) 801c120: 2b 8b 00 18 lw r11,(sp+24) 801c124: 2b 8c 00 14 lw r12,(sp+20) 801c128: 2b 8d 00 10 lw r13,(sp+16) 801c12c: 2b 8e 00 0c lw r14,(sp+12) 801c130: 2b 8f 00 08 lw r15,(sp+8) 801c134: 37 9c 00 18 addi sp,sp,24 801c138: c3 a0 00 00 ret 0801c13c <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 801c13c: 37 9c ff f0 addi sp,sp,-16 801c140: 5b 8b 00 10 sw (sp+16),r11 801c144: 5b 8c 00 0c sw (sp+12),r12 801c148: 5b 8d 00 08 sw (sp+8),r13 801c14c: 5b 9d 00 04 sw (sp+4),ra 801c150: 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 ) 801c154: 28 22 00 10 lw r2,(r1+16) 801c158: b8 20 58 00 mv r11,r1 801c15c: b9 80 08 00 mv r1,r12 801c160: b8 60 68 00 mv r13,r3 801c164: fb ff fc ec calli 801b514 <__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; 801c168: 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 ) 801c16c: 35 84 ff f8 addi r4,r12,-8 801c170: 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 801c174: 54 44 00 16 bgu r2,r4,801c1cc <_Heap_Size_of_alloc_area+0x90> && (uintptr_t) block <= (uintptr_t) heap->last_block; 801c178: 29 61 00 24 lw r1,(r11+36) 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 801c17c: 54 81 00 14 bgu r4,r1,801c1cc <_Heap_Size_of_alloc_area+0x90><== NEVER TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 801c180: 28 85 00 04 lw r5,(r4+4) 801c184: 34 03 ff fe mvi r3,-2 801c188: a0 a3 18 00 and r3,r5,r3 801c18c: b4 83 20 00 add r4,r4,r3 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 801c190: 54 44 00 0f bgu r2,r4,801c1cc <_Heap_Size_of_alloc_area+0x90><== NEVER TAKEN 801c194: 54 81 00 0e bgu r4,r1,801c1cc <_Heap_Size_of_alloc_area+0x90><== NEVER TAKEN } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 801c198: 28 81 00 04 lw r1,(r4+4) 801c19c: 20 21 00 01 andi r1,r1,0x1 801c1a0: 44 20 00 0b be r1,r0,801c1cc <_Heap_Size_of_alloc_area+0x90><== NEVER TAKEN || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 801c1a4: c8 8c 20 00 sub r4,r4,r12 801c1a8: 34 84 00 04 addi r4,r4,4 801c1ac: 34 01 00 01 mvi r1,1 801c1b0: 59 a4 00 00 sw (r13+0),r4 return true; } 801c1b4: 2b 9d 00 04 lw ra,(sp+4) 801c1b8: 2b 8b 00 10 lw r11,(sp+16) 801c1bc: 2b 8c 00 0c lw r12,(sp+12) 801c1c0: 2b 8d 00 08 lw r13,(sp+8) 801c1c4: 37 9c 00 10 addi sp,sp,16 801c1c8: c3 a0 00 00 ret return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; return true; 801c1cc: 34 01 00 00 mvi r1,0 } 801c1d0: 2b 9d 00 04 lw ra,(sp+4) 801c1d4: 2b 8b 00 10 lw r11,(sp+16) 801c1d8: 2b 8c 00 0c lw r12,(sp+12) 801c1dc: 2b 8d 00 08 lw r13,(sp+8) 801c1e0: 37 9c 00 10 addi sp,sp,16 801c1e4: c3 a0 00 00 ret 08003f1c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8003f1c: 37 9c ff a8 addi sp,sp,-88 8003f20: 5b 8b 00 50 sw (sp+80),r11 8003f24: 5b 8c 00 4c sw (sp+76),r12 8003f28: 5b 8d 00 48 sw (sp+72),r13 8003f2c: 5b 8e 00 44 sw (sp+68),r14 8003f30: 5b 8f 00 40 sw (sp+64),r15 8003f34: 5b 90 00 3c sw (sp+60),r16 8003f38: 5b 91 00 38 sw (sp+56),r17 8003f3c: 5b 92 00 34 sw (sp+52),r18 8003f40: 5b 93 00 30 sw (sp+48),r19 8003f44: 5b 94 00 2c sw (sp+44),r20 8003f48: 5b 95 00 28 sw (sp+40),r21 8003f4c: 5b 96 00 24 sw (sp+36),r22 8003f50: 5b 97 00 20 sw (sp+32),r23 8003f54: 5b 98 00 1c sw (sp+28),r24 8003f58: 5b 99 00 18 sw (sp+24),r25 8003f5c: 5b 9b 00 14 sw (sp+20),fp 8003f60: 5b 9d 00 10 sw (sp+16),ra 8003f64: 20 63 00 ff andi r3,r3,0xff 8003f68: b8 20 58 00 mv r11,r1 8003f6c: b8 40 80 00 mv r16,r2 uintptr_t const page_size = heap->page_size; 8003f70: 28 32 00 10 lw r18,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8003f74: 28 33 00 14 lw r19,(r1+20) Heap_Block *const last_block = heap->last_block; 8003f78: 28 34 00 24 lw r20,(r1+36) Heap_Block *block = heap->first_block; 8003f7c: 28 2c 00 20 lw r12,(r1+32) Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8003f80: 5c 60 00 1c bne r3,r0,8003ff0 <_Heap_Walk+0xd4> if ( !_System_state_Is_up( _System_state_Get() ) ) { 8003f84: 78 03 08 02 mvhi r3,0x802 8003f88: 38 63 0a 88 ori r3,r3,0xa88 8003f8c: 28 63 00 00 lw r3,(r3+0) uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8003f90: 78 0f 08 00 mvhi r15,0x800 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8003f94: 34 02 00 03 mvi r2,3 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8003f98: 39 ef 3e f8 ori r15,r15,0x3ef8 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8003f9c: 44 62 00 1c be r3,r2,800400c <_Heap_Walk+0xf0> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 8003fa0: 34 01 00 01 mvi r1,1 block = next_block; } return true; } 8003fa4: 2b 9d 00 10 lw ra,(sp+16) 8003fa8: 2b 8b 00 50 lw r11,(sp+80) 8003fac: 2b 8c 00 4c lw r12,(sp+76) 8003fb0: 2b 8d 00 48 lw r13,(sp+72) 8003fb4: 2b 8e 00 44 lw r14,(sp+68) 8003fb8: 2b 8f 00 40 lw r15,(sp+64) 8003fbc: 2b 90 00 3c lw r16,(sp+60) 8003fc0: 2b 91 00 38 lw r17,(sp+56) 8003fc4: 2b 92 00 34 lw r18,(sp+52) 8003fc8: 2b 93 00 30 lw r19,(sp+48) 8003fcc: 2b 94 00 2c lw r20,(sp+44) 8003fd0: 2b 95 00 28 lw r21,(sp+40) 8003fd4: 2b 96 00 24 lw r22,(sp+36) 8003fd8: 2b 97 00 20 lw r23,(sp+32) 8003fdc: 2b 98 00 1c lw r24,(sp+28) 8003fe0: 2b 99 00 18 lw r25,(sp+24) 8003fe4: 2b 9b 00 14 lw fp,(sp+20) 8003fe8: 37 9c 00 58 addi sp,sp,88 8003fec: c3 a0 00 00 ret Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 8003ff0: 78 03 08 02 mvhi r3,0x802 8003ff4: 38 63 0a 88 ori r3,r3,0xa88 8003ff8: 28 63 00 00 lw r3,(r3+0) uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8003ffc: 78 0f 08 00 mvhi r15,0x800 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8004000: 34 02 00 03 mvi r2,3 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8004004: 39 ef 45 08 ori r15,r15,0x4508 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8004008: 5c 62 ff e6 bne r3,r2,8003fa0 <_Heap_Walk+0x84> <== 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)( 800400c: 29 61 00 08 lw r1,(r11+8) 8004010: 29 66 00 18 lw r6,(r11+24) 8004014: 29 67 00 1c lw r7,(r11+28) 8004018: 5b 81 00 08 sw (sp+8),r1 800401c: 29 61 00 0c lw r1,(r11+12) 8004020: 78 03 08 01 mvhi r3,0x801 8004024: 5b 94 00 04 sw (sp+4),r20 8004028: 5b 81 00 0c sw (sp+12),r1 800402c: 38 63 db c4 ori r3,r3,0xdbc4 8004030: ba 00 08 00 mv r1,r16 8004034: 34 02 00 00 mvi r2,0 8004038: ba 40 20 00 mv r4,r18 800403c: ba 60 28 00 mv r5,r19 8004040: b9 80 40 00 mv r8,r12 8004044: d9 e0 00 00 call r15 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 8004048: 46 40 00 d1 be r18,r0,800438c <_Heap_Walk+0x470> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 800404c: 22 4d 00 07 andi r13,r18,0x7 8004050: 5d a0 00 d6 bne r13,r0,80043a8 <_Heap_Walk+0x48c> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 8004054: ba 60 08 00 mv r1,r19 8004058: ba 40 10 00 mv r2,r18 800405c: fb ff f3 11 calli 8000ca0 <__umodsi3> 8004060: b8 20 88 00 mv r17,r1 8004064: 5c 2d 00 d9 bne r1,r13,80043c8 <_Heap_Walk+0x4ac> ); return false; } if ( 8004068: 35 81 00 08 addi r1,r12,8 800406c: ba 40 10 00 mv r2,r18 8004070: fb ff f3 0c calli 8000ca0 <__umodsi3> 8004074: b8 20 70 00 mv r14,r1 8004078: 5c 31 00 ee bne r1,r17,8004430 <_Heap_Walk+0x514> 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; 800407c: 29 8d 00 04 lw r13,(r12+4) ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8004080: 21 b1 00 01 andi r17,r13,0x1 8004084: 46 21 00 f3 be r17,r1,8004450 <_Heap_Walk+0x534> ); return false; } if ( first_block->prev_size != page_size ) { 8004088: 29 84 00 00 lw r4,(r12+0) 800408c: 5e 44 00 60 bne r18,r4,800420c <_Heap_Walk+0x2f0> ); return false; } if ( _Heap_Is_free( last_block ) ) { 8004090: 2a 82 00 04 lw r2,(r20+4) 8004094: 34 01 ff fe mvi r1,-2 8004098: a0 41 08 00 and r1,r2,r1 800409c: b6 81 08 00 add r1,r20,r1 80040a0: 28 35 00 04 lw r21,(r1+4) 80040a4: 22 b5 00 01 andi r21,r21,0x1 80040a8: 46 ae 00 f1 be r21,r14,800446c <_Heap_Walk+0x550> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 80040ac: 29 6e 00 08 lw r14,(r11+8) int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 80040b0: 29 78 00 10 lw r24,(r11+16) const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 80040b4: 45 6e 00 24 be r11,r14,8004144 <_Heap_Walk+0x228> 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; 80040b8: 29 76 00 20 lw r22,(r11+32) RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 80040bc: 56 ce 00 fb bgu r22,r14,80044a8 <_Heap_Walk+0x58c> <== NEVER TAKEN && (uintptr_t) block <= (uintptr_t) heap->last_block; 80040c0: 29 79 00 24 lw r25,(r11+36) 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 80040c4: 55 d9 00 f9 bgu r14,r25,80044a8 <_Heap_Walk+0x58c> <== NEVER TAKEN ); return false; } if ( 80040c8: 35 c1 00 08 addi r1,r14,8 80040cc: bb 00 10 00 mv r2,r24 80040d0: fb ff f2 f4 calli 8000ca0 <__umodsi3> 80040d4: 5c 20 00 ed bne r1,r0,8004488 <_Heap_Walk+0x56c> <== NEVER TAKEN ); return false; } if ( _Heap_Is_used( free_block ) ) { 80040d8: 29 c2 00 04 lw r2,(r14+4) 80040dc: 34 17 ff fe mvi r23,-2 80040e0: a0 57 10 00 and r2,r2,r23 80040e4: b5 c2 10 00 add r2,r14,r2 80040e8: 28 42 00 04 lw r2,(r2+4) 80040ec: 20 42 00 01 andi r2,r2,0x1 80040f0: 5c 41 00 fe bne r2,r1,80044e8 <_Heap_Walk+0x5cc> <== NEVER TAKEN ); return false; } if ( free_block->prev != prev_block ) { 80040f4: 29 c5 00 0c lw r5,(r14+12) 80040f8: 45 65 00 10 be r11,r5,8004138 <_Heap_Walk+0x21c> <== ALWAYS TAKEN 80040fc: e0 00 00 f3 bi 80044c8 <_Heap_Walk+0x5ac> <== NOT EXECUTED 8004100: 56 ce 00 ea bgu r22,r14,80044a8 <_Heap_Walk+0x58c> ); return false; } if ( 8004104: 35 c1 00 08 addi r1,r14,8 8004108: bb 00 10 00 mv r2,r24 800410c: 55 d9 00 e7 bgu r14,r25,80044a8 <_Heap_Walk+0x58c> <== NEVER TAKEN 8004110: fb ff f2 e4 calli 8000ca0 <__umodsi3> 8004114: 5c 20 00 dd bne r1,r0,8004488 <_Heap_Walk+0x56c> ); return false; } if ( _Heap_Is_used( free_block ) ) { 8004118: 29 c3 00 04 lw r3,(r14+4) 800411c: a0 77 18 00 and r3,r3,r23 8004120: b4 6e 18 00 add r3,r3,r14 8004124: 28 63 00 04 lw r3,(r3+4) 8004128: 20 63 00 01 andi r3,r3,0x1 800412c: 5c 61 00 ef bne r3,r1,80044e8 <_Heap_Walk+0x5cc> ); return false; } if ( free_block->prev != prev_block ) { 8004130: 29 c5 00 0c lw r5,(r14+12) 8004134: 5c b5 00 e5 bne r5,r21,80044c8 <_Heap_Walk+0x5ac> (*printer)( 8004138: b9 c0 a8 00 mv r21,r14 return false; } prev_block = free_block; free_block = free_block->next; 800413c: 29 ce 00 08 lw r14,(r14+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 ) { 8004140: 5d 6e ff f0 bne r11,r14,8004100 <_Heap_Walk+0x1e4> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 8004144: 46 8c ff 97 be r20,r12,8003fa0 <_Heap_Walk+0x84> <== NEVER TAKEN " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 8004148: 78 01 08 01 mvhi r1,0x801 800414c: 5b 81 00 54 sw (sp+84),r1 "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)" : ""), 8004150: 78 01 08 01 mvhi r1,0x801 8004154: 5b 81 00 58 sw (sp+88),r1 block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 8004158: 2b 81 00 54 lw r1,(sp+84) - 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; 800415c: 34 16 ff fe mvi r22,-2 8004160: 78 15 08 01 mvhi r21,0x801 8004164: 38 21 df 1c ori r1,r1,0xdf1c 8004168: 5b 81 00 54 sw (sp+84),r1 "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)" : ""), 800416c: 2b 81 00 58 lw r1,(sp+88) 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)( 8004170: 78 18 08 01 mvhi r24,0x801 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8004174: 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)" : ""), 8004178: 38 21 df 04 ori r1,r1,0xdf04 - 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; 800417c: a1 b6 68 00 and r13,r13,r22 8004180: 5b 81 00 58 sw (sp+88),r1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8004184: ba 20 10 00 mv r2,r17 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 8004188: 3a b5 df 8c ori r21,r21,0xdf8c 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)( 800418c: 3b 18 df 10 ori r24,r24,0xdf10 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8004190: 3a f7 de f8 ori r23,r23,0xdef8 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8004194: 78 1b 08 01 mvhi fp,0x801 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8004198: b5 ac 70 00 add r14,r13,r12 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 ) { 800419c: 44 40 00 59 be r2,r0,8004300 <_Heap_Walk+0x3e4> <== NEVER TAKEN (*printer)( 80041a0: 78 03 08 01 mvhi r3,0x801 80041a4: ba 00 08 00 mv r1,r16 80041a8: 34 02 00 00 mvi r2,0 80041ac: 38 63 dd f8 ori r3,r3,0xddf8 80041b0: b9 80 20 00 mv r4,r12 80041b4: b9 a0 28 00 mv r5,r13 80041b8: d9 e0 00 00 call r15 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 80041bc: 29 63 00 20 lw r3,(r11+32) 80041c0: 54 6e 00 8a bgu r3,r14,80043e8 <_Heap_Walk+0x4cc> <== NEVER TAKEN 80041c4: 29 61 00 24 lw r1,(r11+36) 80041c8: 55 c1 00 88 bgu r14,r1,80043e8 <_Heap_Walk+0x4cc> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 80041cc: b9 a0 08 00 mv r1,r13 80041d0: ba 40 10 00 mv r2,r18 80041d4: fb ff f2 b3 calli 8000ca0 <__umodsi3> 80041d8: b8 20 88 00 mv r17,r1 80041dc: 5c 20 00 8c bne r1,r0,800440c <_Heap_Walk+0x4f0> ); return false; } if ( block_size < min_block_size ) { 80041e0: 51 b3 00 13 bgeu r13,r19,800422c <_Heap_Walk+0x310> (*printer)( 80041e4: 78 03 08 01 mvhi r3,0x801 80041e8: ba 00 08 00 mv r1,r16 80041ec: 38 63 de 98 ori r3,r3,0xde98 80041f0: b9 80 20 00 mv r4,r12 80041f4: b9 a0 28 00 mv r5,r13 80041f8: ba 60 30 00 mv r6,r19 80041fc: 34 02 00 01 mvi r2,1 8004200: d9 e0 00 00 call r15 8004204: ba 20 08 00 mv r1,r17 block, block_size, min_block_size ); return false; 8004208: e3 ff ff 67 bi 8003fa4 <_Heap_Walk+0x88> return false; } if ( first_block->prev_size != page_size ) { (*printer)( 800420c: 78 03 08 01 mvhi r3,0x801 8004210: ba 00 08 00 mv r1,r16 8004214: 38 63 dd 14 ori r3,r3,0xdd14 8004218: ba 40 28 00 mv r5,r18 800421c: 34 02 00 01 mvi r2,1 8004220: d9 e0 00 00 call r15 8004224: b9 c0 08 00 mv r1,r14 8004228: e3 ff ff 5f bi 8003fa4 <_Heap_Walk+0x88> ); return false; } if ( next_block_begin <= block_begin ) { 800422c: 55 cc 00 0a bgu r14,r12,8004254 <_Heap_Walk+0x338> (*printer)( 8004230: 78 03 08 01 mvhi r3,0x801 8004234: ba 00 08 00 mv r1,r16 8004238: 38 63 de c4 ori r3,r3,0xdec4 800423c: b9 80 20 00 mv r4,r12 8004240: b9 c0 28 00 mv r5,r14 8004244: 34 02 00 01 mvi r2,1 8004248: d9 e0 00 00 call r15 800424c: ba 20 08 00 mv r1,r17 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 8004250: e3 ff ff 55 bi 8003fa4 <_Heap_Walk+0x88> } if ( !_Heap_Is_prev_used( next_block ) ) { 8004254: 29 c3 00 04 lw r3,(r14+4) 8004258: 20 63 00 01 andi r3,r3,0x1 800425c: 5c 60 00 22 bne r3,r0,80042e4 <_Heap_Walk+0x3c8> 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; 8004260: 29 91 00 04 lw r17,(r12+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)( 8004264: 29 85 00 0c lw r5,(r12+12) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8004268: 29 61 00 08 lw r1,(r11+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; 800426c: a2 36 68 00 and r13,r17,r22 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; 8004270: 29 63 00 0c lw r3,(r11+12) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8004274: b5 8d c8 00 add r25,r12,r13 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8004278: ba e0 30 00 mv r6,r23 800427c: 44 25 00 03 be r1,r5,8004288 <_Heap_Walk+0x36c> "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)" : ""), 8004280: ba a0 30 00 mv r6,r21 8004284: 44 ab 00 40 be r5,r11,8004384 <_Heap_Walk+0x468> 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)( 8004288: 29 87 00 08 lw r7,(r12+8) 800428c: bb 00 40 00 mv r8,r24 8004290: 44 67 00 03 be r3,r7,800429c <_Heap_Walk+0x380> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 8004294: ba a0 40 00 mv r8,r21 8004298: 44 eb 00 39 be r7,r11,800437c <_Heap_Walk+0x460> 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)( 800429c: 78 03 08 01 mvhi r3,0x801 80042a0: ba 00 08 00 mv r1,r16 80042a4: 34 02 00 00 mvi r2,0 80042a8: 38 63 df 28 ori r3,r3,0xdf28 80042ac: b9 80 20 00 mv r4,r12 80042b0: d9 e0 00 00 call r15 block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 80042b4: 2b 26 00 00 lw r6,(r25+0) 80042b8: 45 a6 00 1a be r13,r6,8004320 <_Heap_Walk+0x404> (*printer)( 80042bc: 78 03 08 01 mvhi r3,0x801 80042c0: ba 00 08 00 mv r1,r16 80042c4: 38 63 df 54 ori r3,r3,0xdf54 80042c8: b9 80 20 00 mv r4,r12 80042cc: b9 a0 28 00 mv r5,r13 80042d0: bb 20 38 00 mv r7,r25 80042d4: 34 02 00 01 mvi r2,1 80042d8: d9 e0 00 00 call r15 80042dc: 34 01 00 00 mvi r1,0 80042e0: e3 ff ff 31 bi 8003fa4 <_Heap_Walk+0x88> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 80042e4: 46 8e ff 2f be r20,r14,8003fa0 <_Heap_Walk+0x84> 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 ) { 80042e8: 29 cd 00 04 lw r13,(r14+4) 80042ec: b9 c0 60 00 mv r12,r14 80042f0: 21 a2 00 01 andi r2,r13,0x1 - 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; 80042f4: a1 b6 68 00 and r13,r13,r22 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 80042f8: b5 ac 70 00 add r14,r13,r12 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 ) { 80042fc: 5c 40 ff a9 bne r2,r0,80041a0 <_Heap_Walk+0x284> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8004300: 29 86 00 00 lw r6,(r12+0) 8004304: bb 60 18 00 mv r3,fp 8004308: ba 00 08 00 mv r1,r16 800430c: 38 63 de 10 ori r3,r3,0xde10 8004310: b9 80 20 00 mv r4,r12 8004314: b9 a0 28 00 mv r5,r13 8004318: d9 e0 00 00 call r15 800431c: e3 ff ff a8 bi 80041bc <_Heap_Walk+0x2a0> ); return false; } if ( !prev_used ) { 8004320: 22 31 00 01 andi r17,r17,0x1 8004324: 46 20 00 0e be r17,r0,800435c <_Heap_Walk+0x440> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 8004328: 29 63 00 08 lw r3,(r11+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 ) { 800432c: 44 6b 00 04 be r3,r11,800433c <_Heap_Walk+0x420> <== NEVER TAKEN if ( free_block == block ) { 8004330: 44 6c ff ed be r3,r12,80042e4 <_Heap_Walk+0x3c8> return true; } free_block = free_block->next; 8004334: 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 ) { 8004338: 5c 6b ff fe bne r3,r11,8004330 <_Heap_Walk+0x414> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 800433c: 78 03 08 01 mvhi r3,0x801 8004340: ba 00 08 00 mv r1,r16 8004344: 38 63 df c0 ori r3,r3,0xdfc0 8004348: b9 80 20 00 mv r4,r12 800434c: 34 02 00 01 mvi r2,1 8004350: d9 e0 00 00 call r15 8004354: 34 01 00 00 mvi r1,0 8004358: e3 ff ff 13 bi 8003fa4 <_Heap_Walk+0x88> return false; } if ( !prev_used ) { (*printer)( 800435c: 78 03 08 01 mvhi r3,0x801 8004360: ba 00 08 00 mv r1,r16 8004364: 38 63 df 90 ori r3,r3,0xdf90 8004368: b9 80 20 00 mv r4,r12 800436c: 34 02 00 01 mvi r2,1 8004370: d9 e0 00 00 call r15 8004374: ba 20 08 00 mv r1,r17 8004378: e3 ff ff 0b bi 8003fa4 <_Heap_Walk+0x88> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 800437c: 2b 88 00 54 lw r8,(sp+84) 8004380: e3 ff ff c7 bi 800429c <_Heap_Walk+0x380> "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)" : ""), 8004384: 2b 86 00 58 lw r6,(sp+88) 8004388: e3 ff ff c0 bi 8004288 <_Heap_Walk+0x36c> first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 800438c: 78 03 08 01 mvhi r3,0x801 8004390: ba 00 08 00 mv r1,r16 8004394: 38 63 dc 58 ori r3,r3,0xdc58 8004398: 34 02 00 01 mvi r2,1 800439c: d9 e0 00 00 call r15 80043a0: ba 40 08 00 mv r1,r18 80043a4: e3 ff ff 00 bi 8003fa4 <_Heap_Walk+0x88> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 80043a8: 78 03 08 01 mvhi r3,0x801 80043ac: ba 00 08 00 mv r1,r16 80043b0: 38 63 dc 6c ori r3,r3,0xdc6c 80043b4: ba 40 20 00 mv r4,r18 80043b8: 34 02 00 01 mvi r2,1 80043bc: d9 e0 00 00 call r15 80043c0: 34 01 00 00 mvi r1,0 80043c4: e3 ff fe f8 bi 8003fa4 <_Heap_Walk+0x88> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 80043c8: 78 03 08 01 mvhi r3,0x801 80043cc: ba 00 08 00 mv r1,r16 80043d0: 38 63 dc 8c ori r3,r3,0xdc8c 80043d4: ba 60 20 00 mv r4,r19 80043d8: 34 02 00 01 mvi r2,1 80043dc: d9 e0 00 00 call r15 80043e0: b9 a0 08 00 mv r1,r13 80043e4: e3 ff fe f0 bi 8003fa4 <_Heap_Walk+0x88> block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 80043e8: 78 03 08 01 mvhi r3,0x801 80043ec: ba 00 08 00 mv r1,r16 80043f0: 38 63 de 38 ori r3,r3,0xde38 80043f4: b9 80 20 00 mv r4,r12 80043f8: b9 c0 28 00 mv r5,r14 80043fc: 34 02 00 01 mvi r2,1 8004400: d9 e0 00 00 call r15 8004404: 34 01 00 00 mvi r1,0 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 8004408: e3 ff fe e7 bi 8003fa4 <_Heap_Walk+0x88> } if ( !_Heap_Is_aligned( block_size, page_size ) ) { (*printer)( 800440c: 78 03 08 01 mvhi r3,0x801 8004410: ba 00 08 00 mv r1,r16 8004414: 38 63 de 68 ori r3,r3,0xde68 8004418: b9 80 20 00 mv r4,r12 800441c: b9 a0 28 00 mv r5,r13 8004420: 34 02 00 01 mvi r2,1 8004424: d9 e0 00 00 call r15 8004428: 34 01 00 00 mvi r1,0 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 800442c: e3 ff fe de bi 8003fa4 <_Heap_Walk+0x88> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8004430: 78 03 08 01 mvhi r3,0x801 8004434: ba 00 08 00 mv r1,r16 8004438: 38 63 dc b0 ori r3,r3,0xdcb0 800443c: b9 80 20 00 mv r4,r12 8004440: 34 02 00 01 mvi r2,1 8004444: d9 e0 00 00 call r15 8004448: ba 20 08 00 mv r1,r17 800444c: e3 ff fe d6 bi 8003fa4 <_Heap_Walk+0x88> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 8004450: 78 03 08 01 mvhi r3,0x801 8004454: ba 00 08 00 mv r1,r16 8004458: 38 63 dc e4 ori r3,r3,0xdce4 800445c: 34 02 00 01 mvi r2,1 8004460: d9 e0 00 00 call r15 8004464: ba 20 08 00 mv r1,r17 8004468: e3 ff fe cf bi 8003fa4 <_Heap_Walk+0x88> return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 800446c: 78 03 08 01 mvhi r3,0x801 8004470: ba 00 08 00 mv r1,r16 8004474: 38 63 dd 40 ori r3,r3,0xdd40 8004478: 34 02 00 01 mvi r2,1 800447c: d9 e0 00 00 call r15 8004480: ba a0 08 00 mv r1,r21 8004484: e3 ff fe c8 bi 8003fa4 <_Heap_Walk+0x88> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8004488: 78 03 08 01 mvhi r3,0x801 800448c: ba 00 08 00 mv r1,r16 8004490: 38 63 dd 78 ori r3,r3,0xdd78 8004494: b9 c0 20 00 mv r4,r14 8004498: 34 02 00 01 mvi r2,1 800449c: d9 e0 00 00 call r15 80044a0: 34 01 00 00 mvi r1,0 80044a4: e3 ff fe c0 bi 8003fa4 <_Heap_Walk+0x88> const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( 80044a8: 78 03 08 01 mvhi r3,0x801 80044ac: ba 00 08 00 mv r1,r16 80044b0: 38 63 dd 58 ori r3,r3,0xdd58 80044b4: b9 c0 20 00 mv r4,r14 80044b8: 34 02 00 01 mvi r2,1 80044bc: d9 e0 00 00 call r15 80044c0: 34 01 00 00 mvi r1,0 80044c4: e3 ff fe b8 bi 8003fa4 <_Heap_Walk+0x88> return false; } if ( free_block->prev != prev_block ) { (*printer)( 80044c8: 78 03 08 01 mvhi r3,0x801 80044cc: ba 00 08 00 mv r1,r16 80044d0: 38 63 dd c4 ori r3,r3,0xddc4 80044d4: b9 c0 20 00 mv r4,r14 80044d8: 34 02 00 01 mvi r2,1 80044dc: d9 e0 00 00 call r15 80044e0: 34 01 00 00 mvi r1,0 80044e4: e3 ff fe b0 bi 8003fa4 <_Heap_Walk+0x88> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 80044e8: 78 03 08 01 mvhi r3,0x801 80044ec: ba 00 08 00 mv r1,r16 80044f0: 38 63 dd a8 ori r3,r3,0xdda8 80044f4: b9 c0 20 00 mv r4,r14 80044f8: 34 02 00 01 mvi r2,1 80044fc: d9 e0 00 00 call r15 8004500: 34 01 00 00 mvi r1,0 8004504: e3 ff fe a8 bi 8003fa4 <_Heap_Walk+0x88> 08002998 <_IO_Initialize_all_drivers>: * * Output Parameters: NONE */ void _IO_Initialize_all_drivers( void ) { 8002998: 37 9c ff f4 addi sp,sp,-12 800299c: 5b 8b 00 0c sw (sp+12),r11 80029a0: 5b 8c 00 08 sw (sp+8),r12 80029a4: 5b 9d 00 04 sw (sp+4),ra rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 80029a8: 78 0c 08 01 mvhi r12,0x801 80029ac: 39 8c f1 90 ori r12,r12,0xf190 80029b0: 29 81 00 00 lw r1,(r12+0) 80029b4: 44 20 00 09 be r1,r0,80029d8 <_IO_Initialize_all_drivers+0x40><== NEVER TAKEN 80029b8: 34 0b 00 00 mvi r11,0 (void) rtems_io_initialize( major, 0, NULL ); 80029bc: 34 02 00 00 mvi r2,0 80029c0: b9 60 08 00 mv r1,r11 80029c4: b8 40 18 00 mv r3,r2 80029c8: f8 00 1a 3f calli 80092c4 void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 80029cc: 29 81 00 00 lw r1,(r12+0) 80029d0: 35 6b 00 01 addi r11,r11,1 80029d4: 54 2b ff fa bgu r1,r11,80029bc <_IO_Initialize_all_drivers+0x24> (void) rtems_io_initialize( major, 0, NULL ); } 80029d8: 2b 9d 00 04 lw ra,(sp+4) 80029dc: 2b 8b 00 0c lw r11,(sp+12) 80029e0: 2b 8c 00 08 lw r12,(sp+8) 80029e4: 37 9c 00 0c addi sp,sp,12 80029e8: c3 a0 00 00 ret 080029ec <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 80029ec: 37 9c ff e8 addi sp,sp,-24 80029f0: 5b 8b 00 18 sw (sp+24),r11 80029f4: 5b 8c 00 14 sw (sp+20),r12 80029f8: 5b 8d 00 10 sw (sp+16),r13 80029fc: 5b 8e 00 0c sw (sp+12),r14 8002a00: 5b 8f 00 08 sw (sp+8),r15 8002a04: 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; 8002a08: 78 01 08 01 mvhi r1,0x801 8002a0c: 38 21 e0 c4 ori r1,r1,0xe0c4 drivers_in_table = Configuration.number_of_device_drivers; number_of_drivers = Configuration.maximum_drivers; 8002a10: 28 2d 00 2c lw r13,(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; 8002a14: 28 2b 00 30 lw r11,(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; 8002a18: 28 2c 00 34 lw r12,(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 ) 8002a1c: 51 6d 00 2d bgeu r11,r13,8002ad0 <_IO_Manager_initialization+0xe4> * 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 ) 8002a20: b5 ad 08 00 add r1,r13,r13 8002a24: 34 02 00 03 mvi r2,3 8002a28: b4 2d 08 00 add r1,r1,r13 8002a2c: fb ff f5 f1 calli 80001f0 <__ashlsi3> 8002a30: b8 20 78 00 mv r15,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 *) 8002a34: f8 00 0d 62 calli 8005fbc <_Workspace_Allocate_or_fatal_error> 8002a38: 78 0e 08 01 mvhi r14,0x801 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8002a3c: 78 04 08 01 mvhi r4,0x801 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 8002a40: 39 ce f1 94 ori r14,r14,0xf194 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8002a44: 38 84 f1 90 ori r4,r4,0xf190 memset( 8002a48: b9 e0 18 00 mv r3,r15 8002a4c: 34 02 00 00 mvi r2,0 _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; 8002a50: 58 8d 00 00 sw (r4+0),r13 /* * 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 *) 8002a54: 59 c1 00 00 sw (r14+0),r1 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 8002a58: f8 00 2d 3f calli 800df54 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8002a5c: 45 60 00 15 be r11,r0,8002ab0 <_IO_Manager_initialization+0xc4><== NEVER TAKEN 8002a60: 29 c5 00 00 lw r5,(r14+0) 8002a64: 34 03 00 00 mvi r3,0 8002a68: b8 60 20 00 mv r4,r3 _IO_Driver_address_table[index] = driver_table[index]; 8002a6c: b5 83 10 00 add r2,r12,r3 8002a70: 28 46 00 00 lw r6,(r2+0) 8002a74: b4 a3 08 00 add r1,r5,r3 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8002a78: 34 84 00 01 addi r4,r4,1 _IO_Driver_address_table[index] = driver_table[index]; 8002a7c: 58 26 00 00 sw (r1+0),r6 8002a80: 28 46 00 04 lw r6,(r2+4) memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8002a84: 34 63 00 18 addi r3,r3,24 _IO_Driver_address_table[index] = driver_table[index]; 8002a88: 58 26 00 04 sw (r1+4),r6 8002a8c: 28 46 00 08 lw r6,(r2+8) 8002a90: 58 26 00 08 sw (r1+8),r6 8002a94: 28 46 00 0c lw r6,(r2+12) 8002a98: 58 26 00 0c sw (r1+12),r6 8002a9c: 28 46 00 10 lw r6,(r2+16) 8002aa0: 58 26 00 10 sw (r1+16),r6 8002aa4: 28 42 00 14 lw r2,(r2+20) 8002aa8: 58 22 00 14 sw (r1+20),r2 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8002aac: 55 64 ff f0 bgu r11,r4,8002a6c <_IO_Manager_initialization+0x80> _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 8002ab0: 2b 9d 00 04 lw ra,(sp+4) 8002ab4: 2b 8b 00 18 lw r11,(sp+24) 8002ab8: 2b 8c 00 14 lw r12,(sp+20) 8002abc: 2b 8d 00 10 lw r13,(sp+16) 8002ac0: 2b 8e 00 0c lw r14,(sp+12) 8002ac4: 2b 8f 00 08 lw r15,(sp+8) 8002ac8: 37 9c 00 18 addi sp,sp,24 8002acc: c3 a0 00 00 ret * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 8002ad0: 78 02 08 01 mvhi r2,0x801 _IO_Number_of_drivers = number_of_drivers; 8002ad4: 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; 8002ad8: 38 42 f1 94 ori r2,r2,0xf194 _IO_Number_of_drivers = number_of_drivers; 8002adc: 38 21 f1 90 ori r1,r1,0xf190 * 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; 8002ae0: 58 4c 00 00 sw (r2+0),r12 _IO_Number_of_drivers = number_of_drivers; 8002ae4: 58 2b 00 00 sw (r1+0),r11 ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 8002ae8: 2b 9d 00 04 lw ra,(sp+4) 8002aec: 2b 8b 00 18 lw r11,(sp+24) 8002af0: 2b 8c 00 14 lw r12,(sp+20) 8002af4: 2b 8d 00 10 lw r13,(sp+16) 8002af8: 2b 8e 00 0c lw r14,(sp+12) 8002afc: 2b 8f 00 08 lw r15,(sp+8) 8002b00: 37 9c 00 18 addi sp,sp,24 8002b04: c3 a0 00 00 ret 08003790 <_ISR_Handler_initialization>: * * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { 8003790: 37 9c ff f4 addi sp,sp,-12 8003794: 5b 8b 00 0c sw (sp+12),r11 8003798: 5b 8c 00 08 sw (sp+8),r12 800379c: 5b 9d 00 04 sw (sp+4),ra _ISR_Signals_to_thread_executing = false; 80037a0: 78 03 08 01 mvhi r3,0x801 _ISR_Nest_level = 0; 80037a4: 78 02 08 01 mvhi r2,0x801 * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; 80037a8: 34 04 00 00 mvi r4,0 80037ac: 38 63 e9 f8 ori r3,r3,0xe9f8 _ISR_Nest_level = 0; 80037b0: 38 42 e9 3c ori r2,r2,0xe93c * Output parameters: NONE */ void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; 80037b4: 30 64 00 00 sb (r3+0),r4 _ISR_Nest_level = 0; 80037b8: 58 44 00 00 sw (r2+0),r4 #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( 80037bc: 34 01 00 80 mvi r1,128 void _ISR_Handler_initialization( void ) { _ISR_Signals_to_thread_executing = false; _ISR_Nest_level = 0; 80037c0: b8 80 60 00 mv r12,r4 #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( 80037c4: f8 00 09 fe calli 8005fbc <_Workspace_Allocate_or_fatal_error> _CPU_Initialize_vectors(); #if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE ) if ( !_Stack_Is_enough(Configuration.interrupt_stack_size) ) 80037c8: 78 0b 08 01 mvhi r11,0x801 80037cc: 78 02 08 01 mvhi r2,0x801 80037d0: 38 42 e0 bc ori r2,r2,0xe0bc 80037d4: 39 6b e0 c4 ori r11,r11,0xe0c4 80037d8: 28 44 00 00 lw r4,(r2+0) 80037dc: 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( 80037e0: 78 02 08 01 mvhi r2,0x801 80037e4: 38 42 e9 20 ori r2,r2,0xe920 80037e8: 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) ) 80037ec: 50 64 00 05 bgeu r3,r4,8003800 <_ISR_Handler_initialization+0x70><== ALWAYS TAKEN _Internal_error_Occurred( 80037f0: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80037f4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80037f8: 34 03 00 05 mvi r3,5 <== NOT EXECUTED 80037fc: fb ff ff d6 calli 8003754 <_Internal_error_Occurred> <== NOT EXECUTED INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL ); _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( 8003800: b8 60 08 00 mv r1,r3 8003804: f8 00 09 ee calli 8005fbc <_Workspace_Allocate_or_fatal_error> Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 8003808: 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( 800380c: 78 02 08 01 mvhi r2,0x801 Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 8003810: 78 03 08 01 mvhi r3,0x801 8003814: 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( 8003818: 38 42 e8 b4 ori r2,r2,0xe8b4 Configuration.interrupt_stack_size ); _CPU_Interrupt_stack_high = _Addresses_Add_offset( 800381c: 38 63 e8 38 ori r3,r3,0xe838 8003820: 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( 8003824: 58 41 00 00 sw (r2+0),r1 #if ( CPU_HAS_HARDWARE_INTERRUPT_STACK == TRUE ) _CPU_Install_interrupt_stack(); #endif } 8003828: 2b 9d 00 04 lw ra,(sp+4) 800382c: 2b 8b 00 0c lw r11,(sp+12) 8003830: 2b 8c 00 08 lw r12,(sp+8) 8003834: 37 9c 00 0c addi sp,sp,12 8003838: c3 a0 00 00 ret 0800383c <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 800383c: 37 9c ff ec addi sp,sp,-20 8003840: 5b 8b 00 14 sw (sp+20),r11 8003844: 5b 8c 00 10 sw (sp+16),r12 8003848: 5b 8d 00 0c sw (sp+12),r13 800384c: 5b 8e 00 08 sw (sp+8),r14 8003850: 5b 9d 00 04 sw (sp+4),ra 8003854: 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 ) 8003858: 28 21 00 18 lw r1,(r1+24) 800385c: b8 20 60 00 mv r12,r1 8003860: 5c 20 00 09 bne r1,r0,8003884 <_Objects_Allocate+0x48> <== ALWAYS TAKEN information->inactive--; } } return the_object; } 8003864: b9 80 08 00 mv r1,r12 8003868: 2b 9d 00 04 lw ra,(sp+4) 800386c: 2b 8b 00 14 lw r11,(sp+20) 8003870: 2b 8c 00 10 lw r12,(sp+16) 8003874: 2b 8d 00 0c lw r13,(sp+12) 8003878: 2b 8e 00 08 lw r14,(sp+8) 800387c: 37 9c 00 14 addi sp,sp,20 8003880: c3 a0 00 00 ret /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8003884: 35 6d 00 20 addi r13,r11,32 8003888: b9 a0 08 00 mv r1,r13 800388c: f8 00 16 c0 calli 800938c <_Chain_Get> 8003890: b8 20 60 00 mv r12,r1 if ( information->auto_extend ) { 8003894: 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 ); 8003898: b9 80 70 00 mv r14,r12 if ( information->auto_extend ) { 800389c: 44 20 ff f2 be r1,r0,8003864 <_Objects_Allocate+0x28> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 80038a0: 45 80 00 1a be r12,r0,8003908 <_Objects_Allocate+0xcc> } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 80038a4: 29 83 00 08 lw r3,(r12+8) 80038a8: 29 61 00 08 lw r1,(r11+8) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 80038ac: 2d 62 00 14 lhu r2,(r11+20) } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 80038b0: 20 63 ff ff andi r3,r3,0xffff 80038b4: 20 21 ff ff andi r1,r1,0xffff _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 80038b8: c8 61 08 00 sub r1,r3,r1 80038bc: f8 00 5f 06 calli 801b4d4 <__udivsi3> 80038c0: 34 02 00 02 mvi r2,2 80038c4: fb ff f2 4b calli 80001f0 <__ashlsi3> 80038c8: 29 62 00 30 lw r2,(r11+48) information->inactive--; 80038cc: 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 ]--; 80038d0: b4 41 08 00 add r1,r2,r1 80038d4: 28 22 00 00 lw r2,(r1+0) information->inactive--; 80038d8: 34 63 ff ff addi r3,r3,-1 80038dc: 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 ]--; 80038e0: 34 42 ff ff addi r2,r2,-1 80038e4: 58 22 00 00 sw (r1+0),r2 information->inactive--; } } return the_object; } 80038e8: b9 80 08 00 mv r1,r12 80038ec: 2b 9d 00 04 lw ra,(sp+4) 80038f0: 2b 8b 00 14 lw r11,(sp+20) 80038f4: 2b 8c 00 10 lw r12,(sp+16) 80038f8: 2b 8d 00 0c lw r13,(sp+12) 80038fc: 2b 8e 00 08 lw r14,(sp+8) 8003900: 37 9c 00 14 addi sp,sp,20 8003904: c3 a0 00 00 ret * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { _Objects_Extend_information( information ); 8003908: b9 60 08 00 mv r1,r11 800390c: f8 00 00 06 calli 8003924 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8003910: b9 a0 08 00 mv r1,r13 8003914: f8 00 16 9e calli 800938c <_Chain_Get> 8003918: b8 20 60 00 mv r12,r1 } if ( the_object ) { 800391c: 44 2e ff d2 be r1,r14,8003864 <_Objects_Allocate+0x28> 8003920: e3 ff ff e1 bi 80038a4 <_Objects_Allocate+0x68> 08003924 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 8003924: 37 9c ff c8 addi sp,sp,-56 8003928: 5b 8b 00 2c sw (sp+44),r11 800392c: 5b 8c 00 28 sw (sp+40),r12 8003930: 5b 8d 00 24 sw (sp+36),r13 8003934: 5b 8e 00 20 sw (sp+32),r14 8003938: 5b 8f 00 1c sw (sp+28),r15 800393c: 5b 90 00 18 sw (sp+24),r16 8003940: 5b 91 00 14 sw (sp+20),r17 8003944: 5b 92 00 10 sw (sp+16),r18 8003948: 5b 93 00 0c sw (sp+12),r19 800394c: 5b 94 00 08 sw (sp+8),r20 8003950: 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 ); 8003954: 28 30 00 08 lw r16,(r1+8) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 8003958: 28 31 00 34 lw r17,(r1+52) */ void _Objects_Extend_information( Objects_Information *information ) { 800395c: 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 ); 8003960: 22 10 ff ff andi r16,r16,0xffff index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 8003964: 46 20 00 ba be r17,r0,8003c4c <_Objects_Extend_information+0x328> block_count = 0; else { block_count = information->maximum / information->allocation_size; 8003968: 2c 2f 00 14 lhu r15,(r1+20) 800396c: 2c 32 00 10 lhu r18,(r1+16) for ( ; block < block_count; block++ ) { 8003970: ba 00 68 00 mv r13,r16 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; 8003974: b9 e0 10 00 mv r2,r15 8003978: ba 40 08 00 mv r1,r18 800397c: f8 00 5e d6 calli 801b4d4 <__udivsi3> 8003980: 20 2e ff ff andi r14,r1,0xffff for ( ; block < block_count; block++ ) { 8003984: b9 c0 60 00 mv r12,r14 8003988: b9 e0 08 00 mv r1,r15 800398c: 45 c0 00 08 be r14,r0,80039ac <_Objects_Extend_information+0x88><== NEVER TAKEN if ( information->object_blocks[ block ] == NULL ) 8003990: 2a 2c 00 00 lw r12,(r17+0) 8003994: 45 80 00 06 be r12,r0,80039ac <_Objects_Extend_information+0x88><== NEVER TAKEN 8003998: ba 20 18 00 mv r3,r17 800399c: 34 0c 00 00 mvi r12,0 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 80039a0: 35 8c 00 01 addi r12,r12,1 if ( information->object_blocks[ block ] == NULL ) break; else index_base += information->allocation_size; 80039a4: b5 af 68 00 add r13,r13,r15 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 80039a8: 55 cc 00 8c bgu r14,r12,8003bd8 <_Objects_Extend_information+0x2b4> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 80039ac: b6 41 90 00 add r18,r18,r1 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 80039b0: 38 02 ff ff mvu r2,0xffff 80039b4: 56 42 00 7c bgu r18,r2,8003ba4 <_Objects_Extend_information+0x280><== 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; 80039b8: 29 62 00 18 lw r2,(r11+24) 80039bc: f8 00 5e 47 calli 801b2d8 <__mulsi3> if ( information->auto_extend ) { 80039c0: 41 62 00 12 lbu r2,(r11+18) 80039c4: 5c 40 00 89 bne r2,r0,8003be8 <_Objects_Extend_information+0x2c4> new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 80039c8: f8 00 09 7d calli 8005fbc <_Workspace_Allocate_or_fatal_error> 80039cc: 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 ) { 80039d0: 2d 61 00 10 lhu r1,(r11+16) 80039d4: 54 2d 00 4a bgu r1,r13,8003afc <_Objects_Extend_information+0x1d8> */ /* * Up the block count and maximum */ block_count++; 80039d8: 35 d3 00 01 addi r19,r14,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 ); 80039dc: b6 73 08 00 add r1,r19,r19 80039e0: b4 33 08 00 add r1,r1,r19 80039e4: b6 41 08 00 add r1,r18,r1 80039e8: 34 02 00 02 mvi r2,2 80039ec: b4 30 08 00 add r1,r1,r16 80039f0: fb ff f2 00 calli 80001f0 <__ashlsi3> 80039f4: f8 00 09 81 calli 8005ff8 <_Workspace_Allocate> 80039f8: b8 20 88 00 mv r17,r1 if ( !object_blocks ) { 80039fc: 44 20 00 9a be r1,r0,8003c64 <_Objects_Extend_information+0x340><== NEVER TAKEN } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 8003a00: ba 60 08 00 mv r1,r19 8003a04: 34 02 00 02 mvi r2,2 8003a08: fb ff f1 fa calli 80001f0 <__ashlsi3> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 8003a0c: 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); 8003a10: b6 21 98 00 add r19,r17,r1 8003a14: b6 61 a0 00 add r20,r19,r1 8003a18: 54 50 00 78 bgu r2,r16,8003bf8 <_Objects_Extend_information+0x2d4> information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 8003a1c: 34 03 00 00 mvi r3,0 8003a20: ba 80 20 00 mv r4,r20 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 8003a24: b8 60 10 00 mv r2,r3 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 8003a28: 46 03 00 05 be r16,r3,8003a3c <_Objects_Extend_information+0x118><== NEVER TAKEN local_table[ index ] = NULL; 8003a2c: 58 82 00 00 sw (r4+0),r2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 8003a30: 34 63 00 01 addi r3,r3,1 8003a34: 34 84 00 04 addi r4,r4,4 8003a38: 56 03 ff fd bgu r16,r3,8003a2c <_Objects_Extend_information+0x108><== NEVER TAKEN 8003a3c: b9 c0 08 00 mv r1,r14 8003a40: 34 02 00 02 mvi r2,2 8003a44: fb ff f1 eb calli 80001f0 <__ashlsi3> 8003a48: b8 20 70 00 mv r14,r1 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 8003a4c: 2d 61 00 14 lhu r1,(r11+20) /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 8003a50: b6 6e 10 00 add r2,r19,r14 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 8003a54: 34 10 00 00 mvi r16,0 8003a58: b6 2e 70 00 add r14,r17,r14 8003a5c: 59 d0 00 00 sw (r14+0),r16 inactive_per_block[block_count] = 0; 8003a60: 58 50 00 00 sw (r2+0),r16 for ( index=index_base ; index < ( information->allocation_size + index_base ); 8003a64: b5 a1 70 00 add r14,r13,r1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8003a68: 51 ae 00 0b bgeu r13,r14,8003a94 <_Objects_Extend_information+0x170><== NEVER TAKEN 8003a6c: 34 02 00 02 mvi r2,2 8003a70: b9 a0 08 00 mv r1,r13 8003a74: fb ff f1 df calli 80001f0 <__ashlsi3> 8003a78: b6 81 18 00 add r3,r20,r1 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 8003a7c: ba 00 10 00 mv r2,r16 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8003a80: b9 a0 20 00 mv r4,r13 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 8003a84: 58 62 00 00 sw (r3+0),r2 object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 8003a88: 34 84 00 01 addi r4,r4,1 8003a8c: 34 63 00 04 addi r3,r3,4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8003a90: 55 c4 ff fd bgu r14,r4,8003a84 <_Objects_Extend_information+0x160> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 8003a94: 90 00 70 00 rcsr r14,IE 8003a98: 34 01 ff fe mvi r1,-2 8003a9c: a1 c1 08 00 and r1,r14,r1 8003aa0: 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( 8003aa4: 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; 8003aa8: 22 52 ff ff andi r18,r18,0xffff 8003aac: 0d 72 00 10 sh (r11+16),r18 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 8003ab0: 59 73 00 30 sw (r11+48),r19 information->local_table = local_table; 8003ab4: 59 74 00 1c sw (r11+28),r20 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 8003ab8: 29 70 00 34 lw r16,(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( 8003abc: 34 02 00 18 mvi r2,24 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 8003ac0: 59 71 00 34 sw (r11+52),r17 information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 8003ac4: fb ff f1 cb calli 80001f0 <__ashlsi3> 8003ac8: 78 02 00 01 mvhi r2,0x1 8003acc: 38 42 00 00 ori r2,r2,0x0 8003ad0: b8 22 88 00 or r17,r1,r2 8003ad4: 2d 61 00 04 lhu r1,(r11+4) 8003ad8: 34 02 00 1b mvi r2,27 8003adc: fb ff f1 c5 calli 80001f0 <__ashlsi3> 8003ae0: ba 21 08 00 or r1,r17,r1 8003ae4: b8 32 90 00 or r18,r1,r18 8003ae8: 59 72 00 0c sw (r11+12),r18 information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 8003aec: d0 0e 00 00 wcsr IE,r14 if ( old_tables ) 8003af0: 46 00 00 03 be r16,r0,8003afc <_Objects_Extend_information+0x1d8> _Workspace_Free( old_tables ); 8003af4: ba 00 08 00 mv r1,r16 8003af8: f8 00 09 4b calli 8006024 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 8003afc: 34 02 00 02 mvi r2,2 8003b00: b9 80 08 00 mv r1,r12 8003b04: fb ff f1 bb calli 80001f0 <__ashlsi3> 8003b08: b8 20 90 00 mv r18,r1 8003b0c: 29 61 00 34 lw r1,(r11+52) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 8003b10: 2d 63 00 14 lhu r3,(r11+20) 8003b14: 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; 8003b18: b4 32 08 00 add r1,r1,r18 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 8003b1c: 37 90 00 30 addi r16,sp,48 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 8003b20: 58 2f 00 00 sw (r1+0),r15 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 8003b24: b9 e0 10 00 mv r2,r15 8003b28: ba 00 08 00 mv r1,r16 */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 8003b2c: 78 0f 00 01 mvhi r15,0x1 information->object_blocks[ block ] = new_object_block; /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 8003b30: f8 00 16 28 calli 80093d0 <_Chain_Initialize> */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 8003b34: 39 ef 00 00 ori r15,r15,0x0 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 8003b38: 35 71 00 20 addi r17,r11,32 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 8003b3c: e0 00 00 0e bi 8003b74 <_Objects_Extend_information+0x250> the_object->id = _Objects_Build_id( 8003b40: 29 61 00 00 lw r1,(r11+0) 8003b44: fb ff f1 ab calli 80001f0 <__ashlsi3> 8003b48: b8 2f 70 00 or r14,r1,r15 8003b4c: 2d 61 00 04 lhu r1,(r11+4) 8003b50: 34 02 00 1b mvi r2,27 8003b54: fb ff f1 a7 calli 80001f0 <__ashlsi3> 8003b58: b9 c1 10 00 or r2,r14,r1 8003b5c: b8 4d 10 00 or r2,r2,r13 8003b60: 59 82 00 08 sw (r12+8),r2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 8003b64: ba 20 08 00 mv r1,r17 8003b68: b9 80 10 00 mv r2,r12 8003b6c: fb ff fc a0 calli 8002dec <_Chain_Append> index++; 8003b70: 35 ad 00 01 addi r13,r13,1 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 8003b74: ba 00 08 00 mv r1,r16 8003b78: f8 00 16 05 calli 800938c <_Chain_Get> 8003b7c: b8 20 60 00 mv r12,r1 the_object->id = _Objects_Build_id( 8003b80: 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 ) { 8003b84: 5c 20 ff ef bne r1,r0,8003b40 <_Objects_Extend_information+0x21c> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 8003b88: 2d 62 00 14 lhu r2,(r11+20) information->inactive = 8003b8c: 2d 61 00 2c lhu r1,(r11+44) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 8003b90: 29 63 00 30 lw r3,(r11+48) information->inactive = 8003b94: b4 41 08 00 add r1,r2,r1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 8003b98: b4 72 90 00 add r18,r3,r18 information->inactive = 8003b9c: 0d 61 00 2c sh (r11+44),r1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 8003ba0: 5a 42 00 00 sw (r18+0),r2 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 8003ba4: 2b 9d 00 04 lw ra,(sp+4) 8003ba8: 2b 8b 00 2c lw r11,(sp+44) 8003bac: 2b 8c 00 28 lw r12,(sp+40) 8003bb0: 2b 8d 00 24 lw r13,(sp+36) 8003bb4: 2b 8e 00 20 lw r14,(sp+32) 8003bb8: 2b 8f 00 1c lw r15,(sp+28) 8003bbc: 2b 90 00 18 lw r16,(sp+24) 8003bc0: 2b 91 00 14 lw r17,(sp+20) 8003bc4: 2b 92 00 10 lw r18,(sp+16) 8003bc8: 2b 93 00 0c lw r19,(sp+12) 8003bcc: 2b 94 00 08 lw r20,(sp+8) 8003bd0: 37 9c 00 38 addi sp,sp,56 8003bd4: c3 a0 00 00 ret block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) 8003bd8: 28 62 00 04 lw r2,(r3+4) 8003bdc: 34 63 00 04 addi r3,r3,4 8003be0: 5c 40 ff 70 bne r2,r0,80039a0 <_Objects_Extend_information+0x7c> 8003be4: e3 ff ff 72 bi 80039ac <_Objects_Extend_information+0x88> * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); 8003be8: f8 00 09 04 calli 8005ff8 <_Workspace_Allocate> 8003bec: b8 20 78 00 mv r15,r1 if ( !new_object_block ) 8003bf0: 5c 20 ff 78 bne r1,r0,80039d0 <_Objects_Extend_information+0xac> 8003bf4: e3 ff ff ec bi 8003ba4 <_Objects_Extend_information+0x280> * separate parts as size of each block has changed. */ memcpy( object_blocks, information->object_blocks, block_count * sizeof(void*) ); 8003bf8: b9 c0 08 00 mv r1,r14 8003bfc: 34 02 00 02 mvi r2,2 8003c00: fb ff f1 7c 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, 8003c04: 29 62 00 34 lw r2,(r11+52) information->object_blocks, block_count * sizeof(void*) ); 8003c08: b8 20 70 00 mv r14,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, 8003c0c: b9 c0 18 00 mv r3,r14 8003c10: ba 20 08 00 mv r1,r17 8003c14: f8 00 28 72 calli 800dddc information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 8003c18: 29 62 00 30 lw r2,(r11+48) 8003c1c: b9 c0 18 00 mv r3,r14 8003c20: ba 60 08 00 mv r1,r19 8003c24: f8 00 28 6e calli 800dddc information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 8003c28: 2d 61 00 10 lhu r1,(r11+16) 8003c2c: 34 02 00 02 mvi r2,2 8003c30: b6 01 08 00 add r1,r16,r1 8003c34: fb ff f1 6f calli 80001f0 <__ashlsi3> 8003c38: 29 62 00 1c lw r2,(r11+28) 8003c3c: b8 20 18 00 mv r3,r1 8003c40: ba 80 08 00 mv r1,r20 8003c44: f8 00 28 66 calli 800dddc 8003c48: e3 ff ff 81 bi 8003a4c <_Objects_Extend_information+0x128> minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 8003c4c: 2c 32 00 10 lhu r18,(r1+16) 8003c50: ba 20 60 00 mv r12,r17 8003c54: 2c 21 00 14 lhu r1,(r1+20) 8003c58: ba 00 68 00 mv r13,r16 8003c5c: ba 20 70 00 mv r14,r17 8003c60: e3 ff ff 53 bi 80039ac <_Objects_Extend_information+0x88> (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 8003c64: b9 e0 08 00 mv r1,r15 8003c68: f8 00 08 ef calli 8006024 <_Workspace_Free> return; 8003c6c: e3 ff ff ce bi 8003ba4 <_Objects_Extend_information+0x280> 08003d68 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 8003d68: 37 9c ff f4 addi sp,sp,-12 8003d6c: 5b 8b 00 0c sw (sp+12),r11 8003d70: 5b 8c 00 08 sw (sp+8),r12 8003d74: 5b 9d 00 04 sw (sp+4),ra 8003d78: b8 40 58 00 mv r11,r2 8003d7c: b8 20 60 00 mv r12,r1 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 8003d80: 5c 40 00 07 bne r2,r0,8003d9c <_Objects_Get_information+0x34> * 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 ) 8003d84: 34 01 00 00 mvi r1,0 return NULL; #endif return info; } 8003d88: 2b 9d 00 04 lw ra,(sp+4) 8003d8c: 2b 8b 00 0c lw r11,(sp+12) 8003d90: 2b 8c 00 08 lw r12,(sp+8) 8003d94: 37 9c 00 0c addi sp,sp,12 8003d98: c3 a0 00 00 ret /* * This call implicitly validates the_api so we do not call * _Objects_Is_api_valid above here. */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); 8003d9c: f8 00 17 68 calli 8009b3c <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 8003da0: 44 20 ff f9 be r1,r0,8003d84 <_Objects_Get_information+0x1c> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 8003da4: 55 61 ff f8 bgu r11,r1,8003d84 <_Objects_Get_information+0x1c> return NULL; if ( !_Objects_Information_table[ the_api ] ) 8003da8: b9 80 08 00 mv r1,r12 8003dac: 34 02 00 02 mvi r2,2 8003db0: 78 0c 08 01 mvhi r12,0x801 8003db4: 39 8c e8 3c ori r12,r12,0xe83c 8003db8: fb ff f1 0e calli 80001f0 <__ashlsi3> 8003dbc: b5 81 08 00 add r1,r12,r1 8003dc0: 28 2c 00 00 lw r12,(r1+0) 8003dc4: 45 80 ff f0 be r12,r0,8003d84 <_Objects_Get_information+0x1c><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 8003dc8: b9 60 08 00 mv r1,r11 8003dcc: 34 02 00 02 mvi r2,2 8003dd0: fb ff f1 08 calli 80001f0 <__ashlsi3> 8003dd4: b5 81 08 00 add r1,r12,r1 8003dd8: 28 21 00 00 lw r1,(r1+0) if ( !info ) 8003ddc: 44 20 ff eb be r1,r0,8003d88 <_Objects_Get_information+0x20><== 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 ) 8003de0: 2c 22 00 10 lhu r2,(r1+16) 8003de4: 5c 40 ff e9 bne r2,r0,8003d88 <_Objects_Get_information+0x20> 8003de8: e3 ff ff e7 bi 8003d84 <_Objects_Get_information+0x1c> 08014c70 <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 8014c70: 37 9c ff e0 addi sp,sp,-32 8014c74: 5b 8b 00 14 sw (sp+20),r11 8014c78: 5b 8c 00 10 sw (sp+16),r12 8014c7c: 5b 8d 00 0c sw (sp+12),r13 8014c80: 5b 8e 00 08 sw (sp+8),r14 8014c84: 5b 9d 00 04 sw (sp+4),ra 8014c88: b8 40 60 00 mv r12,r2 8014c8c: b8 60 58 00 mv r11,r3 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 8014c90: 5c 40 00 0a bne r2,r0,8014cb8 <_Objects_Get_name_as_string+0x48> } } *d = '\0'; _Thread_Enable_dispatch(); return name; 8014c94: 34 0b 00 00 mvi r11,0 } return NULL; /* unreachable path */ } 8014c98: b9 60 08 00 mv r1,r11 8014c9c: 2b 9d 00 04 lw ra,(sp+4) 8014ca0: 2b 8b 00 14 lw r11,(sp+20) 8014ca4: 2b 8c 00 10 lw r12,(sp+16) 8014ca8: 2b 8d 00 0c lw r13,(sp+12) 8014cac: 2b 8e 00 08 lw r14,(sp+8) 8014cb0: 37 9c 00 20 addi sp,sp,32 8014cb4: c3 a0 00 00 ret Objects_Id tmpId; if ( length == 0 ) return NULL; if ( name == NULL ) 8014cb8: 44 60 ff f8 be r3,r0,8014c98 <_Objects_Get_name_as_string+0x28> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 8014cbc: b8 20 68 00 mv r13,r1 8014cc0: 5c 20 00 05 bne r1,r0,8014cd4 <_Objects_Get_name_as_string+0x64> 8014cc4: 78 01 08 03 mvhi r1,0x803 8014cc8: 38 21 32 78 ori r1,r1,0x3278 8014ccc: 28 21 00 00 lw r1,(r1+0) 8014cd0: 28 2d 00 08 lw r13,(r1+8) information = _Objects_Get_information_id( tmpId ); 8014cd4: b9 a0 08 00 mv r1,r13 8014cd8: fb ff d9 17 calli 800b134 <_Objects_Get_information_id> 8014cdc: b8 20 70 00 mv r14,r1 if ( !information ) 8014ce0: 44 20 ff ed be r1,r0,8014c94 <_Objects_Get_name_as_string+0x24> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 8014ce4: b9 a0 10 00 mv r2,r13 8014ce8: 37 83 00 20 addi r3,sp,32 8014cec: fb ff d9 77 calli 800b2c8 <_Objects_Get> switch ( location ) { 8014cf0: 2b 82 00 20 lw r2,(sp+32) 8014cf4: 5c 40 ff e8 bne r2,r0,8014c94 <_Objects_Get_name_as_string+0x24> return NULL; case OBJECTS_LOCAL: #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 8014cf8: 41 ce 00 38 lbu r14,(r14+56) 8014cfc: 45 c2 00 1c be r14,r2,8014d6c <_Objects_Get_name_as_string+0xfc> s = the_object->name.name_p; 8014d00: 28 27 00 0c lw r7,(r1+12) lname[ 4 ] = '\0'; s = lname; } d = name; if ( s ) { 8014d04: 44 e0 00 2b be r7,r0,8014db0 <_Objects_Get_name_as_string+0x140><== NEVER TAKEN for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 8014d08: 35 8c ff ff addi r12,r12,-1 8014d0c: 45 80 00 29 be r12,r0,8014db0 <_Objects_Get_name_as_string+0x140><== NEVER TAKEN 8014d10: 40 e1 00 00 lbu r1,(r7+0) 8014d14: 44 20 00 27 be r1,r0,8014db0 <_Objects_Get_name_as_string+0x140> 8014d18: 78 04 08 03 mvhi r4,0x803 8014d1c: 38 84 23 b0 ori r4,r4,0x23b0 8014d20: b9 60 18 00 mv r3,r11 8014d24: 34 02 00 00 mvi r2,0 *d = (isprint((unsigned char)*s)) ? *s : '*'; 8014d28: 28 85 00 00 lw r5,(r4+0) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 8014d2c: 34 42 00 01 addi r2,r2,1 8014d30: b4 e2 30 00 add r6,r7,r2 *d = (isprint((unsigned char)*s)) ? *s : '*'; 8014d34: b4 a1 28 00 add r5,r5,r1 8014d38: 40 a5 00 01 lbu r5,(r5+1) 8014d3c: 20 a5 00 97 andi r5,r5,0x97 8014d40: 5c a0 00 02 bne r5,r0,8014d48 <_Objects_Get_name_as_string+0xd8> 8014d44: 34 01 00 2a mvi r1,42 8014d48: 30 61 00 00 sb (r3+0),r1 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 8014d4c: 34 63 00 01 addi r3,r3,1 8014d50: 50 4c 00 03 bgeu r2,r12,8014d5c <_Objects_Get_name_as_string+0xec> 8014d54: 40 c1 00 00 lbu r1,(r6+0) 8014d58: 5c 20 ff f4 bne r1,r0,8014d28 <_Objects_Get_name_as_string+0xb8> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 8014d5c: 34 01 00 00 mvi r1,0 8014d60: 30 61 00 00 sb (r3+0),r1 _Thread_Enable_dispatch(); 8014d64: fb ff dc a9 calli 800c008 <_Thread_Enable_dispatch> return name; 8014d68: e3 ff ff cc bi 8014c98 <_Objects_Get_name_as_string+0x28> if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 8014d6c: 28 2d 00 0c lw r13,(r1+12) lname[ 0 ] = (u32_name >> 24) & 0xff; 8014d70: 34 02 00 18 mvi r2,24 8014d74: b9 a0 08 00 mv r1,r13 8014d78: fb ff ae b2 calli 8000840 <__lshrsi3> 8014d7c: 33 81 00 18 sb (sp+24),r1 lname[ 1 ] = (u32_name >> 16) & 0xff; 8014d80: 34 02 00 10 mvi r2,16 8014d84: b9 a0 08 00 mv r1,r13 8014d88: fb ff ae ae calli 8000840 <__lshrsi3> 8014d8c: 33 81 00 19 sb (sp+25),r1 lname[ 2 ] = (u32_name >> 8) & 0xff; 8014d90: 34 02 00 08 mvi r2,8 8014d94: b9 a0 08 00 mv r1,r13 8014d98: fb ff ae aa calli 8000840 <__lshrsi3> 8014d9c: 33 81 00 1a sb (sp+26),r1 lname[ 3 ] = (u32_name >> 0) & 0xff; 8014da0: 33 8d 00 1b sb (sp+27),r13 lname[ 4 ] = '\0'; 8014da4: 33 8e 00 1c sb (sp+28),r14 8014da8: 37 87 00 18 addi r7,sp,24 8014dac: e3 ff ff d7 bi 8014d08 <_Objects_Get_name_as_string+0x98> s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 8014db0: b9 60 18 00 mv r3,r11 8014db4: e3 ff ff ea bi 8014d5c <_Objects_Get_name_as_string+0xec> 0801797c <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 801797c: 37 9c ff f4 addi sp,sp,-12 8017980: 5b 8b 00 0c sw (sp+12),r11 8017984: 5b 8c 00 08 sw (sp+8),r12 8017988: 5b 9d 00 04 sw (sp+4),ra /* * 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; 801798c: 28 25 00 08 lw r5,(r1+8) if ( information->maximum >= index ) { 8017990: 2c 24 00 10 lhu r4,(r1+16) Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 8017994: 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; 8017998: c8 45 10 00 sub r2,r2,r5 801799c: 34 42 00 01 addi r2,r2,1 if ( information->maximum >= index ) { 80179a0: 54 44 00 0f bgu r2,r4,80179dc <_Objects_Get_no_protection+0x60> if ( (the_object = information->local_table[ index ]) != NULL ) { 80179a4: 28 2c 00 1c lw r12,(r1+28) 80179a8: b8 40 08 00 mv r1,r2 80179ac: 34 02 00 02 mvi r2,2 80179b0: fb ff d9 52 calli 800def8 <__ashlsi3> 80179b4: b5 81 08 00 add r1,r12,r1 80179b8: 28 21 00 00 lw r1,(r1+0) 80179bc: 44 20 00 08 be r1,r0,80179dc <_Objects_Get_no_protection+0x60><== NEVER TAKEN *location = OBJECTS_LOCAL; 80179c0: 34 02 00 00 mvi r2,0 80179c4: 59 62 00 00 sw (r11+0),r2 * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; return NULL; } 80179c8: 2b 9d 00 04 lw ra,(sp+4) 80179cc: 2b 8b 00 0c lw r11,(sp+12) 80179d0: 2b 8c 00 08 lw r12,(sp+8) 80179d4: 37 9c 00 0c addi sp,sp,12 80179d8: c3 a0 00 00 ret /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 80179dc: 34 01 00 01 mvi r1,1 80179e0: 59 61 00 00 sw (r11+0),r1 80179e4: 34 01 00 00 mvi r1,0 return NULL; } 80179e8: 2b 9d 00 04 lw ra,(sp+4) 80179ec: 2b 8b 00 0c lw r11,(sp+12) 80179f0: 2b 8c 00 08 lw r12,(sp+8) 80179f4: 37 9c 00 0c addi sp,sp,12 80179f8: c3 a0 00 00 ret 0800b37c <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 800b37c: 37 9c ff ec addi sp,sp,-20 800b380: 5b 8b 00 10 sw (sp+16),r11 800b384: 5b 8c 00 0c sw (sp+12),r12 800b388: 5b 8d 00 08 sw (sp+8),r13 800b38c: 5b 9d 00 04 sw (sp+4),ra 800b390: b8 40 68 00 mv r13,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 800b394: b8 20 58 00 mv r11,r1 800b398: 5c 20 00 05 bne r1,r0,800b3ac <_Objects_Id_to_name+0x30> 800b39c: 78 01 08 03 mvhi r1,0x803 800b3a0: 38 21 32 78 ori r1,r1,0x3278 800b3a4: 28 21 00 00 lw r1,(r1+0) 800b3a8: 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); 800b3ac: b9 60 08 00 mv r1,r11 800b3b0: 34 02 00 18 mvi r2,24 800b3b4: fb ff d5 23 calli 8000840 <__lshrsi3> 800b3b8: 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 ) 800b3bc: 34 24 ff ff addi r4,r1,-1 800b3c0: 34 03 00 03 mvi r3,3 800b3c4: 54 83 00 12 bgu r4,r3,800b40c <_Objects_Id_to_name+0x90> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 800b3c8: 78 0c 08 03 mvhi r12,0x803 800b3cc: 34 02 00 02 mvi r2,2 800b3d0: 39 8c 31 54 ori r12,r12,0x3154 800b3d4: fb ff d4 f3 calli 80007a0 <__ashlsi3> 800b3d8: b5 81 08 00 add r1,r12,r1 800b3dc: 28 2c 00 00 lw r12,(r1+0) 800b3e0: 45 80 00 0b be r12,r0,800b40c <_Objects_Id_to_name+0x90> return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 800b3e4: 34 02 00 1b mvi r2,27 800b3e8: b9 60 08 00 mv r1,r11 800b3ec: fb ff d5 15 calli 8000840 <__lshrsi3> 800b3f0: 34 02 00 02 mvi r2,2 800b3f4: fb ff d4 eb calli 80007a0 <__ashlsi3> 800b3f8: b5 81 08 00 add r1,r12,r1 800b3fc: 28 21 00 00 lw r1,(r1+0) if ( !information ) 800b400: 44 20 00 03 be r1,r0,800b40c <_Objects_Id_to_name+0x90> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 800b404: 40 2c 00 38 lbu r12,(r1+56) 800b408: 45 80 00 08 be r12,r0,800b428 <_Objects_Id_to_name+0xac> <== ALWAYS TAKEN if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 800b40c: 34 01 00 03 mvi r1,3 } 800b410: 2b 9d 00 04 lw ra,(sp+4) 800b414: 2b 8b 00 10 lw r11,(sp+16) 800b418: 2b 8c 00 0c lw r12,(sp+12) 800b41c: 2b 8d 00 08 lw r13,(sp+8) 800b420: 37 9c 00 14 addi sp,sp,20 800b424: c3 a0 00 00 ret #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 ); 800b428: b9 60 10 00 mv r2,r11 800b42c: 37 83 00 14 addi r3,sp,20 800b430: fb ff ff a6 calli 800b2c8 <_Objects_Get> if ( !the_object ) 800b434: 44 2c ff f6 be r1,r12,800b40c <_Objects_Id_to_name+0x90> return OBJECTS_INVALID_ID; *name = the_object->name; 800b438: 28 21 00 0c lw r1,(r1+12) 800b43c: 59 a1 00 00 sw (r13+0),r1 _Thread_Enable_dispatch(); 800b440: f8 00 02 f2 calli 800c008 <_Thread_Enable_dispatch> 800b444: b9 80 08 00 mv r1,r12 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 800b448: 2b 9d 00 04 lw ra,(sp+4) 800b44c: 2b 8b 00 10 lw r11,(sp+16) 800b450: 2b 8c 00 0c lw r12,(sp+12) 800b454: 2b 8d 00 08 lw r13,(sp+8) 800b458: 37 9c 00 14 addi sp,sp,20 800b45c: c3 a0 00 00 ret 0800423c <_Objects_Set_name>: bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 800423c: 37 9c ff ec addi sp,sp,-20 8004240: 5b 8b 00 14 sw (sp+20),r11 8004244: 5b 8c 00 10 sw (sp+16),r12 8004248: 5b 8d 00 0c sw (sp+12),r13 800424c: 5b 8e 00 08 sw (sp+8),r14 8004250: 5b 9d 00 04 sw (sp+4),ra 8004254: b8 40 68 00 mv r13,r2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 8004258: 2c 22 00 3a lhu r2,(r1+58) bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 800425c: b8 20 70 00 mv r14,r1 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 8004260: b8 60 08 00 mv r1,r3 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 8004264: b8 60 58 00 mv r11,r3 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 8004268: f8 00 2d c8 calli 800f988 800426c: b8 20 60 00 mv r12,r1 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 8004270: 41 c1 00 38 lbu r1,(r14+56) 8004274: 5c 20 00 25 bne r1,r0,8004308 <_Objects_Set_name+0xcc> d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 8004278: 41 61 00 00 lbu r1,(r11+0) 800427c: 34 02 00 18 mvi r2,24 8004280: fb ff f0 65 calli 8000414 <__ashlsi3> 8004284: 34 03 00 01 mvi r3,1 8004288: b8 20 70 00 mv r14,r1 800428c: 50 6c 00 19 bgeu r3,r12,80042f0 <_Objects_Set_name+0xb4> 8004290: 41 61 00 01 lbu r1,(r11+1) 8004294: 34 02 00 10 mvi r2,16 8004298: fb ff f0 5f calli 8000414 <__ashlsi3> 800429c: b8 2e 70 00 or r14,r1,r14 80042a0: 34 01 00 02 mvi r1,2 80042a4: 45 81 00 16 be r12,r1,80042fc <_Objects_Set_name+0xc0> 80042a8: 41 61 00 02 lbu r1,(r11+2) 80042ac: 34 02 00 08 mvi r2,8 80042b0: fb ff f0 59 calli 8000414 <__ashlsi3> 80042b4: b9 c1 70 00 or r14,r14,r1 80042b8: 34 01 00 03 mvi r1,3 80042bc: 34 02 00 20 mvi r2,32 80042c0: 45 81 00 02 be r12,r1,80042c8 <_Objects_Set_name+0x8c> 80042c4: 41 62 00 03 lbu r2,(r11+3) 80042c8: b9 c2 70 00 or r14,r14,r2 80042cc: 59 ae 00 0c sw (r13+12),r14 80042d0: 34 01 00 01 mvi r1,1 ); } return true; } 80042d4: 2b 9d 00 04 lw ra,(sp+4) 80042d8: 2b 8b 00 14 lw r11,(sp+20) 80042dc: 2b 8c 00 10 lw r12,(sp+16) 80042e0: 2b 8d 00 0c lw r13,(sp+12) 80042e4: 2b 8e 00 08 lw r14,(sp+8) 80042e8: 37 9c 00 14 addi sp,sp,20 80042ec: c3 a0 00 00 ret d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 80042f0: 78 01 00 20 mvhi r1,0x20 80042f4: 38 21 00 00 ori r1,r1,0x0 80042f8: b9 c1 70 00 or r14,r14,r1 80042fc: 39 ce 20 00 ori r14,r14,0x2000 8004300: 34 02 00 20 mvi r2,32 8004304: e3 ff ff f1 bi 80042c8 <_Objects_Set_name+0x8c> #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 8004308: 35 81 00 01 addi r1,r12,1 800430c: f8 00 04 3d calli 8005400 <_Workspace_Allocate> 8004310: b8 20 70 00 mv r14,r1 if ( !d ) 8004314: 45 c0 ff f0 be r14,r0,80042d4 <_Objects_Set_name+0x98> <== NEVER TAKEN return false; if ( the_object->name.name_p ) { 8004318: 29 a1 00 0c lw r1,(r13+12) 800431c: 44 20 00 04 be r1,r0,800432c <_Objects_Set_name+0xf0> _Workspace_Free( (void *)the_object->name.name_p ); 8004320: f8 00 04 43 calli 800542c <_Workspace_Free> the_object->name.name_p = NULL; 8004324: 34 01 00 00 mvi r1,0 8004328: 59 a1 00 0c sw (r13+12),r1 } strncpy( d, name, length ); 800432c: b9 80 18 00 mv r3,r12 8004330: b9 60 10 00 mv r2,r11 8004334: b9 c0 08 00 mv r1,r14 8004338: f8 00 2d 62 calli 800f8c0 d[length] = '\0'; 800433c: b5 cc 60 00 add r12,r14,r12 8004340: 34 01 00 00 mvi r1,0 8004344: 31 81 00 00 sb (r12+0),r1 the_object->name.name_p = d; 8004348: 34 01 00 01 mvi r1,1 800434c: 59 ae 00 0c sw (r13+12),r14 ); } return true; } 8004350: 2b 9d 00 04 lw ra,(sp+4) 8004354: 2b 8b 00 14 lw r11,(sp+20) 8004358: 2b 8c 00 10 lw r12,(sp+16) 800435c: 2b 8d 00 0c lw r13,(sp+12) 8004360: 2b 8e 00 08 lw r14,(sp+8) 8004364: 37 9c 00 14 addi sp,sp,20 8004368: c3 a0 00 00 ret 08003fdc <_Objects_Shrink_information>: */ void _Objects_Shrink_information( Objects_Information *information ) { 8003fdc: 37 9c ff ec addi sp,sp,-20 8003fe0: 5b 8b 00 14 sw (sp+20),r11 8003fe4: 5b 8c 00 10 sw (sp+16),r12 8003fe8: 5b 8d 00 0c sw (sp+12),r13 8003fec: 5b 8e 00 08 sw (sp+8),r14 8003ff0: 5b 9d 00 04 sw (sp+4),ra /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 8003ff4: 28 2c 00 08 lw r12,(r1+8) block_count = (information->maximum - index_base) / 8003ff8: 2c 2d 00 14 lhu r13,(r1+20) */ void _Objects_Shrink_information( Objects_Information *information ) { 8003ffc: b8 20 70 00 mv r14,r1 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / 8004000: 2c 21 00 10 lhu r1,(r1+16) /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 8004004: 21 8c ff ff andi r12,r12,0xffff block_count = (information->maximum - index_base) / 8004008: b9 a0 10 00 mv r2,r13 800400c: c8 2c 08 00 sub r1,r1,r12 8004010: f8 00 5d 31 calli 801b4d4 <__udivsi3> information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8004014: 44 20 00 09 be r1,r0,8004038 <_Objects_Shrink_information+0x5c><== NEVER TAKEN if ( information->inactive_per_block[ block ] == 8004018: 29 c5 00 30 lw r5,(r14+48) information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 800401c: 34 0b 00 04 mvi r11,4 8004020: 34 03 00 00 mvi r3,0 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 8004024: 28 a2 00 00 lw r2,(r5+0) 8004028: 45 a2 00 11 be r13,r2,800406c <_Objects_Shrink_information+0x90><== NEVER TAKEN index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 800402c: 34 63 00 01 addi r3,r3,1 if ( information->inactive_per_block[ block ] == 8004030: b4 ab 10 00 add r2,r5,r11 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8004034: 54 23 00 08 bgu r1,r3,8004054 <_Objects_Shrink_information+0x78> return; } index_base += information->allocation_size; } } 8004038: 2b 9d 00 04 lw ra,(sp+4) 800403c: 2b 8b 00 14 lw r11,(sp+20) 8004040: 2b 8c 00 10 lw r12,(sp+16) 8004044: 2b 8d 00 0c lw r13,(sp+12) 8004048: 2b 8e 00 08 lw r14,(sp+8) 800404c: 37 9c 00 14 addi sp,sp,20 8004050: c3 a0 00 00 ret index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 8004054: 28 42 00 00 lw r2,(r2+0) information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 8004058: b5 8d 60 00 add r12,r12,r13 800405c: 35 64 00 04 addi r4,r11,4 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 8004060: 45 a2 00 04 be r13,r2,8004070 <_Objects_Shrink_information+0x94> 8004064: b8 80 58 00 mv r11,r4 8004068: e3 ff ff f1 bi 800402c <_Objects_Shrink_information+0x50> 800406c: b8 60 58 00 mv r11,r3 <== NOT EXECUTED information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; 8004070: 29 c1 00 20 lw r1,(r14+32) do { index = _Objects_Get_index( the_object->id ); 8004074: 28 22 00 08 lw r2,(r1+8) /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 8004078: 28 2d 00 00 lw r13,(r1+0) * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; do { index = _Objects_Get_index( the_object->id ); 800407c: 20 42 ff ff andi r2,r2,0xffff /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 8004080: 55 82 00 05 bgu r12,r2,8004094 <_Objects_Shrink_information+0xb8> (index < (index_base + information->allocation_size))) { 8004084: 2d c3 00 14 lhu r3,(r14+20) 8004088: b5 83 18 00 add r3,r12,r3 800408c: 50 43 00 02 bgeu r2,r3,8004094 <_Objects_Shrink_information+0xb8> _Chain_Extract( &extract_me->Node ); 8004090: f8 00 14 b5 calli 8009364 <_Chain_Extract> } } while ( the_object ); 8004094: 45 a0 00 03 be r13,r0,80040a0 <_Objects_Shrink_information+0xc4> 8004098: b9 a0 08 00 mv r1,r13 800409c: e3 ff ff f6 bi 8004074 <_Objects_Shrink_information+0x98> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 80040a0: 29 c1 00 34 lw r1,(r14+52) 80040a4: b4 2b 08 00 add r1,r1,r11 80040a8: 28 21 00 00 lw r1,(r1+0) 80040ac: f8 00 07 de calli 8006024 <_Workspace_Free> information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 80040b0: 2d c3 00 2c lhu r3,(r14+44) /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 80040b4: 29 c1 00 34 lw r1,(r14+52) information->inactive_per_block[ block ] = 0; 80040b8: 29 c4 00 30 lw r4,(r14+48) information->inactive -= information->allocation_size; 80040bc: 2d c2 00 14 lhu r2,(r14+20) /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 80040c0: b4 2b 08 00 add r1,r1,r11 information->inactive_per_block[ block ] = 0; 80040c4: b4 8b 58 00 add r11,r4,r11 information->inactive -= information->allocation_size; 80040c8: c8 62 10 00 sub r2,r3,r2 * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 80040cc: 59 6d 00 00 sw (r11+0),r13 information->inactive -= information->allocation_size; 80040d0: 0d c2 00 2c sh (r14+44),r2 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 80040d4: 58 2d 00 00 sw (r1+0),r13 return; } index_base += information->allocation_size; } } 80040d8: 2b 9d 00 04 lw ra,(sp+4) 80040dc: 2b 8b 00 14 lw r11,(sp+20) 80040e0: 2b 8c 00 10 lw r12,(sp+16) 80040e4: 2b 8d 00 0c lw r13,(sp+12) 80040e8: 2b 8e 00 08 lw r14,(sp+8) 80040ec: 37 9c 00 14 addi sp,sp,20 80040f0: c3 a0 00 00 ret 08003da4 <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 8003da4: 37 9c ff e0 addi sp,sp,-32 8003da8: 5b 8b 00 1c sw (sp+28),r11 8003dac: 5b 8c 00 18 sw (sp+24),r12 8003db0: 5b 8d 00 14 sw (sp+20),r13 8003db4: 5b 8e 00 10 sw (sp+16),r14 8003db8: 5b 8f 00 0c sw (sp+12),r15 8003dbc: 5b 90 00 08 sw (sp+8),r16 8003dc0: 5b 9d 00 04 sw (sp+4),ra 8003dc4: b8 40 58 00 mv r11,r2 8003dc8: b8 20 70 00 mv r14,r1 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 8003dcc: 37 82 00 20 addi r2,sp,32 8003dd0: b9 60 08 00 mv r1,r11 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 8003dd4: b8 60 78 00 mv r15,r3 8003dd8: 20 8d 00 ff andi r13,r4,0xff register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 8003ddc: f8 00 00 90 calli 800401c <_POSIX_Mutex_Get> 8003de0: 44 20 00 0c be r1,r0,8003e10 <_POSIX_Condition_variables_Wait_support+0x6c> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8003de4: 78 05 08 02 mvhi r5,0x802 8003de8: 38 a5 18 74 ori r5,r5,0x1874 8003dec: 28 a4 00 00 lw r4,(r5+0) return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 8003df0: b9 c0 08 00 mv r1,r14 8003df4: 37 82 00 20 addi r2,sp,32 8003df8: 34 84 ff ff addi r4,r4,-1 8003dfc: 58 a4 00 00 sw (r5+0),r4 8003e00: fb ff ff 39 calli 8003ae4 <_POSIX_Condition_variables_Get> switch ( location ) { 8003e04: 2b 85 00 20 lw r5,(sp+32) return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 8003e08: b8 20 60 00 mv r12,r1 switch ( location ) { 8003e0c: 44 a0 00 0c be r5,r0,8003e3c <_POSIX_Condition_variables_Wait_support+0x98> /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); if ( mutex_status ) 8003e10: 34 0c 00 16 mvi r12,22 case OBJECTS_ERROR: break; } return EINVAL; } 8003e14: b9 80 08 00 mv r1,r12 8003e18: 2b 9d 00 04 lw ra,(sp+4) 8003e1c: 2b 8b 00 1c lw r11,(sp+28) 8003e20: 2b 8c 00 18 lw r12,(sp+24) 8003e24: 2b 8d 00 14 lw r13,(sp+20) 8003e28: 2b 8e 00 10 lw r14,(sp+16) 8003e2c: 2b 8f 00 0c lw r15,(sp+12) 8003e30: 2b 90 00 08 lw r16,(sp+8) 8003e34: 37 9c 00 20 addi sp,sp,32 8003e38: c3 a0 00 00 ret the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 8003e3c: 28 21 00 14 lw r1,(r1+20) 8003e40: 44 25 00 06 be r1,r5,8003e58 <_POSIX_Condition_variables_Wait_support+0xb4> 8003e44: 29 62 00 00 lw r2,(r11+0) 8003e48: 44 22 00 04 be r1,r2,8003e58 <_POSIX_Condition_variables_Wait_support+0xb4> _Thread_Enable_dispatch(); 8003e4c: f8 00 0c a5 calli 80070e0 <_Thread_Enable_dispatch> 8003e50: 34 0c 00 16 mvi r12,22 return EINVAL; 8003e54: e3 ff ff f0 bi 8003e14 <_POSIX_Condition_variables_Wait_support+0x70> } (void) pthread_mutex_unlock( mutex ); 8003e58: b9 60 08 00 mv r1,r11 8003e5c: f8 00 01 20 calli 80042dc _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 8003e60: 45 a0 00 07 be r13,r0,8003e7c <_POSIX_Condition_variables_Wait_support+0xd8> status = _Thread_Executing->Wait.return_code; if ( status && status != ETIMEDOUT ) return status; } else { _Thread_Enable_dispatch(); 8003e64: f8 00 0c 9f calli 80070e0 <_Thread_Enable_dispatch> 8003e68: 34 0c 00 74 mvi r12,116 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 8003e6c: b9 60 08 00 mv r1,r11 8003e70: f8 00 00 e9 calli 8004214 if ( mutex_status ) 8003e74: 44 20 ff e8 be r1,r0,8003e14 <_POSIX_Condition_variables_Wait_support+0x70> 8003e78: e3 ff ff e6 bi 8003e10 <_POSIX_Condition_variables_Wait_support+0x6c> if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 8003e7c: 78 10 08 02 mvhi r16,0x802 return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 8003e80: 29 61 00 00 lw r1,(r11+0) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 8003e84: 3a 10 19 30 ori r16,r16,0x1930 8003e88: 2a 04 00 00 lw r4,(r16+0) return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 8003e8c: 59 81 00 14 sw (r12+20),r1 _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 8003e90: 35 85 00 18 addi r5,r12,24 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 8003e94: 58 8d 00 34 sw (r4+52),r13 _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 8003e98: 29 ce 00 00 lw r14,(r14+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; 8003e9c: 34 01 00 01 mvi r1,1 _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 8003ea0: 78 03 08 00 mvhi r3,0x800 8003ea4: 59 81 00 48 sw (r12+72),r1 8003ea8: b9 e0 10 00 mv r2,r15 8003eac: b8 a0 08 00 mv r1,r5 the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 8003eb0: 58 8e 00 20 sw (r4+32),r14 _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 8003eb4: 38 63 7b 88 ori r3,r3,0x7b88 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 8003eb8: 58 85 00 44 sw (r4+68),r5 _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 8003ebc: f8 00 0d e5 calli 8007650 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 8003ec0: f8 00 0c 88 calli 80070e0 <_Thread_Enable_dispatch> /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 8003ec4: 2a 01 00 00 lw r1,(r16+0) 8003ec8: 28 2c 00 34 lw r12,(r1+52) if ( status && status != ETIMEDOUT ) 8003ecc: 7d 82 00 74 cmpnei r2,r12,116 8003ed0: 7d 81 00 00 cmpnei r1,r12,0 8003ed4: a0 41 08 00 and r1,r2,r1 8003ed8: 44 2d ff e5 be r1,r13,8003e6c <_POSIX_Condition_variables_Wait_support+0xc8><== ALWAYS TAKEN 8003edc: e3 ff ff ce bi 8003e14 <_POSIX_Condition_variables_Wait_support+0x70><== NOT EXECUTED 08008c18 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 8008c18: 37 9c ff d8 addi sp,sp,-40 8008c1c: 5b 8b 00 20 sw (sp+32),r11 8008c20: 5b 8c 00 1c sw (sp+28),r12 8008c24: 5b 8d 00 18 sw (sp+24),r13 8008c28: 5b 8e 00 14 sw (sp+20),r14 8008c2c: 5b 8f 00 10 sw (sp+16),r15 8008c30: 5b 90 00 0c sw (sp+12),r16 8008c34: 5b 91 00 08 sw (sp+8),r17 8008c38: 5b 9d 00 04 sw (sp+4),ra 8008c3c: b8 20 68 00 mv r13,r1 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 8008c40: 78 01 08 02 mvhi r1,0x802 8008c44: b8 40 88 00 mv r17,r2 8008c48: b8 60 70 00 mv r14,r3 8008c4c: 38 21 a2 40 ori r1,r1,0xa240 8008c50: b9 a0 10 00 mv r2,r13 8008c54: 37 83 00 28 addi r3,sp,40 8008c58: b8 80 78 00 mv r15,r4 8008c5c: b8 c0 80 00 mv r16,r6 8008c60: 20 ab 00 ff andi r11,r5,0xff 8008c64: f8 00 0c 77 calli 800be40 <_Objects_Get> 8008c68: b8 20 38 00 mv r7,r1 Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 8008c6c: 2b 81 00 28 lw r1,(sp+40) 8008c70: 44 20 00 0f be r1,r0,8008cac <_POSIX_Message_queue_Receive_support+0x94> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 8008c74: f8 00 32 5d calli 80155e8 <__errno> 8008c78: 34 02 00 09 mvi r2,9 8008c7c: 58 22 00 00 sw (r1+0),r2 8008c80: 34 01 ff ff mvi r1,-1 } 8008c84: 2b 9d 00 04 lw ra,(sp+4) 8008c88: 2b 8b 00 20 lw r11,(sp+32) 8008c8c: 2b 8c 00 1c lw r12,(sp+28) 8008c90: 2b 8d 00 18 lw r13,(sp+24) 8008c94: 2b 8e 00 14 lw r14,(sp+20) 8008c98: 2b 8f 00 10 lw r15,(sp+16) 8008c9c: 2b 90 00 0c lw r16,(sp+12) 8008ca0: 2b 91 00 08 lw r17,(sp+8) 8008ca4: 37 9c 00 28 addi sp,sp,40 8008ca8: c3 a0 00 00 ret the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 8008cac: 28 e1 00 14 lw r1,(r7+20) 8008cb0: 34 05 00 01 mvi r5,1 8008cb4: 20 28 00 03 andi r8,r1,0x3 8008cb8: 45 05 00 30 be r8,r5,8008d78 <_POSIX_Message_queue_Receive_support+0x160> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 8008cbc: 28 ec 00 10 lw r12,(r7+16) if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 8008cc0: 29 82 00 68 lw r2,(r12+104) 8008cc4: 51 c2 00 07 bgeu r14,r2,8008ce0 <_POSIX_Message_queue_Receive_support+0xc8> _Thread_Enable_dispatch(); 8008cc8: f8 00 0f 16 calli 800c920 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 8008ccc: f8 00 32 47 calli 80155e8 <__errno> 8008cd0: 34 02 00 7a mvi r2,122 8008cd4: 58 22 00 00 sw (r1+0),r2 8008cd8: 34 01 ff ff mvi r1,-1 8008cdc: e3 ff ff ea bi 8008c84 <_POSIX_Message_queue_Receive_support+0x6c> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 8008ce0: b9 60 28 00 mv r5,r11 8008ce4: 5d 60 00 18 bne r11,r0,8008d44 <_POSIX_Message_queue_Receive_support+0x12c><== ALWAYS TAKEN timeout ); _Thread_Enable_dispatch(); *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 8008ce8: 78 0b 08 02 mvhi r11,0x802 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 8008cec: 35 81 00 1c addi r1,r12,28 8008cf0: b9 a0 10 00 mv r2,r13 8008cf4: ba 20 18 00 mv r3,r17 8008cf8: ba 00 30 00 mv r6,r16 8008cfc: 37 84 00 24 addi r4,sp,36 timeout ); _Thread_Enable_dispatch(); *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 8008d00: 39 6b 9e 70 ori r11,r11,0x9e70 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 8008d04: 34 0d ff ff mvi r13,-1 8008d08: 5b 8d 00 24 sw (sp+36),r13 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 8008d0c: f8 00 07 41 calli 800aa10 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 8008d10: f8 00 0f 04 calli 800c920 <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 8008d14: 29 6c 00 00 lw r12,(r11+0) do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 8008d18: 34 02 00 1f mvi r2,31 8008d1c: 29 81 00 24 lw r1,(r12+36) 8008d20: fb ff f6 95 calli 8006774 <__ashrsi3> 8008d24: 29 83 00 24 lw r3,(r12+36) _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 8008d28: 29 82 00 34 lw r2,(r12+52) do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 8008d2c: 98 23 18 00 xor r3,r1,r3 8008d30: c8 61 08 00 sub r1,r3,r1 8008d34: 59 e1 00 00 sw (r15+0),r1 _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 8008d38: 5c 40 00 08 bne r2,r0,8008d58 <_POSIX_Message_queue_Receive_support+0x140> return length_out; 8008d3c: 2b 81 00 24 lw r1,(sp+36) 8008d40: e3 ff ff d1 bi 8008c84 <_POSIX_Message_queue_Receive_support+0x6c> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 8008d44: 34 02 00 0e mvi r2,14 8008d48: fb ff f6 63 calli 80066d4 <__lshrsi3> 8008d4c: 18 21 00 01 xori r1,r1,0x1 8008d50: 20 25 00 01 andi r5,r1,0x1 8008d54: e3 ff ff e5 bi 8008ce8 <_POSIX_Message_queue_Receive_support+0xd0> _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) return length_out; rtems_set_errno_and_return_minus_one( 8008d58: f8 00 32 24 calli 80155e8 <__errno> 8008d5c: b8 20 60 00 mv r12,r1 8008d60: 29 61 00 00 lw r1,(r11+0) 8008d64: 28 21 00 34 lw r1,(r1+52) 8008d68: f8 00 00 c7 calli 8009084 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 8008d6c: 59 81 00 00 sw (r12+0),r1 8008d70: b9 a0 08 00 mv r1,r13 8008d74: e3 ff ff c4 bi 8008c84 <_POSIX_Message_queue_Receive_support+0x6c> the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { _Thread_Enable_dispatch(); 8008d78: f8 00 0e ea calli 800c920 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EBADF ); 8008d7c: f8 00 32 1b calli 80155e8 <__errno> 8008d80: 34 02 00 09 mvi r2,9 8008d84: 58 22 00 00 sw (r1+0),r2 8008d88: 34 01 ff ff mvi r1,-1 8008d8c: e3 ff ff be bi 8008c84 <_POSIX_Message_queue_Receive_support+0x6c> 08007230 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 8007230: 37 9c ff fc addi sp,sp,-4 8007234: 5b 9d 00 04 sw (sp+4),ra POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8007238: 28 22 01 2c lw r2,(r1+300) if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 800723c: 28 43 00 d4 lw r3,(r2+212) 8007240: 5c 60 00 04 bne r3,r0,8007250 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x20><== NEVER TAKEN thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 8007244: 28 44 00 d8 lw r4,(r2+216) 8007248: 34 03 00 01 mvi r3,1 800724c: 44 83 00 05 be r4,r3,8007260 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x30> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); 8007250: fb ff f3 fc calli 8004240 <_Thread_Enable_dispatch> } 8007254: 2b 9d 00 04 lw ra,(sp+4) 8007258: 37 9c 00 04 addi sp,sp,4 800725c: c3 a0 00 00 ret thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && thread_support->cancelation_requested ) { 8007260: 28 42 00 dc lw r2,(r2+220) 8007264: 44 40 ff fb be r2,r0,8007250 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x20> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8007268: 78 03 08 01 mvhi r3,0x801 800726c: 38 63 f8 64 ori r3,r3,0xf864 8007270: 28 64 00 00 lw r4,(r3+0) _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 8007274: 34 02 ff ff mvi r2,-1 8007278: b4 82 20 00 add r4,r4,r2 800727c: 58 64 00 00 sw (r3+0),r4 8007280: f8 00 02 2f calli 8007b3c <_POSIX_Thread_Exit> { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 8007284: e3 ff ff f4 bi 8007254 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x24> 08009b48 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 8009b48: 37 9c ff ec addi sp,sp,-20 8009b4c: 5b 8b 00 14 sw (sp+20),r11 8009b50: 5b 8c 00 10 sw (sp+16),r12 8009b54: 5b 8d 00 0c sw (sp+12),r13 8009b58: 5b 8e 00 08 sw (sp+8),r14 8009b5c: 5b 9d 00 04 sw (sp+4),ra 8009b60: b8 20 60 00 mv r12,r1 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 8009b64: 28 41 00 00 lw r1,(r2+0) int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 8009b68: b8 40 58 00 mv r11,r2 8009b6c: b8 60 68 00 mv r13,r3 8009b70: b8 80 70 00 mv r14,r4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 8009b74: fb ff ff ed calli 8009b28 <_POSIX_Priority_Is_valid> 8009b78: 34 02 00 00 mvi r2,0 8009b7c: 44 22 00 0a be r1,r2,8009ba4 <_POSIX_Thread_Translate_sched_param+0x5c><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 8009b80: 59 a2 00 00 sw (r13+0),r2 *budget_callout = NULL; 8009b84: 59 c2 00 00 sw (r14+0),r2 if ( policy == SCHED_OTHER ) { 8009b88: 45 82 00 0f be r12,r2,8009bc4 <_POSIX_Thread_Translate_sched_param+0x7c> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 8009b8c: 34 01 00 01 mvi r1,1 8009b90: 45 81 00 2f be r12,r1,8009c4c <_POSIX_Thread_Translate_sched_param+0x104> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 8009b94: 34 01 00 02 mvi r1,2 8009b98: 45 81 00 30 be r12,r1,8009c58 <_POSIX_Thread_Translate_sched_param+0x110> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 8009b9c: 34 01 00 04 mvi r1,4 8009ba0: 45 81 00 13 be r12,r1,8009bec <_POSIX_Thread_Translate_sched_param+0xa4> if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; 8009ba4: 34 01 00 16 mvi r1,22 } return EINVAL; } 8009ba8: 2b 9d 00 04 lw ra,(sp+4) 8009bac: 2b 8b 00 14 lw r11,(sp+20) 8009bb0: 2b 8c 00 10 lw r12,(sp+16) 8009bb4: 2b 8d 00 0c lw r13,(sp+12) 8009bb8: 2b 8e 00 08 lw r14,(sp+8) 8009bbc: 37 9c 00 14 addi sp,sp,20 8009bc0: c3 a0 00 00 ret *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 8009bc4: 34 01 00 01 mvi r1,1 8009bc8: 59 a1 00 00 sw (r13+0),r1 8009bcc: b9 80 08 00 mv r1,r12 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 8009bd0: 2b 9d 00 04 lw ra,(sp+4) 8009bd4: 2b 8b 00 14 lw r11,(sp+20) 8009bd8: 2b 8c 00 10 lw r12,(sp+16) 8009bdc: 2b 8d 00 0c lw r13,(sp+12) 8009be0: 2b 8e 00 08 lw r14,(sp+8) 8009be4: 37 9c 00 14 addi sp,sp,20 8009be8: c3 a0 00 00 ret *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { if ( (param->sched_ss_repl_period.tv_sec == 0) && 8009bec: 29 61 00 08 lw r1,(r11+8) 8009bf0: 5c 20 00 03 bne r1,r0,8009bfc <_POSIX_Thread_Translate_sched_param+0xb4> (param->sched_ss_repl_period.tv_nsec == 0) ) 8009bf4: 29 62 00 0c lw r2,(r11+12) 8009bf8: 44 41 ff eb be r2,r1,8009ba4 <_POSIX_Thread_Translate_sched_param+0x5c> return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 8009bfc: 29 61 00 10 lw r1,(r11+16) 8009c00: 5c 20 00 03 bne r1,r0,8009c0c <_POSIX_Thread_Translate_sched_param+0xc4> (param->sched_ss_init_budget.tv_nsec == 0) ) 8009c04: 29 62 00 14 lw r2,(r11+20) 8009c08: 44 41 ff e7 be r2,r1,8009ba4 <_POSIX_Thread_Translate_sched_param+0x5c> return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 8009c0c: 35 61 00 08 addi r1,r11,8 8009c10: fb ff f3 d5 calli 8006b64 <_Timespec_To_ticks> 8009c14: b8 20 60 00 mv r12,r1 8009c18: 35 61 00 10 addi r1,r11,16 8009c1c: fb ff f3 d2 calli 8006b64 <_Timespec_To_ticks> 8009c20: 54 2c ff e1 bgu r1,r12,8009ba4 <_POSIX_Thread_Translate_sched_param+0x5c> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 8009c24: 29 61 00 04 lw r1,(r11+4) 8009c28: fb ff ff c0 calli 8009b28 <_POSIX_Priority_Is_valid> 8009c2c: 44 20 ff de be r1,r0,8009ba4 <_POSIX_Thread_Translate_sched_param+0x5c> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 8009c30: 78 01 08 00 mvhi r1,0x800 8009c34: 38 21 33 f8 ori r1,r1,0x33f8 return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 8009c38: 34 02 00 03 mvi r2,3 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 8009c3c: 59 c1 00 00 sw (r14+0),r1 return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 8009c40: 59 a2 00 00 sw (r13+0),r2 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 8009c44: 34 01 00 00 mvi r1,0 return 0; 8009c48: e3 ff ff d8 bi 8009ba8 <_POSIX_Thread_Translate_sched_param+0x60> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 8009c4c: 59 a2 00 00 sw (r13+0),r2 8009c50: b8 40 08 00 mv r1,r2 return 0; 8009c54: e3 ff ff d5 bi 8009ba8 <_POSIX_Thread_Translate_sched_param+0x60> } if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 8009c58: 59 ac 00 00 sw (r13+0),r12 8009c5c: b8 40 08 00 mv r1,r2 return 0; 8009c60: e3 ff ff d2 bi 8009ba8 <_POSIX_Thread_Translate_sched_param+0x60> 08008610 <_POSIX_Threads_Exitted_extension>: * This method is invoked each time a thread exits. */ void _POSIX_Threads_Exitted_extension( Thread_Control *executing ) { 8008610: 37 9c ff f8 addi sp,sp,-8 8008614: 5b 8b 00 08 sw (sp+8),r11 8008618: 5b 9d 00 04 sw (sp+4),ra 800861c: b8 20 58 00 mv r11,r1 /* * If the executing thread was not created with the POSIX API, then this * API do not get to define its exit behavior. */ if ( _Objects_Get_API( executing->Object.id ) == OBJECTS_POSIX_API ) 8008620: 28 21 00 08 lw r1,(r1+8) 8008624: 34 02 00 18 mvi r2,24 8008628: fb ff df 1a calli 8000290 <__lshrsi3> 800862c: 20 21 00 07 andi r1,r1,0x7 8008630: 34 02 00 03 mvi r2,3 8008634: 44 22 00 05 be r1,r2,8008648 <_POSIX_Threads_Exitted_extension+0x38> pthread_exit( executing->Wait.return_argument ); } 8008638: 2b 9d 00 04 lw ra,(sp+4) 800863c: 2b 8b 00 08 lw r11,(sp+8) 8008640: 37 9c 00 08 addi sp,sp,8 8008644: c3 a0 00 00 ret /* * If the executing thread was not created with the POSIX API, then this * API do not get to define its exit behavior. */ if ( _Objects_Get_API( executing->Object.id ) == OBJECTS_POSIX_API ) pthread_exit( executing->Wait.return_argument ); 8008648: 29 61 00 28 lw r1,(r11+40) 800864c: f8 00 0d 49 calli 800bb70 } 8008650: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8008654: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8008658: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 800865c: c3 a0 00 00 ret <== NOT EXECUTED 08003074 <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 8003074: 37 9c ff ac addi sp,sp,-84 8003078: 5b 8b 00 14 sw (sp+20),r11 800307c: 5b 8c 00 10 sw (sp+16),r12 8003080: 5b 8d 00 0c sw (sp+12),r13 8003084: 5b 8e 00 08 sw (sp+8),r14 8003088: 5b 9d 00 04 sw (sp+4),ra uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 800308c: 78 01 08 01 mvhi r1,0x801 8003090: 38 21 f0 a8 ori r1,r1,0xf0a8 maximum = Configuration_POSIX_API.number_of_initialization_threads; 8003094: 28 2e 00 30 lw r14,(r1+48) uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 8003098: 28 2c 00 34 lw r12,(r1+52) maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads || maximum == 0 ) 800309c: 65 cd 00 00 cmpei r13,r14,0 80030a0: 65 81 00 00 cmpei r1,r12,0 80030a4: b9 a1 68 00 or r13,r13,r1 80030a8: 5d a0 00 13 bne r13,r0,80030f4 <_POSIX_Threads_Initialize_user_threads_body+0x80><== NEVER TAKEN 80030ac: 37 8b 00 18 addi r11,sp,24 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 80030b0: b9 60 08 00 mv r1,r11 80030b4: f8 00 1a ec calli 8009c64 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 80030b8: 34 02 00 02 mvi r2,2 80030bc: b9 60 08 00 mv r1,r11 80030c0: f8 00 1b 0e calli 8009cf8 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 80030c4: 29 82 00 04 lw r2,(r12+4) 80030c8: b9 60 08 00 mv r1,r11 80030cc: f8 00 1b 19 calli 8009d30 status = pthread_create( 80030d0: 29 83 00 00 lw r3,(r12+0) 80030d4: 37 81 00 54 addi r1,sp,84 80030d8: b9 60 10 00 mv r2,r11 80030dc: 34 04 00 00 mvi r4,0 80030e0: fb ff fe de calli 8002c58 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 80030e4: 5c 20 00 0b bne r1,r0,8003110 <_POSIX_Threads_Initialize_user_threads_body+0x9c> * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 80030e8: 35 ad 00 01 addi r13,r13,1 80030ec: 35 8c 00 08 addi r12,r12,8 80030f0: 55 cd ff f0 bgu r14,r13,80030b0 <_POSIX_Threads_Initialize_user_threads_body+0x3c><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 80030f4: 2b 9d 00 04 lw ra,(sp+4) 80030f8: 2b 8b 00 14 lw r11,(sp+20) 80030fc: 2b 8c 00 10 lw r12,(sp+16) 8003100: 2b 8d 00 0c lw r13,(sp+12) 8003104: 2b 8e 00 08 lw r14,(sp+8) 8003108: 37 9c 00 54 addi sp,sp,84 800310c: c3 a0 00 00 ret &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 8003110: b8 20 18 00 mv r3,r1 8003114: 34 02 00 01 mvi r2,1 8003118: 34 01 00 02 mvi r1,2 800311c: f8 00 06 6b calli 8004ac8 <_Internal_error_Occurred> 080088b8 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 80088b8: 37 9c ff f4 addi sp,sp,-12 80088bc: 5b 8b 00 0c sw (sp+12),r11 80088c0: 5b 8c 00 08 sw (sp+8),r12 80088c4: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 80088c8: 28 4c 01 2c lw r12,(r2+300) */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 80088cc: b8 40 58 00 mv r11,r2 the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 80088d0: 35 81 00 94 addi r1,r12,148 80088d4: f8 00 07 13 calli 800a520 <_Timespec_To_ticks> 80088d8: 78 02 08 01 mvhi r2,0x801 80088dc: 38 42 e0 c0 ori r2,r2,0xe0c0 the_thread->cpu_time_budget = ticks; 80088e0: 59 61 00 78 sw (r11+120),r1 80088e4: 40 41 00 00 lbu r1,(r2+0) 80088e8: 29 82 00 84 lw r2,(r12+132) */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 80088ec: 29 63 00 1c lw r3,(r11+28) 80088f0: c8 22 10 00 sub r2,r1,r2 ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); the_thread->cpu_time_budget = ticks; new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 80088f4: 59 62 00 18 sw (r11+24),r2 */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 80088f8: 5c 60 00 06 bne r3,r0,8008910 <_POSIX_Threads_Sporadic_budget_TSR+0x58><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 80088fc: 29 61 00 14 lw r1,(r11+20) 8008900: 50 41 00 04 bgeu r2,r1,8008910 <_POSIX_Threads_Sporadic_budget_TSR+0x58> _Thread_Change_priority( the_thread, new_priority, true ); 8008904: b9 60 08 00 mv r1,r11 8008908: 34 03 00 01 mvi r3,1 800890c: fb ff ed fc calli 80040fc <_Thread_Change_priority> #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 8008910: 35 81 00 8c addi r1,r12,140 8008914: f8 00 07 03 calli 800a520 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8008918: 59 81 00 b0 sw (r12+176),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800891c: 78 01 08 01 mvhi r1,0x801 8008920: 38 21 e9 80 ori r1,r1,0xe980 8008924: 35 82 00 a4 addi r2,r12,164 8008928: fb ff f4 cb calli 8005c54 <_Watchdog_Insert> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 800892c: 2b 9d 00 04 lw ra,(sp+4) 8008930: 2b 8b 00 0c lw r11,(sp+12) 8008934: 2b 8c 00 08 lw r12,(sp+8) 8008938: 37 9c 00 0c addi sp,sp,12 800893c: c3 a0 00 00 ret 08008868 <_POSIX_Threads_Sporadic_budget_callout>: * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 8008868: 37 9c ff fc addi sp,sp,-4 800886c: 5b 9d 00 04 sw (sp+4),ra POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8008870: 28 25 01 2c lw r5,(r1+300) /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 8008874: 34 04 ff ff mvi r4,-1 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 8008878: 78 02 08 01 mvhi r2,0x801 800887c: 38 42 e0 c0 ori r2,r2,0xe0c0 8008880: 58 24 00 78 sw (r1+120),r4 8008884: 40 44 00 00 lbu r4,(r2+0) 8008888: 28 a2 00 88 lw r2,(r5+136) */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 800888c: 28 25 00 1c lw r5,(r1+28) 8008890: c8 82 10 00 sub r2,r4,r2 * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 8008894: 58 22 00 18 sw (r1+24),r2 */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 8008898: 5c a0 00 05 bne r5,r0,80088ac <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 800889c: 28 23 00 14 lw r3,(r1+20) 80088a0: 50 62 00 03 bgeu r3,r2,80088ac <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 80088a4: 34 03 00 01 mvi r3,1 80088a8: fb ff ee 15 calli 80040fc <_Thread_Change_priority> #if 0 printk( "lower priority\n" ); #endif } } } 80088ac: 2b 9d 00 04 lw ra,(sp+4) 80088b0: 37 9c 00 04 addi sp,sp,4 80088b4: c3 a0 00 00 ret 0800b6b8 <_POSIX_Threads_cancel_run>: #include void _POSIX_Threads_cancel_run( Thread_Control *the_thread ) { 800b6b8: 37 9c ff ec addi sp,sp,-20 800b6bc: 5b 8b 00 14 sw (sp+20),r11 800b6c0: 5b 8c 00 10 sw (sp+16),r12 800b6c4: 5b 8d 00 0c sw (sp+12),r13 800b6c8: 5b 8e 00 08 sw (sp+8),r14 800b6cc: 5b 9d 00 04 sw (sp+4),ra POSIX_Cancel_Handler_control *handler; Chain_Control *handler_stack; POSIX_API_Control *thread_support; ISR_Level level; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800b6d0: 28 2c 01 2c lw r12,(r1+300) handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 800b6d4: 34 01 00 01 mvi r1,1 POSIX_API_Control *thread_support; ISR_Level level; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 800b6d8: 29 82 00 e0 lw r2,(r12+224) thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 800b6dc: 59 81 00 d4 sw (r12+212),r1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800b6e0: 35 8d 00 e4 addi r13,r12,228 POSIX_API_Control *thread_support; ISR_Level level; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 800b6e4: 44 4d 00 12 be r2,r13,800b72c <_POSIX_Threads_cancel_run+0x74> thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; while ( !_Chain_Is_empty( handler_stack ) ) { _ISR_Disable( level ); 800b6e8: 34 0e ff fe mvi r14,-2 800b6ec: 90 00 08 00 rcsr r1,IE 800b6f0: a0 2e 10 00 and r2,r1,r14 800b6f4: d0 02 00 00 wcsr IE,r2 handler = (POSIX_Cancel_Handler_control *) 800b6f8: 29 ab 00 04 lw r11,(r13+4) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 800b6fc: 29 62 00 00 lw r2,(r11+0) previous = the_node->previous; 800b700: 29 63 00 04 lw r3,(r11+4) next->previous = previous; previous->next = next; 800b704: 58 62 00 00 sw (r3+0),r2 Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 800b708: 58 43 00 04 sw (r2+4),r3 _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); 800b70c: d0 01 00 00 wcsr IE,r1 (*handler->routine)( handler->arg ); 800b710: 29 62 00 08 lw r2,(r11+8) 800b714: 29 61 00 0c lw r1,(r11+12) 800b718: d8 40 00 00 call r2 _Workspace_Free( handler ); 800b71c: b9 60 08 00 mv r1,r11 800b720: fb ff ea 41 calli 8006024 <_Workspace_Free> POSIX_API_Control *thread_support; ISR_Level level; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 800b724: 29 81 00 e0 lw r1,(r12+224) 800b728: 5c 2d ff f1 bne r1,r13,800b6ec <_POSIX_Threads_cancel_run+0x34><== NEVER TAKEN (*handler->routine)( handler->arg ); _Workspace_Free( handler ); } } 800b72c: 2b 9d 00 04 lw ra,(sp+4) 800b730: 2b 8b 00 14 lw r11,(sp+20) 800b734: 2b 8c 00 10 lw r12,(sp+16) 800b738: 2b 8d 00 0c lw r13,(sp+12) 800b73c: 2b 8e 00 08 lw r14,(sp+8) 800b740: 37 9c 00 14 addi sp,sp,20 800b744: c3 a0 00 00 ret 08002c08 <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 8002c08: 37 9c ff f8 addi sp,sp,-8 8002c0c: 5b 8b 00 08 sw (sp+8),r11 8002c10: 5b 9d 00 04 sw (sp+4),ra 8002c14: b8 40 58 00 mv r11,r2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 8002c18: 28 42 00 68 lw r2,(r2+104) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 8002c1c: 29 61 00 54 lw r1,(r11+84) bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 8002c20: 34 42 00 01 addi r2,r2,1 8002c24: 59 62 00 68 sw (r11+104),r2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 8002c28: 5c 20 00 0e bne r1,r0,8002c60 <_POSIX_Timer_TSR+0x58> ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 8002c2c: 29 62 00 58 lw r2,(r11+88) 8002c30: 5c 41 00 0c bne r2,r1,8002c60 <_POSIX_Timer_TSR+0x58> <== ALWAYS TAKEN /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 8002c34: 34 01 00 04 mvi r1,4 <== NOT EXECUTED 8002c38: 31 61 00 3c sb (r11+60),r1 <== NOT EXECUTED /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 8002c3c: 29 61 00 38 lw r1,(r11+56) 8002c40: 29 62 00 44 lw r2,(r11+68) 8002c44: f8 00 15 9c calli 80082b4 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 8002c48: 34 01 00 00 mvi r1,0 8002c4c: 59 61 00 68 sw (r11+104),r1 } 8002c50: 2b 9d 00 04 lw ra,(sp+4) 8002c54: 2b 8b 00 08 lw r11,(sp+8) 8002c58: 37 9c 00 08 addi sp,sp,8 8002c5c: c3 a0 00 00 ret ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 8002c60: 29 62 00 64 lw r2,(r11+100) 8002c64: 29 63 00 08 lw r3,(r11+8) 8002c68: 78 04 08 00 mvhi r4,0x800 8002c6c: 38 84 2c 08 ori r4,r4,0x2c08 8002c70: 35 61 00 10 addi r1,r11,16 8002c74: b9 60 28 00 mv r5,r11 8002c78: f8 00 16 f8 calli 8008858 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 8002c7c: 44 20 ff f5 be r1,r0,8002c50 <_POSIX_Timer_TSR+0x48> <== NEVER TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 8002c80: 35 61 00 6c addi r1,r11,108 8002c84: f8 00 03 46 calli 800399c <_TOD_Get> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 8002c88: 34 01 00 03 mvi r1,3 8002c8c: 31 61 00 3c sb (r11+60),r1 /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 8002c90: e3 ff ff eb bi 8002c3c <_POSIX_Timer_TSR+0x34> 0800b888 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 800b888: 37 9c ff e0 addi sp,sp,-32 800b88c: 5b 8b 00 14 sw (sp+20),r11 800b890: 5b 8c 00 10 sw (sp+16),r12 800b894: 5b 8d 00 0c sw (sp+12),r13 800b898: 5b 8e 00 08 sw (sp+8),r14 800b89c: 5b 9d 00 04 sw (sp+4),ra siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 800b8a0: 37 8e 00 18 addi r14,sp,24 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 800b8a4: 20 64 00 ff andi r4,r3,0xff siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 800b8a8: 34 05 00 01 mvi r5,1 800b8ac: b9 c0 18 00 mv r3,r14 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 800b8b0: b8 20 60 00 mv r12,r1 800b8b4: b8 40 58 00 mv r11,r2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 800b8b8: f8 00 00 2b calli 800b964 <_POSIX_signals_Clear_signals> 800b8bc: 44 20 00 22 be r1,r0,800b944 <_POSIX_signals_Check_signal+0xbc> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 800b8c0: b5 6b 08 00 add r1,r11,r11 800b8c4: 34 02 00 02 mvi r2,2 800b8c8: b4 2b 08 00 add r1,r1,r11 800b8cc: 78 0d 08 01 mvhi r13,0x801 800b8d0: fb ff d2 48 calli 80001f0 <__ashlsi3> 800b8d4: 39 ad ed b0 ori r13,r13,0xedb0 800b8d8: b5 a1 08 00 add r1,r13,r1 800b8dc: 28 24 00 08 lw r4,(r1+8) 800b8e0: 34 02 00 01 mvi r2,1 800b8e4: 44 82 00 18 be r4,r2,800b944 <_POSIX_signals_Check_signal+0xbc><== NEVER TAKEN return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 800b8e8: 29 8d 00 cc lw r13,(r12+204) api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 800b8ec: 28 23 00 04 lw r3,(r1+4) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 800b8f0: 28 22 00 00 lw r2,(r1+0) /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 800b8f4: b8 6d 08 00 or r1,r3,r13 800b8f8: 59 81 00 cc sw (r12+204),r1 /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 800b8fc: 34 01 00 02 mvi r1,2 800b900: 44 41 00 0c be r2,r1,800b930 <_POSIX_signals_Check_signal+0xa8> &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 800b904: b9 60 08 00 mv r1,r11 800b908: d8 80 00 00 call r4 } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 800b90c: 34 01 00 01 mvi r1,1 800b910: 59 8d 00 cc sw (r12+204),r13 return true; } 800b914: 2b 9d 00 04 lw ra,(sp+4) 800b918: 2b 8b 00 14 lw r11,(sp+20) 800b91c: 2b 8c 00 10 lw r12,(sp+16) 800b920: 2b 8d 00 0c lw r13,(sp+12) 800b924: 2b 8e 00 08 lw r14,(sp+8) 800b928: 37 9c 00 20 addi sp,sp,32 800b92c: c3 a0 00 00 ret /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 800b930: b9 60 08 00 mv r1,r11 800b934: b9 c0 10 00 mv r2,r14 800b938: 34 03 00 00 mvi r3,0 800b93c: d8 80 00 00 call r4 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 800b940: e3 ff ff f3 bi 800b90c <_POSIX_signals_Check_signal+0x84> /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 800b944: 34 01 00 00 mvi r1,0 } 800b948: 2b 9d 00 04 lw ra,(sp+4) 800b94c: 2b 8b 00 14 lw r11,(sp+20) 800b950: 2b 8c 00 10 lw r12,(sp+16) 800b954: 2b 8d 00 0c lw r13,(sp+12) 800b958: 2b 8e 00 08 lw r14,(sp+8) 800b95c: 37 9c 00 20 addi sp,sp,32 800b960: c3 a0 00 00 ret 0800ce30 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 800ce30: 37 9c ff f0 addi sp,sp,-16 800ce34: 5b 8b 00 10 sw (sp+16),r11 800ce38: 5b 8c 00 0c sw (sp+12),r12 800ce3c: 5b 8d 00 08 sw (sp+8),r13 800ce40: 5b 9d 00 04 sw (sp+4),ra 800ce44: b8 20 58 00 mv r11,r1 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 800ce48: 90 00 68 00 rcsr r13,IE 800ce4c: 34 01 ff fe mvi r1,-2 800ce50: a1 a1 08 00 and r1,r13,r1 800ce54: d0 01 00 00 wcsr IE,r1 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 800ce58: b5 6b 08 00 add r1,r11,r11 800ce5c: 34 02 00 02 mvi r2,2 800ce60: b4 2b 08 00 add r1,r1,r11 800ce64: 78 0c 08 01 mvhi r12,0x801 800ce68: fb ff cc e2 calli 80001f0 <__ashlsi3> 800ce6c: 39 8c ed b0 ori r12,r12,0xedb0 800ce70: b5 81 60 00 add r12,r12,r1 800ce74: 29 83 00 00 lw r3,(r12+0) 800ce78: 34 02 00 02 mvi r2,2 800ce7c: 44 62 00 17 be r3,r2,800ced8 <_POSIX_signals_Clear_process_signals+0xa8> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 800ce80: 35 62 ff ff addi r2,r11,-1 800ce84: 34 01 00 01 mvi r1,1 800ce88: fb ff cc da calli 80001f0 <__ashlsi3> 800ce8c: 78 02 08 01 mvhi r2,0x801 800ce90: 38 42 ef a4 ori r2,r2,0xefa4 800ce94: 28 43 00 00 lw r3,(r2+0) 800ce98: a4 20 08 00 not r1,r1 800ce9c: a0 23 08 00 and r1,r1,r3 800cea0: 58 41 00 00 sw (r2+0),r1 if ( !_POSIX_signals_Pending ) 800cea4: 5c 20 00 06 bne r1,r0,800cebc <_POSIX_signals_Clear_process_signals+0x8c><== NEVER TAKEN _Thread_Do_post_task_switch_extension--; 800cea8: 78 01 08 01 mvhi r1,0x801 800ceac: 38 21 e9 44 ori r1,r1,0xe944 800ceb0: 28 22 00 00 lw r2,(r1+0) 800ceb4: 34 42 ff ff addi r2,r2,-1 800ceb8: 58 22 00 00 sw (r1+0),r2 } _ISR_Enable( level ); 800cebc: d0 0d 00 00 wcsr IE,r13 } 800cec0: 2b 9d 00 04 lw ra,(sp+4) 800cec4: 2b 8b 00 10 lw r11,(sp+16) 800cec8: 2b 8c 00 0c lw r12,(sp+12) 800cecc: 2b 8d 00 08 lw r13,(sp+8) 800ced0: 37 9c 00 10 addi sp,sp,16 800ced4: c3 a0 00 00 ret ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 800ced8: 78 02 08 01 mvhi r2,0x801 800cedc: 38 42 ef a8 ori r2,r2,0xefa8 800cee0: b4 22 08 00 add r1,r1,r2 800cee4: 28 22 00 00 lw r2,(r1+0) 800cee8: 34 21 00 04 addi r1,r1,4 800ceec: 44 41 ff e5 be r2,r1,800ce80 <_POSIX_signals_Clear_process_signals+0x50><== ALWAYS TAKEN if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; if ( !_POSIX_signals_Pending ) _Thread_Do_post_task_switch_extension--; } _ISR_Enable( level ); 800cef0: d0 0d 00 00 wcsr IE,r13 <== NOT EXECUTED } 800cef4: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800cef8: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED 800cefc: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED 800cf00: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED 800cf04: 37 9c 00 10 addi sp,sp,16 <== NOT EXECUTED 800cf08: c3 a0 00 00 ret <== NOT EXECUTED 080039e8 <_POSIX_signals_Get_highest>: #include int _POSIX_signals_Get_highest( sigset_t set ) { 80039e8: 37 9c ff f0 addi sp,sp,-16 80039ec: 5b 8b 00 10 sw (sp+16),r11 80039f0: 5b 8c 00 0c sw (sp+12),r12 80039f4: 5b 8d 00 08 sw (sp+8),r13 80039f8: 5b 9d 00 04 sw (sp+4),ra 80039fc: 34 0b 00 1b mvi r11,27 8003a00: b8 20 60 00 mv r12,r1 int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8003a04: 34 0d 00 20 mvi r13,32 if ( set & signo_to_mask( signo ) ) { 8003a08: 35 62 ff ff addi r2,r11,-1 8003a0c: 34 01 00 01 mvi r1,1 8003a10: fb ff f4 ea calli 8000db8 <__ashlsi3> 8003a14: a0 2c 08 00 and r1,r1,r12 8003a18: 5c 20 00 0d bne r1,r0,8003a4c <_POSIX_signals_Get_highest+0x64><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8003a1c: 35 6b 00 01 addi r11,r11,1 8003a20: 5d 6d ff fa bne r11,r13,8003a08 <_POSIX_signals_Get_highest+0x20> 8003a24: 34 0b 00 01 mvi r11,1 */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 8003a28: 34 0d 00 1b mvi r13,27 8003a2c: e0 00 00 03 bi 8003a38 <_POSIX_signals_Get_highest+0x50> 8003a30: 35 6b 00 01 addi r11,r11,1 8003a34: 45 6d 00 06 be r11,r13,8003a4c <_POSIX_signals_Get_highest+0x64><== NEVER TAKEN if ( set & signo_to_mask( signo ) ) { 8003a38: 35 62 ff ff addi r2,r11,-1 8003a3c: 34 01 00 01 mvi r1,1 8003a40: fb ff f4 de calli 8000db8 <__ashlsi3> 8003a44: a0 2c 10 00 and r2,r1,r12 8003a48: 44 40 ff fa be r2,r0,8003a30 <_POSIX_signals_Get_highest+0x48> * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 8003a4c: b9 60 08 00 mv r1,r11 8003a50: 2b 9d 00 04 lw ra,(sp+4) 8003a54: 2b 8b 00 10 lw r11,(sp+16) 8003a58: 2b 8c 00 0c lw r12,(sp+12) 8003a5c: 2b 8d 00 08 lw r13,(sp+8) 8003a60: 37 9c 00 10 addi sp,sp,16 8003a64: c3 a0 00 00 ret 0800cf50 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 800cf50: 37 9c ff f0 addi sp,sp,-16 800cf54: 5b 8b 00 10 sw (sp+16),r11 800cf58: 5b 8c 00 0c sw (sp+12),r12 800cf5c: 5b 8d 00 08 sw (sp+8),r13 800cf60: 5b 9d 00 04 sw (sp+4),ra 800cf64: b8 20 58 00 mv r11,r1 800cf68: b8 40 68 00 mv r13,r2 800cf6c: 34 01 00 01 mvi r1,1 800cf70: 34 42 ff ff addi r2,r2,-1 800cf74: b8 60 60 00 mv r12,r3 800cf78: fb ff cc 9e calli 80001f0 <__ashlsi3> /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 800cf7c: 29 65 00 10 lw r5,(r11+16) 800cf80: 78 04 10 00 mvhi r4,0x1000 800cf84: 38 84 80 00 ori r4,r4,0x8000 800cf88: a0 a4 10 00 and r2,r5,r4 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800cf8c: 29 63 01 2c lw r3,(r11+300) /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 800cf90: 44 44 00 2d be r2,r4,800d044 <_POSIX_signals_Unblock_thread+0xf4> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 800cf94: 28 62 00 cc lw r2,(r3+204) 800cf98: a4 40 10 00 not r2,r2 800cf9c: a0 22 08 00 and r1,r1,r2 800cfa0: 44 20 00 22 be r1,r0,800d028 <_POSIX_signals_Unblock_thread+0xd8> * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 800cfa4: 78 01 10 00 mvhi r1,0x1000 800cfa8: 38 21 00 00 ori r1,r1,0x0 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; 800cfac: 34 02 00 01 mvi r2,1 800cfb0: 31 62 00 74 sb (r11+116),r2 if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 800cfb4: a0 a1 08 00 and r1,r5,r1 800cfb8: 44 20 00 13 be r1,r0,800d004 <_POSIX_signals_Unblock_thread+0xb4> the_thread->Wait.return_code = EINTR; 800cfbc: 34 01 00 04 mvi r1,4 800cfc0: 59 61 00 34 sw (r11+52),r1 #if 0 if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ 800cfc4: 20 a5 00 08 andi r5,r5,0x8 800cfc8: 44 a0 00 18 be r5,r0,800d028 <_POSIX_signals_Unblock_thread+0xd8><== NEVER TAKEN if ( _Watchdog_Is_active( &the_thread->Timer ) ) 800cfcc: 29 62 00 50 lw r2,(r11+80) 800cfd0: 34 01 00 02 mvi r1,2 800cfd4: 44 41 00 41 be r2,r1,800d0d8 <_POSIX_signals_Unblock_thread+0x188><== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800cfd8: 78 02 10 03 mvhi r2,0x1003 800cfdc: b9 60 08 00 mv r1,r11 800cfe0: 38 42 ff f8 ori r2,r2,0xfff8 800cfe4: fb ff f3 b7 calli 8009ec0 <_Thread_Clear_state> 800cfe8: 34 01 00 00 mvi r1,0 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; } } return false; } 800cfec: 2b 9d 00 04 lw ra,(sp+4) 800cff0: 2b 8b 00 10 lw r11,(sp+16) 800cff4: 2b 8c 00 0c lw r12,(sp+12) 800cff8: 2b 8d 00 08 lw r13,(sp+8) 800cffc: 37 9c 00 10 addi sp,sp,16 800d000: c3 a0 00 00 ret if ( _States_Is_delaying(the_thread->current_state) ){ if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 800d004: 5c a1 00 09 bne r5,r1,800d028 <_POSIX_signals_Unblock_thread+0xd8><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 800d008: 78 01 08 01 mvhi r1,0x801 800d00c: 38 21 e9 3c ori r1,r1,0xe93c 800d010: 28 21 00 00 lw r1,(r1+0) 800d014: 44 25 00 05 be r1,r5,800d028 <_POSIX_signals_Unblock_thread+0xd8> 800d018: 78 01 08 01 mvhi r1,0x801 800d01c: 38 21 e9 60 ori r1,r1,0xe960 800d020: 28 21 00 00 lw r1,(r1+0) 800d024: 45 61 00 28 be r11,r1,800d0c4 <_POSIX_signals_Unblock_thread+0x174><== ALWAYS TAKEN _ISR_Signals_to_thread_executing = true; 800d028: 34 01 00 00 mvi r1,0 } } return false; } 800d02c: 2b 9d 00 04 lw ra,(sp+4) 800d030: 2b 8b 00 10 lw r11,(sp+16) 800d034: 2b 8c 00 0c lw r12,(sp+12) 800d038: 2b 8d 00 08 lw r13,(sp+8) 800d03c: 37 9c 00 10 addi sp,sp,16 800d040: c3 a0 00 00 ret * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 800d044: 29 62 00 30 lw r2,(r11+48) 800d048: a0 22 10 00 and r2,r1,r2 800d04c: 44 40 00 14 be r2,r0,800d09c <_POSIX_signals_Unblock_thread+0x14c> the_thread->Wait.return_code = EINTR; 800d050: 34 01 00 04 mvi r1,4 800d054: 59 61 00 34 sw (r11+52),r1 the_info = (siginfo_t *) the_thread->Wait.return_argument; 800d058: 29 61 00 28 lw r1,(r11+40) if ( !info ) { 800d05c: 45 80 00 15 be r12,r0,800d0b0 <_POSIX_signals_Unblock_thread+0x160> the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; } else { *the_info = *info; 800d060: 29 82 00 00 lw r2,(r12+0) 800d064: 58 22 00 00 sw (r1+0),r2 800d068: 29 82 00 04 lw r2,(r12+4) 800d06c: 58 22 00 04 sw (r1+4),r2 800d070: 29 8c 00 08 lw r12,(r12+8) 800d074: 58 2c 00 08 sw (r1+8),r12 } _Thread_queue_Extract_with_proxy( the_thread ); 800d078: b9 60 08 00 mv r1,r11 800d07c: fb ff e0 1a calli 80050e4 <_Thread_queue_Extract_with_proxy> 800d080: 34 01 00 01 mvi r1,1 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; } } return false; } 800d084: 2b 9d 00 04 lw ra,(sp+4) 800d088: 2b 8b 00 10 lw r11,(sp+16) 800d08c: 2b 8c 00 0c lw r12,(sp+12) 800d090: 2b 8d 00 08 lw r13,(sp+8) 800d094: 37 9c 00 10 addi sp,sp,16 800d098: c3 a0 00 00 ret * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 800d09c: 28 63 00 cc lw r3,(r3+204) 800d0a0: a4 60 18 00 not r3,r3 800d0a4: a0 23 08 00 and r1,r1,r3 800d0a8: 5c 22 ff ea bne r1,r2,800d050 <_POSIX_signals_Unblock_thread+0x100> 800d0ac: e3 ff ff df bi 800d028 <_POSIX_signals_Unblock_thread+0xd8> the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; 800d0b0: 34 02 00 01 mvi r2,1 the_info->si_value.sival_int = 0; 800d0b4: 58 2c 00 08 sw (r1+8),r12 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 800d0b8: 58 2d 00 00 sw (r1+0),r13 the_info->si_code = SI_USER; 800d0bc: 58 22 00 04 sw (r1+4),r2 800d0c0: e3 ff ff ee bi 800d078 <_POSIX_signals_Unblock_thread+0x128> (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 800d0c4: 78 01 08 01 mvhi r1,0x801 800d0c8: 38 21 e9 f8 ori r1,r1,0xe9f8 800d0cc: 30 22 00 00 sb (r1+0),r2 800d0d0: b8 a0 08 00 mv r1,r5 800d0d4: e3 ff ff d6 bi 800d02c <_POSIX_signals_Unblock_thread+0xdc> _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); 800d0d8: 35 61 00 48 addi r1,r11,72 800d0dc: fb ff e3 45 calli 8005df0 <_Watchdog_Remove> 800d0e0: e3 ff ff be bi 800cfd8 <_POSIX_signals_Unblock_thread+0x88> 080026b4 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 80026b4: 37 9c ff e8 addi sp,sp,-24 80026b8: 5b 8b 00 14 sw (sp+20),r11 80026bc: 5b 8c 00 10 sw (sp+16),r12 80026c0: 5b 8d 00 0c sw (sp+12),r13 80026c4: 5b 8e 00 08 sw (sp+8),r14 80026c8: 5b 9d 00 04 sw (sp+4),ra rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 80026cc: 78 01 08 01 mvhi r1,0x801 80026d0: 38 21 e0 8c ori r1,r1,0xe08c 80026d4: 28 2b 00 2c lw r11,(r1+44) maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 80026d8: 28 2e 00 28 lw r14,(r1+40) /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 80026dc: 45 60 00 15 be r11,r0,8002730 <_RTEMS_tasks_Initialize_user_tasks_body+0x7c> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 80026e0: 45 c0 00 14 be r14,r0,8002730 <_RTEMS_tasks_Initialize_user_tasks_body+0x7c><== NEVER TAKEN 80026e4: 34 0c 00 00 mvi r12,0 return_value = rtems_task_create( 80026e8: 29 61 00 00 lw r1,(r11+0) 80026ec: 29 62 00 08 lw r2,(r11+8) 80026f0: 29 63 00 04 lw r3,(r11+4) 80026f4: 29 64 00 14 lw r4,(r11+20) 80026f8: 29 65 00 0c lw r5,(r11+12) 80026fc: 37 86 00 18 addi r6,sp,24 8002700: fb ff ff 3a calli 80023e8 8002704: b8 20 68 00 mv r13,r1 user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 8002708: 5c 20 00 11 bne r1,r0,800274c <_RTEMS_tasks_Initialize_user_tasks_body+0x98> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 800270c: 29 63 00 18 lw r3,(r11+24) 8002710: 2b 81 00 18 lw r1,(sp+24) 8002714: 29 62 00 10 lw r2,(r11+16) 8002718: f8 00 00 14 calli 8002768 800271c: b8 20 18 00 mv r3,r1 id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 8002720: 5c 2d 00 0f bne r1,r13,800275c <_RTEMS_tasks_Initialize_user_tasks_body+0xa8> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 8002724: 35 8c 00 01 addi r12,r12,1 8002728: 35 6b 00 1c addi r11,r11,28 800272c: 55 cc ff ef bgu r14,r12,80026e8 <_RTEMS_tasks_Initialize_user_tasks_body+0x34><== NEVER TAKEN user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 8002730: 2b 9d 00 04 lw ra,(sp+4) 8002734: 2b 8b 00 14 lw r11,(sp+20) 8002738: 2b 8c 00 10 lw r12,(sp+16) 800273c: 2b 8d 00 0c lw r13,(sp+12) 8002740: 2b 8e 00 08 lw r14,(sp+8) 8002744: 37 9c 00 18 addi sp,sp,24 8002748: c3 a0 00 00 ret user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 800274c: 34 01 00 01 mvi r1,1 8002750: b9 a0 18 00 mv r3,r13 8002754: b8 20 10 00 mv r2,r1 8002758: f8 00 03 ff calli 8003754 <_Internal_error_Occurred> id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 800275c: 34 01 00 01 mvi r1,1 8002760: b8 20 10 00 mv r2,r1 8002764: f8 00 03 fc calli 8003754 <_Internal_error_Occurred> 08009070 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 8009070: 37 9c ff f0 addi sp,sp,-16 8009074: 5b 8b 00 0c sw (sp+12),r11 8009078: 5b 8c 00 08 sw (sp+8),r12 800907c: 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 ]; 8009080: 28 2b 01 28 lw r11,(r1+296) if ( !api ) 8009084: 45 60 00 1b be r11,r0,80090f0 <_RTEMS_tasks_Post_switch_extension+0x80><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 8009088: 90 00 10 00 rcsr r2,IE 800908c: 34 01 ff fe mvi r1,-2 8009090: a0 41 08 00 and r1,r2,r1 8009094: d0 01 00 00 wcsr IE,r1 signal_set = asr->signals_posted; asr->signals_posted = 0; 8009098: 34 01 00 00 mvi r1,0 */ asr = &api->Signal; _ISR_Disable( level ); signal_set = asr->signals_posted; 800909c: 29 6c 00 14 lw r12,(r11+20) asr->signals_posted = 0; 80090a0: 59 61 00 14 sw (r11+20),r1 _ISR_Enable( level ); 80090a4: d0 02 00 00 wcsr IE,r2 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 80090a8: 45 80 00 12 be r12,r0,80090f0 <_RTEMS_tasks_Post_switch_extension+0x80> return; asr->nest_level += 1; 80090ac: 29 63 00 1c lw r3,(r11+28) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 80090b0: 29 61 00 10 lw r1,(r11+16) 80090b4: 38 02 ff ff mvu r2,0xffff if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 80090b8: 34 63 00 01 addi r3,r3,1 80090bc: 59 63 00 1c sw (r11+28),r3 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 80090c0: 37 83 00 10 addi r3,sp,16 80090c4: f8 00 0b 5e calli 800be3c (*asr->handler)( signal_set ); 80090c8: 29 62 00 0c lw r2,(r11+12) 80090cc: b9 80 08 00 mv r1,r12 80090d0: d8 40 00 00 call r2 asr->nest_level -= 1; 80090d4: 29 63 00 1c lw r3,(r11+28) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 80090d8: 2b 81 00 10 lw r1,(sp+16) 80090dc: 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; 80090e0: 34 63 ff ff addi r3,r3,-1 80090e4: 59 63 00 1c sw (r11+28),r3 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 80090e8: 37 83 00 10 addi r3,sp,16 80090ec: f8 00 0b 54 calli 800be3c } 80090f0: 2b 9d 00 04 lw ra,(sp+4) 80090f4: 2b 8b 00 0c lw r11,(sp+12) 80090f8: 2b 8c 00 08 lw r12,(sp+8) 80090fc: 37 9c 00 10 addi sp,sp,16 8009100: c3 a0 00 00 ret 08008fa4 <_RTEMS_tasks_Switch_extension>: /* * Per Task Variables */ tvp = executing->task_variables; 8008fa4: 28 21 01 38 lw r1,(r1+312) while (tvp) { 8008fa8: 44 20 00 08 be r1,r0,8008fc8 <_RTEMS_tasks_Switch_extension+0x24> tvp->tval = *tvp->ptr; 8008fac: 28 23 00 04 lw r3,(r1+4) 8008fb0: 28 64 00 00 lw r4,(r3+0) 8008fb4: 58 24 00 0c sw (r1+12),r4 *tvp->ptr = tvp->gval; 8008fb8: 28 24 00 08 lw r4,(r1+8) tvp = (rtems_task_variable_t *)tvp->next; 8008fbc: 28 21 00 00 lw r1,(r1+0) */ tvp = executing->task_variables; while (tvp) { tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; 8008fc0: 58 64 00 00 sw (r3+0),r4 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 8008fc4: 5c 20 ff fa bne r1,r0,8008fac <_RTEMS_tasks_Switch_extension+0x8><== NEVER TAKEN tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 8008fc8: 28 41 01 38 lw r1,(r2+312) while (tvp) { 8008fcc: 44 20 00 08 be r1,r0,8008fec <_RTEMS_tasks_Switch_extension+0x48> tvp->gval = *tvp->ptr; 8008fd0: 28 22 00 04 lw r2,(r1+4) *tvp->ptr = tvp->tval; 8008fd4: 28 24 00 0c lw r4,(r1+12) tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { tvp->gval = *tvp->ptr; 8008fd8: 28 43 00 00 lw r3,(r2+0) 8008fdc: 58 23 00 08 sw (r1+8),r3 *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; 8008fe0: 28 21 00 00 lw r1,(r1+0) } tvp = heir->task_variables; while (tvp) { tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; 8008fe4: 58 44 00 00 sw (r2+0),r4 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 8008fe8: 5c 20 ff fa bne r1,r0,8008fd0 <_RTEMS_tasks_Switch_extension+0x2c><== NEVER TAKEN 8008fec: c3 a0 00 00 ret 080420f8 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 80420f8: 37 9c ff f4 addi sp,sp,-12 80420fc: 5b 8b 00 08 sw (sp+8),r11 8042100: 5b 9d 00 04 sw (sp+4),ra 8042104: b8 20 10 00 mv r2,r1 8042108: 78 01 08 07 mvhi r1,0x807 804210c: 38 21 6b c0 ori r1,r1,0x6bc0 8042110: 37 83 00 0c addi r3,sp,12 8042114: fb ff 23 4b calli 800ae40 <_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 ) { 8042118: 2b 82 00 0c lw r2,(sp+12) 804211c: b8 20 58 00 mv r11,r1 8042120: 44 40 00 05 be r2,r0,8042134 <_Rate_monotonic_Timeout+0x3c><== ALWAYS TAKEN case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 8042124: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8042128: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 804212c: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 8042130: c3 a0 00 00 ret <== NOT EXECUTED */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: the_thread = the_period->owner; 8042134: 28 21 00 40 lw r1,(r1+64) if ( _States_Is_waiting_for_period( the_thread->current_state ) && 8042138: 28 23 00 10 lw r3,(r1+16) 804213c: 20 63 40 00 andi r3,r3,0x4000 8042140: 44 62 00 04 be r3,r2,8042150 <_Rate_monotonic_Timeout+0x58> the_thread->Wait.id == the_period->Object.id ) { 8042144: 28 23 00 20 lw r3,(r1+32) 8042148: 29 62 00 08 lw r2,(r11+8) 804214c: 44 62 00 1a be r3,r2,80421b4 <_Rate_monotonic_Timeout+0xbc> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 8042150: 29 62 00 38 lw r2,(r11+56) 8042154: 34 01 00 01 mvi r1,1 8042158: 44 41 00 0c be r2,r1,8042188 <_Rate_monotonic_Timeout+0x90> _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 804215c: 34 01 00 04 mvi r1,4 8042160: 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; 8042164: 78 01 08 07 mvhi r1,0x807 8042168: 38 21 60 9c ori r1,r1,0x609c 804216c: 28 22 00 00 lw r2,(r1+0) 8042170: 34 42 ff ff addi r2,r2,-1 8042174: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 8042178: 2b 9d 00 04 lw ra,(sp+4) 804217c: 2b 8b 00 08 lw r11,(sp+8) 8042180: 37 9c 00 0c addi sp,sp,12 8042184: c3 a0 00 00 ret _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 8042188: 34 01 00 03 mvi r1,3 804218c: 59 61 00 38 sw (r11+56),r1 _Rate_monotonic_Initiate_statistics( the_period ); 8042190: b9 60 08 00 mv r1,r11 8042194: fb ff fe a7 calli 8041c30 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8042198: 29 61 00 3c lw r1,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 804219c: 35 62 00 10 addi r2,r11,16 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80421a0: 59 61 00 1c sw (r11+28),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80421a4: 78 01 08 07 mvhi r1,0x807 80421a8: 38 21 61 78 ori r1,r1,0x6178 80421ac: fb ff 2b 62 calli 800cf34 <_Watchdog_Insert> 80421b0: e3 ff ff ed bi 8042164 <_Rate_monotonic_Timeout+0x6c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 80421b4: 78 02 10 03 mvhi r2,0x1003 80421b8: 38 42 ff f8 ori r2,r2,0xfff8 80421bc: fb ff b2 93 calli 802ec08 <_Thread_Clear_state> 80421c0: e3 ff ff f4 bi 8042190 <_Rate_monotonic_Timeout+0x98> 08041dc4 <_Rate_monotonic_Update_statistics>: } void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 8041dc4: 37 9c ff e0 addi sp,sp,-32 8041dc8: 5b 8b 00 10 sw (sp+16),r11 8041dcc: 5b 8c 00 0c sw (sp+12),r12 8041dd0: 5b 8d 00 08 sw (sp+8),r13 8041dd4: 5b 9d 00 04 sw (sp+4),ra 8041dd8: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8041ddc: 28 21 00 54 lw r1,(r1+84) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8041de0: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8041de4: 34 21 00 01 addi r1,r1,1 8041de8: 59 61 00 54 sw (r11+84),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8041dec: 34 01 00 04 mvi r1,4 8041df0: 44 41 00 36 be r2,r1,8041ec8 <_Rate_monotonic_Update_statistics+0x104> /* * Grab status for time statistics. */ valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 8041df4: 37 8c 00 14 addi r12,sp,20 8041df8: 37 8d 00 1c addi r13,sp,28 8041dfc: b9 60 08 00 mv r1,r11 8041e00: b9 80 10 00 mv r2,r12 8041e04: b9 a0 18 00 mv r3,r13 8041e08: fb ff ff b5 calli 8041cdc <_Rate_monotonic_Get_status> if (!valid_status) 8041e0c: 5c 20 00 07 bne r1,r0,8041e28 <_Rate_monotonic_Update_statistics+0x64><== ALWAYS TAKEN stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 8041e10: 2b 9d 00 04 lw ra,(sp+4) 8041e14: 2b 8b 00 10 lw r11,(sp+16) 8041e18: 2b 8c 00 0c lw r12,(sp+12) 8041e1c: 2b 8d 00 08 lw r13,(sp+8) 8041e20: 37 9c 00 20 addi sp,sp,32 8041e24: c3 a0 00 00 ret /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 8041e28: b9 a0 10 00 mv r2,r13 8041e2c: 35 61 00 6c addi r1,r11,108 8041e30: fb ff 2b 18 calli 800ca90 <_Timespec_Add_to> if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 8041e34: b9 a0 08 00 mv r1,r13 8041e38: 35 62 00 5c addi r2,r11,92 8041e3c: f8 00 03 31 calli 8042b00 <_Timespec_Less_than> 8041e40: 44 20 00 05 be r1,r0,8041e54 <_Rate_monotonic_Update_statistics+0x90> stats->min_cpu_time = executed; 8041e44: 2b 81 00 1c lw r1,(sp+28) 8041e48: 59 61 00 5c sw (r11+92),r1 8041e4c: 2b 81 00 20 lw r1,(sp+32) 8041e50: 59 61 00 60 sw (r11+96),r1 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 8041e54: b9 a0 08 00 mv r1,r13 8041e58: 35 62 00 64 addi r2,r11,100 8041e5c: f8 00 03 1d calli 8042ad0 <_Timespec_Greater_than> 8041e60: 44 20 00 05 be r1,r0,8041e74 <_Rate_monotonic_Update_statistics+0xb0> stats->max_cpu_time = executed; 8041e64: 2b 81 00 1c lw r1,(sp+28) 8041e68: 59 61 00 64 sw (r11+100),r1 8041e6c: 2b 81 00 20 lw r1,(sp+32) 8041e70: 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 ); 8041e74: b9 80 10 00 mv r2,r12 8041e78: 35 61 00 84 addi r1,r11,132 8041e7c: fb ff 2b 05 calli 800ca90 <_Timespec_Add_to> if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 8041e80: b9 80 08 00 mv r1,r12 8041e84: 35 62 00 74 addi r2,r11,116 8041e88: f8 00 03 1e calli 8042b00 <_Timespec_Less_than> 8041e8c: 5c 20 00 13 bne r1,r0,8041ed8 <_Rate_monotonic_Update_statistics+0x114> stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 8041e90: b9 80 08 00 mv r1,r12 8041e94: 35 62 00 7c addi r2,r11,124 8041e98: f8 00 03 0e calli 8042ad0 <_Timespec_Greater_than> 8041e9c: 44 20 ff dd be r1,r0,8041e10 <_Rate_monotonic_Update_statistics+0x4c> stats->max_wall_time = since_last_period; 8041ea0: 2b 81 00 18 lw r1,(sp+24) 8041ea4: 59 61 00 80 sw (r11+128),r1 8041ea8: 2b 81 00 14 lw r1,(sp+20) 8041eac: 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 } 8041eb0: 2b 9d 00 04 lw ra,(sp+4) 8041eb4: 2b 8b 00 10 lw r11,(sp+16) 8041eb8: 2b 8c 00 0c lw r12,(sp+12) 8041ebc: 2b 8d 00 08 lw r13,(sp+8) 8041ec0: 37 9c 00 20 addi sp,sp,32 8041ec4: c3 a0 00 00 ret */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) stats->missed_count++; 8041ec8: 29 61 00 58 lw r1,(r11+88) 8041ecc: 34 21 00 01 addi r1,r1,1 8041ed0: 59 61 00 58 sw (r11+88),r1 8041ed4: e3 ff ff c8 bi 8041df4 <_Rate_monotonic_Update_statistics+0x30> */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; 8041ed8: 2b 81 00 14 lw r1,(sp+20) 8041edc: 59 61 00 74 sw (r11+116),r1 8041ee0: 2b 81 00 18 lw r1,(sp+24) 8041ee4: 59 61 00 78 sw (r11+120),r1 8041ee8: e3 ff ff ea bi 8041e90 <_Rate_monotonic_Update_statistics+0xcc> 08009618 <_TOD_Get>: */ void _TOD_Get( struct timespec *time ) { 8009618: 37 9c ff e4 addi sp,sp,-28 800961c: 5b 8b 00 0c sw (sp+12),r11 8009620: 5b 8c 00 08 sw (sp+8),r12 8009624: 5b 9d 00 04 sw (sp+4),ra 8009628: 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 ); 800962c: 90 00 60 00 rcsr r12,IE 8009630: 34 01 ff fe mvi r1,-2 8009634: a1 81 08 00 and r1,r12,r1 8009638: d0 01 00 00 wcsr IE,r1 now = _TOD_Now; 800963c: 78 02 08 01 mvhi r2,0x801 8009640: 38 42 e9 34 ori r2,r2,0xe934 if ( _Watchdog_Nanoseconds_since_tick_handler ) 8009644: 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; 8009648: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 800964c: 38 63 ea 44 ori r3,r3,0xea44 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 8009650: 28 42 00 00 lw r2,(r2+0) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8009654: 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; 8009658: 5b 81 00 14 sw (sp+20),r1 800965c: 5b 82 00 10 sw (sp+16),r2 if ( _Watchdog_Nanoseconds_since_tick_handler ) 8009660: b8 60 20 00 mv r4,r3 8009664: 44 60 00 03 be r3,r0,8009670 <_TOD_Get+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 8009668: d8 60 00 00 call r3 <== NOT EXECUTED 800966c: b8 20 20 00 mv r4,r1 <== NOT EXECUTED _ISR_Enable( level ); 8009670: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 8009674: 34 03 00 00 mvi r3,0 _Timestamp_Add_to( &now, &offset ); 8009678: 37 81 00 10 addi r1,sp,16 800967c: 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 ); 8009680: 5b 83 00 18 sw (sp+24),r3 8009684: 5b 84 00 1c sw (sp+28),r4 _Timestamp_Add_to( &now, &offset ); 8009688: fb ff f0 4a calli 80057b0 <_Timespec_Add_to> _Timestamp_To_timespec( &now, time ); 800968c: 2b 81 00 14 lw r1,(sp+20) 8009690: 59 61 00 04 sw (r11+4),r1 8009694: 2b 81 00 10 lw r1,(sp+16) 8009698: 59 61 00 00 sw (r11+0),r1 } 800969c: 2b 9d 00 04 lw ra,(sp+4) 80096a0: 2b 8b 00 0c lw r11,(sp+12) 80096a4: 2b 8c 00 08 lw r12,(sp+8) 80096a8: 37 9c 00 1c addi sp,sp,28 80096ac: c3 a0 00 00 ret 080096b0 <_TOD_Get_uptime>: */ void _TOD_Get_uptime( Timestamp_Control *uptime ) { 80096b0: 37 9c ff e4 addi sp,sp,-28 80096b4: 5b 8b 00 0c sw (sp+12),r11 80096b8: 5b 8c 00 08 sw (sp+8),r12 80096bc: 5b 9d 00 04 sw (sp+4),ra 80096c0: 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 ); 80096c4: 90 00 60 00 rcsr r12,IE 80096c8: 34 01 ff fe mvi r1,-2 80096cc: a1 81 08 00 and r1,r12,r1 80096d0: d0 01 00 00 wcsr IE,r1 up = _TOD_Uptime; 80096d4: 78 02 08 01 mvhi r2,0x801 80096d8: 38 42 e9 24 ori r2,r2,0xe924 if ( _Watchdog_Nanoseconds_since_tick_handler ) 80096dc: 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; 80096e0: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 80096e4: 38 63 ea 44 ori r3,r3,0xea44 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 80096e8: 28 42 00 00 lw r2,(r2+0) if ( _Watchdog_Nanoseconds_since_tick_handler ) 80096ec: 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; 80096f0: 5b 81 00 14 sw (sp+20),r1 80096f4: 5b 82 00 10 sw (sp+16),r2 if ( _Watchdog_Nanoseconds_since_tick_handler ) 80096f8: b8 60 20 00 mv r4,r3 80096fc: 44 60 00 03 be r3,r0,8009708 <_TOD_Get_uptime+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 8009700: d8 60 00 00 call r3 <== NOT EXECUTED 8009704: b8 20 20 00 mv r4,r1 <== NOT EXECUTED _ISR_Enable( level ); 8009708: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 800970c: 34 03 00 00 mvi r3,0 _Timestamp_Add_to( &up, &offset ); 8009710: 37 81 00 10 addi r1,sp,16 8009714: 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 ); 8009718: 5b 83 00 18 sw (sp+24),r3 800971c: 5b 84 00 1c sw (sp+28),r4 _Timestamp_Add_to( &up, &offset ); 8009720: fb ff f0 24 calli 80057b0 <_Timespec_Add_to> *uptime = up; 8009724: 2b 81 00 14 lw r1,(sp+20) 8009728: 59 61 00 04 sw (r11+4),r1 800972c: 2b 81 00 10 lw r1,(sp+16) 8009730: 59 61 00 00 sw (r11+0),r1 } 8009734: 2b 9d 00 04 lw ra,(sp+4) 8009738: 2b 8b 00 0c lw r11,(sp+12) 800973c: 2b 8c 00 08 lw r12,(sp+8) 8009740: 37 9c 00 1c addi sp,sp,28 8009744: c3 a0 00 00 ret 08003240 <_TOD_Tickle_ticks>: * * Output parameters: NONE */ void _TOD_Tickle_ticks( void ) { 8003240: 37 9c ff ec addi sp,sp,-20 8003244: 5b 8b 00 0c sw (sp+12),r11 8003248: 5b 8c 00 08 sw (sp+8),r12 800324c: 5b 9d 00 04 sw (sp+4),ra Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 8003250: 78 01 08 01 mvhi r1,0x801 8003254: 38 21 e0 c4 ori r1,r1,0xe0c4 8003258: 28 21 00 0c lw r1,(r1+12) 800325c: 34 03 00 00 mvi r3,0 8003260: 34 02 03 e8 mvi r2,1000 8003264: 5b 83 00 10 sw (sp+16),r3 8003268: f8 00 60 1c calli 801b2d8 <__mulsi3> /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; 800326c: 78 03 08 01 mvhi r3,0x801 8003270: 38 63 e9 f4 ori r3,r3,0xe9f4 8003274: 28 64 00 00 lw r4,(r3+0) /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 8003278: 37 8b 00 10 addi r11,sp,16 { Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 800327c: 5b 81 00 14 sw (sp+20),r1 /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; 8003280: 34 84 00 01 addi r4,r4,1 /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 8003284: 78 01 08 01 mvhi r1,0x801 8003288: b9 60 10 00 mv r2,r11 /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; 800328c: 58 64 00 00 sw (r3+0),r4 /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 8003290: 38 21 e9 24 ori r1,r1,0xe924 8003294: f8 00 09 47 calli 80057b0 <_Timespec_Add_to> /* we do not care how much the uptime changed */ /* Update the timespec format TOD */ seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick ); 8003298: 78 01 08 01 mvhi r1,0x801 800329c: b9 60 10 00 mv r2,r11 80032a0: 38 21 e9 34 ori r1,r1,0xe934 80032a4: f8 00 09 43 calli 80057b0 <_Timespec_Add_to> 80032a8: b8 20 58 00 mv r11,r1 while ( seconds ) { 80032ac: 44 20 00 07 be r1,r0,80032c8 <_TOD_Tickle_ticks+0x88> */ RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_seconds( void ) { _Watchdog_Tickle( &_Watchdog_Seconds_chain ); 80032b0: 78 0c 08 01 mvhi r12,0x801 80032b4: b9 80 08 00 mv r1,r12 _Watchdog_Tickle_seconds(); seconds--; 80032b8: 35 6b ff ff addi r11,r11,-1 80032bc: 38 21 e9 74 ori r1,r1,0xe974 80032c0: f8 00 0b 03 calli 8005ecc <_Watchdog_Tickle> _Timestamp_Add_to( &_TOD_Uptime, &tick ); /* we do not care how much the uptime changed */ /* Update the timespec format TOD */ seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick ); while ( seconds ) { 80032c4: 5d 60 ff fc bne r11,r0,80032b4 <_TOD_Tickle_ticks+0x74> <== NEVER TAKEN _Watchdog_Tickle_seconds(); seconds--; } } 80032c8: 2b 9d 00 04 lw ra,(sp+4) 80032cc: 2b 8b 00 0c lw r11,(sp+12) 80032d0: 2b 8c 00 08 lw r12,(sp+8) 80032d4: 37 9c 00 14 addi sp,sp,20 80032d8: c3 a0 00 00 ret 08003a50 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 8003a50: 37 9c ff f4 addi sp,sp,-12 8003a54: 5b 8b 00 0c sw (sp+12),r11 8003a58: 5b 8c 00 08 sw (sp+8),r12 8003a5c: 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(); 8003a60: 78 02 08 02 mvhi r2,0x802 8003a64: 38 42 40 c4 ori r2,r2,0x40c4 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 8003a68: 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(); 8003a6c: 28 42 00 0c lw r2,(r2+12) if ((!the_tod) || 8003a70: 44 20 00 22 be r1,r0,8003af8 <_TOD_Validate+0xa8> <== NEVER TAKEN 8003a74: 78 01 00 0f mvhi r1,0xf 8003a78: 38 21 42 40 ori r1,r1,0x4240 8003a7c: f8 00 73 3f calli 8020778 <__udivsi3> (the_tod->ticks >= ticks_per_second) || 8003a80: 29 62 00 18 lw r2,(r11+24) 8003a84: 50 41 00 1d bgeu r2,r1,8003af8 <_TOD_Validate+0xa8> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 8003a88: 29 62 00 14 lw r2,(r11+20) 8003a8c: 34 01 00 3b mvi r1,59 8003a90: 54 41 00 1a bgu r2,r1,8003af8 <_TOD_Validate+0xa8> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 8003a94: 29 62 00 10 lw r2,(r11+16) 8003a98: 54 41 00 18 bgu r2,r1,8003af8 <_TOD_Validate+0xa8> (the_tod->hour >= TOD_HOURS_PER_DAY) || 8003a9c: 29 62 00 0c lw r2,(r11+12) 8003aa0: 34 01 00 17 mvi r1,23 8003aa4: 54 41 00 15 bgu r2,r1,8003af8 <_TOD_Validate+0xa8> (the_tod->month == 0) || 8003aa8: 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) || 8003aac: 44 20 00 13 be r1,r0,8003af8 <_TOD_Validate+0xa8> <== NEVER TAKEN 8003ab0: 34 02 00 0c mvi r2,12 8003ab4: 54 22 00 11 bgu r1,r2,8003af8 <_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) || 8003ab8: 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) || 8003abc: 34 03 07 c3 mvi r3,1987 8003ac0: 50 62 00 0e bgeu r3,r2,8003af8 <_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) ) 8003ac4: 29 6b 00 08 lw r11,(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) || 8003ac8: 45 60 00 0c be r11,r0,8003af8 <_TOD_Validate+0xa8> <== NEVER TAKEN (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 ) 8003acc: 20 42 00 03 andi r2,r2,0x3 8003ad0: 5c 40 00 02 bne r2,r0,8003ad8 <_TOD_Validate+0x88> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 8003ad4: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 8003ad8: 78 0c 08 02 mvhi r12,0x802 8003adc: 34 02 00 02 mvi r2,2 8003ae0: fb ff f5 c4 calli 80011f0 <__ashlsi3> 8003ae4: 39 8c 22 f0 ori r12,r12,0x22f0 8003ae8: b5 81 08 00 add r1,r12,r1 8003aec: 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( 8003af0: f0 2b 08 00 cmpgeu r1,r1,r11 8003af4: e0 00 00 02 bi 8003afc <_TOD_Validate+0xac> 8003af8: 34 01 00 00 mvi r1,0 if ( the_tod->day > days_in_month ) return false; return true; } 8003afc: 2b 9d 00 04 lw ra,(sp+4) 8003b00: 2b 8b 00 0c lw r11,(sp+12) 8003b04: 2b 8c 00 08 lw r12,(sp+8) 8003b08: 37 9c 00 0c addi sp,sp,12 8003b0c: c3 a0 00 00 ret 080040fc <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 80040fc: 37 9c ff ec addi sp,sp,-20 8004100: 5b 8b 00 14 sw (sp+20),r11 8004104: 5b 8c 00 10 sw (sp+16),r12 8004108: 5b 8d 00 0c sw (sp+12),r13 800410c: 5b 8e 00 08 sw (sp+8),r14 8004110: 5b 9d 00 04 sw (sp+4),ra 8004114: b8 20 58 00 mv r11,r1 */ /* * Save original state */ original_state = the_thread->current_state; 8004118: 28 2d 00 10 lw r13,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 800411c: b8 40 60 00 mv r12,r2 8004120: 20 6e 00 ff andi r14,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 ); 8004124: f8 00 04 f3 calli 80054f0 <_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 ) 8004128: 29 61 00 14 lw r1,(r11+20) 800412c: 44 2c 00 04 be r1,r12,800413c <_Thread_Change_priority+0x40> _Thread_Set_priority( the_thread, new_priority ); 8004130: b9 80 10 00 mv r2,r12 8004134: b9 60 08 00 mv r1,r11 8004138: f8 00 04 49 calli 800525c <_Thread_Set_priority> _ISR_Disable( level ); 800413c: 90 00 60 00 rcsr r12,IE 8004140: 34 02 ff fe mvi r2,-2 8004144: a1 82 10 00 and r2,r12,r2 8004148: d0 02 00 00 wcsr IE,r2 /* * 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; 800414c: 29 61 00 10 lw r1,(r11+16) if ( state != STATES_TRANSIENT ) { 8004150: 34 04 00 04 mvi r4,4 8004154: 44 24 00 21 be r1,r4,80041d8 <_Thread_Change_priority+0xdc> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 8004158: a1 a4 68 00 and r13,r13,r4 800415c: 45 a0 00 0d be r13,r0,8004190 <_Thread_Change_priority+0x94><== ALWAYS TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 8004160: d0 0c 00 00 wcsr IE,r12 <== NOT EXECUTED if ( _States_Is_waiting_on_thread_queue( state ) ) { 8004164: 78 02 00 03 mvhi r2,0x3 <== NOT EXECUTED 8004168: 38 42 be e0 ori r2,r2,0xbee0 <== NOT EXECUTED 800416c: a0 22 08 00 and r1,r1,r2 <== NOT EXECUTED 8004170: 5c 20 00 10 bne r1,r0,80041b0 <_Thread_Change_priority+0xb4><== NOT EXECUTED if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 8004174: 2b 9d 00 04 lw ra,(sp+4) 8004178: 2b 8b 00 14 lw r11,(sp+20) 800417c: 2b 8c 00 10 lw r12,(sp+16) 8004180: 2b 8d 00 0c lw r13,(sp+12) 8004184: 2b 8e 00 08 lw r14,(sp+8) 8004188: 37 9c 00 14 addi sp,sp,20 800418c: c3 a0 00 00 ret */ state = the_thread->current_state; if ( state != STATES_TRANSIENT ) { /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 8004190: 34 02 ff fb mvi r2,-5 8004194: a0 22 10 00 and r2,r1,r2 8004198: 59 62 00 10 sw (r11+16),r2 _ISR_Enable( level ); 800419c: d0 0c 00 00 wcsr IE,r12 if ( _States_Is_waiting_on_thread_queue( state ) ) { 80041a0: 78 02 00 03 mvhi r2,0x3 80041a4: 38 42 be e0 ori r2,r2,0xbee0 80041a8: a0 22 08 00 and r1,r1,r2 80041ac: 44 20 ff f2 be r1,r0,8004174 <_Thread_Change_priority+0x78> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 80041b0: 29 61 00 44 lw r1,(r11+68) 80041b4: b9 60 10 00 mv r2,r11 80041b8: f8 00 03 ee calli 8005170 <_Thread_queue_Requeue> if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 80041bc: 2b 9d 00 04 lw ra,(sp+4) 80041c0: 2b 8b 00 14 lw r11,(sp+20) 80041c4: 2b 8c 00 10 lw r12,(sp+16) 80041c8: 2b 8d 00 0c lw r13,(sp+12) 80041cc: 2b 8e 00 08 lw r14,(sp+8) 80041d0: 37 9c 00 14 addi sp,sp,20 80041d4: c3 a0 00 00 ret } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 80041d8: 21 ad 00 04 andi r13,r13,0x4 80041dc: 45 a0 00 3a be r13,r0,80042c4 <_Thread_Change_priority+0x1c8><== ALWAYS TAKEN 80041e0: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 80041e4: 38 21 e9 54 ori r1,r1,0xe954 <== NOT EXECUTED _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 80041e8: d0 0c 00 00 wcsr IE,r12 80041ec: d0 02 00 00 wcsr IE,r2 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 ); 80041f0: 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; 80041f4: 78 02 08 01 mvhi r2,0x801 80041f8: 38 42 e8 30 ori r2,r2,0xe830 80041fc: 28 4e 00 00 lw r14,(r2+0) 8004200: 20 21 ff ff andi r1,r1,0xffff 8004204: 34 02 00 ff mvi r2,255 8004208: 54 22 00 49 bgu r1,r2,800432c <_Thread_Change_priority+0x230> 800420c: 78 0b 08 01 mvhi r11,0x801 8004210: 39 6b c7 d4 ori r11,r11,0xc7d4 8004214: b5 61 08 00 add r1,r11,r1 8004218: 40 2d 00 00 lbu r13,(r1+0) 800421c: 35 ad 00 08 addi r13,r13,8 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8004220: 78 02 08 01 mvhi r2,0x801 8004224: b5 ad 08 00 add r1,r13,r13 8004228: 38 42 e9 d0 ori r2,r2,0xe9d0 800422c: b4 41 10 00 add r2,r2,r1 8004230: 2c 41 00 00 lhu r1,(r2+0) 8004234: 34 02 00 ff mvi r2,255 8004238: 54 22 00 38 bgu r1,r2,8004318 <_Thread_Change_priority+0x21c> 800423c: b5 61 58 00 add r11,r11,r1 8004240: 41 6b 00 00 lbu r11,(r11+0) 8004244: 35 6b 00 08 addi r11,r11,8 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8004248: 34 02 00 04 mvi r2,4 800424c: b9 a0 08 00 mv r1,r13 8004250: fb ff ef e8 calli 80001f0 <__ashlsi3> 8004254: b5 61 08 00 add r1,r11,r1 8004258: b4 21 10 00 add r2,r1,r1 800425c: b4 41 08 00 add r1,r2,r1 8004260: 34 02 00 02 mvi r2,2 8004264: fb ff ef e3 calli 80001f0 <__ashlsi3> 8004268: 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 ); 800426c: 78 02 08 01 mvhi r2,0x801 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8004270: 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 ); 8004274: 38 42 e9 60 ori r2,r2,0xe960 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8004278: 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 ); 800427c: 28 42 00 00 lw r2,(r2+0) * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8004280: 38 21 e9 30 ori r1,r1,0xe930 8004284: 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() && 8004288: 44 62 00 07 be r3,r2,80042a4 <_Thread_Change_priority+0x1a8> _Thread_Executing->is_preemptible ) 800428c: 40 41 00 75 lbu r1,(r2+117) 8004290: 44 20 00 05 be r1,r0,80042a4 <_Thread_Change_priority+0x1a8> _Context_Switch_necessary = true; 8004294: 78 01 08 01 mvhi r1,0x801 8004298: 38 21 e9 70 ori r1,r1,0xe970 800429c: 34 02 00 01 mvi r2,1 80042a0: 30 22 00 00 sb (r1+0),r2 _ISR_Enable( level ); 80042a4: d0 0c 00 00 wcsr IE,r12 } 80042a8: 2b 9d 00 04 lw ra,(sp+4) 80042ac: 2b 8b 00 14 lw r11,(sp+20) 80042b0: 2b 8c 00 10 lw r12,(sp+16) 80042b4: 2b 8d 00 0c lw r13,(sp+12) 80042b8: 2b 8e 00 08 lw r14,(sp+8) 80042bc: 37 9c 00 14 addi sp,sp,20 80042c0: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 80042c4: 29 63 00 90 lw r3,(r11+144) 80042c8: 2d 64 00 96 lhu r4,(r11+150) _Priority_Major_bit_map |= the_priority_map->ready_major; 80042cc: 78 01 08 01 mvhi r1,0x801 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 80042d0: 2c 65 00 00 lhu r5,(r3+0) _Priority_Major_bit_map |= the_priority_map->ready_major; 80042d4: 38 21 e9 54 ori r1,r1,0xe954 * 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 ); 80042d8: 59 6d 00 10 sw (r11+16),r13 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 80042dc: b8 a4 20 00 or r4,r5,r4 80042e0: 0c 64 00 00 sh (r3+0),r4 _Priority_Major_bit_map |= the_priority_map->ready_major; 80042e4: 2c 23 00 00 lhu r3,(r1+0) 80042e8: 2d 64 00 94 lhu r4,(r11+148) 80042ec: b8 83 18 00 or r3,r4,r3 80042f0: 20 63 ff ff andi r3,r3,0xffff 80042f4: 0c 23 00 00 sh (r1+0),r3 _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 80042f8: 45 cd 00 14 be r14,r13,8004348 <_Thread_Change_priority+0x24c> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 80042fc: 29 63 00 8c lw r3,(r11+140) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8004300: 28 64 00 00 lw r4,(r3+0) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8004304: 59 63 00 04 sw (r11+4),r3 before_node = after_node->next; after_node->next = the_node; 8004308: 58 6b 00 00 sw (r3+0),r11 the_node->next = before_node; before_node->previous = the_node; 800430c: 58 8b 00 04 sw (r4+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; 8004310: 59 64 00 00 sw (r11+0),r4 8004314: e3 ff ff b5 bi 80041e8 <_Thread_Change_priority+0xec> { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8004318: 34 02 00 08 mvi r2,8 800431c: fb ff ef dd calli 8000290 <__lshrsi3> 8004320: b5 61 08 00 add r1,r11,r1 8004324: 40 2b 00 00 lbu r11,(r1+0) 8004328: e3 ff ff c8 bi 8004248 <_Thread_Change_priority+0x14c> 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 ); 800432c: 34 02 00 08 mvi r2,8 8004330: 78 0b 08 01 mvhi r11,0x801 8004334: fb ff ef d7 calli 8000290 <__lshrsi3> 8004338: 39 6b c7 d4 ori r11,r11,0xc7d4 800433c: b5 61 08 00 add r1,r11,r1 8004340: 40 2d 00 00 lbu r13,(r1+0) 8004344: e3 ff ff b7 bi 8004220 <_Thread_Change_priority+0x124> _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); 8004348: 29 63 00 8c lw r3,(r11+140) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 800434c: 34 64 00 04 addi r4,r3,4 8004350: 59 64 00 00 sw (r11+0),r4 old_last_node = the_chain->last; 8004354: 28 64 00 08 lw r4,(r3+8) the_chain->last = the_node; 8004358: 58 6b 00 08 sw (r3+8),r11 old_last_node->next = the_node; the_node->previous = old_last_node; 800435c: 59 64 00 04 sw (r11+4),r4 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; 8004360: 58 8b 00 00 sw (r4+0),r11 8004364: e3 ff ff a1 bi 80041e8 <_Thread_Change_priority+0xec> 08009ec0 <_Thread_Clear_state>: ) { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 8009ec0: 90 00 18 00 rcsr r3,IE 8009ec4: 34 05 ff fe mvi r5,-2 8009ec8: a0 65 28 00 and r5,r3,r5 8009ecc: d0 05 00 00 wcsr IE,r5 current_state = the_thread->current_state; 8009ed0: 28 24 00 10 lw r4,(r1+16) if ( current_state & state ) { 8009ed4: a0 44 30 00 and r6,r2,r4 8009ed8: 44 c0 00 2a be r6,r0,8009f80 <_Thread_Clear_state+0xc0> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 8009edc: a4 40 10 00 not r2,r2 8009ee0: a0 44 20 00 and r4,r2,r4 current_state = 8009ee4: 58 24 00 10 sw (r1+16),r4 the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 8009ee8: 5c 80 00 26 bne r4,r0,8009f80 <_Thread_Clear_state+0xc0> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8009eec: 28 26 00 90 lw r6,(r1+144) 8009ef0: 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); 8009ef4: 28 24 00 8c lw r4,(r1+140) 8009ef8: 2c c8 00 00 lhu r8,(r6+0) _Priority_Major_bit_map |= the_priority_map->ready_major; 8009efc: 78 02 08 01 mvhi r2,0x801 8009f00: 38 42 e9 54 ori r2,r2,0xe954 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8009f04: b9 07 38 00 or r7,r8,r7 8009f08: 0c c7 00 00 sh (r6+0),r7 _Priority_Major_bit_map |= the_priority_map->ready_major; 8009f0c: 2c 47 00 00 lhu r7,(r2+0) 8009f10: 2c 28 00 94 lhu r8,(r1+148) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8009f14: 34 86 00 04 addi r6,r4,4 8009f18: 58 26 00 00 sw (r1+0),r6 old_last_node = the_chain->last; 8009f1c: 28 86 00 08 lw r6,(r4+8) 8009f20: b9 07 38 00 or r7,r8,r7 the_chain->last = the_node; 8009f24: 58 81 00 08 sw (r4+8),r1 8009f28: 20 e4 ff ff andi r4,r7,0xffff 8009f2c: 0c 44 00 00 sh (r2+0),r4 old_last_node->next = the_node; the_node->previous = old_last_node; 8009f30: 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; 8009f34: 58 c1 00 00 sw (r6+0),r1 _ISR_Flash( level ); 8009f38: d0 03 00 00 wcsr IE,r3 8009f3c: 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 ) { 8009f40: 78 02 08 01 mvhi r2,0x801 8009f44: 38 42 e9 30 ori r2,r2,0xe930 8009f48: 28 44 00 00 lw r4,(r2+0) 8009f4c: 28 25 00 14 lw r5,(r1+20) 8009f50: 28 84 00 14 lw r4,(r4+20) 8009f54: 50 a4 00 0b bgeu r5,r4,8009f80 <_Thread_Clear_state+0xc0> _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 8009f58: 78 04 08 01 mvhi r4,0x801 8009f5c: 38 84 e9 60 ori r4,r4,0xe960 8009f60: 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; 8009f64: 58 41 00 00 sw (r2+0),r1 if ( _Thread_Executing->is_preemptible || 8009f68: 40 81 00 75 lbu r1,(r4+117) 8009f6c: 44 20 00 07 be r1,r0,8009f88 <_Thread_Clear_state+0xc8> the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 8009f70: 78 01 08 01 mvhi r1,0x801 8009f74: 38 21 e9 70 ori r1,r1,0xe970 8009f78: 34 02 00 01 mvi r2,1 8009f7c: 30 22 00 00 sb (r1+0),r2 } } } _ISR_Enable( level ); 8009f80: d0 03 00 00 wcsr IE,r3 } 8009f84: c3 a0 00 00 ret * 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; if ( _Thread_Executing->is_preemptible || 8009f88: 44 a1 ff fa be r5,r1,8009f70 <_Thread_Clear_state+0xb0> <== NEVER TAKEN 8009f8c: e3 ff ff fd bi 8009f80 <_Thread_Clear_state+0xc0> 0800c6ac <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800c6ac: 37 9c ff f8 addi sp,sp,-8 800c6b0: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800c6b4: 37 82 00 08 addi r2,sp,8 800c6b8: f8 00 00 a5 calli 800c94c <_Thread_Get> switch ( location ) { 800c6bc: 2b 82 00 08 lw r2,(sp+8) 800c6c0: 5c 40 00 09 bne r2,r0,800c6e4 <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800c6c4: 78 02 10 00 mvhi r2,0x1000 800c6c8: 38 42 00 18 ori r2,r2,0x18 800c6cc: fb ff ff 4b calli 800c3f8 <_Thread_Clear_state> 800c6d0: 78 01 08 02 mvhi r1,0x802 800c6d4: 38 21 ba 2c ori r1,r1,0xba2c 800c6d8: 28 22 00 00 lw r2,(r1+0) 800c6dc: 34 42 ff ff addi r2,r2,-1 800c6e0: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800c6e4: 2b 9d 00 04 lw ra,(sp+4) 800c6e8: 37 9c 00 08 addi sp,sp,8 800c6ec: c3 a0 00 00 ret 0800454c <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 800454c: 37 9c ff b4 addi sp,sp,-76 8004550: 5b 8b 00 3c sw (sp+60),r11 8004554: 5b 8c 00 38 sw (sp+56),r12 8004558: 5b 8d 00 34 sw (sp+52),r13 800455c: 5b 8e 00 30 sw (sp+48),r14 8004560: 5b 8f 00 2c sw (sp+44),r15 8004564: 5b 90 00 28 sw (sp+40),r16 8004568: 5b 91 00 24 sw (sp+36),r17 800456c: 5b 92 00 20 sw (sp+32),r18 8004570: 5b 93 00 1c sw (sp+28),r19 8004574: 5b 94 00 18 sw (sp+24),r20 8004578: 5b 95 00 14 sw (sp+20),r21 800457c: 5b 96 00 10 sw (sp+16),r22 8004580: 5b 97 00 0c sw (sp+12),r23 8004584: 5b 98 00 08 sw (sp+8),r24 8004588: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 800458c: 78 0e 08 01 mvhi r14,0x801 8004590: 39 ce e9 60 ori r14,r14,0xe960 8004594: 29 cc 00 00 lw r12,(r14+0) _ISR_Disable( level ); 8004598: 90 00 08 00 rcsr r1,IE 800459c: 34 02 ff fe mvi r2,-2 80045a0: a0 22 10 00 and r2,r1,r2 80045a4: d0 02 00 00 wcsr IE,r2 while ( _Context_Switch_necessary == true ) { 80045a8: 78 0d 08 01 mvhi r13,0x801 80045ac: 39 ad e9 70 ori r13,r13,0xe970 80045b0: 41 a2 00 00 lbu r2,(r13+0) 80045b4: 44 40 00 3d be r2,r0,80046a8 <_Thread_Dispatch+0x15c> 80045b8: 78 11 08 01 mvhi r17,0x801 80045bc: 78 15 08 01 mvhi r21,0x801 80045c0: 78 0f 08 01 mvhi r15,0x801 80045c4: 78 14 08 01 mvhi r20,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; 80045c8: 78 18 08 01 mvhi r24,0x801 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 80045cc: ba 20 b8 00 mv r23,r17 80045d0: 3a b5 e9 30 ori r21,r21,0xe930 80045d4: 39 ef e8 a4 ori r15,r15,0xe8a4 80045d8: 3a 94 e9 2c ori r20,r20,0xe92c #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; 80045dc: 3b 18 e8 34 ori r24,r24,0xe834 80045e0: 37 93 00 48 addi r19,sp,72 80045e4: 37 92 00 40 addi r18,sp,64 80045e8: 3a 31 e9 68 ori r17,r17,0xe968 executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 80045ec: 34 10 00 01 mvi r16,1 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 80045f0: 34 16 ff fe mvi r22,-2 80045f4: e0 00 00 23 bi 8004680 <_Thread_Dispatch+0x134> 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; _ISR_Enable( level ); 80045f8: d0 01 00 00 wcsr IE,r1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 80045fc: ba 60 08 00 mv r1,r19 8004600: f8 00 14 2c calli 80096b0 <_TOD_Get_uptime> _Timestamp_Subtract( 8004604: ba e0 08 00 mv r1,r23 8004608: ba 40 18 00 mv r3,r18 800460c: 38 21 e9 68 ori r1,r1,0xe968 8004610: ba 60 10 00 mv r2,r19 8004614: f8 00 04 7c calli 8005804 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 8004618: ba 40 10 00 mv r2,r18 800461c: 35 81 00 84 addi r1,r12,132 8004620: f8 00 04 64 calli 80057b0 <_Timespec_Add_to> _Thread_Time_of_last_context_switch = uptime; 8004624: 2b 83 00 48 lw r3,(sp+72) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004628: 2a 84 00 00 lw r4,(r20+0) executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 800462c: b9 80 08 00 mv r1,r12 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 8004630: 5a 23 00 00 sw (r17+0),r3 8004634: 2b 83 00 4c lw r3,(sp+76) if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 8004638: b9 60 10 00 mv r2,r11 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 800463c: 5a 23 00 04 sw (r17+4),r3 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004640: 44 80 00 05 be r4,r0,8004654 <_Thread_Dispatch+0x108> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 8004644: 28 83 00 00 lw r3,(r4+0) 8004648: 59 83 01 24 sw (r12+292),r3 *_Thread_libc_reent = heir->libc_reent; 800464c: 29 63 01 24 lw r3,(r11+292) 8004650: 58 83 00 00 sw (r4+0),r3 } _User_extensions_Thread_switch( executing, heir ); 8004654: f8 00 05 66 calli 8005bec <_User_extensions_Thread_switch> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 8004658: 35 81 00 d0 addi r1,r12,208 800465c: 35 62 00 d0 addi r2,r11,208 8004660: f8 00 06 98 calli 80060c0 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 8004664: 29 cc 00 00 lw r12,(r14+0) _ISR_Disable( level ); 8004668: 90 00 20 00 rcsr r4,IE 800466c: a0 96 08 00 and r1,r4,r22 8004670: d0 01 00 00 wcsr IE,r1 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 8004674: 41 a2 00 00 lbu r2,(r13+0) 8004678: b8 80 08 00 mv r1,r4 800467c: 44 40 00 0e be r2,r0,80046b4 <_Thread_Dispatch+0x168> heir = _Thread_Heir; 8004680: 2a ab 00 00 lw r11,(r21+0) _Thread_Dispatch_disable_level = 1; 8004684: 59 f0 00 00 sw (r15+0),r16 _Context_Switch_necessary = false; 8004688: 34 02 00 00 mvi r2,0 _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 ) 800468c: 29 63 00 7c lw r3,(r11+124) executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 8004690: 31 a2 00 00 sb (r13+0),r2 _Thread_Executing = heir; 8004694: 59 cb 00 00 sw (r14+0),r11 #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 ) 8004698: 5c 70 ff d8 bne r3,r16,80045f8 <_Thread_Dispatch+0xac> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 800469c: 2b 02 00 00 lw r2,(r24+0) 80046a0: 59 62 00 78 sw (r11+120),r2 80046a4: e3 ff ff d5 bi 80045f8 <_Thread_Dispatch+0xac> 80046a8: 78 0f 08 01 mvhi r15,0x801 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 80046ac: b8 20 20 00 mv r4,r1 80046b0: 39 ef e8 a4 ori r15,r15,0xe8a4 executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 80046b4: 34 02 00 00 mvi r2,0 80046b8: 59 e2 00 00 sw (r15+0),r2 _ISR_Enable( level ); 80046bc: d0 04 00 00 wcsr IE,r4 if ( _Thread_Do_post_task_switch_extension || 80046c0: 78 01 08 01 mvhi r1,0x801 80046c4: 38 21 e9 44 ori r1,r1,0xe944 80046c8: 28 21 00 00 lw r1,(r1+0) 80046cc: 5c 20 00 03 bne r1,r0,80046d8 <_Thread_Dispatch+0x18c> executing->do_post_task_switch_extension ) { 80046d0: 41 82 00 74 lbu r2,(r12+116) 80046d4: 44 41 00 04 be r2,r1,80046e4 <_Thread_Dispatch+0x198> executing->do_post_task_switch_extension = false; 80046d8: 34 01 00 00 mvi r1,0 80046dc: 31 81 00 74 sb (r12+116),r1 _API_extensions_Run_postswitch(); 80046e0: fb ff f9 4e calli 8002c18 <_API_extensions_Run_postswitch> } } 80046e4: 2b 9d 00 04 lw ra,(sp+4) 80046e8: 2b 8b 00 3c lw r11,(sp+60) 80046ec: 2b 8c 00 38 lw r12,(sp+56) 80046f0: 2b 8d 00 34 lw r13,(sp+52) 80046f4: 2b 8e 00 30 lw r14,(sp+48) 80046f8: 2b 8f 00 2c lw r15,(sp+44) 80046fc: 2b 90 00 28 lw r16,(sp+40) 8004700: 2b 91 00 24 lw r17,(sp+36) 8004704: 2b 92 00 20 lw r18,(sp+32) 8004708: 2b 93 00 1c lw r19,(sp+28) 800470c: 2b 94 00 18 lw r20,(sp+24) 8004710: 2b 95 00 14 lw r21,(sp+20) 8004714: 2b 96 00 10 lw r22,(sp+16) 8004718: 2b 97 00 0c lw r23,(sp+12) 800471c: 2b 98 00 08 lw r24,(sp+8) 8004720: 37 9c 00 4c addi sp,sp,76 8004724: c3 a0 00 00 ret 0800c48c <_Thread_Evaluate_mode>: bool _Thread_Evaluate_mode( void ) { Thread_Control *executing; executing = _Thread_Executing; 800c48c: 78 01 08 01 mvhi r1,0x801 800c490: 38 21 e9 60 ori r1,r1,0xe960 800c494: 28 21 00 00 lw r1,(r1+0) if ( !_States_Is_ready( executing->current_state ) || 800c498: 28 22 00 10 lw r2,(r1+16) 800c49c: 5c 40 00 07 bne r2,r0,800c4b8 <_Thread_Evaluate_mode+0x2c> <== NEVER TAKEN 800c4a0: 78 02 08 01 mvhi r2,0x801 800c4a4: 38 42 e9 30 ori r2,r2,0xe930 800c4a8: 28 42 00 00 lw r2,(r2+0) 800c4ac: 44 22 00 09 be r1,r2,800c4d0 <_Thread_Evaluate_mode+0x44> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 800c4b0: 40 21 00 75 lbu r1,(r1+117) 800c4b4: 44 20 00 07 be r1,r0,800c4d0 <_Thread_Evaluate_mode+0x44> <== NEVER TAKEN _Context_Switch_necessary = true; 800c4b8: 78 01 08 01 mvhi r1,0x801 800c4bc: 38 21 e9 70 ori r1,r1,0xe970 800c4c0: 34 02 00 01 mvi r2,1 800c4c4: 30 22 00 00 sb (r1+0),r2 800c4c8: b8 40 08 00 mv r1,r2 return true; 800c4cc: c3 a0 00 00 ret 800c4d0: 34 01 00 00 mvi r1,0 } return false; } 800c4d4: c3 a0 00 00 ret 0800c4d8 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 800c4d8: 37 9c ff f4 addi sp,sp,-12 800c4dc: 5b 8b 00 0c sw (sp+12),r11 800c4e0: 5b 8c 00 08 sw (sp+8),r12 800c4e4: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 800c4e8: 78 01 08 01 mvhi r1,0x801 800c4ec: 38 21 e9 60 ori r1,r1,0xe960 800c4f0: 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; 800c4f4: 29 61 00 b8 lw r1,(r11+184) _ISR_Set_level(level); 800c4f8: 64 21 00 00 cmpei r1,r1,0 800c4fc: d0 01 00 00 wcsr IE,r1 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 800c500: 78 02 08 01 mvhi r2,0x801 800c504: 38 42 e6 a8 ori r2,r2,0xe6a8 800c508: 40 4c 00 00 lbu r12,(r2+0) doneConstructors = 1; 800c50c: 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 ); 800c510: 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; 800c514: 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 ); 800c518: fb ff e5 15 calli 800596c <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 800c51c: fb ff e0 83 calli 8004728 <_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) */ { 800c520: 45 80 00 0b be r12,r0,800c54c <_Thread_Handler+0x74> INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800c524: 29 61 00 a0 lw r1,(r11+160) 800c528: 44 20 00 0c be r1,r0,800c558 <_Thread_Handler+0x80> (*(Thread_Entry_numeric) executing->Start.entry_point)( executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 800c52c: 34 02 00 01 mvi r2,1 800c530: 44 22 00 0f be r1,r2,800c56c <_Thread_Handler+0x94> <== ALWAYS TAKEN * 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 ); 800c534: b9 60 08 00 mv r1,r11 800c538: fb ff e5 24 calli 80059c8 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 800c53c: 34 01 00 00 mvi r1,0 800c540: 34 02 00 01 mvi r2,1 800c544: 34 03 00 06 mvi r3,6 800c548: fb ff dc 83 calli 8003754 <_Internal_error_Occurred> * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (!doneCons) /* && (volatile void *)_init) */ { INIT_NAME (); 800c54c: fb ff ce ad calli 8000000 } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800c550: 29 61 00 a0 lw r1,(r11+160) 800c554: 5c 20 ff f6 bne r1,r0,800c52c <_Thread_Handler+0x54> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 800c558: 29 62 00 9c lw r2,(r11+156) 800c55c: 29 61 00 a8 lw r1,(r11+168) 800c560: d8 40 00 00 call r2 INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 800c564: 59 61 00 28 sw (r11+40),r1 800c568: e3 ff ff f3 bi 800c534 <_Thread_Handler+0x5c> ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 800c56c: 29 62 00 9c lw r2,(r11+156) 800c570: 29 61 00 a4 lw r1,(r11+164) 800c574: d8 40 00 00 call r2 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 800c578: 59 61 00 28 sw (r11+40),r1 800c57c: e3 ff ff ee bi 800c534 <_Thread_Handler+0x5c> 08004ae4 <_Thread_Handler_initialization>: * * Output parameters: NONE */ void _Thread_Handler_initialization(void) { 8004ae4: 37 9c ff f0 addi sp,sp,-16 8004ae8: 5b 8b 00 10 sw (sp+16),r11 8004aec: 5b 8c 00 0c sw (sp+12),r12 8004af0: 5b 8d 00 08 sw (sp+8),r13 8004af4: 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; 8004af8: 78 01 08 01 mvhi r1,0x801 8004afc: 38 21 e0 c4 ori r1,r1,0xe0c4 #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 8004b00: 28 22 00 20 lw r2,(r1+32) 8004b04: 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; 8004b08: 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) 8004b0c: 64 42 00 00 cmpei r2,r2,0 8004b10: 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; 8004b14: 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) 8004b18: 99 22 48 00 xor r9,r9,r2 8004b1c: b9 20 58 00 mv r11,r9 8004b20: 5d 20 00 37 bne r9,r0,8004bfc <_Thread_Handler_initialization+0x118><== NEVER TAKEN _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004b24: 78 0c 08 01 mvhi r12,0x801 8004b28: 39 8c e0 c0 ori r12,r12,0xe0c0 8004b2c: 41 81 00 00 lbu r1,(r12+0) INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 8004b30: 78 08 08 01 mvhi r8,0x801 _Thread_Executing = NULL; 8004b34: 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( 8004b38: 34 21 00 01 addi r1,r1,1 INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; _Thread_Executing = NULL; _Thread_Heir = NULL; 8004b3c: 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; 8004b40: 78 03 08 01 mvhi r3,0x801 _Thread_Maximum_extensions = maximum_extensions; 8004b44: 78 07 08 01 mvhi r7,0x801 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8004b48: 78 06 08 01 mvhi r6,0x801 INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; _Thread_Executing = NULL; _Thread_Heir = NULL; 8004b4c: 38 84 e9 30 ori r4,r4,0xe930 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; 8004b50: 38 63 e9 44 ori r3,r3,0xe944 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8004b54: 38 c6 e8 34 ori r6,r6,0xe834 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 8004b58: 39 08 e9 70 ori r8,r8,0xe970 _Thread_Executing = NULL; 8004b5c: 38 a5 e9 60 ori r5,r5,0xe960 _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; 8004b60: 38 e7 e9 40 ori r7,r7,0xe940 _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004b64: 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; 8004b68: 58 ca 00 00 sw (r6+0),r10 INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; _Thread_Executing = NULL; _Thread_Heir = NULL; 8004b6c: 58 89 00 00 sw (r4+0),r9 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; 8004b70: 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( 8004b74: b4 41 08 00 add r1,r2,r1 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 8004b78: 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( 8004b7c: 34 02 00 02 mvi r2,2 _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; 8004b80: 58 ed 00 00 sw (r7+0),r13 true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; _Thread_Executing = NULL; 8004b84: 58 a9 00 00 sw (r5+0),r9 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004b88: fb ff ed 9a calli 80001f0 <__ashlsi3> 8004b8c: f8 00 05 0c calli 8005fbc <_Workspace_Allocate_or_fatal_error> 8004b90: 78 03 08 01 mvhi r3,0x801 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 8004b94: 41 84 00 00 lbu r4,(r12+0) _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004b98: 38 63 e8 30 ori r3,r3,0xe830 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 8004b9c: b9 60 10 00 mv r2,r11 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 8004ba0: 58 61 00 00 sw (r3+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; 8004ba4: 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); 8004ba8: 34 23 00 04 addi r3,r1,4 8004bac: 58 23 00 00 sw (r1+0),r3 the_chain->permanent_null = NULL; 8004bb0: 58 26 00 04 sw (r1+4),r6 the_chain->last = _Chain_Head(the_chain); 8004bb4: 58 21 00 08 sw (r1+8),r1 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 8004bb8: 34 42 00 01 addi r2,r2,1 8004bbc: 34 21 00 0c addi r1,r1,12 8004bc0: 50 82 ff fa bgeu r4,r2,8004ba8 <_Thread_Handler_initialization+0xc4> /* * Initialize this class of objects. */ _Objects_Initialize_information( 8004bc4: 34 02 00 01 mvi r2,1 8004bc8: 78 01 08 01 mvhi r1,0x801 8004bcc: 38 21 ea 00 ori r1,r1,0xea00 8004bd0: b8 40 18 00 mv r3,r2 8004bd4: b8 40 20 00 mv r4,r2 8004bd8: 34 05 01 3c mvi r5,316 8004bdc: 34 07 00 08 mvi r7,8 8004be0: fb ff fc 83 calli 8003dec <_Objects_Initialize_information> false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 8004be4: 2b 9d 00 04 lw ra,(sp+4) 8004be8: 2b 8b 00 10 lw r11,(sp+16) 8004bec: 2b 8c 00 0c lw r12,(sp+12) 8004bf0: 2b 8d 00 08 lw r13,(sp+8) 8004bf4: 37 9c 00 10 addi sp,sp,16 8004bf8: c3 a0 00 00 ret * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) == (!Configuration.stack_free_hook) ) ) _Internal_error_Occurred( 8004bfc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8004c00: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8004c04: 34 03 00 0f mvi r3,15 <== NOT EXECUTED 8004c08: fb ff fa d3 calli 8003754 <_Internal_error_Occurred> <== NOT EXECUTED 08006220 <_Thread_Restart>: bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 8006220: 37 9c ff f0 addi sp,sp,-16 8006224: 5b 8b 00 08 sw (sp+8),r11 8006228: 5b 9d 00 04 sw (sp+4),ra if ( !_States_Is_dormant( the_thread->current_state ) ) { 800622c: 28 25 00 10 lw r5,(r1+16) 8006230: 34 04 00 00 mvi r4,0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 8006234: b8 20 58 00 mv r11,r1 if ( !_States_Is_dormant( the_thread->current_state ) ) { 8006238: 20 a5 00 01 andi r5,r5,0x1 800623c: 44 a4 00 06 be r5,r4,8006254 <_Thread_Restart+0x34> return true; } return false; } 8006240: b8 80 08 00 mv r1,r4 8006244: 2b 9d 00 04 lw ra,(sp+4) 8006248: 2b 8b 00 08 lw r11,(sp+8) 800624c: 37 9c 00 10 addi sp,sp,16 8006250: c3 a0 00 00 ret Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { _Thread_Set_transient( the_thread ); 8006254: 5b 82 00 10 sw (sp+16),r2 8006258: 5b 83 00 0c sw (sp+12),r3 800625c: f8 00 00 b9 calli 8006540 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 8006260: 2b 82 00 10 lw r2,(sp+16) 8006264: 2b 83 00 0c lw r3,(sp+12) 8006268: b9 60 08 00 mv r1,r11 800626c: f8 00 15 19 calli 800b6d0 <_Thread_Reset> _Thread_Load_environment( the_thread ); 8006270: b9 60 08 00 mv r1,r11 8006274: f8 00 13 de calli 800b1ec <_Thread_Load_environment> _Thread_Ready( the_thread ); 8006278: b9 60 08 00 mv r1,r11 800627c: f8 00 14 b1 calli 800b540 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 8006280: b9 60 08 00 mv r1,r11 8006284: f8 00 02 7b calli 8006c70 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 8006288: 78 01 08 02 mvhi r1,0x802 800628c: 38 21 39 b8 ori r1,r1,0x39b8 8006290: 28 21 00 00 lw r1,(r1+0) 8006294: 34 04 00 01 mvi r4,1 8006298: 5d 61 ff ea bne r11,r1,8006240 <_Thread_Restart+0x20> #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 ); 800629c: 35 61 00 d0 addi r1,r11,208 80062a0: f8 00 04 16 calli 80072f8 <_CPU_Context_restore> 80062a4: 34 04 00 01 mvi r4,1 <== NOT EXECUTED 80062a8: e3 ff ff e6 bi 8006240 <_Thread_Restart+0x20> <== NOT EXECUTED 0800ab6c <_Thread_Resume>: { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 800ab6c: 90 00 10 00 rcsr r2,IE 800ab70: 34 04 ff fe mvi r4,-2 800ab74: a0 44 20 00 and r4,r2,r4 800ab78: d0 04 00 00 wcsr IE,r4 _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 800ab7c: 28 23 00 10 lw r3,(r1+16) if ( current_state & STATES_SUSPENDED ) { 800ab80: 20 65 00 02 andi r5,r3,0x2 800ab84: 44 a0 00 2a be r5,r0,800ac2c <_Thread_Resume+0xc0> <== NEVER TAKEN 800ab88: 34 05 ff fd mvi r5,-3 800ab8c: a0 65 18 00 and r3,r3,r5 current_state = 800ab90: 58 23 00 10 sw (r1+16),r3 the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 800ab94: 5c 60 00 26 bne r3,r0,800ac2c <_Thread_Resume+0xc0> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 800ab98: 28 26 00 90 lw r6,(r1+144) 800ab9c: 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); 800aba0: 28 25 00 8c lw r5,(r1+140) 800aba4: 2c c8 00 00 lhu r8,(r6+0) _Priority_Major_bit_map |= the_priority_map->ready_major; 800aba8: 78 03 08 02 mvhi r3,0x802 800abac: 38 63 5a 2c ori r3,r3,0x5a2c RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 800abb0: b9 07 38 00 or r7,r8,r7 800abb4: 0c c7 00 00 sh (r6+0),r7 _Priority_Major_bit_map |= the_priority_map->ready_major; 800abb8: 2c 67 00 00 lhu r7,(r3+0) 800abbc: 2c 28 00 94 lhu r8,(r1+148) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 800abc0: 34 a6 00 04 addi r6,r5,4 800abc4: 58 26 00 00 sw (r1+0),r6 old_last_node = the_chain->last; 800abc8: 28 a6 00 08 lw r6,(r5+8) 800abcc: b9 07 38 00 or r7,r8,r7 the_chain->last = the_node; 800abd0: 58 a1 00 08 sw (r5+8),r1 800abd4: 20 e5 ff ff andi r5,r7,0xffff 800abd8: 0c 65 00 00 sh (r3+0),r5 old_last_node->next = the_node; the_node->previous = old_last_node; 800abdc: 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; 800abe0: 58 c1 00 00 sw (r6+0),r1 _ISR_Flash( level ); 800abe4: d0 02 00 00 wcsr IE,r2 800abe8: d0 04 00 00 wcsr IE,r4 if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 800abec: 78 03 08 02 mvhi r3,0x802 800abf0: 38 63 5a 08 ori r3,r3,0x5a08 800abf4: 28 64 00 00 lw r4,(r3+0) 800abf8: 28 25 00 14 lw r5,(r1+20) 800abfc: 28 84 00 14 lw r4,(r4+20) 800ac00: 50 a4 00 0b bgeu r5,r4,800ac2c <_Thread_Resume+0xc0> _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 800ac04: 78 04 08 02 mvhi r4,0x802 800ac08: 38 84 5a 38 ori r4,r4,0x5a38 800ac0c: 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; 800ac10: 58 61 00 00 sw (r3+0),r1 if ( _Thread_Executing->is_preemptible || 800ac14: 40 81 00 75 lbu r1,(r4+117) 800ac18: 44 20 00 07 be r1,r0,800ac34 <_Thread_Resume+0xc8> the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 800ac1c: 78 01 08 02 mvhi r1,0x802 800ac20: 38 21 5a 48 ori r1,r1,0x5a48 800ac24: 34 03 00 01 mvi r3,1 800ac28: 30 23 00 00 sb (r1+0),r3 } } } _ISR_Enable( level ); 800ac2c: d0 02 00 00 wcsr IE,r2 } 800ac30: c3 a0 00 00 ret _ISR_Flash( level ); if ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 800ac34: 44 a1 ff fa be r5,r1,800ac1c <_Thread_Resume+0xb0> <== NEVER TAKEN 800ac38: e3 ff ff fd bi 800ac2c <_Thread_Resume+0xc0> 0800571c <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 800571c: 37 9c ff f8 addi sp,sp,-8 8005720: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; executing = _Thread_Executing; 8005724: 78 01 08 01 mvhi r1,0x801 8005728: 38 21 e9 60 ori r1,r1,0xe960 800572c: 28 21 00 00 lw r1,(r1+0) /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 8005730: 40 22 00 75 lbu r2,(r1+117) 8005734: 44 40 00 09 be r2,r0,8005758 <_Thread_Tickle_timeslice+0x3c> return; if ( !_States_Is_ready( executing->current_state ) ) 8005738: 28 22 00 10 lw r2,(r1+16) 800573c: 5c 40 00 07 bne r2,r0,8005758 <_Thread_Tickle_timeslice+0x3c> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 8005740: 28 22 00 7c lw r2,(r1+124) 8005744: 44 40 00 05 be r2,r0,8005758 <_Thread_Tickle_timeslice+0x3c> 8005748: 34 03 00 02 mvi r3,2 800574c: 50 62 00 0d bgeu r3,r2,8005780 <_Thread_Tickle_timeslice+0x64> 8005750: 34 03 00 03 mvi r3,3 8005754: 44 43 00 04 be r2,r3,8005764 <_Thread_Tickle_timeslice+0x48><== ALWAYS TAKEN if ( --executing->cpu_time_budget == 0 ) (*executing->budget_callout)( executing ); break; #endif } } 8005758: 2b 9d 00 04 lw ra,(sp+4) 800575c: 37 9c 00 08 addi sp,sp,8 8005760: c3 a0 00 00 ret } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 8005764: 28 22 00 78 lw r2,(r1+120) 8005768: 34 42 ff ff addi r2,r2,-1 800576c: 58 22 00 78 sw (r1+120),r2 8005770: 5c 40 ff fa bne r2,r0,8005758 <_Thread_Tickle_timeslice+0x3c> (*executing->budget_callout)( executing ); 8005774: 28 22 00 80 lw r2,(r1+128) 8005778: d8 40 00 00 call r2 800577c: e3 ff ff f7 bi 8005758 <_Thread_Tickle_timeslice+0x3c> case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 8005780: 28 22 00 78 lw r2,(r1+120) 8005784: 34 42 ff ff addi r2,r2,-1 8005788: 58 22 00 78 sw (r1+120),r2 800578c: 48 40 ff f3 bg r2,r0,8005758 <_Thread_Tickle_timeslice+0x3c> _Thread_Reset_timeslice(); 8005790: 5b 81 00 08 sw (sp+8),r1 8005794: f8 00 13 38 calli 800a474 <_Thread_Reset_timeslice> executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 8005798: 78 02 08 01 mvhi r2,0x801 800579c: 38 42 e8 34 ori r2,r2,0xe834 80057a0: 2b 81 00 08 lw r1,(sp+8) 80057a4: 28 42 00 00 lw r2,(r2+0) 80057a8: 58 22 00 78 sw (r1+120),r2 80057ac: e3 ff ff eb bi 8005758 <_Thread_Tickle_timeslice+0x3c> 0800d9e0 <_Thread_Yield_processor>: { ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 800d9e0: 78 01 08 02 mvhi r1,0x802 800d9e4: 38 21 ba e8 ori r1,r1,0xbae8 800d9e8: 28 21 00 00 lw r1,(r1+0) ready = executing->ready; 800d9ec: 28 22 00 8c lw r2,(r1+140) _ISR_Disable( level ); 800d9f0: 90 00 20 00 rcsr r4,IE 800d9f4: 34 03 ff fe mvi r3,-2 800d9f8: a0 83 18 00 and r3,r4,r3 800d9fc: d0 03 00 00 wcsr IE,r3 if ( !_Chain_Has_only_one_node( ready ) ) { 800da00: 28 46 00 00 lw r6,(r2+0) 800da04: 28 45 00 08 lw r5,(r2+8) 800da08: 44 c5 00 1a be r6,r5,800da70 <_Thread_Yield_processor+0x90> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 800da0c: 28 25 00 00 lw r5,(r1+0) previous = the_node->previous; 800da10: 28 26 00 04 lw r6,(r1+4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 800da14: 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; 800da18: 58 c5 00 00 sw (r6+0),r5 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 800da1c: 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; 800da20: 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; 800da24: 28 45 00 08 lw r5,(r2+8) the_chain->last = the_node; 800da28: 58 41 00 08 sw (r2+8),r1 old_last_node->next = the_node; the_node->previous = old_last_node; 800da2c: 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; 800da30: 58 a1 00 00 sw (r5+0),r1 _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 800da34: d0 04 00 00 wcsr IE,r4 800da38: d0 03 00 00 wcsr IE,r3 if ( _Thread_Is_heir( executing ) ) 800da3c: 78 03 08 02 mvhi r3,0x802 800da40: 38 63 ba b8 ori r3,r3,0xbab8 800da44: 28 65 00 00 lw r5,(r3+0) 800da48: 44 25 00 07 be r1,r5,800da64 <_Thread_Yield_processor+0x84><== ALWAYS TAKEN _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) _Context_Switch_necessary = true; 800da4c: 78 01 08 02 mvhi r1,0x802 800da50: 38 21 ba f8 ori r1,r1,0xbaf8 800da54: 34 02 00 01 mvi r2,1 800da58: 30 22 00 00 sb (r1+0),r2 _ISR_Enable( level ); 800da5c: d0 04 00 00 wcsr IE,r4 } 800da60: c3 a0 00 00 ret _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; 800da64: 28 42 00 00 lw r2,(r2+0) 800da68: 58 62 00 00 sw (r3+0),r2 800da6c: e3 ff ff f8 bi 800da4c <_Thread_Yield_processor+0x6c> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 800da70: 78 02 08 02 mvhi r2,0x802 800da74: 38 42 ba b8 ori r2,r2,0xbab8 800da78: 28 42 00 00 lw r2,(r2+0) 800da7c: 5c 22 ff f4 bne r1,r2,800da4c <_Thread_Yield_processor+0x6c><== NEVER TAKEN 800da80: e3 ff ff f7 bi 800da5c <_Thread_Yield_processor+0x7c> 08004eb4 <_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 ) { 8004eb4: 37 9c ff ec addi sp,sp,-20 8004eb8: 5b 8b 00 14 sw (sp+20),r11 8004ebc: 5b 8c 00 10 sw (sp+16),r12 8004ec0: 5b 8d 00 0c sw (sp+12),r13 8004ec4: 5b 8e 00 08 sw (sp+8),r14 8004ec8: 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; 8004ecc: 28 4b 00 14 lw r11,(r2+20) Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 8004ed0: b8 40 60 00 mv r12,r2 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8004ed4: 34 44 00 3c addi r4,r2,60 8004ed8: 59 84 00 38 sw (r12+56),r4 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 8004edc: 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; 8004ee0: 34 04 00 00 mvi r4,0 8004ee4: b8 20 68 00 mv r13,r1 8004ee8: 59 84 00 3c sw (r12+60),r4 the_chain->last = _Chain_Head(the_chain); 8004eec: 59 82 00 40 sw (r12+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 ]; 8004ef0: b9 60 08 00 mv r1,r11 8004ef4: 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 ) { 8004ef8: 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 ]; 8004efc: fb ff ec e5 calli 8000290 <__lshrsi3> 8004f00: b4 21 10 00 add r2,r1,r1 8004f04: b4 41 08 00 add r1,r2,r1 8004f08: 34 02 00 02 mvi r2,2 8004f0c: fb ff ec b9 calli 80001f0 <__ashlsi3> block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 8004f10: 21 62 00 20 andi r2,r11,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 ]; 8004f14: b5 a1 40 00 add r8,r13,r1 block_state = the_thread_queue->state; 8004f18: 29 a6 00 38 lw r6,(r13+56) if ( _Thread_queue_Is_reverse_search( priority ) ) 8004f1c: 5c 40 00 25 bne r2,r0,8004fb0 <_Thread_queue_Enqueue_priority+0xfc> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8004f20: 35 01 00 04 addi r1,r8,4 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 8004f24: 34 0a ff fe mvi r10,-2 8004f28: 90 00 10 00 rcsr r2,IE 8004f2c: a0 4a 48 00 and r9,r2,r10 8004f30: d0 09 00 00 wcsr IE,r9 search_thread = (Thread_Control *) header->first; 8004f34: 29 04 00 00 lw r4,(r8+0) while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8004f38: 44 81 00 69 be r4,r1,80050dc <_Thread_queue_Enqueue_priority+0x228> search_priority = search_thread->current_priority; 8004f3c: 28 85 00 14 lw r5,(r4+20) if ( priority <= search_priority ) 8004f40: 50 ab 00 10 bgeu r5,r11,8004f80 <_Thread_queue_Enqueue_priority+0xcc> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 8004f44: d0 02 00 00 wcsr IE,r2 8004f48: d0 09 00 00 wcsr IE,r9 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8004f4c: 28 83 00 10 lw r3,(r4+16) 8004f50: a0 c3 18 00 and r3,r6,r3 8004f54: 5c 60 00 09 bne r3,r0,8004f78 <_Thread_queue_Enqueue_priority+0xc4><== ALWAYS TAKEN 8004f58: e0 00 00 43 bi 8005064 <_Thread_queue_Enqueue_priority+0x1b0><== NOT EXECUTED 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 ) ) { search_priority = search_thread->current_priority; 8004f5c: 28 85 00 14 lw r5,(r4+20) if ( priority <= search_priority ) 8004f60: 50 ab 00 08 bgeu r5,r11,8004f80 <_Thread_queue_Enqueue_priority+0xcc> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 8004f64: d0 02 00 00 wcsr IE,r2 8004f68: d0 09 00 00 wcsr IE,r9 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8004f6c: 28 87 00 10 lw r7,(r4+16) 8004f70: a0 c7 38 00 and r7,r6,r7 8004f74: 44 e0 00 3c be r7,r0,8005064 <_Thread_queue_Enqueue_priority+0x1b0><== NEVER TAKEN _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 8004f78: 28 84 00 00 lw r4,(r4+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 ) ) { 8004f7c: 5c 81 ff f8 bne r4,r1,8004f5c <_Thread_queue_Enqueue_priority+0xa8> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8004f80: 29 a1 00 30 lw r1,(r13+48) 8004f84: 34 06 00 01 mvi r6,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; 8004f88: b8 40 18 00 mv r3,r2 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8004f8c: 44 26 00 38 be r1,r6,800506c <_Thread_queue_Enqueue_priority+0x1b8> * 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; 8004f90: 59 c3 00 00 sw (r14+0),r3 return the_thread_queue->sync_state; } 8004f94: 2b 9d 00 04 lw ra,(sp+4) 8004f98: 2b 8b 00 14 lw r11,(sp+20) 8004f9c: 2b 8c 00 10 lw r12,(sp+16) 8004fa0: 2b 8d 00 0c lw r13,(sp+12) 8004fa4: 2b 8e 00 08 lw r14,(sp+8) 8004fa8: 37 9c 00 14 addi sp,sp,20 8004fac: c3 a0 00 00 ret 8004fb0: 78 01 08 01 mvhi r1,0x801 8004fb4: 38 21 e0 c0 ori r1,r1,0xe0c0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 8004fb8: 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; 8004fbc: 40 25 00 00 lbu r5,(r1+0) 8004fc0: 34 a5 00 01 addi r5,r5,1 _ISR_Disable( level ); 8004fc4: 90 00 38 00 rcsr r7,IE 8004fc8: a0 e3 48 00 and r9,r7,r3 8004fcc: d0 09 00 00 wcsr IE,r9 search_thread = (Thread_Control *) header->last; 8004fd0: 29 04 00 08 lw r4,(r8+8) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8004fd4: 5c 88 00 04 bne r4,r8,8004fe4 <_Thread_queue_Enqueue_priority+0x130> 8004fd8: e0 00 00 0c bi 8005008 <_Thread_queue_Enqueue_priority+0x154> _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 8004fdc: 28 84 00 04 lw r4,(r4+4) restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8004fe0: 45 04 00 0a be r8,r4,8005008 <_Thread_queue_Enqueue_priority+0x154> search_priority = search_thread->current_priority; 8004fe4: 28 85 00 14 lw r5,(r4+20) if ( priority >= search_priority ) 8004fe8: 51 65 00 08 bgeu r11,r5,8005008 <_Thread_queue_Enqueue_priority+0x154> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 8004fec: d0 07 00 00 wcsr IE,r7 8004ff0: d0 09 00 00 wcsr IE,r9 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8004ff4: 28 82 00 10 lw r2,(r4+16) 8004ff8: a0 c2 10 00 and r2,r6,r2 8004ffc: 5c 40 ff f8 bne r2,r0,8004fdc <_Thread_queue_Enqueue_priority+0x128><== ALWAYS TAKEN _ISR_Enable( level ); 8005000: d0 07 00 00 wcsr IE,r7 <== NOT EXECUTED goto restart_reverse_search; 8005004: e3 ff ff ee bi 8004fbc <_Thread_queue_Enqueue_priority+0x108><== NOT EXECUTED } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8005008: 29 a1 00 30 lw r1,(r13+48) 800500c: 34 02 00 01 mvi r2,1 8005010: b8 e0 18 00 mv r3,r7 8005014: 5c 22 ff df bne r1,r2,8004f90 <_Thread_queue_Enqueue_priority+0xdc> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8005018: 34 01 00 00 mvi r1,0 800501c: 59 a1 00 30 sw (r13+48),r1 if ( priority == search_priority ) 8005020: b8 e0 10 00 mv r2,r7 8005024: 45 65 00 24 be r11,r5,80050b4 <_Thread_queue_Enqueue_priority+0x200> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8005028: 28 81 00 00 lw r1,(r4+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 800502c: 59 84 00 04 sw (r12+4),r4 search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 8005030: 59 8d 00 44 sw (r12+68),r13 search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 8005034: 59 81 00 00 sw (r12+0),r1 the_node->previous = search_node; search_node->next = the_node; 8005038: 58 8c 00 00 sw (r4+0),r12 next_node->previous = the_node; 800503c: 58 2c 00 04 sw (r1+4),r12 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 8005040: d0 07 00 00 wcsr IE,r7 8005044: 34 01 00 01 mvi r1,1 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8005048: 2b 9d 00 04 lw ra,(sp+4) 800504c: 2b 8b 00 14 lw r11,(sp+20) 8005050: 2b 8c 00 10 lw r12,(sp+16) 8005054: 2b 8d 00 0c lw r13,(sp+12) 8005058: 2b 8e 00 08 lw r14,(sp+8) 800505c: 37 9c 00 14 addi sp,sp,20 8005060: c3 a0 00 00 ret if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 8005064: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED goto restart_forward_search; 8005068: e3 ff ff b0 bi 8004f28 <_Thread_queue_Enqueue_priority+0x74><== NOT EXECUTED if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 800506c: 34 01 00 00 mvi r1,0 8005070: 59 a1 00 30 sw (r13+48),r1 if ( priority == search_priority ) 8005074: 45 65 00 10 be r11,r5,80050b4 <_Thread_queue_Enqueue_priority+0x200> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 8005078: 28 81 00 04 lw r1,(r4+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 800507c: 59 84 00 00 sw (r12+0),r4 the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 8005080: 59 8d 00 44 sw (r12+68),r13 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; 8005084: 59 81 00 04 sw (r12+4),r1 previous_node->next = the_node; 8005088: 58 2c 00 00 sw (r1+0),r12 search_node->previous = the_node; 800508c: 58 8c 00 04 sw (r4+4),r12 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 8005090: d0 02 00 00 wcsr IE,r2 8005094: 34 01 00 01 mvi r1,1 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8005098: 2b 9d 00 04 lw ra,(sp+4) 800509c: 2b 8b 00 14 lw r11,(sp+20) 80050a0: 2b 8c 00 10 lw r12,(sp+16) 80050a4: 2b 8d 00 0c lw r13,(sp+12) 80050a8: 2b 8e 00 08 lw r14,(sp+8) 80050ac: 37 9c 00 14 addi sp,sp,20 80050b0: c3 a0 00 00 ret 80050b4: 34 84 00 3c addi r4,r4,60 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 80050b8: 28 81 00 04 lw r1,(r4+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 80050bc: 59 84 00 00 sw (r12+0),r4 the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 80050c0: 59 8d 00 44 sw (r12+68),r13 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; 80050c4: 59 81 00 04 sw (r12+4),r1 previous_node->next = the_node; 80050c8: 58 2c 00 00 sw (r1+0),r12 search_node->previous = the_node; 80050cc: 58 8c 00 04 sw (r4+4),r12 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 80050d0: d0 02 00 00 wcsr IE,r2 80050d4: 34 01 00 01 mvi r1,1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 80050d8: e3 ff ff af bi 8004f94 <_Thread_queue_Enqueue_priority+0xe0> 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 ) ) { 80050dc: 34 05 ff ff mvi r5,-1 80050e0: e3 ff ff a8 bi 8004f80 <_Thread_queue_Enqueue_priority+0xcc> 0800a288 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 800a288: 37 9c ff fc addi sp,sp,-4 800a28c: 5b 9d 00 04 sw (sp+4),ra 800a290: b8 20 10 00 mv r2,r1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 800a294: 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 && 800a298: 28 24 00 30 lw r4,(r1+48) 800a29c: 44 80 00 05 be r4,r0,800a2b0 <_Thread_queue_Process_timeout+0x28> 800a2a0: 78 03 08 01 mvhi r3,0x801 800a2a4: 38 63 e9 60 ori r3,r3,0xe960 800a2a8: 28 63 00 00 lw r3,(r3+0) 800a2ac: 44 43 00 07 be r2,r3,800a2c8 <_Thread_queue_Process_timeout+0x40><== ALWAYS TAKEN if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800a2b0: 28 23 00 3c lw r3,(r1+60) 800a2b4: 58 43 00 34 sw (r2+52),r3 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 800a2b8: fb ff ff 93 calli 800a104 <_Thread_queue_Extract> } } 800a2bc: 2b 9d 00 04 lw ra,(sp+4) 800a2c0: 37 9c 00 04 addi sp,sp,4 800a2c4: c3 a0 00 00 ret * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 800a2c8: 34 03 00 03 mvi r3,3 800a2cc: 44 83 ff fc be r4,r3,800a2bc <_Thread_queue_Process_timeout+0x34><== ALWAYS TAKEN the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800a2d0: 34 03 00 02 mvi r3,2 <== NOT EXECUTED 800a2d4: 58 23 00 30 sw (r1+48),r3 <== NOT EXECUTED */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800a2d8: 28 21 00 3c lw r1,(r1+60) <== NOT EXECUTED 800a2dc: 58 41 00 34 sw (r2+52),r1 <== NOT EXECUTED 800a2e0: e3 ff ff f7 bi 800a2bc <_Thread_queue_Process_timeout+0x34><== NOT EXECUTED 08005170 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 8005170: 37 9c ff ec addi sp,sp,-20 8005174: 5b 8b 00 10 sw (sp+16),r11 8005178: 5b 8c 00 0c sw (sp+12),r12 800517c: 5b 8d 00 08 sw (sp+8),r13 8005180: 5b 9d 00 04 sw (sp+4),ra 8005184: b8 20 58 00 mv r11,r1 8005188: 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 ) 800518c: 44 20 00 04 be r1,r0,800519c <_Thread_queue_Requeue+0x2c> <== NEVER TAKEN /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 8005190: 28 22 00 34 lw r2,(r1+52) 8005194: 34 01 00 01 mvi r1,1 8005198: 44 41 00 07 be r2,r1,80051b4 <_Thread_queue_Requeue+0x44> <== ALWAYS TAKEN _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } 800519c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80051a0: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED 80051a4: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED 80051a8: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED 80051ac: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED 80051b0: c3 a0 00 00 ret <== NOT EXECUTED if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 80051b4: 90 00 68 00 rcsr r13,IE 80051b8: 34 01 ff fe mvi r1,-2 80051bc: a1 a1 08 00 and r1,r13,r1 80051c0: d0 01 00 00 wcsr IE,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 80051c4: 29 82 00 10 lw r2,(r12+16) 80051c8: 78 01 00 03 mvhi r1,0x3 80051cc: 38 21 be e0 ori r1,r1,0xbee0 80051d0: a0 41 08 00 and r1,r2,r1 80051d4: 5c 20 00 08 bne r1,r0,80051f4 <_Thread_queue_Requeue+0x84> <== ALWAYS TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); 80051d8: d0 0d 00 00 wcsr IE,r13 <== NOT EXECUTED } } 80051dc: 2b 9d 00 04 lw ra,(sp+4) 80051e0: 2b 8b 00 10 lw r11,(sp+16) 80051e4: 2b 8c 00 0c lw r12,(sp+12) 80051e8: 2b 8d 00 08 lw r13,(sp+8) 80051ec: 37 9c 00 14 addi sp,sp,20 80051f0: c3 a0 00 00 ret 80051f4: 34 03 00 01 mvi r3,1 80051f8: 59 63 00 30 sw (r11+48),r3 ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 80051fc: b9 60 08 00 mv r1,r11 8005200: b9 80 10 00 mv r2,r12 8005204: f8 00 13 ce calli 800a13c <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 8005208: b9 60 08 00 mv r1,r11 800520c: b9 80 10 00 mv r2,r12 8005210: 37 83 00 14 addi r3,sp,20 8005214: fb ff ff 28 calli 8004eb4 <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 8005218: d0 0d 00 00 wcsr IE,r13 800521c: e3 ff ff f0 bi 80051dc <_Thread_queue_Requeue+0x6c> 08005220 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 8005220: 37 9c ff f8 addi sp,sp,-8 8005224: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 8005228: 37 82 00 08 addi r2,sp,8 800522c: fb ff fd 4c calli 800475c <_Thread_Get> switch ( location ) { 8005230: 2b 82 00 08 lw r2,(sp+8) 8005234: 5c 40 00 07 bne r2,r0,8005250 <_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 ); 8005238: f8 00 14 14 calli 800a288 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800523c: 78 01 08 01 mvhi r1,0x801 8005240: 38 21 e8 a4 ori r1,r1,0xe8a4 8005244: 28 22 00 00 lw r2,(r1+0) 8005248: 34 42 ff ff addi r2,r2,-1 800524c: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8005250: 2b 9d 00 04 lw ra,(sp+4) 8005254: 37 9c 00 08 addi sp,sp,8 8005258: c3 a0 00 00 ret 08014998 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8014998: 37 9c ff a0 addi sp,sp,-96 801499c: 5b 8b 00 44 sw (sp+68),r11 80149a0: 5b 8c 00 40 sw (sp+64),r12 80149a4: 5b 8d 00 3c sw (sp+60),r13 80149a8: 5b 8e 00 38 sw (sp+56),r14 80149ac: 5b 8f 00 34 sw (sp+52),r15 80149b0: 5b 90 00 30 sw (sp+48),r16 80149b4: 5b 91 00 2c sw (sp+44),r17 80149b8: 5b 92 00 28 sw (sp+40),r18 80149bc: 5b 93 00 24 sw (sp+36),r19 80149c0: 5b 94 00 20 sw (sp+32),r20 80149c4: 5b 95 00 1c sw (sp+28),r21 80149c8: 5b 96 00 18 sw (sp+24),r22 80149cc: 5b 97 00 14 sw (sp+20),r23 80149d0: 5b 98 00 10 sw (sp+16),r24 80149d4: 5b 99 00 0c sw (sp+12),r25 80149d8: 5b 9b 00 08 sw (sp+8),fp 80149dc: 5b 9d 00 04 sw (sp+4),ra RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 80149e0: 34 17 00 00 mvi r23,0 80149e4: b8 20 58 00 mv r11,r1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 80149e8: 37 98 00 58 addi r24,sp,88 80149ec: 37 96 00 5c addi r22,sp,92 80149f0: 37 8f 00 4c addi r15,sp,76 80149f4: 37 95 00 50 addi r21,sp,80 80149f8: 78 14 08 04 mvhi r20,0x804 80149fc: 78 13 08 04 mvhi r19,0x804 8014a00: 78 19 08 04 mvhi r25,0x804 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014a04: 34 31 00 30 addi r17,r1,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 ); 8014a08: 34 30 00 68 addi r16,r1,104 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8014a0c: 34 21 00 08 addi r1,r1,8 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8014a10: 5b 96 00 58 sw (sp+88),r22 the_chain->permanent_null = NULL; 8014a14: 5b 97 00 5c sw (sp+92),r23 the_chain->last = _Chain_Head(the_chain); 8014a18: 5b 98 00 60 sw (sp+96),r24 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8014a1c: 5b 95 00 4c sw (sp+76),r21 the_chain->permanent_null = NULL; 8014a20: 5b 97 00 50 sw (sp+80),r23 the_chain->last = _Chain_Head(the_chain); 8014a24: 5b 8f 00 54 sw (sp+84),r15 8014a28: 3a 94 0d fc ori r20,r20,0xdfc 8014a2c: 3a 73 0d 3c ori r19,r19,0xd3c 8014a30: 3b 39 0c ac ori r25,r25,0xcac 8014a34: 5b 81 00 48 sw (sp+72),r1 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8014a38: 35 7b 00 40 addi fp,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 ); 8014a3c: 34 0c 00 01 mvi r12,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 ) { 8014a40: 34 0d 00 03 mvi r13,3 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 8014a44: 34 12 ff fe mvi r18,-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; 8014a48: 59 78 00 78 sw (r11+120),r24 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8014a4c: 2a 82 00 00 lw r2,(r20+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 8014a50: 29 63 00 3c lw r3,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014a54: ba 20 08 00 mv r1,r17 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 8014a58: 59 62 00 3c sw (r11+60),r2 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014a5c: c8 43 10 00 sub r2,r2,r3 8014a60: b9 e0 18 00 mv r3,r15 8014a64: f8 00 15 df calli 801a1e0 <_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; 8014a68: 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(); 8014a6c: 2a 6e 00 00 lw r14,(r19+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 ) { 8014a70: 50 4e 00 19 bgeu r2,r14,8014ad4 <_Timer_server_Body+0x13c> /* * 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 ); 8014a74: c9 c2 10 00 sub r2,r14,r2 8014a78: ba 00 08 00 mv r1,r16 8014a7c: b9 e0 18 00 mv r3,r15 8014a80: f8 00 15 d8 calli 801a1e0 <_Watchdog_Adjust_to_chain> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 8014a84: 59 6e 00 74 sw (r11+116),r14 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8014a88: 29 61 00 78 lw r1,(r11+120) 8014a8c: f8 00 03 34 calli 801575c <_Chain_Get> if ( timer == NULL ) { 8014a90: 44 20 00 0a be r1,r0,8014ab8 <_Timer_server_Body+0x120> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8014a94: 28 22 00 38 lw r2,(r1+56) 8014a98: 44 4c 00 15 be r2,r12,8014aec <_Timer_server_Body+0x154> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8014a9c: 5c 4d ff fb bne r2,r13,8014a88 <_Timer_server_Body+0xf0> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8014aa0: 34 22 00 10 addi r2,r1,16 8014aa4: ba 00 08 00 mv r1,r16 8014aa8: f8 00 15 f8 calli 801a288 <_Watchdog_Insert> } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8014aac: 29 61 00 78 lw r1,(r11+120) 8014ab0: f8 00 03 2b calli 801575c <_Chain_Get> if ( timer == NULL ) { 8014ab4: 5c 20 ff f8 bne r1,r0,8014a94 <_Timer_server_Body+0xfc> <== NEVER TAKEN * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 8014ab8: 90 00 10 00 rcsr r2,IE 8014abc: a0 52 18 00 and r3,r2,r18 8014ac0: d0 03 00 00 wcsr IE,r3 if ( _Chain_Is_empty( insert_chain ) ) { 8014ac4: 2b 83 00 58 lw r3,(sp+88) 8014ac8: 46 c3 00 0d be r22,r3,8014afc <_Timer_server_Body+0x164> <== ALWAYS TAKEN ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 8014acc: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED 8014ad0: e3 ff ff df bi 8014a4c <_Timer_server_Body+0xb4> <== NOT EXECUTED * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 8014ad4: 51 c2 ff ec bgeu r14,r2,8014a84 <_Timer_server_Body+0xec> /* * 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 ); 8014ad8: c8 4e 18 00 sub r3,r2,r14 8014adc: ba 00 08 00 mv r1,r16 8014ae0: 34 02 00 01 mvi r2,1 8014ae4: f8 00 15 81 calli 801a0e8 <_Watchdog_Adjust> 8014ae8: e3 ff ff e7 bi 8014a84 <_Timer_server_Body+0xec> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8014aec: 34 22 00 10 addi r2,r1,16 8014af0: ba 20 08 00 mv r1,r17 8014af4: f8 00 15 e5 calli 801a288 <_Watchdog_Insert> 8014af8: e3 ff ff e4 bi 8014a88 <_Timer_server_Body+0xf0> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 8014afc: 59 77 00 78 sw (r11+120),r23 _ISR_Enable( level ); 8014b00: 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 ) ) { 8014b04: 2b 82 00 4c lw r2,(sp+76) 8014b08: 5e a2 00 0b bne r21,r2,8014b34 <_Timer_server_Body+0x19c> 8014b0c: e0 00 00 11 bi 8014b50 <_Timer_server_Body+0x1b8> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 8014b10: 28 83 00 00 lw r3,(r4+0) * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 8014b14: 58 97 00 08 sw (r4+8),r23 the_chain->first = new_first; 8014b18: 5b 83 00 4c sw (sp+76),r3 new_first->previous = _Chain_Head(the_chain); 8014b1c: 58 6f 00 04 sw (r3+4),r15 _ISR_Enable( level ); 8014b20: 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 ); 8014b24: 28 82 00 24 lw r2,(r4+36) 8014b28: 28 83 00 1c lw r3,(r4+28) 8014b2c: 28 81 00 20 lw r1,(r4+32) 8014b30: d8 60 00 00 call r3 /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 8014b34: 90 00 10 00 rcsr r2,IE 8014b38: a0 52 18 00 and r3,r2,r18 8014b3c: 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)); 8014b40: 2b 84 00 4c lw r4,(sp+76) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 8014b44: 5e a4 ff f3 bne r21,r4,8014b10 <_Timer_server_Body+0x178> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 8014b48: d0 02 00 00 wcsr IE,r2 8014b4c: e3 ff ff bf bi 8014a48 <_Timer_server_Body+0xb0> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 8014b50: 34 01 00 00 mvi r1,0 8014b54: 31 61 00 7c sb (r11+124),r1 8014b58: 2b 21 00 00 lw r1,(r25+0) 8014b5c: 34 21 00 01 addi r1,r1,1 8014b60: 5b 21 00 00 sw (r25+0),r1 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 8014b64: 29 61 00 00 lw r1,(r11+0) 8014b68: 34 02 00 08 mvi r2,8 8014b6c: f8 00 12 38 calli 801944c <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 8014b70: b9 60 08 00 mv r1,r11 8014b74: fb ff ff 47 calli 8014890 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 8014b78: b9 60 08 00 mv r1,r11 8014b7c: fb ff ff 66 calli 8014914 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 8014b80: f8 00 0e bf calli 801867c <_Thread_Enable_dispatch> ts->active = true; 8014b84: 34 01 00 01 mvi r1,1 8014b88: 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 ); 8014b8c: 2b 81 00 48 lw r1,(sp+72) 8014b90: f8 00 16 25 calli 801a424 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8014b94: bb 60 08 00 mv r1,fp 8014b98: f8 00 16 23 calli 801a424 <_Watchdog_Remove> 8014b9c: e3 ff ff ab bi 8014a48 <_Timer_server_Body+0xb0> 08005a20 <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 8005a20: 37 9c ff e8 addi sp,sp,-24 8005a24: 5b 8b 00 18 sw (sp+24),r11 8005a28: 5b 8c 00 14 sw (sp+20),r12 8005a2c: 5b 8d 00 10 sw (sp+16),r13 8005a30: 5b 8e 00 0c sw (sp+12),r14 8005a34: 5b 8f 00 08 sw (sp+8),r15 8005a38: 5b 9d 00 04 sw (sp+4),ra Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 8005a3c: 78 0c 08 01 mvhi r12,0x801 8005a40: 39 8c ea 4c ori r12,r12,0xea4c 8005a44: 29 8b 00 08 lw r11,(r12+8) void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 8005a48: b8 20 78 00 mv r15,r1 8005a4c: b8 60 70 00 mv r14,r3 8005a50: 20 4d 00 ff andi r13,r2,0xff Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 8005a54: 45 6c 00 09 be r11,r12,8005a78 <_User_extensions_Fatal+0x58><== NEVER TAKEN !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) 8005a58: 29 64 00 30 lw r4,(r11+48) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 8005a5c: b9 e0 08 00 mv r1,r15 8005a60: b9 a0 10 00 mv r2,r13 8005a64: b9 c0 18 00 mv r3,r14 !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) 8005a68: 44 80 00 02 be r4,r0,8005a70 <_User_extensions_Fatal+0x50> (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 8005a6c: d8 80 00 00 call r4 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 8005a70: 29 6b 00 04 lw r11,(r11+4) ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 8005a74: 5d 6c ff f9 bne r11,r12,8005a58 <_User_extensions_Fatal+0x38> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); } } 8005a78: 2b 9d 00 04 lw ra,(sp+4) 8005a7c: 2b 8b 00 18 lw r11,(sp+24) 8005a80: 2b 8c 00 14 lw r12,(sp+20) 8005a84: 2b 8d 00 10 lw r13,(sp+16) 8005a88: 2b 8e 00 0c lw r14,(sp+12) 8005a8c: 2b 8f 00 08 lw r15,(sp+8) 8005a90: 37 9c 00 18 addi sp,sp,24 8005a94: c3 a0 00 00 ret 08005858 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 8005858: 37 9c ff e8 addi sp,sp,-24 800585c: 5b 8b 00 18 sw (sp+24),r11 8005860: 5b 8c 00 14 sw (sp+20),r12 8005864: 5b 8d 00 10 sw (sp+16),r13 8005868: 5b 8e 00 0c sw (sp+12),r14 800586c: 5b 8f 00 08 sw (sp+8),r15 8005870: 5b 9d 00 04 sw (sp+4),ra User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 8005874: 78 04 08 01 mvhi r4,0x801 8005878: 38 84 e0 c4 ori r4,r4,0xe0c4 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 800587c: 78 03 08 01 mvhi r3,0x801 8005880: 78 01 08 01 mvhi r1,0x801 8005884: 38 63 ea 4c ori r3,r3,0xea4c 8005888: 38 21 e8 a8 ori r1,r1,0xe8a8 initial_extensions = Configuration.User_extension_table; 800588c: 28 8c 00 3c lw r12,(r4+60) the_chain->permanent_null = NULL; 8005890: 34 0d 00 00 mvi r13,0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8005894: 34 65 00 04 addi r5,r3,4 8005898: 34 22 00 04 addi r2,r1,4 800589c: 58 65 00 00 sw (r3+0),r5 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 80058a0: 58 63 00 08 sw (r3+8),r3 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 80058a4: 58 22 00 00 sw (r1+0),r2 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 80058a8: 58 21 00 08 sw (r1+8),r1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 80058ac: 58 6d 00 04 sw (r3+4),r13 80058b0: 58 2d 00 04 sw (r1+4),r13 User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 80058b4: 28 8e 00 38 lw r14,(r4+56) initial_extensions = Configuration.User_extension_table; _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 80058b8: 45 8d 00 25 be r12,r13,800594c <_User_extensions_Handler_initialization+0xf4> extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) 80058bc: b5 ce 78 00 add r15,r14,r14 80058c0: b5 ee 78 00 add r15,r15,r14 80058c4: 34 02 00 04 mvi r2,4 80058c8: b9 e0 08 00 mv r1,r15 80058cc: fb ff ea 49 calli 80001f0 <__ashlsi3> 80058d0: b5 e1 78 00 add r15,r15,r1 80058d4: b5 ee 78 00 add r15,r15,r14 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 80058d8: b9 e0 08 00 mv r1,r15 80058dc: f8 00 01 b8 calli 8005fbc <_Workspace_Allocate_or_fatal_error> _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 80058e0: b9 a0 10 00 mv r2,r13 80058e4: b9 e0 18 00 mv r3,r15 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 80058e8: b8 20 58 00 mv r11,r1 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 80058ec: f8 00 21 9a calli 800df54 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 80058f0: 45 cd 00 17 be r14,r13,800594c <_User_extensions_Handler_initialization+0xf4><== NEVER TAKEN RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 80058f4: 29 81 00 00 lw r1,(r12+0) 80058f8: 35 ad 00 01 addi r13,r13,1 80058fc: 59 61 00 14 sw (r11+20),r1 8005900: 29 82 00 04 lw r2,(r12+4) _User_extensions_Add_set( extension ); 8005904: b9 60 08 00 mv r1,r11 RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 8005908: 59 62 00 18 sw (r11+24),r2 800590c: 29 82 00 08 lw r2,(r12+8) 8005910: 59 62 00 1c sw (r11+28),r2 8005914: 29 82 00 0c lw r2,(r12+12) 8005918: 59 62 00 20 sw (r11+32),r2 800591c: 29 82 00 10 lw r2,(r12+16) 8005920: 59 62 00 24 sw (r11+36),r2 8005924: 29 82 00 14 lw r2,(r12+20) 8005928: 59 62 00 28 sw (r11+40),r2 800592c: 29 82 00 18 lw r2,(r12+24) 8005930: 59 62 00 2c sw (r11+44),r2 8005934: 29 82 00 1c lw r2,(r12+28) 8005938: 35 8c 00 20 addi r12,r12,32 800593c: 59 62 00 30 sw (r11+48),r2 _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 8005940: 35 6b 00 34 addi r11,r11,52 _User_extensions_Add_set( extension ); 8005944: f8 00 13 1a calli 800a5ac <_User_extensions_Add_set> extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 8005948: 55 cd ff eb bgu r14,r13,80058f4 <_User_extensions_Handler_initialization+0x9c> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 800594c: 2b 9d 00 04 lw ra,(sp+4) 8005950: 2b 8b 00 18 lw r11,(sp+24) 8005954: 2b 8c 00 14 lw r12,(sp+20) 8005958: 2b 8d 00 10 lw r13,(sp+16) 800595c: 2b 8e 00 0c lw r14,(sp+12) 8005960: 2b 8f 00 08 lw r15,(sp+8) 8005964: 37 9c 00 18 addi sp,sp,24 8005968: c3 a0 00 00 ret 0800596c <_User_extensions_Thread_begin>: #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 800596c: 37 9c ff f0 addi sp,sp,-16 8005970: 5b 8b 00 10 sw (sp+16),r11 8005974: 5b 8c 00 0c sw (sp+12),r12 8005978: 5b 8d 00 08 sw (sp+8),r13 800597c: 5b 9d 00 04 sw (sp+4),ra Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 8005980: 78 0c 08 01 mvhi r12,0x801 8005984: 39 8c ea 4c ori r12,r12,0xea4c 8005988: 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; 800598c: 35 8c 00 04 addi r12,r12,4 #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 8005990: b8 20 68 00 mv r13,r1 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 8005994: 45 6c 00 07 be r11,r12,80059b0 <_User_extensions_Thread_begin+0x44><== NEVER TAKEN !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_begin != NULL ) 8005998: 29 62 00 28 lw r2,(r11+40) (*the_extension->Callouts.thread_begin)( executing ); 800599c: b9 a0 08 00 mv r1,r13 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_begin != NULL ) 80059a0: 44 40 00 02 be r2,r0,80059a8 <_User_extensions_Thread_begin+0x3c> (*the_extension->Callouts.thread_begin)( executing ); 80059a4: d8 40 00 00 call r2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 80059a8: 29 6b 00 00 lw r11,(r11+0) ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 80059ac: 5d 6c ff fb bne r11,r12,8005998 <_User_extensions_Thread_begin+0x2c> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_begin != NULL ) (*the_extension->Callouts.thread_begin)( executing ); } } 80059b0: 2b 9d 00 04 lw ra,(sp+4) 80059b4: 2b 8b 00 10 lw r11,(sp+16) 80059b8: 2b 8c 00 0c lw r12,(sp+12) 80059bc: 2b 8d 00 08 lw r13,(sp+8) 80059c0: 37 9c 00 10 addi sp,sp,16 80059c4: c3 a0 00 00 ret 08005a98 <_User_extensions_Thread_create>: #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 8005a98: 37 9c ff ec addi sp,sp,-20 8005a9c: 5b 8b 00 14 sw (sp+20),r11 8005aa0: 5b 8c 00 10 sw (sp+16),r12 8005aa4: 5b 8d 00 0c sw (sp+12),r13 8005aa8: 5b 8e 00 08 sw (sp+8),r14 8005aac: 5b 9d 00 04 sw (sp+4),ra Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 8005ab0: 78 0d 08 01 mvhi r13,0x801 8005ab4: 39 ad ea 4c ori r13,r13,0xea4c 8005ab8: 29 ab 00 00 lw r11,(r13+0) 8005abc: 35 ad 00 04 addi r13,r13,4 #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 8005ac0: b8 20 70 00 mv r14,r1 Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 8005ac4: 45 6d 00 0b be r11,r13,8005af0 <_User_extensions_Thread_create+0x58><== NEVER TAKEN the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_create != NULL ) { status = (*the_extension->Callouts.thread_create)( 8005ac8: 78 0c 08 01 mvhi r12,0x801 8005acc: 39 8c e9 60 ori r12,r12,0xe960 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_create != NULL ) { 8005ad0: 29 63 00 14 lw r3,(r11+20) status = (*the_extension->Callouts.thread_create)( 8005ad4: b9 c0 10 00 mv r2,r14 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_create != NULL ) { 8005ad8: 44 60 00 04 be r3,r0,8005ae8 <_User_extensions_Thread_create+0x50> status = (*the_extension->Callouts.thread_create)( 8005adc: 29 81 00 00 lw r1,(r12+0) 8005ae0: d8 60 00 00 call r3 _Thread_Executing, the_thread ); if ( !status ) 8005ae4: 44 20 00 04 be r1,r0,8005af4 <_User_extensions_Thread_create+0x5c> User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 8005ae8: 29 6b 00 00 lw r11,(r11+0) { Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 8005aec: 5d 6d ff f9 bne r11,r13,8005ad0 <_User_extensions_Thread_create+0x38> 8005af0: 34 01 00 01 mvi r1,1 return false; } } return true; } 8005af4: 2b 9d 00 04 lw ra,(sp+4) 8005af8: 2b 8b 00 14 lw r11,(sp+20) 8005afc: 2b 8c 00 10 lw r12,(sp+16) 8005b00: 2b 8d 00 0c lw r13,(sp+12) 8005b04: 2b 8e 00 08 lw r14,(sp+8) 8005b08: 37 9c 00 14 addi sp,sp,20 8005b0c: c3 a0 00 00 ret 08005b10 <_User_extensions_Thread_delete>: #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 8005b10: 37 9c ff ec addi sp,sp,-20 8005b14: 5b 8b 00 14 sw (sp+20),r11 8005b18: 5b 8c 00 10 sw (sp+16),r12 8005b1c: 5b 8d 00 0c sw (sp+12),r13 8005b20: 5b 8e 00 08 sw (sp+8),r14 8005b24: 5b 9d 00 04 sw (sp+4),ra Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 8005b28: 78 0d 08 01 mvhi r13,0x801 8005b2c: 39 ad ea 4c ori r13,r13,0xea4c 8005b30: 29 ab 00 08 lw r11,(r13+8) #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 8005b34: b8 20 70 00 mv r14,r1 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 8005b38: 45 6d 00 0a be r11,r13,8005b60 <_User_extensions_Thread_delete+0x50><== NEVER TAKEN the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_delete != NULL ) (*the_extension->Callouts.thread_delete)( 8005b3c: 78 0c 08 01 mvhi r12,0x801 8005b40: 39 8c e9 60 ori r12,r12,0xe960 !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_delete != NULL ) 8005b44: 29 63 00 20 lw r3,(r11+32) (*the_extension->Callouts.thread_delete)( 8005b48: b9 c0 10 00 mv r2,r14 !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_delete != NULL ) 8005b4c: 44 60 00 03 be r3,r0,8005b58 <_User_extensions_Thread_delete+0x48> (*the_extension->Callouts.thread_delete)( 8005b50: 29 81 00 00 lw r1,(r12+0) 8005b54: d8 60 00 00 call r3 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 8005b58: 29 6b 00 04 lw r11,(r11+4) ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 8005b5c: 5d 6d ff fa bne r11,r13,8005b44 <_User_extensions_Thread_delete+0x34> (*the_extension->Callouts.thread_delete)( _Thread_Executing, the_thread ); } } 8005b60: 2b 9d 00 04 lw ra,(sp+4) 8005b64: 2b 8b 00 14 lw r11,(sp+20) 8005b68: 2b 8c 00 10 lw r12,(sp+16) 8005b6c: 2b 8d 00 0c lw r13,(sp+12) 8005b70: 2b 8e 00 08 lw r14,(sp+8) 8005b74: 37 9c 00 14 addi sp,sp,20 8005b78: c3 a0 00 00 ret 080059c8 <_User_extensions_Thread_exitted>: void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 80059c8: 37 9c ff f0 addi sp,sp,-16 80059cc: 5b 8b 00 10 sw (sp+16),r11 80059d0: 5b 8c 00 0c sw (sp+12),r12 80059d4: 5b 8d 00 08 sw (sp+8),r13 80059d8: 5b 9d 00 04 sw (sp+4),ra Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 80059dc: 78 0c 08 01 mvhi r12,0x801 80059e0: 39 8c ea 4c ori r12,r12,0xea4c 80059e4: 29 8b 00 08 lw r11,(r12+8) } void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 80059e8: b8 20 68 00 mv r13,r1 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 80059ec: 45 6c 00 07 be r11,r12,8005a08 <_User_extensions_Thread_exitted+0x40><== NEVER TAKEN !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) 80059f0: 29 62 00 2c lw r2,(r11+44) (*the_extension->Callouts.thread_exitted)( executing ); 80059f4: b9 a0 08 00 mv r1,r13 !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) 80059f8: 44 40 00 02 be r2,r0,8005a00 <_User_extensions_Thread_exitted+0x38> (*the_extension->Callouts.thread_exitted)( executing ); 80059fc: d8 40 00 00 call r2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 8005a00: 29 6b 00 04 lw r11,(r11+4) ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 8005a04: 5d 6c ff fb bne r11,r12,80059f0 <_User_extensions_Thread_exitted+0x28> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) (*the_extension->Callouts.thread_exitted)( executing ); } } 8005a08: 2b 9d 00 04 lw ra,(sp+4) 8005a0c: 2b 8b 00 10 lw r11,(sp+16) 8005a10: 2b 8c 00 0c lw r12,(sp+12) 8005a14: 2b 8d 00 08 lw r13,(sp+8) 8005a18: 37 9c 00 10 addi sp,sp,16 8005a1c: c3 a0 00 00 ret 08006c70 <_User_extensions_Thread_restart>: #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 8006c70: 37 9c ff ec addi sp,sp,-20 8006c74: 5b 8b 00 14 sw (sp+20),r11 8006c78: 5b 8c 00 10 sw (sp+16),r12 8006c7c: 5b 8d 00 0c sw (sp+12),r13 8006c80: 5b 8e 00 08 sw (sp+8),r14 8006c84: 5b 9d 00 04 sw (sp+4),ra Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 8006c88: 78 0d 08 02 mvhi r13,0x802 8006c8c: 39 ad 3a a4 ori r13,r13,0x3aa4 8006c90: 29 ab 00 00 lw r11,(r13+0) 8006c94: 35 ad 00 04 addi r13,r13,4 #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 8006c98: b8 20 70 00 mv r14,r1 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 8006c9c: 45 6d 00 0a be r11,r13,8006cc4 <_User_extensions_Thread_restart+0x54><== NEVER TAKEN the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_restart != NULL ) (*the_extension->Callouts.thread_restart)( 8006ca0: 78 0c 08 02 mvhi r12,0x802 8006ca4: 39 8c 39 b8 ori r12,r12,0x39b8 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_restart != NULL ) 8006ca8: 29 63 00 1c lw r3,(r11+28) (*the_extension->Callouts.thread_restart)( 8006cac: b9 c0 10 00 mv r2,r14 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_restart != NULL ) 8006cb0: 44 60 00 03 be r3,r0,8006cbc <_User_extensions_Thread_restart+0x4c> (*the_extension->Callouts.thread_restart)( 8006cb4: 29 81 00 00 lw r1,(r12+0) 8006cb8: d8 60 00 00 call r3 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 8006cbc: 29 6b 00 00 lw r11,(r11+0) ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 8006cc0: 5d 6d ff fa bne r11,r13,8006ca8 <_User_extensions_Thread_restart+0x38> (*the_extension->Callouts.thread_restart)( _Thread_Executing, the_thread ); } } 8006cc4: 2b 9d 00 04 lw ra,(sp+4) 8006cc8: 2b 8b 00 14 lw r11,(sp+20) 8006ccc: 2b 8c 00 10 lw r12,(sp+16) 8006cd0: 2b 8d 00 0c lw r13,(sp+12) 8006cd4: 2b 8e 00 08 lw r14,(sp+8) 8006cd8: 37 9c 00 14 addi sp,sp,20 8006cdc: c3 a0 00 00 ret 08005b7c <_User_extensions_Thread_start>: #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 8005b7c: 37 9c ff ec addi sp,sp,-20 8005b80: 5b 8b 00 14 sw (sp+20),r11 8005b84: 5b 8c 00 10 sw (sp+16),r12 8005b88: 5b 8d 00 0c sw (sp+12),r13 8005b8c: 5b 8e 00 08 sw (sp+8),r14 8005b90: 5b 9d 00 04 sw (sp+4),ra Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 8005b94: 78 0d 08 01 mvhi r13,0x801 8005b98: 39 ad ea 4c ori r13,r13,0xea4c 8005b9c: 29 ab 00 00 lw r11,(r13+0) 8005ba0: 35 ad 00 04 addi r13,r13,4 #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 8005ba4: b8 20 70 00 mv r14,r1 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 8005ba8: 45 6d 00 0a be r11,r13,8005bd0 <_User_extensions_Thread_start+0x54><== NEVER TAKEN the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_start != NULL ) (*the_extension->Callouts.thread_start)( 8005bac: 78 0c 08 01 mvhi r12,0x801 8005bb0: 39 8c e9 60 ori r12,r12,0xe960 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_start != NULL ) 8005bb4: 29 63 00 18 lw r3,(r11+24) (*the_extension->Callouts.thread_start)( 8005bb8: b9 c0 10 00 mv r2,r14 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_start != NULL ) 8005bbc: 44 60 00 03 be r3,r0,8005bc8 <_User_extensions_Thread_start+0x4c> (*the_extension->Callouts.thread_start)( 8005bc0: 29 81 00 00 lw r1,(r12+0) 8005bc4: d8 60 00 00 call r3 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 8005bc8: 29 6b 00 00 lw r11,(r11+0) ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 8005bcc: 5d 6d ff fa bne r11,r13,8005bb4 <_User_extensions_Thread_start+0x38> (*the_extension->Callouts.thread_start)( _Thread_Executing, the_thread ); } } 8005bd0: 2b 9d 00 04 lw ra,(sp+4) 8005bd4: 2b 8b 00 14 lw r11,(sp+20) 8005bd8: 2b 8c 00 10 lw r12,(sp+16) 8005bdc: 2b 8d 00 0c lw r13,(sp+12) 8005be0: 2b 8e 00 08 lw r14,(sp+8) 8005be4: 37 9c 00 14 addi sp,sp,20 8005be8: c3 a0 00 00 ret 08005bec <_User_extensions_Thread_switch>: void _User_extensions_Thread_switch ( Thread_Control *executing, Thread_Control *heir ) { 8005bec: 37 9c ff ec addi sp,sp,-20 8005bf0: 5b 8b 00 14 sw (sp+20),r11 8005bf4: 5b 8c 00 10 sw (sp+16),r12 8005bf8: 5b 8d 00 0c sw (sp+12),r13 8005bfc: 5b 8e 00 08 sw (sp+8),r14 8005c00: 5b 9d 00 04 sw (sp+4),ra Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _User_extensions_Switches_list.first ; 8005c04: 78 0c 08 01 mvhi r12,0x801 8005c08: 39 8c e8 a8 ori r12,r12,0xe8a8 8005c0c: 29 8b 00 00 lw r11,(r12+0) 8005c10: 35 8c 00 04 addi r12,r12,4 void _User_extensions_Thread_switch ( Thread_Control *executing, Thread_Control *heir ) { 8005c14: b8 20 70 00 mv r14,r1 8005c18: b8 40 68 00 mv r13,r2 Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _User_extensions_Switches_list.first ; 8005c1c: 45 6c 00 07 be r11,r12,8005c38 <_User_extensions_Thread_switch+0x4c><== NEVER TAKEN !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; the_node = the_node->next ) { the_extension_switch = (User_extensions_Switch_control *) the_node; (*the_extension_switch->thread_switch)( executing, heir ); 8005c20: 29 63 00 08 lw r3,(r11+8) 8005c24: b9 c0 08 00 mv r1,r14 8005c28: b9 a0 10 00 mv r2,r13 8005c2c: d8 60 00 00 call r3 Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _User_extensions_Switches_list.first ; !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; the_node = the_node->next ) { 8005c30: 29 6b 00 00 lw r11,(r11+0) ) { Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _User_extensions_Switches_list.first ; 8005c34: 5d 6c ff fb bne r11,r12,8005c20 <_User_extensions_Thread_switch+0x34> the_extension_switch = (User_extensions_Switch_control *) the_node; (*the_extension_switch->thread_switch)( executing, heir ); } } 8005c38: 2b 9d 00 04 lw ra,(sp+4) 8005c3c: 2b 8b 00 14 lw r11,(sp+20) 8005c40: 2b 8c 00 10 lw r12,(sp+16) 8005c44: 2b 8d 00 0c lw r13,(sp+12) 8005c48: 2b 8e 00 08 lw r14,(sp+8) 8005c4c: 37 9c 00 14 addi sp,sp,20 8005c50: c3 a0 00 00 ret 08008048 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 8008048: 37 9c ff e4 addi sp,sp,-28 800804c: 5b 8b 00 1c sw (sp+28),r11 8008050: 5b 8c 00 18 sw (sp+24),r12 8008054: 5b 8d 00 14 sw (sp+20),r13 8008058: 5b 8e 00 10 sw (sp+16),r14 800805c: 5b 8f 00 0c sw (sp+12),r15 8008060: 5b 90 00 08 sw (sp+8),r16 8008064: 5b 9d 00 04 sw (sp+4),ra 8008068: b8 20 60 00 mv r12,r1 800806c: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 8008070: 90 00 20 00 rcsr r4,IE 8008074: 34 01 ff fe mvi r1,-2 8008078: a0 81 08 00 and r1,r4,r1 800807c: 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)); 8008080: 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; 8008084: 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 ) ) { 8008088: 44 2e 00 04 be r1,r14,8008098 <_Watchdog_Adjust+0x50> switch ( direction ) { 800808c: 44 40 00 11 be r2,r0,80080d0 <_Watchdog_Adjust+0x88> 8008090: 34 03 00 01 mvi r3,1 8008094: 44 43 00 0b be r2,r3,80080c0 <_Watchdog_Adjust+0x78> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 8008098: d0 04 00 00 wcsr IE,r4 } 800809c: 2b 9d 00 04 lw ra,(sp+4) 80080a0: 2b 8b 00 1c lw r11,(sp+28) 80080a4: 2b 8c 00 18 lw r12,(sp+24) 80080a8: 2b 8d 00 14 lw r13,(sp+20) 80080ac: 2b 8e 00 10 lw r14,(sp+16) 80080b0: 2b 8f 00 0c lw r15,(sp+12) 80080b4: 2b 90 00 08 lw r16,(sp+8) 80080b8: 37 9c 00 1c addi sp,sp,28 80080bc: c3 a0 00 00 ret * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 80080c0: 28 22 00 10 lw r2,(r1+16) 80080c4: b4 4b 58 00 add r11,r2,r11 80080c8: 58 2b 00 10 sw (r1+16),r11 break; 80080cc: e3 ff ff f3 bi 8008098 <_Watchdog_Adjust+0x50> case WATCHDOG_FORWARD: while ( units ) { 80080d0: 44 62 ff f2 be r3,r2,8008098 <_Watchdog_Adjust+0x50> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 80080d4: 28 2d 00 10 lw r13,(r1+16) _Watchdog_First( header )->delta_interval -= units; break; 80080d8: b8 80 18 00 mv r3,r4 } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 80080dc: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 80080e0: 34 0f ff fe mvi r15,-2 case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 80080e4: 51 6d 00 02 bgeu r11,r13,80080ec <_Watchdog_Adjust+0xa4> <== ALWAYS TAKEN 80080e8: e0 00 00 11 bi 800812c <_Watchdog_Adjust+0xe4> <== NOT EXECUTED _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 80080ec: 58 30 00 10 sw (r1+16),r16 _ISR_Enable( level ); 80080f0: d0 03 00 00 wcsr IE,r3 _Watchdog_Tickle( header ); 80080f4: b9 80 08 00 mv r1,r12 80080f8: f8 00 00 b0 calli 80083b8 <_Watchdog_Tickle> _ISR_Disable( level ); 80080fc: 90 00 10 00 rcsr r2,IE 8008100: a0 4f 08 00 and r1,r2,r15 8008104: 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)); 8008108: 29 84 00 00 lw r4,(r12+0) while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 800810c: c9 6d 58 00 sub r11,r11,r13 case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 8008110: b8 40 18 00 mv r3,r2 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 8008114: b8 80 08 00 mv r1,r4 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 8008118: 45 c4 00 08 be r14,r4,8008138 <_Watchdog_Adjust+0xf0> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 800811c: 45 60 00 07 be r11,r0,8008138 <_Watchdog_Adjust+0xf0> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 8008120: 28 2d 00 10 lw r13,(r1+16) 8008124: 51 6d ff f2 bgeu r11,r13,80080ec <_Watchdog_Adjust+0xa4> 8008128: b8 60 20 00 mv r4,r3 _Watchdog_First( header )->delta_interval -= units; 800812c: c9 ab 58 00 sub r11,r13,r11 8008130: 58 2b 00 10 sw (r1+16),r11 break; 8008134: e3 ff ff d9 bi 8008098 <_Watchdog_Adjust+0x50> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 8008138: b8 40 20 00 mv r4,r2 800813c: e3 ff ff d7 bi 8008098 <_Watchdog_Adjust+0x50> 08005c54 <_Watchdog_Insert>: void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 8005c54: 37 9c ff f8 addi sp,sp,-8 8005c58: 5b 8b 00 08 sw (sp+8),r11 8005c5c: 5b 8c 00 04 sw (sp+4),r12 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 8005c60: 78 03 08 01 mvhi r3,0x801 8005c64: 38 63 e9 3c ori r3,r3,0xe93c 8005c68: 28 69 00 00 lw r9,(r3+0) _ISR_Disable( level ); 8005c6c: 90 00 30 00 rcsr r6,IE 8005c70: 34 08 ff fe mvi r8,-2 8005c74: a0 c8 40 00 and r8,r6,r8 8005c78: d0 08 00 00 wcsr IE,r8 /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_watchdog->state != WATCHDOG_INACTIVE ) { 8005c7c: 28 43 00 08 lw r3,(r2+8) 8005c80: 5c 60 00 3e bne r3,r0,8005d78 <_Watchdog_Insert+0x124> _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 8005c84: 78 0c 08 01 mvhi r12,0x801 8005c88: 39 8c e9 f0 ori r12,r12,0xe9f0 8005c8c: 29 83 00 00 lw r3,(r12+0) if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 8005c90: 34 0a 00 01 mvi r10,1 8005c94: 78 07 08 01 mvhi r7,0x801 _Watchdog_Sync_count++; 8005c98: b4 6a 18 00 add r3,r3,r10 8005c9c: 59 83 00 00 sw (r12+0),r3 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 8005ca0: 58 4a 00 08 sw (r2+8),r10 8005ca4: 38 e7 e9 5c ori r7,r7,0xe95c _Watchdog_Sync_count++; restart: delta_interval = the_watchdog->initial; 8005ca8: 28 44 00 0c lw r4,(r2+12) * cache *header!! * * Till Straumann, 7/2003 (gcc-3.2.2 -O4 on powerpc) * */ for ( after = (Watchdog_Control *) ((volatile Chain_Control *)header)->first ; 8005cac: 28 23 00 00 lw r3,(r1+0) ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 8005cb0: 44 80 00 14 be r4,r0,8005d00 <_Watchdog_Insert+0xac> 8005cb4: 28 65 00 00 lw r5,(r3+0) 8005cb8: 44 a0 00 12 be r5,r0,8005d00 <_Watchdog_Insert+0xac> break; if ( delta_interval < after->delta_interval ) { 8005cbc: 28 65 00 10 lw r5,(r3+16) 8005cc0: 54 a4 00 0e bgu r5,r4,8005cf8 <_Watchdog_Insert+0xa4> * used around this flash point allowed interrupts to execute * which violated the design assumptions. The critical section * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); 8005cc4: d0 06 00 00 wcsr IE,r6 8005cc8: d0 08 00 00 wcsr IE,r8 if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8005ccc: 28 4b 00 08 lw r11,(r2+8) 8005cd0: 5d 6a 00 19 bne r11,r10,8005d34 <_Watchdog_Insert+0xe0> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 8005cd4: 28 eb 00 00 lw r11,(r7+0) 8005cd8: 55 69 00 2d bgu r11,r9,8005d8c <_Watchdog_Insert+0x138> if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 8005cdc: c8 85 20 00 sub r4,r4,r5 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 8005ce0: 28 63 00 00 lw r3,(r3+0) */ for ( after = (Watchdog_Control *) ((volatile Chain_Control *)header)->first ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 8005ce4: 44 80 00 07 be r4,r0,8005d00 <_Watchdog_Insert+0xac> 8005ce8: 28 65 00 00 lw r5,(r3+0) 8005cec: 44 a0 00 05 be r5,r0,8005d00 <_Watchdog_Insert+0xac> break; if ( delta_interval < after->delta_interval ) { 8005cf0: 28 65 00 10 lw r5,(r3+16) 8005cf4: 50 85 00 19 bgeu r4,r5,8005d58 <_Watchdog_Insert+0x104> after->delta_interval -= delta_interval; 8005cf8: c8 a4 28 00 sub r5,r5,r4 8005cfc: 58 65 00 10 sw (r3+16),r5 _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); 8005d00: 28 63 00 04 lw r3,(r3+4) the_watchdog->start_time = _Watchdog_Ticks_since_boot; 8005d04: 78 01 08 01 mvhi r1,0x801 8005d08: 38 21 e9 f4 ori r1,r1,0xe9f4 } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 8005d0c: 58 44 00 10 sw (r2+16),r4 _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; 8005d10: 28 24 00 00 lw r4,(r1+0) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8005d14: 28 61 00 00 lw r1,(r3+0) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8005d18: 58 43 00 04 sw (r2+4),r3 before_node = after_node->next; after_node->next = the_node; 8005d1c: 58 62 00 00 sw (r3+0),r2 RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 8005d20: 34 03 00 02 mvi r3,2 8005d24: 58 44 00 14 sw (r2+20),r4 8005d28: 58 43 00 08 sw (r2+8),r3 the_node->next = before_node; before_node->previous = the_node; 8005d2c: 58 22 00 04 sw (r1+4),r2 Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 8005d30: 58 41 00 00 sw (r2+0),r1 exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 8005d34: 58 e9 00 00 sw (r7+0),r9 _Watchdog_Sync_count--; 8005d38: 29 81 00 00 lw r1,(r12+0) 8005d3c: 34 21 ff ff addi r1,r1,-1 8005d40: 59 81 00 00 sw (r12+0),r1 _ISR_Enable( level ); 8005d44: d0 06 00 00 wcsr IE,r6 } 8005d48: 2b 8b 00 08 lw r11,(sp+8) 8005d4c: 2b 8c 00 04 lw r12,(sp+4) 8005d50: 37 9c 00 08 addi sp,sp,8 8005d54: c3 a0 00 00 ret * used around this flash point allowed interrupts to execute * which violated the design assumptions. The critical section * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); 8005d58: d0 06 00 00 wcsr IE,r6 8005d5c: d0 08 00 00 wcsr IE,r8 if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8005d60: 28 4b 00 08 lw r11,(r2+8) if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 8005d64: c8 85 20 00 sub r4,r4,r5 * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8005d68: 5d 6a ff f3 bne r11,r10,8005d34 <_Watchdog_Insert+0xe0> <== NEVER TAKEN goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 8005d6c: 28 e5 00 00 lw r5,(r7+0) 8005d70: 54 a9 00 07 bgu r5,r9,8005d8c <_Watchdog_Insert+0x138> <== NEVER TAKEN 8005d74: e3 ff ff db bi 8005ce0 <_Watchdog_Insert+0x8c> * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); 8005d78: d0 06 00 00 wcsr IE,r6 exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; _Watchdog_Sync_count--; _ISR_Enable( level ); } 8005d7c: 2b 8b 00 08 lw r11,(sp+8) 8005d80: 2b 8c 00 04 lw r12,(sp+4) 8005d84: 37 9c 00 08 addi sp,sp,8 8005d88: c3 a0 00 00 ret if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { _Watchdog_Sync_level = insert_isr_nest_level; 8005d8c: 58 e9 00 00 sw (r7+0),r9 goto restart; 8005d90: e3 ff ff c6 bi 8005ca8 <_Watchdog_Insert+0x54> 08005df0 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 8005df0: 90 00 20 00 rcsr r4,IE 8005df4: 34 02 ff fe mvi r2,-2 8005df8: a0 82 10 00 and r2,r4,r2 8005dfc: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 8005e00: 28 22 00 08 lw r2,(r1+8) switch ( previous_state ) { 8005e04: 34 03 00 01 mvi r3,1 8005e08: 44 43 00 28 be r2,r3,8005ea8 <_Watchdog_Remove+0xb8> 8005e0c: 5c 40 00 08 bne r2,r0,8005e2c <_Watchdog_Remove+0x3c> _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8005e10: 78 03 08 01 mvhi r3,0x801 8005e14: 38 63 e9 f4 ori r3,r3,0xe9f4 8005e18: 28 63 00 00 lw r3,(r3+0) 8005e1c: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8005e20: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8005e24: b8 40 08 00 mv r1,r2 8005e28: c3 a0 00 00 ret Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { 8005e2c: 34 03 00 03 mvi r3,3 8005e30: 54 43 ff f8 bgu r2,r3,8005e10 <_Watchdog_Remove+0x20> <== NEVER TAKEN RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 8005e34: 28 23 00 00 lw r3,(r1+0) break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 8005e38: 34 05 00 00 mvi r5,0 8005e3c: 58 25 00 08 sw (r1+8),r5 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 8005e40: 28 65 00 00 lw r5,(r3+0) 8005e44: 44 a0 00 05 be r5,r0,8005e58 <_Watchdog_Remove+0x68> next_watchdog->delta_interval += the_watchdog->delta_interval; 8005e48: 28 66 00 10 lw r6,(r3+16) 8005e4c: 28 25 00 10 lw r5,(r1+16) 8005e50: b4 c5 28 00 add r5,r6,r5 8005e54: 58 65 00 10 sw (r3+16),r5 if ( _Watchdog_Sync_count ) 8005e58: 78 05 08 01 mvhi r5,0x801 8005e5c: 38 a5 e9 f0 ori r5,r5,0xe9f0 8005e60: 28 a5 00 00 lw r5,(r5+0) 8005e64: 44 a0 00 07 be r5,r0,8005e80 <_Watchdog_Remove+0x90> _Watchdog_Sync_level = _ISR_Nest_level; 8005e68: 78 05 08 01 mvhi r5,0x801 8005e6c: 38 a5 e9 3c ori r5,r5,0xe93c 8005e70: 28 a6 00 00 lw r6,(r5+0) 8005e74: 78 05 08 01 mvhi r5,0x801 8005e78: 38 a5 e9 5c ori r5,r5,0xe95c 8005e7c: 58 a6 00 00 sw (r5+0),r6 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 8005e80: 28 25 00 04 lw r5,(r1+4) next->previous = previous; previous->next = next; 8005e84: 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; 8005e88: 58 65 00 04 sw (r3+4),r5 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8005e8c: 78 03 08 01 mvhi r3,0x801 8005e90: 38 63 e9 f4 ori r3,r3,0xe9f4 8005e94: 28 63 00 00 lw r3,(r3+0) 8005e98: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8005e9c: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8005ea0: b8 40 08 00 mv r1,r2 8005ea4: c3 a0 00 00 ret /* * 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; 8005ea8: 34 03 00 00 mvi r3,0 8005eac: 58 23 00 08 sw (r1+8),r3 _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8005eb0: 78 03 08 01 mvhi r3,0x801 8005eb4: 38 63 e9 f4 ori r3,r3,0xe9f4 8005eb8: 28 63 00 00 lw r3,(r3+0) 8005ebc: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8005ec0: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8005ec4: b8 40 08 00 mv r1,r2 8005ec8: c3 a0 00 00 ret 08007d9c <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 8007d9c: 37 9c ff ec addi sp,sp,-20 8007da0: 5b 8b 00 14 sw (sp+20),r11 8007da4: 5b 8c 00 10 sw (sp+16),r12 8007da8: 5b 8d 00 0c sw (sp+12),r13 8007dac: 5b 8e 00 08 sw (sp+8),r14 8007db0: 5b 9d 00 04 sw (sp+4),ra 8007db4: b8 20 70 00 mv r14,r1 8007db8: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 8007dbc: 90 00 68 00 rcsr r13,IE 8007dc0: 34 01 ff fe mvi r1,-2 8007dc4: a1 a1 08 00 and r1,r13,r1 8007dc8: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 8007dcc: 78 01 08 02 mvhi r1,0x802 8007dd0: b9 80 18 00 mv r3,r12 8007dd4: 38 21 1d c8 ori r1,r1,0x1dc8 8007dd8: b9 c0 10 00 mv r2,r14 8007ddc: fb ff eb 9d calli 8002c50 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8007de0: 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; 8007de4: 35 8c 00 04 addi r12,r12,4 if ( !_Chain_Is_empty( header ) ) { 8007de8: 45 6c 00 12 be r11,r12,8007e30 <_Watchdog_Report_chain+0x94> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 8007dec: b9 60 10 00 mv r2,r11 8007df0: 34 01 00 00 mvi r1,0 8007df4: f8 00 00 13 calli 8007e40 <_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 ) 8007df8: 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 ; 8007dfc: 5d 6c ff fc bne r11,r12,8007dec <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 8007e00: 78 01 08 02 mvhi r1,0x802 8007e04: 38 21 1d e0 ori r1,r1,0x1de0 8007e08: b9 c0 10 00 mv r2,r14 8007e0c: fb ff eb 91 calli 8002c50 } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); 8007e10: d0 0d 00 00 wcsr IE,r13 } 8007e14: 2b 9d 00 04 lw ra,(sp+4) 8007e18: 2b 8b 00 14 lw r11,(sp+20) 8007e1c: 2b 8c 00 10 lw r12,(sp+16) 8007e20: 2b 8d 00 0c lw r13,(sp+12) 8007e24: 2b 8e 00 08 lw r14,(sp+8) 8007e28: 37 9c 00 14 addi sp,sp,20 8007e2c: c3 a0 00 00 ret _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 8007e30: 78 01 08 02 mvhi r1,0x802 8007e34: 38 21 1d f0 ori r1,r1,0x1df0 8007e38: fb ff eb 86 calli 8002c50 8007e3c: e3 ff ff f5 bi 8007e10 <_Watchdog_Report_chain+0x74> 08005ecc <_Watchdog_Tickle>: */ void _Watchdog_Tickle( Chain_Control *header ) { 8005ecc: 37 9c ff e4 addi sp,sp,-28 8005ed0: 5b 8b 00 1c sw (sp+28),r11 8005ed4: 5b 8c 00 18 sw (sp+24),r12 8005ed8: 5b 8d 00 14 sw (sp+20),r13 8005edc: 5b 8e 00 10 sw (sp+16),r14 8005ee0: 5b 8f 00 0c sw (sp+12),r15 8005ee4: 5b 90 00 08 sw (sp+8),r16 8005ee8: 5b 9d 00 04 sw (sp+4),ra 8005eec: 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 ); 8005ef0: 90 00 68 00 rcsr r13,IE 8005ef4: 34 01 ff fe mvi r1,-2 8005ef8: a1 a1 08 00 and r1,r13,r1 8005efc: 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)); 8005f00: 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; 8005f04: 35 8e 00 04 addi r14,r12,4 if ( _Chain_Is_empty( header ) ) 8005f08: 45 6e 00 2b be r11,r14,8005fb4 <_Watchdog_Tickle+0xe8> * 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) { 8005f0c: 29 61 00 10 lw r1,(r11+16) 8005f10: 5c 20 00 26 bne r1,r0,8005fa8 <_Watchdog_Tickle+0xdc> do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 8005f14: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8005f18: 34 0f ff fe mvi r15,-2 8005f1c: e0 00 00 0a bi 8005f44 <_Watchdog_Tickle+0x78> 8005f20: 90 00 10 00 rcsr r2,IE <== NOT EXECUTED 8005f24: a0 4f 08 00 and r1,r2,r15 <== NOT EXECUTED 8005f28: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 8005f2c: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED 8005f30: b8 40 68 00 mv r13,r2 <== NOT EXECUTED 8005f34: b8 20 58 00 mv r11,r1 <== NOT EXECUTED the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 8005f38: 45 c1 00 12 be r14,r1,8005f80 <_Watchdog_Tickle+0xb4> <== NOT EXECUTED 8005f3c: 28 21 00 10 lw r1,(r1+16) 8005f40: 5c 20 00 10 bne r1,r0,8005f80 <_Watchdog_Tickle+0xb4> if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 8005f44: b9 60 08 00 mv r1,r11 8005f48: fb ff ff aa calli 8005df0 <_Watchdog_Remove> _ISR_Enable( level ); 8005f4c: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 8005f50: 5c 30 ff f4 bne r1,r16,8005f20 <_Watchdog_Tickle+0x54> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 8005f54: 29 62 00 24 lw r2,(r11+36) 8005f58: 29 63 00 1c lw r3,(r11+28) 8005f5c: 29 61 00 20 lw r1,(r11+32) 8005f60: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8005f64: 90 00 10 00 rcsr r2,IE 8005f68: a0 4f 08 00 and r1,r2,r15 8005f6c: d0 01 00 00 wcsr IE,r1 8005f70: 29 81 00 00 lw r1,(r12+0) 8005f74: b8 40 68 00 mv r13,r2 8005f78: b8 20 58 00 mv r11,r1 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 8005f7c: 5d c1 ff f0 bne r14,r1,8005f3c <_Watchdog_Tickle+0x70> leave: _ISR_Enable(level); 8005f80: d0 02 00 00 wcsr IE,r2 } 8005f84: 2b 9d 00 04 lw ra,(sp+4) 8005f88: 2b 8b 00 1c lw r11,(sp+28) 8005f8c: 2b 8c 00 18 lw r12,(sp+24) 8005f90: 2b 8d 00 14 lw r13,(sp+20) 8005f94: 2b 8e 00 10 lw r14,(sp+16) 8005f98: 2b 8f 00 0c lw r15,(sp+12) 8005f9c: 2b 90 00 08 lw r16,(sp+8) 8005fa0: 37 9c 00 1c addi sp,sp,28 8005fa4: c3 a0 00 00 ret * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { the_watchdog->delta_interval--; 8005fa8: 34 21 ff ff addi r1,r1,-1 8005fac: 59 61 00 10 sw (r11+16),r1 if ( the_watchdog->delta_interval != 0 ) 8005fb0: 44 20 ff d9 be r1,r0,8005f14 <_Watchdog_Tickle+0x48> _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 8005fb4: b9 a0 10 00 mv r2,r13 8005fb8: e3 ff ff f2 bi 8005f80 <_Watchdog_Tickle+0xb4> 08005fbc <_Workspace_Allocate_or_fatal_error>: * _Workspace_Allocate_or_fatal_error */ void *_Workspace_Allocate_or_fatal_error( size_t size ) { 8005fbc: 37 9c ff fc addi sp,sp,-4 8005fc0: 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 ); 8005fc4: 34 03 00 00 mvi r3,0 8005fc8: b8 20 10 00 mv r2,r1 8005fcc: 78 01 08 01 mvhi r1,0x801 8005fd0: 38 21 e8 c8 ori r1,r1,0xe8c8 8005fd4: b8 60 20 00 mv r4,r3 8005fd8: f8 00 0d dc calli 8009748 <_Heap_Allocate_aligned_with_boundary> __builtin_return_address( 1 ), memory ); #endif if ( memory == NULL ) 8005fdc: 44 20 00 04 be r1,r0,8005fec <_Workspace_Allocate_or_fatal_error+0x30><== NEVER TAKEN true, INTERNAL_ERROR_WORKSPACE_ALLOCATION ); return memory; } 8005fe0: 2b 9d 00 04 lw ra,(sp+4) 8005fe4: 37 9c 00 04 addi sp,sp,4 8005fe8: c3 a0 00 00 ret memory ); #endif if ( memory == NULL ) _Internal_error_Occurred( 8005fec: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8005ff0: 34 03 00 04 mvi r3,4 <== NOT EXECUTED 8005ff4: fb ff f5 d8 calli 8003754 <_Internal_error_Occurred> <== NOT EXECUTED 080029b4 : int adjtime( struct timeval *delta, struct timeval *olddelta ) { 80029b4: 37 9c ff e4 addi sp,sp,-28 80029b8: 5b 8b 00 14 sw (sp+20),r11 80029bc: 5b 8c 00 10 sw (sp+16),r12 80029c0: 5b 8d 00 0c sw (sp+12),r13 80029c4: 5b 8e 00 08 sw (sp+8),r14 80029c8: 5b 9d 00 04 sw (sp+4),ra 80029cc: b8 40 60 00 mv r12,r2 long adjustment; /* * Simple validations */ if ( !delta ) 80029d0: 34 02 00 00 mvi r2,0 int adjtime( struct timeval *delta, struct timeval *olddelta ) { 80029d4: b8 20 58 00 mv r11,r1 long adjustment; /* * Simple validations */ if ( !delta ) 80029d8: 44 22 00 05 be r1,r2,80029ec rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 80029dc: 28 2d 00 04 lw r13,(r1+4) 80029e0: 78 01 00 0f mvhi r1,0xf 80029e4: 38 21 42 3f ori r1,r1,0x423f 80029e8: 50 2d 00 06 bgeu r1,r13,8002a00 rtems_set_errno_and_return_minus_one( EINVAL ); 80029ec: f8 00 2e 28 calli 800e28c <__errno> 80029f0: 34 02 00 16 mvi r2,22 80029f4: 58 22 00 00 sw (r1+0),r2 80029f8: 34 01 ff ff mvi r1,-1 80029fc: e0 00 00 47 bi 8002b18 if ( olddelta ) { 8002a00: 45 80 00 04 be r12,r0,8002a10 olddelta->tv_sec = 0; olddelta->tv_usec = 0; 8002a04: 59 82 00 04 sw (r12+4),r2 8002a08: 29 6d 00 04 lw r13,(r11+4) if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { olddelta->tv_sec = 0; 8002a0c: 59 82 00 00 sw (r12+0),r2 olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 8002a10: 29 61 00 00 lw r1,(r11+0) 8002a14: 78 02 00 0f mvhi r2,0xf 8002a18: 38 42 42 40 ori r2,r2,0x4240 8002a1c: f8 00 67 e9 calli 801c9c0 <__mulsi3> adjustment += delta->tv_usec; /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 8002a20: 78 02 08 02 mvhi r2,0x802 8002a24: 38 42 00 c4 ori r2,r2,0xc4 8002a28: 28 42 00 0c lw r2,(r2+12) 8002a2c: b5 a1 08 00 add r1,r13,r1 8002a30: 54 41 00 39 bgu r2,r1,8002b14 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8002a34: 78 01 08 02 mvhi r1,0x802 8002a38: 38 21 09 9c ori r1,r1,0x99c 8002a3c: 28 22 00 00 lw r2,(r1+0) 8002a40: 34 42 00 01 addi r2,r2,1 8002a44: 58 22 00 00 sw (r1+0),r2 * This prevents context switches while we are adjusting the TOD */ _Thread_Disable_dispatch(); _TOD_Get( &ts ); 8002a48: 37 8d 00 18 addi r13,sp,24 8002a4c: b9 a0 08 00 mv r1,r13 8002a50: f8 00 03 f9 calli 8003a34 <_TOD_Get> ts.tv_sec += delta->tv_sec; 8002a54: 29 62 00 00 lw r2,(r11+0) 8002a58: 2b 8e 00 18 lw r14,(sp+24) ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 8002a5c: 29 61 00 04 lw r1,(r11+4) _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 8002a60: b5 c2 70 00 add r14,r14,r2 ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 8002a64: 34 02 03 e8 mvi r2,1000 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 8002a68: 5b 8e 00 18 sw (sp+24),r14 ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 8002a6c: f8 00 67 d5 calli 801c9c0 <__mulsi3> 8002a70: 2b 83 00 1c lw r3,(sp+28) /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8002a74: 78 06 3b 9a mvhi r6,0x3b9a 8002a78: 38 c6 c9 ff ori r6,r6,0xc9ff _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 8002a7c: b4 23 18 00 add r3,r1,r3 8002a80: 5b 83 00 1c sw (sp+28),r3 8002a84: 78 02 c4 65 mvhi r2,0xc465 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8002a88: 50 c3 00 09 bgeu r6,r3,8002aac ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 8002a8c: b8 40 28 00 mv r5,r2 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8002a90: b9 c0 20 00 mv r4,r14 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 8002a94: 38 a5 36 00 ori r5,r5,0x3600 8002a98: b4 65 18 00 add r3,r3,r5 * At one point there was a static variable named adjustment * used by this implementation. I don't see any reason for it * to be here based upon the GNU/Linux documentation. */ int adjtime( 8002a9c: 34 84 00 01 addi r4,r4,1 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8002aa0: 54 66 ff fe bgu r3,r6,8002a98 <== NEVER TAKEN 8002aa4: 5b 84 00 18 sw (sp+24),r4 8002aa8: 5b 83 00 1c sw (sp+28),r3 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 8002aac: 38 42 36 00 ori r2,r2,0x3600 8002ab0: 54 62 00 09 bgu r3,r2,8002ad4 <== NEVER TAKEN 8002ab4: 2b 84 00 18 lw r4,(sp+24) 8002ab8: 78 05 3b 9a mvhi r5,0x3b9a ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; 8002abc: 38 a5 ca 00 ori r5,r5,0xca00 8002ac0: b4 65 18 00 add r3,r3,r5 * At one point there was a static variable named adjustment * used by this implementation. I don't see any reason for it * to be here based upon the GNU/Linux documentation. */ int adjtime( 8002ac4: 34 84 ff ff addi r4,r4,-1 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 8002ac8: 50 43 ff fe bgeu r2,r3,8002ac0 8002acc: 5b 83 00 1c sw (sp+28),r3 8002ad0: 5b 84 00 18 sw (sp+24),r4 ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 8002ad4: b9 a0 08 00 mv r1,r13 8002ad8: f8 00 04 0c calli 8003b08 <_TOD_Set> _Thread_Enable_dispatch(); 8002adc: f8 00 08 59 calli 8004c40 <_Thread_Enable_dispatch> /* set the user's output */ if ( olddelta ) 8002ae0: 45 80 00 0d be r12,r0,8002b14 <== NEVER TAKEN *olddelta = *delta; 8002ae4: 29 61 00 00 lw r1,(r11+0) 8002ae8: 59 81 00 00 sw (r12+0),r1 8002aec: 29 6b 00 04 lw r11,(r11+4) 8002af0: 34 01 00 00 mvi r1,0 8002af4: 59 8b 00 04 sw (r12+4),r11 return 0; } 8002af8: 2b 9d 00 04 lw ra,(sp+4) 8002afc: 2b 8b 00 14 lw r11,(sp+20) 8002b00: 2b 8c 00 10 lw r12,(sp+16) 8002b04: 2b 8d 00 0c lw r13,(sp+12) 8002b08: 2b 8e 00 08 lw r14,(sp+8) 8002b0c: 37 9c 00 1c addi sp,sp,28 8002b10: c3 a0 00 00 ret _Thread_Enable_dispatch(); /* set the user's output */ if ( olddelta ) *olddelta = *delta; 8002b14: 34 01 00 00 mvi r1,0 return 0; } 8002b18: 2b 9d 00 04 lw ra,(sp+4) 8002b1c: 2b 8b 00 14 lw r11,(sp+20) 8002b20: 2b 8c 00 10 lw r12,(sp+16) 8002b24: 2b 8d 00 0c lw r13,(sp+12) 8002b28: 2b 8e 00 08 lw r14,(sp+8) 8002b2c: 37 9c 00 1c addi sp,sp,28 8002b30: c3 a0 00 00 ret 0800289c : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 800289c: 37 9c ff fc addi sp,sp,-4 80028a0: 5b 9d 00 04 sw (sp+4),ra if ( !tp ) 80028a4: 44 40 00 09 be r2,r0,80028c8 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 80028a8: 34 03 00 01 mvi r3,1 80028ac: 44 23 00 1b be r1,r3,8002918 _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 80028b0: 34 03 00 04 mvi r3,4 80028b4: 44 23 00 13 be r1,r3,8002900 <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 80028b8: 34 03 00 02 mvi r3,2 80028bc: 44 23 00 11 be r1,r3,8002900 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 80028c0: 34 02 00 03 mvi r2,3 80028c4: 44 22 00 08 be r1,r2,80028e4 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif rtems_set_errno_and_return_minus_one( EINVAL ); 80028c8: f8 00 2f 31 calli 800e58c <__errno> 80028cc: 34 02 00 16 mvi r2,22 80028d0: 58 22 00 00 sw (r1+0),r2 80028d4: 34 01 ff ff mvi r1,-1 return 0; } 80028d8: 2b 9d 00 04 lw ra,(sp+4) 80028dc: 37 9c 00 04 addi sp,sp,4 80028e0: c3 a0 00 00 ret } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); 80028e4: f8 00 2f 2a calli 800e58c <__errno> 80028e8: 34 02 00 58 mvi r2,88 80028ec: 58 22 00 00 sw (r1+0),r2 80028f0: 34 01 ff ff mvi r1,-1 #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 80028f4: 2b 9d 00 04 lw ra,(sp+4) 80028f8: 37 9c 00 04 addi sp,sp,4 80028fc: c3 a0 00 00 ret } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { _TOD_Get_uptime_as_timespec( tp ); 8002900: b8 40 08 00 mv r1,r2 8002904: f8 00 06 ba calli 80043ec <_TOD_Get_uptime_as_timespec> 8002908: 34 01 00 00 mvi r1,0 #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 800290c: 2b 9d 00 04 lw ra,(sp+4) 8002910: 37 9c 00 04 addi sp,sp,4 8002914: c3 a0 00 00 ret { if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); 8002918: b8 40 08 00 mv r1,r2 800291c: f8 00 06 8e calli 8004354 <_TOD_Get> 8002920: 34 01 00 00 mvi r1,0 return 0; 8002924: e3 ff ff ed bi 80028d8 0802bbf4 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 802bbf4: 37 9c ff fc addi sp,sp,-4 802bbf8: 5b 9d 00 04 sw (sp+4),ra if ( !tp ) 802bbfc: 44 40 00 07 be r2,r0,802bc18 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 802bc00: 34 03 00 01 mvi r3,1 802bc04: 44 23 00 0c be r1,r3,802bc34 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 802bc08: 34 02 00 02 mvi r2,2 802bc0c: 44 22 00 1b be r1,r2,802bc78 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 802bc10: 34 02 00 03 mvi r2,3 802bc14: 44 22 00 19 be r1,r2,802bc78 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 802bc18: f8 00 73 bd calli 8048b0c <__errno> 802bc1c: 34 02 00 16 mvi r2,22 802bc20: 58 22 00 00 sw (r1+0),r2 802bc24: 34 01 ff ff mvi r1,-1 return 0; } 802bc28: 2b 9d 00 04 lw ra,(sp+4) 802bc2c: 37 9c 00 04 addi sp,sp,4 802bc30: c3 a0 00 00 ret { if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 802bc34: 28 43 00 00 lw r3,(r2+0) 802bc38: 78 01 21 da mvhi r1,0x21da 802bc3c: 38 21 e4 ff ori r1,r1,0xe4ff 802bc40: 54 61 00 02 bgu r3,r1,802bc48 802bc44: e3 ff ff f5 bi 802bc18 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 802bc48: 78 01 08 07 mvhi r1,0x807 802bc4c: 38 21 60 9c ori r1,r1,0x609c 802bc50: 28 23 00 00 lw r3,(r1+0) 802bc54: 34 63 00 01 addi r3,r3,1 802bc58: 58 23 00 00 sw (r1+0),r3 rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); 802bc5c: b8 40 08 00 mv r1,r2 802bc60: f8 00 09 b3 calli 802e32c <_TOD_Set> _Thread_Enable_dispatch(); 802bc64: fb ff 7f 59 calli 800b9c8 <_Thread_Enable_dispatch> 802bc68: 34 01 00 00 mvi r1,0 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 802bc6c: 2b 9d 00 04 lw ra,(sp+4) 802bc70: 37 9c 00 04 addi sp,sp,4 802bc74: c3 a0 00 00 ret else if ( clock_id == CLOCK_PROCESS_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); 802bc78: f8 00 73 a5 calli 8048b0c <__errno> 802bc7c: 34 02 00 58 mvi r2,88 802bc80: 58 22 00 00 sw (r1+0),r2 802bc84: 34 01 ff ff mvi r1,-1 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 802bc88: 2b 9d 00 04 lw ra,(sp+4) 802bc8c: 37 9c 00 04 addi sp,sp,4 802bc90: c3 a0 00 00 ret 0800cb30 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 800cb30: 37 9c ff d8 addi sp,sp,-40 800cb34: 5b 8b 00 1c sw (sp+28),r11 800cb38: 5b 8c 00 18 sw (sp+24),r12 800cb3c: 5b 8d 00 14 sw (sp+20),r13 800cb40: 5b 8e 00 10 sw (sp+16),r14 800cb44: 5b 8f 00 0c sw (sp+12),r15 800cb48: 5b 90 00 08 sw (sp+8),r16 800cb4c: 5b 9d 00 04 sw (sp+4),ra 800cb50: b8 20 58 00 mv r11,r1 800cb54: b8 40 60 00 mv r12,r2 800cb58: b8 60 78 00 mv r15,r3 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 800cb5c: fb ff fa d3 calli 800b6a8 800cb60: 5c 2b 00 a9 bne r1,r11,800ce04 rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) 800cb64: 45 80 00 04 be r12,r0,800cb74 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 800cb68: 35 8b ff ff addi r11,r12,-1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 800cb6c: 34 01 00 1f mvi r1,31 800cb70: 50 2b 00 06 bgeu r1,r11,800cb88 rtems_set_errno_and_return_minus_one( EINVAL ); 800cb74: f8 00 01 f4 calli 800d344 <__errno> 800cb78: 34 02 00 16 mvi r2,22 800cb7c: 58 22 00 00 sw (r1+0),r2 800cb80: 34 01 ff ff mvi r1,-1 800cb84: e0 00 00 50 bi 800ccc4 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 800cb88: b5 8c 80 00 add r16,r12,r12 800cb8c: 34 02 00 02 mvi r2,2 800cb90: 78 0d 08 01 mvhi r13,0x801 800cb94: b6 0c 08 00 add r1,r16,r12 800cb98: fb ff cd 96 calli 80001f0 <__ashlsi3> 800cb9c: 39 ad ed b0 ori r13,r13,0xedb0 800cba0: b5 a1 08 00 add r1,r13,r1 800cba4: 28 22 00 08 lw r2,(r1+8) 800cba8: 34 0e 00 01 mvi r14,1 800cbac: 34 01 00 00 mvi r1,0 800cbb0: 44 4e 00 45 be r2,r14,800ccc4 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) 800cbb4: 65 82 00 04 cmpei r2,r12,4 800cbb8: 65 81 00 08 cmpei r1,r12,8 800cbbc: b8 41 08 00 or r1,r2,r1 800cbc0: 5c 20 00 4a bne r1,r0,800cce8 800cbc4: 34 01 00 0b mvi r1,11 800cbc8: 45 81 00 48 be r12,r1,800cce8 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 800cbcc: b9 60 10 00 mv r2,r11 800cbd0: b9 c0 08 00 mv r1,r14 800cbd4: fb ff cd 87 calli 80001f0 <__ashlsi3> /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 800cbd8: 5b 8e 00 24 sw (sp+36),r14 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 800cbdc: 5b 8c 00 20 sw (sp+32),r12 800cbe0: b8 20 58 00 mv r11,r1 siginfo->si_code = SI_USER; if ( !value ) { 800cbe4: 45 e0 00 02 be r15,r0,800cbec siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 800cbe8: 29 ef 00 00 lw r15,(r15+0) 800cbec: 78 02 08 01 mvhi r2,0x801 800cbf0: 5b 8f 00 28 sw (sp+40),r15 800cbf4: 38 42 e8 a4 ori r2,r2,0xe8a4 800cbf8: 28 41 00 00 lw r1,(r2+0) 800cbfc: 34 21 00 01 addi r1,r1,1 800cc00: 58 41 00 00 sw (r2+0),r1 /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 800cc04: 78 02 08 01 mvhi r2,0x801 800cc08: 38 42 e9 60 ori r2,r2,0xe960 800cc0c: 28 41 00 00 lw r1,(r2+0) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800cc10: 28 22 01 2c lw r2,(r1+300) 800cc14: 28 42 00 cc lw r2,(r2+204) 800cc18: a4 40 10 00 not r2,r2 800cc1c: a1 62 10 00 and r2,r11,r2 800cc20: 5c 40 00 17 bne r2,r0,800cc7c /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 800cc24: 78 05 08 01 mvhi r5,0x801 800cc28: 38 a5 ef 3c ori r5,r5,0xef3c 800cc2c: 28 a3 00 00 lw r3,(r5+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800cc30: 34 a5 00 04 addi r5,r5,4 800cc34: 44 65 00 42 be r3,r5,800cd3c #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 800cc38: 28 62 00 30 lw r2,(r3+48) for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 800cc3c: b8 60 08 00 mv r1,r3 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800cc40: 28 64 01 2c lw r4,(r3+300) #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 800cc44: a1 62 10 00 and r2,r11,r2 800cc48: 44 40 00 09 be r2,r0,800cc6c 800cc4c: e0 00 00 0c bi 800cc7c the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 800cc50: 28 63 00 00 lw r3,(r3+0) /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 800cc54: 44 65 00 3a be r3,r5,800cd3c <== ALWAYS TAKEN #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 800cc58: 28 62 00 30 lw r2,(r3+48) <== NOT EXECUTED for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800cc5c: 28 64 01 2c lw r4,(r3+300) <== NOT EXECUTED for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 800cc60: b8 60 08 00 mv r1,r3 <== NOT EXECUTED #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 800cc64: a1 62 10 00 and r2,r11,r2 <== NOT EXECUTED 800cc68: 5c 40 00 05 bne r2,r0,800cc7c <== NOT EXECUTED /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 800cc6c: 28 84 00 cc lw r4,(r4+204) 800cc70: a4 80 20 00 not r4,r4 800cc74: a1 64 20 00 and r4,r11,r4 800cc78: 44 82 ff f6 be r4,r2,800cc50 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 800cc7c: 34 02 00 01 mvi r2,1 800cc80: 30 22 00 74 sb (r1+116),r2 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 800cc84: 37 83 00 20 addi r3,sp,32 800cc88: b9 80 10 00 mv r2,r12 800cc8c: f8 00 00 b1 calli 800cf50 <_POSIX_signals_Unblock_thread> 800cc90: 5c 20 00 0b bne r1,r0,800ccbc /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 800cc94: b9 60 08 00 mv r1,r11 800cc98: f8 00 00 9d calli 800cf0c <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 800cc9c: 34 02 00 02 mvi r2,2 800cca0: b6 0c 08 00 add r1,r16,r12 800cca4: fb ff cd 53 calli 80001f0 <__ashlsi3> 800cca8: b5 a1 68 00 add r13,r13,r1 800ccac: 29 a2 00 00 lw r2,(r13+0) 800ccb0: b8 20 58 00 mv r11,r1 800ccb4: 34 01 00 02 mvi r1,2 800ccb8: 44 41 00 10 be r2,r1,800ccf8 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 800ccbc: fb ff de 9b calli 8004728 <_Thread_Enable_dispatch> 800ccc0: 34 01 00 00 mvi r1,0 return 0; } 800ccc4: 2b 9d 00 04 lw ra,(sp+4) 800ccc8: 2b 8b 00 1c lw r11,(sp+28) 800cccc: 2b 8c 00 18 lw r12,(sp+24) 800ccd0: 2b 8d 00 14 lw r13,(sp+20) 800ccd4: 2b 8e 00 10 lw r14,(sp+16) 800ccd8: 2b 8f 00 0c lw r15,(sp+12) 800ccdc: 2b 90 00 08 lw r16,(sp+8) 800cce0: 37 9c 00 28 addi sp,sp,40 800cce4: c3 a0 00 00 ret * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) return pthread_kill( pthread_self(), sig ); 800cce8: f8 00 01 4e calli 800d220 800ccec: b9 80 10 00 mv r2,r12 800ccf0: f8 00 00 fd calli 800d0e4 800ccf4: e3 ff ff f4 bi 800ccc4 */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 800ccf8: 78 01 08 01 mvhi r1,0x801 800ccfc: 38 21 ef 30 ori r1,r1,0xef30 800cd00: fb ff f1 a3 calli 800938c <_Chain_Get> 800cd04: b8 20 18 00 mv r3,r1 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 800cd08: 44 20 00 44 be r1,r0,800ce18 _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 800cd0c: 2b 81 00 20 lw r1,(sp+32) 800cd10: 58 61 00 08 sw (r3+8),r1 800cd14: 2b 82 00 24 lw r2,(sp+36) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 800cd18: 78 01 08 01 mvhi r1,0x801 800cd1c: 38 21 ef a8 ori r1,r1,0xefa8 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 800cd20: 58 62 00 0c sw (r3+12),r2 800cd24: 2b 84 00 28 lw r4,(sp+40) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 800cd28: b5 61 08 00 add r1,r11,r1 800cd2c: b8 60 10 00 mv r2,r3 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 800cd30: 58 64 00 10 sw (r3+16),r4 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 800cd34: fb ff d8 2e calli 8002dec <_Chain_Append> 800cd38: e3 ff ff e1 bi 800ccbc * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 800cd3c: 78 01 08 01 mvhi r1,0x801 800cd40: 38 21 e0 c0 ori r1,r1,0xe0c0 800cd44: 40 26 00 00 lbu r6,(r1+0) 800cd48: 78 07 08 01 mvhi r7,0x801 800cd4c: 38 e7 e8 44 ori r7,r7,0xe844 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 800cd50: 78 0a 10 00 mvhi r10,0x1000 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 800cd54: 34 c6 00 01 addi r6,r6,1 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 800cd58: 39 4a 00 00 ori r10,r10,0x0 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 800cd5c: 34 ee 00 0c addi r14,r7,12 800cd60: 34 01 00 00 mvi r1,0 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and ITRON is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 800cd64: 28 e2 00 00 lw r2,(r7+0) 800cd68: 44 40 00 1d be r2,r0,800cddc continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 800cd6c: 28 42 00 04 lw r2,(r2+4) */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 800cd70: 2c 48 00 10 lhu r8,(r2+16) object_table = the_info->local_table; 800cd74: 28 44 00 1c lw r4,(r2+28) for ( index = 1 ; index <= maximum ; index++ ) { 800cd78: 45 00 00 19 be r8,r0,800cddc 800cd7c: 34 03 00 01 mvi r3,1 the_thread = (Thread_Control *) object_table[ index ]; 800cd80: 28 82 00 04 lw r2,(r4+4) #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 800cd84: 34 63 00 01 addi r3,r3,1 800cd88: 34 84 00 04 addi r4,r4,4 the_thread = (Thread_Control *) object_table[ index ]; if ( !the_thread ) 800cd8c: 44 40 00 13 be r2,r0,800cdd8 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 800cd90: 28 45 00 14 lw r5,(r2+20) 800cd94: 54 a6 00 11 bgu r5,r6,800cdd8 DEBUG_STEP("2"); /* * If this thread is not interested, then go on to the next thread. */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800cd98: 28 49 01 2c lw r9,(r2+300) 800cd9c: 29 29 00 cc lw r9,(r9+204) 800cda0: a5 20 48 00 not r9,r9 800cda4: a1 69 48 00 and r9,r11,r9 800cda8: 45 20 00 0c be r9,r0,800cdd8 * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { 800cdac: 54 c5 00 09 bgu r6,r5,800cdd0 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 800cdb0: 28 29 00 10 lw r9,(r1+16) 800cdb4: 45 20 00 09 be r9,r0,800cdd8 <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 800cdb8: 28 4f 00 10 lw r15,(r2+16) continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 800cdbc: a1 2a 48 00 and r9,r9,r10 */ if ( !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 800cdc0: 45 e0 00 04 be r15,r0,800cdd0 DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 800cdc4: a1 ea 78 00 and r15,r15,r10 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 800cdc8: 5d 20 00 04 bne r9,r0,800cdd8 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 800cdcc: 45 e9 00 03 be r15,r9,800cdd8 800cdd0: b8 a0 30 00 mv r6,r5 800cdd4: b8 40 08 00 mv r1,r2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 800cdd8: 51 03 ff ea bgeu r8,r3,800cd80 800cddc: 34 e7 00 04 addi r7,r7,4 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 800cde0: 5c ee ff e1 bne r7,r14,800cd64 } } } } if ( interested ) { 800cde4: 44 20 ff ac be r1,r0,800cc94 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 800cde8: 34 02 00 01 mvi r2,1 800cdec: 30 22 00 74 sb (r1+116),r2 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 800cdf0: 37 83 00 20 addi r3,sp,32 800cdf4: b9 80 10 00 mv r2,r12 800cdf8: f8 00 00 56 calli 800cf50 <_POSIX_signals_Unblock_thread> 800cdfc: 44 20 ff a6 be r1,r0,800cc94 <== ALWAYS TAKEN 800ce00: e3 ff ff af bi 800ccbc <== NOT EXECUTED /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); 800ce04: f8 00 01 50 calli 800d344 <__errno> 800ce08: 34 02 00 03 mvi r2,3 800ce0c: 58 22 00 00 sw (r1+0),r2 800ce10: 34 01 ff ff mvi r1,-1 800ce14: e3 ff ff ac bi 800ccc4 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { _Thread_Enable_dispatch(); 800ce18: fb ff de 44 calli 8004728 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 800ce1c: f8 00 01 4a calli 800d344 <__errno> 800ce20: 34 02 00 0b mvi r2,11 800ce24: 58 22 00 00 sw (r1+0),r2 800ce28: 34 01 ff ff mvi r1,-1 800ce2c: e3 ff ff a6 bi 800ccc4 080089d8 : int oflag, ... /* mode_t mode, */ /* struct mq_attr attr */ ) { 80089d8: 37 9c ff bc addi sp,sp,-68 80089dc: 5b 8b 00 1c sw (sp+28),r11 80089e0: 5b 8c 00 18 sw (sp+24),r12 80089e4: 5b 8d 00 14 sw (sp+20),r13 80089e8: 5b 8e 00 10 sw (sp+16),r14 80089ec: 5b 8f 00 0c sw (sp+12),r15 80089f0: 5b 90 00 08 sw (sp+8),r16 80089f4: 5b 9d 00 04 sw (sp+4),ra rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80089f8: 78 09 08 02 mvhi r9,0x802 80089fc: 39 29 9d b4 ori r9,r9,0x9db4 8008a00: 29 2a 00 00 lw r10,(r9+0) 8008a04: 5b 83 00 30 sw (sp+48),r3 8008a08: 5b 84 00 34 sw (sp+52),r4 8008a0c: 35 43 00 01 addi r3,r10,1 8008a10: 59 23 00 00 sw (r9+0),r3 8008a14: 5b 85 00 38 sw (sp+56),r5 8008a18: 5b 86 00 3c sw (sp+60),r6 8008a1c: 5b 87 00 40 sw (sp+64),r7 8008a20: 5b 88 00 44 sw (sp+68),r8 8008a24: b8 20 78 00 mv r15,r1 8008a28: 5b 82 00 2c sw (sp+44),r2 8008a2c: b8 40 68 00 mv r13,r2 POSIX_Message_queue_Control_fd *the_mq_fd; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 8008a30: 20 4c 02 00 andi r12,r2,0x200 8008a34: b9 80 80 00 mv r16,r12 8008a38: 5d 80 00 3a bne r12,r0,8008b20 */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) 8008a3c: 78 01 08 02 mvhi r1,0x802 8008a40: 38 21 a2 40 ori r1,r1,0xa240 8008a44: f8 00 0b 7b calli 800b830 <_Objects_Allocate> 8008a48: b8 20 58 00 mv r11,r1 attr = (struct mq_attr *) va_arg( arg, struct mq_attr * ); va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 8008a4c: 44 20 00 3b be r1,r0,8008b38 <== NEVER TAKEN _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENFILE ); } the_mq_fd->oflag = oflag; 8008a50: 58 2d 00 14 sw (r1+20),r13 status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); 8008a54: 37 82 00 28 addi r2,sp,40 8008a58: b9 e0 08 00 mv r1,r15 8008a5c: f8 00 1f 20 calli 80106dc <_POSIX_Message_queue_Name_to_id> 8008a60: b8 20 70 00 mv r14,r1 * If the name to id translation worked, then the message queue exists * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "message queue does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 8008a64: 5c 20 00 24 bne r1,r0,8008af4 } else { /* name -> ID translation succeeded */ /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 8008a68: 21 ad 0a 00 andi r13,r13,0xa00 8008a6c: 34 01 0a 00 mvi r1,2560 8008a70: 45 a1 00 38 be r13,r1,8008b50 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (POSIX_Message_queue_Control *) 8008a74: 2b 82 00 28 lw r2,(sp+40) 8008a78: 78 01 08 02 mvhi r1,0x802 8008a7c: 37 83 00 20 addi r3,sp,32 8008a80: 38 21 a0 b4 ori r1,r1,0xa0b4 8008a84: f8 00 0c ef calli 800be40 <_Objects_Get> /* * In this case we need to do an ID->pointer conversion to * check the mode. */ the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); the_mq->open_count += 1; 8008a88: 28 23 00 18 lw r3,(r1+24) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8008a8c: 78 02 08 02 mvhi r2,0x802 8008a90: 38 42 a2 40 ori r2,r2,0xa240 8008a94: 34 63 00 01 addi r3,r3,1 8008a98: 58 23 00 18 sw (r1+24),r3 8008a9c: 29 63 00 08 lw r3,(r11+8) 8008aa0: 28 4c 00 1c lw r12,(r2+28) /* * In this case we need to do an ID->pointer conversion to * check the mode. */ the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); 8008aa4: 5b 81 00 24 sw (sp+36),r1 8008aa8: 34 02 00 02 mvi r2,2 the_mq->open_count += 1; the_mq_fd->Queue = the_mq; 8008aac: 59 61 00 10 sw (r11+16),r1 8008ab0: 20 61 ff ff andi r1,r3,0xffff 8008ab4: fb ff f6 e0 calli 8006634 <__ashlsi3> 8008ab8: b5 81 08 00 add r1,r12,r1 8008abc: 58 2b 00 00 sw (r1+0),r11 the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 8008ac0: 59 6e 00 0c sw (r11+12),r14 _Objects_Open_string( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 8008ac4: f8 00 0f 97 calli 800c920 <_Thread_Enable_dispatch> _Thread_Enable_dispatch(); 8008ac8: f8 00 0f 96 calli 800c920 <_Thread_Enable_dispatch> return (mqd_t)the_mq_fd->Object.id; 8008acc: 29 61 00 08 lw r1,(r11+8) ); _Thread_Enable_dispatch(); return (mqd_t) the_mq_fd->Object.id; } 8008ad0: 2b 9d 00 04 lw ra,(sp+4) 8008ad4: 2b 8b 00 1c lw r11,(sp+28) 8008ad8: 2b 8c 00 18 lw r12,(sp+24) 8008adc: 2b 8d 00 14 lw r13,(sp+20) 8008ae0: 2b 8e 00 10 lw r14,(sp+16) 8008ae4: 2b 8f 00 0c lw r15,(sp+12) 8008ae8: 2b 90 00 08 lw r16,(sp+8) 8008aec: 37 9c 00 44 addi sp,sp,68 8008af0: c3 a0 00 00 ret if ( status ) { /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 8008af4: 34 01 00 02 mvi r1,2 8008af8: 45 c1 00 20 be r14,r1,8008b78 RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd ( POSIX_Message_queue_Control_fd *the_mq_fd ) { _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); 8008afc: 78 01 08 02 mvhi r1,0x802 8008b00: 38 21 a2 40 ori r1,r1,0xa240 8008b04: b9 60 10 00 mv r2,r11 8008b08: f8 00 0c 6f calli 800bcc4 <_Objects_Free> _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 8008b0c: f8 00 0f 85 calli 800c920 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, mqd_t ); 8008b10: f8 00 32 b6 calli 80155e8 <__errno> 8008b14: 58 2e 00 00 sw (r1+0),r14 8008b18: 34 01 ff ff mvi r1,-1 8008b1c: e3 ff ff ed bi 8008ad0 */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) 8008b20: 78 01 08 02 mvhi r1,0x802 8008b24: 38 21 a2 40 ori r1,r1,0xa240 _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); attr = (struct mq_attr *) va_arg( arg, struct mq_attr * ); 8008b28: 2b 90 00 34 lw r16,(sp+52) 8008b2c: f8 00 0b 41 calli 800b830 <_Objects_Allocate> 8008b30: b8 20 58 00 mv r11,r1 va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 8008b34: 5c 20 ff c7 bne r1,r0,8008a50 _Thread_Enable_dispatch(); 8008b38: f8 00 0f 7a calli 800c920 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENFILE ); 8008b3c: f8 00 32 ab calli 80155e8 <__errno> 8008b40: 34 02 00 17 mvi r2,23 8008b44: 58 22 00 00 sw (r1+0),r2 8008b48: 34 01 ff ff mvi r1,-1 8008b4c: e3 ff ff e1 bi 8008ad0 RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd ( POSIX_Message_queue_Control_fd *the_mq_fd ) { _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); 8008b50: 78 01 08 02 mvhi r1,0x802 8008b54: b9 60 10 00 mv r2,r11 8008b58: 38 21 a2 40 ori r1,r1,0xa240 8008b5c: f8 00 0c 5a calli 800bcc4 <_Objects_Free> /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 8008b60: f8 00 0f 70 calli 800c920 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, mqd_t ); 8008b64: f8 00 32 a1 calli 80155e8 <__errno> 8008b68: 34 02 00 11 mvi r2,17 8008b6c: 58 22 00 00 sw (r1+0),r2 8008b70: 34 01 ff ff mvi r1,-1 8008b74: e3 ff ff d7 bi 8008ad0 if ( status ) { /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 8008b78: 45 80 ff e1 be r12,r0,8008afc /* * At this point, the message queue does not exist and everything has been * checked. We should go ahead and create a message queue. */ status = _POSIX_Message_queue_Create_support( 8008b7c: b9 e0 08 00 mv r1,r15 8008b80: ba 00 18 00 mv r3,r16 8008b84: 34 02 00 01 mvi r2,1 8008b88: 37 84 00 24 addi r4,sp,36 8008b8c: f8 00 1e 62 calli 8010514 <_POSIX_Message_queue_Create_support> 8008b90: b8 20 60 00 mv r12,r1 ); /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { 8008b94: 34 01 ff ff mvi r1,-1 8008b98: 45 81 00 11 be r12,r1,8008bdc _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); return (mqd_t) -1; } the_mq_fd->Queue = the_mq; 8008b9c: 2b 83 00 24 lw r3,(sp+36) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8008ba0: 29 61 00 08 lw r1,(r11+8) 8008ba4: 78 02 08 02 mvhi r2,0x802 8008ba8: 38 42 a2 40 ori r2,r2,0xa240 8008bac: 28 4c 00 1c lw r12,(r2+28) 8008bb0: 59 63 00 10 sw (r11+16),r3 8008bb4: b9 c0 10 00 mv r2,r14 8008bb8: 20 21 ff ff andi r1,r1,0xffff 8008bbc: fb ff f6 9e calli 8006634 <__ashlsi3> 8008bc0: b5 81 08 00 add r1,r12,r1 8008bc4: 58 2b 00 00 sw (r1+0),r11 the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 8008bc8: 34 01 00 00 mvi r1,0 8008bcc: 59 61 00 0c sw (r11+12),r1 &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 8008bd0: f8 00 0f 54 calli 800c920 <_Thread_Enable_dispatch> return (mqd_t) the_mq_fd->Object.id; 8008bd4: 29 61 00 08 lw r1,(r11+8) 8008bd8: e3 ff ff be bi 8008ad0 8008bdc: 78 01 08 02 mvhi r1,0x802 8008be0: 38 21 a2 40 ori r1,r1,0xa240 8008be4: b9 60 10 00 mv r2,r11 8008be8: f8 00 0c 37 calli 800bcc4 <_Objects_Free> /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 8008bec: f8 00 0f 4d calli 800c920 <_Thread_Enable_dispatch> 8008bf0: b9 80 08 00 mv r1,r12 return (mqd_t) -1; 8008bf4: e3 ff ff b7 bi 8008ad0 0802c47c : int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ) { 802c47c: 37 9c ff ec addi sp,sp,-20 802c480: 5b 8b 00 14 sw (sp+20),r11 802c484: 5b 8c 00 10 sw (sp+16),r12 802c488: 5b 8d 00 0c sw (sp+12),r13 802c48c: 5b 8e 00 08 sw (sp+8),r14 802c490: 5b 9d 00 04 sw (sp+4),ra Watchdog_Interval ticks; if ( !_Timespec_Is_valid( rqtp ) ) 802c494: 34 0e 00 00 mvi r14,0 int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ) { 802c498: b8 40 68 00 mv r13,r2 802c49c: b8 20 58 00 mv r11,r1 Watchdog_Interval ticks; if ( !_Timespec_Is_valid( rqtp ) ) 802c4a0: f8 00 00 6b calli 802c64c <_Timespec_Is_valid> 802c4a4: 44 2e 00 05 be r1,r14,802c4b8 * Return EINVAL if the delay interval is negative. * * NOTE: This behavior is beyond the POSIX specification. * FSU and GNU/Linux pthreads shares this behavior. */ if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 ) 802c4a8: 29 61 00 00 lw r1,(r11+0) 802c4ac: 48 01 00 03 bg r0,r1,802c4b8 <== NEVER TAKEN 802c4b0: 29 61 00 04 lw r1,(r11+4) 802c4b4: 4c 20 00 06 bge r1,r0,802c4cc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 802c4b8: fb ff b3 e2 calli 8019440 <__errno> 802c4bc: 34 02 00 16 mvi r2,22 802c4c0: 58 22 00 00 sw (r1+0),r2 802c4c4: 34 01 ff ff mvi r1,-1 802c4c8: e0 00 00 10 bi 802c508 ticks = _Timespec_To_ticks( rqtp ); 802c4cc: b9 60 08 00 mv r1,r11 802c4d0: fb ff a3 c0 calli 80153d0 <_Timespec_To_ticks> 802c4d4: b8 20 58 00 mv r11,r1 * A nanosleep for zero time is implemented as a yield. * This behavior is also beyond the POSIX specification but is * consistent with the RTEMS API and yields desirable behavior. */ if ( !ticks ) { 802c4d8: 5c 20 00 13 bne r1,r0,802c524 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 802c4dc: 78 01 08 03 mvhi r1,0x803 802c4e0: 38 21 31 bc ori r1,r1,0x31bc 802c4e4: 28 22 00 00 lw r2,(r1+0) 802c4e8: 34 42 00 01 addi r2,r2,1 802c4ec: 58 22 00 00 sw (r1+0),r2 _Thread_Disable_dispatch(); _Thread_Yield_processor(); 802c4f0: fb ff 83 0b calli 800d11c <_Thread_Yield_processor> _Thread_Enable_dispatch(); 802c4f4: fb ff 7e c5 calli 800c008 <_Thread_Enable_dispatch> if ( rmtp ) { 802c4f8: 45 ab 00 2e be r13,r11,802c5b0 rmtp->tv_sec = 0; rmtp->tv_nsec = 0; 802c4fc: 59 ab 00 04 sw (r13+4),r11 if ( !ticks ) { _Thread_Disable_dispatch(); _Thread_Yield_processor(); _Thread_Enable_dispatch(); if ( rmtp ) { rmtp->tv_sec = 0; 802c500: 59 ab 00 00 sw (r13+0),r11 rmtp->tv_nsec = 0; 802c504: b9 60 08 00 mv r1,r11 rtems_set_errno_and_return_minus_one( EINTR ); #endif } return 0; } 802c508: 2b 9d 00 04 lw ra,(sp+4) 802c50c: 2b 8b 00 14 lw r11,(sp+20) 802c510: 2b 8c 00 10 lw r12,(sp+16) 802c514: 2b 8d 00 0c lw r13,(sp+12) 802c518: 2b 8e 00 08 lw r14,(sp+8) 802c51c: 37 9c 00 14 addi sp,sp,20 802c520: c3 a0 00 00 ret 802c524: 78 01 08 03 mvhi r1,0x803 802c528: 38 21 31 bc ori r1,r1,0x31bc 802c52c: 28 22 00 00 lw r2,(r1+0) 802c530: 34 42 00 01 addi r2,r2,1 802c534: 58 22 00 00 sw (r1+0),r2 /* * Block for the desired amount of time */ _Thread_Disable_dispatch(); _Thread_Set_state( 802c538: 78 0c 08 03 mvhi r12,0x803 802c53c: 39 8c 32 78 ori r12,r12,0x3278 802c540: 29 81 00 00 lw r1,(r12+0) 802c544: 78 02 10 00 mvhi r2,0x1000 802c548: 38 42 00 08 ori r2,r2,0x8 802c54c: fb ff 81 cc calli 800cc7c <_Thread_Set_state> _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( &_Thread_Executing->Timer, 802c550: 29 83 00 00 lw r3,(r12+0) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 802c554: 78 02 08 00 mvhi r2,0x800 802c558: 38 42 bd e8 ori r2,r2,0xbde8 _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( 802c55c: 28 64 00 08 lw r4,(r3+8) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 802c560: 78 01 08 03 mvhi r1,0x803 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 802c564: 58 62 00 64 sw (r3+100),r2 the_watchdog->id = id; 802c568: 58 64 00 68 sw (r3+104),r4 the_watchdog->user_data = user_data; 802c56c: 58 6e 00 6c sw (r3+108),r14 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 802c570: 38 21 32 98 ori r1,r1,0x3298 802c574: 34 62 00 48 addi r2,r3,72 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 802c578: 58 6e 00 50 sw (r3+80),r14 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 802c57c: 58 6b 00 54 sw (r3+84),r11 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 802c580: fb ff 84 59 calli 800d6e4 <_Watchdog_Insert> _Thread_Delay_ended, _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); _Thread_Enable_dispatch(); 802c584: fb ff 7e a1 calli 800c008 <_Thread_Enable_dispatch> /* calculate time remaining */ if ( rmtp ) { 802c588: 45 a0 00 0a be r13,r0,802c5b0 ticks -= _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; 802c58c: 29 81 00 00 lw r1,(r12+0) _Timespec_From_ticks( ticks, rmtp ); 802c590: b9 a0 10 00 mv r2,r13 _Thread_Enable_dispatch(); /* calculate time remaining */ if ( rmtp ) { ticks -= 802c594: 28 23 00 60 lw r3,(r1+96) 802c598: 28 21 00 5c lw r1,(r1+92) 802c59c: c8 23 08 00 sub r1,r1,r3 802c5a0: b4 2b 58 00 add r11,r1,r11 _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; _Timespec_From_ticks( ticks, rmtp ); 802c5a4: b9 60 08 00 mv r1,r11 802c5a8: f8 00 00 0f calli 802c5e4 <_Timespec_From_ticks> */ #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) 802c5ac: 5d 60 00 09 bne r11,r0,802c5d0 rtems_set_errno_and_return_minus_one( EINTR ); 802c5b0: 34 01 00 00 mvi r1,0 #endif } return 0; } 802c5b4: 2b 9d 00 04 lw ra,(sp+4) 802c5b8: 2b 8b 00 14 lw r11,(sp+20) 802c5bc: 2b 8c 00 10 lw r12,(sp+16) 802c5c0: 2b 8d 00 0c lw r13,(sp+12) 802c5c4: 2b 8e 00 08 lw r14,(sp+8) 802c5c8: 37 9c 00 14 addi sp,sp,20 802c5cc: c3 a0 00 00 ret #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) rtems_set_errno_and_return_minus_one( EINTR ); 802c5d0: fb ff b3 9c calli 8019440 <__errno> 802c5d4: 34 02 00 04 mvi r2,4 802c5d8: 58 22 00 00 sw (r1+0),r2 802c5dc: 34 01 ff ff mvi r1,-1 802c5e0: e3 ff ff ca bi 802c508 08006ff0 : int pthread_attr_getinheritsched( const pthread_attr_t *attr, int *inheritsched ) { if ( !attr || !attr->is_initialized || !inheritsched ) 8006ff0: 44 20 00 0a be r1,r0,8007018 <== NEVER TAKEN 8006ff4: 28 23 00 00 lw r3,(r1+0) 8006ff8: 64 44 00 00 cmpei r4,r2,0 8006ffc: 64 63 00 00 cmpei r3,r3,0 8007000: b8 83 18 00 or r3,r4,r3 8007004: 5c 60 00 05 bne r3,r0,8007018 return EINVAL; *inheritsched = attr->inheritsched; 8007008: 28 21 00 10 lw r1,(r1+16) 800700c: 58 41 00 00 sw (r2+0),r1 8007010: b8 60 08 00 mv r1,r3 return 0; 8007014: c3 a0 00 00 ret 8007018: 34 01 00 16 mvi r1,22 } 800701c: c3 a0 00 00 ret 08007294 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) 8007294: 44 20 00 0d be r1,r0,80072c8 8007298: 28 23 00 00 lw r3,(r1+0) 800729c: 44 60 00 0b be r3,r0,80072c8 return EINVAL; switch ( policy ) { 80072a0: 48 02 00 05 bg r0,r2,80072b4 80072a4: 34 03 00 02 mvi r3,2 80072a8: 4c 62 00 05 bge r3,r2,80072bc 80072ac: 34 03 00 04 mvi r3,4 80072b0: 44 43 00 03 be r2,r3,80072bc <== ALWAYS TAKEN 80072b4: 34 01 00 86 mvi r1,134 80072b8: c3 a0 00 00 ret case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 80072bc: 58 22 00 14 sw (r1+20),r2 80072c0: 34 01 00 00 mvi r1,0 return 0; 80072c4: c3 a0 00 00 ret 80072c8: 34 01 00 16 mvi r1,22 default: return ENOTSUP; } } 80072cc: c3 a0 00 00 ret 080030b4 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 80030b4: 37 9c ff d4 addi sp,sp,-44 80030b8: 5b 8b 00 18 sw (sp+24),r11 80030bc: 5b 8c 00 14 sw (sp+20),r12 80030c0: 5b 8d 00 10 sw (sp+16),r13 80030c4: 5b 8e 00 0c sw (sp+12),r14 80030c8: 5b 8f 00 08 sw (sp+8),r15 80030cc: 5b 9d 00 04 sw (sp+4),ra 80030d0: b8 20 58 00 mv r11,r1 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 80030d4: 44 20 00 08 be r1,r0,80030f4 return EINVAL; if ( count == 0 ) 80030d8: 44 60 00 07 be r3,r0,80030f4 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 80030dc: b8 40 20 00 mv r4,r2 80030e0: 44 40 00 35 be r2,r0,80031b4 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 80030e4: 28 81 00 00 lw r1,(r4+0) 80030e8: 44 20 00 03 be r1,r0,80030f4 return EINVAL; switch ( the_attr->process_shared ) { 80030ec: 28 8c 00 04 lw r12,(r4+4) 80030f0: 45 80 00 0a be r12,r0,8003118 <== ALWAYS TAKEN /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; 80030f4: 34 01 00 16 mvi r1,22 } 80030f8: 2b 9d 00 04 lw ra,(sp+4) 80030fc: 2b 8b 00 18 lw r11,(sp+24) 8003100: 2b 8c 00 14 lw r12,(sp+20) 8003104: 2b 8d 00 10 lw r13,(sp+16) 8003108: 2b 8e 00 0c lw r14,(sp+12) 800310c: 2b 8f 00 08 lw r15,(sp+8) 8003110: 37 9c 00 2c addi sp,sp,44 8003114: c3 a0 00 00 ret rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8003118: 78 01 08 02 mvhi r1,0x802 800311c: 38 21 08 74 ori r1,r1,0x874 8003120: 28 22 00 00 lw r2,(r1+0) /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; the_attributes.maximum_count = count; 8003124: 5b 83 00 2c sw (sp+44),r3 } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 8003128: 5b 8c 00 28 sw (sp+40),r12 800312c: 34 42 00 01 addi r2,r2,1 8003130: 58 22 00 00 sw (r1+0),r2 * This function allocates a barrier control block from * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) 8003134: 78 01 08 02 mvhi r1,0x802 8003138: 38 21 0b f4 ori r1,r1,0xbf4 800313c: f8 00 07 50 calli 8004e7c <_Objects_Allocate> 8003140: b8 20 68 00 mv r13,r1 */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 8003144: 44 2c 00 19 be r1,r12,80031a8 _Thread_Enable_dispatch(); return EAGAIN; } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 8003148: 37 82 00 28 addi r2,sp,40 800314c: 34 21 00 10 addi r1,r1,16 8003150: f8 00 04 8f calli 800438c <_CORE_barrier_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8003154: 78 01 08 02 mvhi r1,0x802 8003158: 29 ae 00 08 lw r14,(r13+8) 800315c: 38 21 0b f4 ori r1,r1,0xbf4 8003160: 28 2f 00 1c lw r15,(r1+28) 8003164: 34 02 00 02 mvi r2,2 8003168: 21 c1 ff ff andi r1,r14,0xffff 800316c: fb ff f7 bc calli 800105c <__ashlsi3> 8003170: b5 e1 08 00 add r1,r15,r1 8003174: 58 2d 00 00 sw (r1+0),r13 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 8003178: 59 ac 00 0c sw (r13+12),r12 ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 800317c: 59 6e 00 00 sw (r11+0),r14 _Thread_Enable_dispatch(); 8003180: f8 00 0a c3 calli 8005c8c <_Thread_Enable_dispatch> 8003184: b9 80 08 00 mv r1,r12 return 0; } 8003188: 2b 9d 00 04 lw ra,(sp+4) 800318c: 2b 8b 00 18 lw r11,(sp+24) 8003190: 2b 8c 00 14 lw r12,(sp+20) 8003194: 2b 8d 00 10 lw r13,(sp+16) 8003198: 2b 8e 00 0c lw r14,(sp+12) 800319c: 2b 8f 00 08 lw r15,(sp+8) 80031a0: 37 9c 00 2c addi sp,sp,44 80031a4: c3 a0 00 00 ret _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { _Thread_Enable_dispatch(); 80031a8: f8 00 0a b9 calli 8005c8c <_Thread_Enable_dispatch> 80031ac: 34 01 00 0b mvi r1,11 return EAGAIN; 80031b0: e3 ff ff d2 bi 80030f8 * If the user passed in NULL, use the default attributes */ if ( attr ) { the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 80031b4: 37 8c 00 20 addi r12,sp,32 80031b8: b9 80 08 00 mv r1,r12 80031bc: 5b 83 00 1c sw (sp+28),r3 80031c0: fb ff ff 7f calli 8002fbc 80031c4: b9 80 20 00 mv r4,r12 80031c8: 2b 83 00 1c lw r3,(sp+28) 80031cc: e3 ff ff c6 bi 80030e4 08002fe0 : int pthread_barrierattr_setpshared( pthread_barrierattr_t *attr, int pshared ) { if ( !attr ) 8002fe0: 44 20 00 08 be r1,r0,8003000 <== NEVER TAKEN return EINVAL; if ( !attr->is_initialized ) 8002fe4: 28 23 00 00 lw r3,(r1+0) 8002fe8: 44 60 00 06 be r3,r0,8003000 <== NEVER TAKEN return EINVAL; switch ( pshared ) { 8002fec: 34 03 00 01 mvi r3,1 8002ff0: 54 43 00 04 bgu r2,r3,8003000 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 8002ff4: 58 22 00 04 sw (r1+4),r2 8002ff8: 34 01 00 00 mvi r1,0 return 0; 8002ffc: c3 a0 00 00 ret 8003000: 34 01 00 16 mvi r1,22 default: return EINVAL; } } 8003004: c3 a0 00 00 ret 08001f70 : */ void pthread_cleanup_pop( int execute ) { 8001f70: 37 9c ff f0 addi sp,sp,-16 8001f74: 5b 8b 00 10 sw (sp+16),r11 8001f78: 5b 8c 00 0c sw (sp+12),r12 8001f7c: 5b 8d 00 08 sw (sp+8),r13 8001f80: 5b 9d 00 04 sw (sp+4),ra rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8001f84: 78 02 08 01 mvhi r2,0x801 8001f88: 38 42 e8 34 ori r2,r2,0xe834 POSIX_Cancel_Handler_control tmp_handler; Chain_Control *handler_stack; POSIX_API_Control *thread_support; ISR_Level level; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 8001f8c: 78 03 08 01 mvhi r3,0x801 8001f90: 28 44 00 00 lw r4,(r2+0) 8001f94: 38 63 e8 f0 ori r3,r3,0xe8f0 8001f98: 28 63 00 00 lw r3,(r3+0) 8001f9c: 34 84 00 01 addi r4,r4,1 8001fa0: 58 44 00 00 sw (r2+0),r4 */ void pthread_cleanup_pop( int execute ) { 8001fa4: b8 20 60 00 mv r12,r1 POSIX_Cancel_Handler_control tmp_handler; Chain_Control *handler_stack; POSIX_API_Control *thread_support; ISR_Level level; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 8001fa8: 28 62 01 2c lw r2,(r3+300) * ensure that we do not get prempted and deleted while we are holding * memory that needs to be freed. */ _Thread_Disable_dispatch(); _ISR_Disable( level ); 8001fac: 90 00 58 00 rcsr r11,IE 8001fb0: 34 03 ff fe mvi r3,-2 8001fb4: a1 63 18 00 and r3,r11,r3 8001fb8: d0 03 00 00 wcsr IE,r3 POSIX_API_Control *thread_support; ISR_Level level; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 8001fbc: 28 43 00 e0 lw r3,(r2+224) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8001fc0: 34 42 00 e4 addi r2,r2,228 8001fc4: 44 62 00 15 be r3,r2,8002018 _Thread_Enable_dispatch(); _ISR_Enable( level ); return; } handler = (POSIX_Cancel_Handler_control *) 8001fc8: 28 42 00 04 lw r2,(r2+4) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8001fcc: 28 43 00 00 lw r3,(r2+0) previous = the_node->previous; 8001fd0: 28 41 00 04 lw r1,(r2+4) next->previous = previous; previous->next = next; 8001fd4: 58 23 00 00 sw (r1+0),r3 Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 8001fd8: 58 61 00 04 sw (r3+4),r1 _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); 8001fdc: d0 0b 00 00 wcsr IE,r11 tmp_handler = *handler; _Workspace_Free( handler ); 8001fe0: b8 40 08 00 mv r1,r2 _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); tmp_handler = *handler; 8001fe4: 28 4d 00 0c lw r13,(r2+12) 8001fe8: 28 4b 00 08 lw r11,(r2+8) _Workspace_Free( handler ); 8001fec: f8 00 09 55 calli 8004540 <_Workspace_Free> _Thread_Enable_dispatch(); 8001ff0: f8 00 06 86 calli 8003a08 <_Thread_Enable_dispatch> if ( execute ) 8001ff4: 45 80 00 03 be r12,r0,8002000 <== NEVER TAKEN (*tmp_handler.routine)( tmp_handler.arg ); 8001ff8: b9 a0 08 00 mv r1,r13 8001ffc: d9 60 00 00 call r11 } 8002000: 2b 9d 00 04 lw ra,(sp+4) 8002004: 2b 8b 00 10 lw r11,(sp+16) 8002008: 2b 8c 00 0c lw r12,(sp+12) 800200c: 2b 8d 00 08 lw r13,(sp+8) 8002010: 37 9c 00 10 addi sp,sp,16 8002014: c3 a0 00 00 ret _Thread_Disable_dispatch(); _ISR_Disable( level ); if ( _Chain_Is_empty( handler_stack ) ) { _Thread_Enable_dispatch(); 8002018: f8 00 06 7c calli 8003a08 <_Thread_Enable_dispatch> _ISR_Enable( level ); 800201c: d0 0b 00 00 wcsr IE,r11 _Thread_Enable_dispatch(); if ( execute ) (*tmp_handler.routine)( tmp_handler.arg ); } 8002020: 2b 9d 00 04 lw ra,(sp+4) 8002024: 2b 8b 00 10 lw r11,(sp+16) 8002028: 2b 8c 00 0c lw r12,(sp+12) 800202c: 2b 8d 00 08 lw r13,(sp+8) 8002030: 37 9c 00 10 addi sp,sp,16 8002034: c3 a0 00 00 ret 08002680 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 8002680: 37 9c ff f4 addi sp,sp,-12 8002684: 5b 8b 00 0c sw (sp+12),r11 8002688: 5b 8c 00 08 sw (sp+8),r12 800268c: 5b 9d 00 04 sw (sp+4),ra 8002690: b8 20 58 00 mv r11,r1 8002694: b8 40 60 00 mv r12,r2 /* * The POSIX standard does not address what to do when the routine * is NULL. It also does not address what happens when we cannot * allocate memory or anything else bad happens. */ if ( !routine ) 8002698: 44 20 00 14 be r1,r0,80026e8 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 800269c: 78 03 08 02 mvhi r3,0x802 80026a0: 38 63 08 5c ori r3,r3,0x85c 80026a4: 28 61 00 00 lw r1,(r3+0) 80026a8: 34 21 00 01 addi r1,r1,1 80026ac: 58 61 00 00 sw (r3+0),r1 return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 80026b0: 34 01 00 10 mvi r1,16 80026b4: f8 00 10 ad calli 8006968 <_Workspace_Allocate> 80026b8: b8 20 18 00 mv r3,r1 if ( handler ) { 80026bc: 44 20 00 0a be r1,r0,80026e4 <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 80026c0: 78 04 08 02 mvhi r4,0x802 80026c4: 38 84 09 18 ori r4,r4,0x918 80026c8: 28 81 00 00 lw r1,(r4+0) handler->routine = routine; 80026cc: 58 6b 00 08 sw (r3+8),r11 handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); 80026d0: b8 60 10 00 mv r2,r3 handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); if ( handler ) { thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 80026d4: 28 21 01 2c lw r1,(r1+300) handler->routine = routine; handler->arg = arg; 80026d8: 58 6c 00 0c sw (r3+12),r12 _Chain_Append( handler_stack, &handler->Node ); 80026dc: 34 21 00 e0 addi r1,r1,224 80026e0: f8 00 04 c1 calli 80039e4 <_Chain_Append> } _Thread_Enable_dispatch(); 80026e4: f8 00 0a b2 calli 80051ac <_Thread_Enable_dispatch> } 80026e8: 2b 9d 00 04 lw ra,(sp+4) 80026ec: 2b 8b 00 0c lw r11,(sp+12) 80026f0: 2b 8c 00 08 lw r12,(sp+8) 80026f4: 37 9c 00 0c addi sp,sp,12 80026f8: c3 a0 00 00 ret 08003b64 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 8003b64: 37 9c ff e8 addi sp,sp,-24 8003b68: 5b 8b 00 18 sw (sp+24),r11 8003b6c: 5b 8c 00 14 sw (sp+20),r12 8003b70: 5b 8d 00 10 sw (sp+16),r13 8003b74: 5b 8e 00 0c sw (sp+12),r14 8003b78: 5b 8f 00 08 sw (sp+8),r15 8003b7c: 5b 9d 00 04 sw (sp+4),ra 8003b80: b8 20 70 00 mv r14,r1 POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 8003b84: b8 40 58 00 mv r11,r2 8003b88: 44 40 00 37 be r2,r0,8003c64 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 8003b8c: 29 61 00 04 lw r1,(r11+4) 8003b90: 34 02 00 01 mvi r2,1 8003b94: 44 22 00 04 be r1,r2,8003ba4 <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 8003b98: 29 61 00 00 lw r1,(r11+0) 8003b9c: 34 0d 00 00 mvi r13,0 8003ba0: 5c 2d 00 0a bne r1,r13,8003bc8 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; 8003ba4: 34 01 00 16 mvi r1,22 } 8003ba8: 2b 9d 00 04 lw ra,(sp+4) 8003bac: 2b 8b 00 18 lw r11,(sp+24) 8003bb0: 2b 8c 00 14 lw r12,(sp+20) 8003bb4: 2b 8d 00 10 lw r13,(sp+16) 8003bb8: 2b 8e 00 0c lw r14,(sp+12) 8003bbc: 2b 8f 00 08 lw r15,(sp+8) 8003bc0: 37 9c 00 18 addi sp,sp,24 8003bc4: c3 a0 00 00 ret rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8003bc8: 78 02 08 02 mvhi r2,0x802 8003bcc: 38 42 18 74 ori r2,r2,0x1874 8003bd0: 28 41 00 00 lw r1,(r2+0) 8003bd4: 34 21 00 01 addi r1,r1,1 8003bd8: 58 41 00 00 sw (r2+0),r1 */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 8003bdc: 78 01 08 02 mvhi r1,0x802 8003be0: 38 21 1c 8c ori r1,r1,0x1c8c 8003be4: f8 00 09 1f calli 8006060 <_Objects_Allocate> 8003be8: b8 20 60 00 mv r12,r1 _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 8003bec: 44 2d 00 21 be r1,r13,8003c70 _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 8003bf0: 29 6b 00 04 lw r11,(r11+4) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 8003bf4: 34 03 08 00 mvi r3,2048 8003bf8: 34 04 00 74 mvi r4,116 if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 8003bfc: 58 2b 00 10 sw (r1+16),r11 the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 8003c00: 58 2d 00 14 sw (r1+20),r13 /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 8003c04: b9 a0 10 00 mv r2,r13 8003c08: 34 21 00 18 addi r1,r1,24 8003c0c: f8 00 0f 9f calli 8007a88 <_Thread_queue_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8003c10: 78 02 08 02 mvhi r2,0x802 8003c14: 29 8b 00 08 lw r11,(r12+8) 8003c18: 38 42 1c 8c ori r2,r2,0x1c8c 8003c1c: 28 4f 00 1c lw r15,(r2+28) 8003c20: 21 61 ff ff andi r1,r11,0xffff 8003c24: 34 02 00 02 mvi r2,2 8003c28: fb ff f7 74 calli 80019f8 <__ashlsi3> 8003c2c: b5 e1 08 00 add r1,r15,r1 8003c30: 58 2c 00 00 sw (r1+0),r12 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 8003c34: 59 8d 00 0c sw (r12+12),r13 &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 8003c38: 59 cb 00 00 sw (r14+0),r11 _Thread_Enable_dispatch(); 8003c3c: f8 00 0d 29 calli 80070e0 <_Thread_Enable_dispatch> 8003c40: b9 a0 08 00 mv r1,r13 return 0; } 8003c44: 2b 9d 00 04 lw ra,(sp+4) 8003c48: 2b 8b 00 18 lw r11,(sp+24) 8003c4c: 2b 8c 00 14 lw r12,(sp+20) 8003c50: 2b 8d 00 10 lw r13,(sp+16) 8003c54: 2b 8e 00 0c lw r14,(sp+12) 8003c58: 2b 8f 00 08 lw r15,(sp+8) 8003c5c: 37 9c 00 18 addi sp,sp,24 8003c60: c3 a0 00 00 ret ) { POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 8003c64: 78 0b 08 01 mvhi r11,0x801 8003c68: 39 6b f9 20 ori r11,r11,0xf920 8003c6c: e3 ff ff c8 bi 8003b8c _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { _Thread_Enable_dispatch(); 8003c70: f8 00 0d 1c calli 80070e0 <_Thread_Enable_dispatch> 8003c74: 34 01 00 0c mvi r1,12 return ENOMEM; 8003c78: e3 ff ff cc bi 8003ba8 0800399c : int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) 800399c: 34 02 00 00 mvi r2,0 80039a0: 44 22 00 06 be r1,r2,80039b8 80039a4: 28 23 00 00 lw r3,(r1+0) 80039a8: 44 62 00 04 be r3,r2,80039b8 <== NEVER TAKEN return EINVAL; attr->is_initialized = false; 80039ac: 58 22 00 00 sw (r1+0),r2 80039b0: b8 40 08 00 mv r1,r2 return 0; 80039b4: c3 a0 00 00 ret 80039b8: 34 01 00 16 mvi r1,22 } 80039bc: c3 a0 00 00 ret 08002c58 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 8002c58: 37 9c ff a4 addi sp,sp,-92 8002c5c: 5b 8b 00 38 sw (sp+56),r11 8002c60: 5b 8c 00 34 sw (sp+52),r12 8002c64: 5b 8d 00 30 sw (sp+48),r13 8002c68: 5b 8e 00 2c sw (sp+44),r14 8002c6c: 5b 8f 00 28 sw (sp+40),r15 8002c70: 5b 90 00 24 sw (sp+36),r16 8002c74: 5b 91 00 20 sw (sp+32),r17 8002c78: 5b 92 00 1c sw (sp+28),r18 8002c7c: 5b 93 00 18 sw (sp+24),r19 8002c80: 5b 94 00 14 sw (sp+20),r20 8002c84: 5b 9d 00 10 sw (sp+16),ra int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 8002c88: 34 0c 00 0e mvi r12,14 pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 8002c8c: b8 60 68 00 mv r13,r3 8002c90: b8 20 78 00 mv r15,r1 8002c94: b8 80 70 00 mv r14,r4 int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 8002c98: 44 60 00 12 be r3,r0,8002ce0 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 8002c9c: b8 40 58 00 mv r11,r2 8002ca0: 44 40 00 65 be r2,r0,8002e34 if ( !the_attr->is_initialized ) 8002ca4: 29 61 00 00 lw r1,(r11+0) 8002ca8: 44 20 00 0d be r1,r0,8002cdc * stack space if it is allowed to allocate it itself. * * NOTE: If the user provides the stack we will let it drop below * twice the minimum. */ if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) ) 8002cac: 29 61 00 04 lw r1,(r11+4) 8002cb0: 44 20 00 06 be r1,r0,8002cc8 8002cb4: 78 02 08 01 mvhi r2,0x801 8002cb8: 38 42 f0 e0 ori r2,r2,0xf0e0 8002cbc: 28 41 00 00 lw r1,(r2+0) 8002cc0: 29 62 00 08 lw r2,(r11+8) 8002cc4: 54 22 00 06 bgu r1,r2,8002cdc * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread * inherits scheduling attributes from the creating thread. If it is * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { 8002cc8: 29 61 00 10 lw r1,(r11+16) 8002ccc: 34 02 00 01 mvi r2,1 8002cd0: 44 22 00 5c be r1,r2,8002e40 8002cd4: 34 02 00 02 mvi r2,2 8002cd8: 44 22 00 10 be r1,r2,8002d18 * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; 8002cdc: 34 0c 00 16 mvi r12,22 } 8002ce0: b9 80 08 00 mv r1,r12 8002ce4: 2b 9d 00 10 lw ra,(sp+16) 8002ce8: 2b 8b 00 38 lw r11,(sp+56) 8002cec: 2b 8c 00 34 lw r12,(sp+52) 8002cf0: 2b 8d 00 30 lw r13,(sp+48) 8002cf4: 2b 8e 00 2c lw r14,(sp+44) 8002cf8: 2b 8f 00 28 lw r15,(sp+40) 8002cfc: 2b 90 00 24 lw r16,(sp+36) 8002d00: 2b 91 00 20 lw r17,(sp+32) 8002d04: 2b 92 00 1c lw r18,(sp+28) 8002d08: 2b 93 00 18 lw r19,(sp+24) 8002d0c: 2b 94 00 14 lw r20,(sp+20) 8002d10: 37 9c 00 5c addi sp,sp,92 8002d14: c3 a0 00 00 ret schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 8002d18: 29 67 00 18 lw r7,(r11+24) schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 8002d1c: 29 71 00 14 lw r17,(r11+20) schedparam = the_attr->schedparam; 8002d20: 5b 87 00 3c sw (sp+60),r7 8002d24: 29 69 00 1c lw r9,(r11+28) 8002d28: 5b 89 00 40 sw (sp+64),r9 8002d2c: 29 61 00 20 lw r1,(r11+32) 8002d30: 5b 81 00 44 sw (sp+68),r1 8002d34: 29 62 00 24 lw r2,(r11+36) 8002d38: 5b 82 00 48 sw (sp+72),r2 8002d3c: 29 66 00 28 lw r6,(r11+40) 8002d40: 5b 86 00 4c sw (sp+76),r6 8002d44: 29 67 00 2c lw r7,(r11+44) 8002d48: 5b 87 00 50 sw (sp+80),r7 8002d4c: 29 69 00 30 lw r9,(r11+48) 8002d50: 5b 89 00 54 sw (sp+84),r9 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 8002d54: 29 70 00 0c lw r16,(r11+12) 8002d58: 34 0c 00 86 mvi r12,134 8002d5c: 5e 00 ff e1 bne r16,r0,8002ce0 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 8002d60: 2b 81 00 3c lw r1,(sp+60) 8002d64: f8 00 1b 71 calli 8009b28 <_POSIX_Priority_Is_valid> 8002d68: 44 30 ff dd be r1,r16,8002cdc <== NEVER TAKEN RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 8002d6c: 78 05 08 01 mvhi r5,0x801 8002d70: 38 a5 f0 e4 ori r5,r5,0xf0e4 core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 8002d74: ba 20 08 00 mv r1,r17 8002d78: 37 82 00 3c addi r2,sp,60 8002d7c: 37 83 00 5c addi r3,sp,92 8002d80: 37 84 00 58 addi r4,sp,88 8002d84: 40 b4 00 00 lbu r20,(r5+0) * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 8002d88: 2b 90 00 3c lw r16,(sp+60) /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 8002d8c: f8 00 1b 6f calli 8009b48 <_POSIX_Thread_Translate_sched_param> 8002d90: b8 20 60 00 mv r12,r1 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 8002d94: 5c 20 ff d3 bne r1,r0,8002ce0 #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 8002d98: 78 13 08 01 mvhi r19,0x801 8002d9c: 3a 73 f9 18 ori r19,r19,0xf918 8002da0: 2a 61 00 00 lw r1,(r19+0) 8002da4: f8 00 04 c4 calli 80040b4 <_API_Mutex_Lock> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 8002da8: 78 01 08 01 mvhi r1,0x801 8002dac: 38 21 fa 64 ori r1,r1,0xfa64 8002db0: f8 00 07 80 calli 8004bb0 <_Objects_Allocate> 8002db4: b8 20 90 00 mv r18,r1 * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 8002db8: 44 2c 00 1b be r1,r12,8002e24 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 8002dbc: 78 01 08 01 mvhi r1,0x801 8002dc0: 38 21 f0 e0 ori r1,r1,0xf0e0 8002dc4: 28 24 00 00 lw r4,(r1+0) 8002dc8: 29 61 00 08 lw r1,(r11+8) 8002dcc: 29 63 00 04 lw r3,(r11+4) 8002dd0: b4 84 20 00 add r4,r4,r4 8002dd4: 50 81 00 02 bgeu r4,r1,8002ddc 8002dd8: b8 20 20 00 mv r4,r1 8002ddc: 34 09 00 00 mvi r9,0 8002de0: 5b 89 00 08 sw (sp+8),r9 8002de4: 2b 88 00 5c lw r8,(sp+92) 8002de8: 2b 89 00 58 lw r9,(sp+88) 8002dec: 78 01 08 01 mvhi r1,0x801 8002df0: ca 90 30 00 sub r6,r20,r16 8002df4: 38 21 fa 64 ori r1,r1,0xfa64 8002df8: ba 40 10 00 mv r2,r18 8002dfc: b9 80 28 00 mv r5,r12 8002e00: 34 07 00 01 mvi r7,1 8002e04: 5b 89 00 04 sw (sp+4),r9 8002e08: 5b 8c 00 0c sw (sp+12),r12 8002e0c: f8 00 0b 25 calli 8005aa0 <_Thread_Initialize> budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 8002e10: 5c 20 00 20 bne r1,r0,8002e90 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 8002e14: 78 01 08 01 mvhi r1,0x801 8002e18: 38 21 fa 64 ori r1,r1,0xfa64 8002e1c: ba 40 10 00 mv r2,r18 8002e20: f8 00 08 71 calli 8004fe4 <_Objects_Free> _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 8002e24: 2a 61 00 00 lw r1,(r19+0) 8002e28: 34 0c 00 0b mvi r12,11 8002e2c: f8 00 04 be calli 8004124 <_API_Mutex_Unlock> return EAGAIN; 8002e30: e3 ff ff ac bi 8002ce0 int rc; if ( !start_routine ) return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 8002e34: 78 0b 08 01 mvhi r11,0x801 8002e38: 39 6b dc 00 ori r11,r11,0xdc00 8002e3c: e3 ff ff 9a bi 8002ca4 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 8002e40: 78 01 08 01 mvhi r1,0x801 8002e44: 38 21 f9 20 ori r1,r1,0xf920 8002e48: 28 21 00 00 lw r1,(r1+0) 8002e4c: 28 22 01 2c lw r2,(r1+300) schedpolicy = api->schedpolicy; schedparam = api->schedparam; 8002e50: 28 41 00 84 lw r1,(r2+132) * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; schedpolicy = api->schedpolicy; 8002e54: 28 51 00 80 lw r17,(r2+128) schedparam = api->schedparam; 8002e58: 5b 81 00 3c sw (sp+60),r1 8002e5c: 28 46 00 88 lw r6,(r2+136) 8002e60: 5b 86 00 40 sw (sp+64),r6 8002e64: 28 47 00 8c lw r7,(r2+140) 8002e68: 5b 87 00 44 sw (sp+68),r7 8002e6c: 28 49 00 90 lw r9,(r2+144) 8002e70: 5b 89 00 48 sw (sp+72),r9 8002e74: 28 41 00 94 lw r1,(r2+148) 8002e78: 5b 81 00 4c sw (sp+76),r1 8002e7c: 28 46 00 98 lw r6,(r2+152) 8002e80: 5b 86 00 50 sw (sp+80),r6 8002e84: 28 42 00 9c lw r2,(r2+156) 8002e88: 5b 82 00 54 sw (sp+84),r2 break; 8002e8c: e3 ff ff b2 bi 8002d54 } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8002e90: 2a 50 01 2c lw r16,(r18+300) api->Attributes = *the_attr; 8002e94: 29 61 00 00 lw r1,(r11+0) * This insures we evaluate the process-wide signals pending when we * first run. * * NOTE: Since the thread starts with all unblocked, this is necessary. */ the_thread->do_post_task_switch_extension = true; 8002e98: 34 06 00 01 mvi r6,1 /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 8002e9c: b9 a0 18 00 mv r3,r13 /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; 8002ea0: 5a 01 00 00 sw (r16+0),r1 8002ea4: 29 62 00 04 lw r2,(r11+4) the_thread->do_post_task_switch_extension = true; /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 8002ea8: b9 c0 20 00 mv r4,r14 8002eac: ba 40 08 00 mv r1,r18 /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; 8002eb0: 5a 02 00 04 sw (r16+4),r2 8002eb4: 29 67 00 08 lw r7,(r11+8) the_thread->do_post_task_switch_extension = true; /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 8002eb8: b8 c0 10 00 mv r2,r6 8002ebc: b9 80 28 00 mv r5,r12 /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; 8002ec0: 5a 07 00 08 sw (r16+8),r7 8002ec4: 29 69 00 0c lw r9,(r11+12) 8002ec8: 5a 09 00 0c sw (r16+12),r9 8002ecc: 29 67 00 10 lw r7,(r11+16) 8002ed0: 5a 07 00 10 sw (r16+16),r7 8002ed4: 29 69 00 14 lw r9,(r11+20) 8002ed8: 5a 09 00 14 sw (r16+20),r9 8002edc: 29 67 00 18 lw r7,(r11+24) 8002ee0: 5a 07 00 18 sw (r16+24),r7 8002ee4: 29 69 00 1c lw r9,(r11+28) 8002ee8: 5a 09 00 1c sw (r16+28),r9 8002eec: 29 67 00 20 lw r7,(r11+32) 8002ef0: 5a 07 00 20 sw (r16+32),r7 8002ef4: 29 69 00 24 lw r9,(r11+36) 8002ef8: 5a 09 00 24 sw (r16+36),r9 8002efc: 29 67 00 28 lw r7,(r11+40) 8002f00: 5a 07 00 28 sw (r16+40),r7 8002f04: 29 69 00 2c lw r9,(r11+44) 8002f08: 5a 09 00 2c sw (r16+44),r9 8002f0c: 29 67 00 30 lw r7,(r11+48) 8002f10: 5a 07 00 30 sw (r16+48),r7 8002f14: 29 69 00 34 lw r9,(r11+52) 8002f18: 5a 09 00 34 sw (r16+52),r9 8002f1c: 29 67 00 38 lw r7,(r11+56) 8002f20: 5a 07 00 38 sw (r16+56),r7 api->detachstate = the_attr->detachstate; 8002f24: 29 6b 00 38 lw r11,(r11+56) 8002f28: 5a 0b 00 3c sw (r16+60),r11 api->schedpolicy = schedpolicy; 8002f2c: 5a 11 00 80 sw (r16+128),r17 api->schedparam = schedparam; 8002f30: 2b 89 00 3c lw r9,(sp+60) * This insures we evaluate the process-wide signals pending when we * first run. * * NOTE: Since the thread starts with all unblocked, this is necessary. */ the_thread->do_post_task_switch_extension = true; 8002f34: 32 46 00 74 sb (r18+116),r6 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; 8002f38: 5a 09 00 84 sw (r16+132),r9 8002f3c: 2b 86 00 40 lw r6,(sp+64) 8002f40: 5a 06 00 88 sw (r16+136),r6 8002f44: 2b 87 00 44 lw r7,(sp+68) 8002f48: 5a 07 00 8c sw (r16+140),r7 8002f4c: 2b 89 00 48 lw r9,(sp+72) 8002f50: 5a 09 00 90 sw (r16+144),r9 8002f54: 2b 86 00 4c lw r6,(sp+76) 8002f58: 5a 06 00 94 sw (r16+148),r6 8002f5c: 2b 87 00 50 lw r7,(sp+80) 8002f60: 5a 07 00 98 sw (r16+152),r7 8002f64: 2b 89 00 54 lw r9,(sp+84) 8002f68: 5a 09 00 9c sw (r16+156),r9 the_thread->do_post_task_switch_extension = true; /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 8002f6c: f8 00 0e 55 calli 80068c0 <_Thread_Start> _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 8002f70: 34 01 00 04 mvi r1,4 8002f74: 46 21 00 06 be r17,r1,8002f8c } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 8002f78: 2a 52 00 08 lw r18,(r18+8) _RTEMS_Unlock_allocator(); 8002f7c: 2a 61 00 00 lw r1,(r19+0) } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 8002f80: 59 f2 00 00 sw (r15+0),r18 _RTEMS_Unlock_allocator(); 8002f84: f8 00 04 68 calli 8004124 <_API_Mutex_Unlock> return 0; 8002f88: e3 ff ff 56 bi 8002ce0 return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { _Watchdog_Insert_ticks( 8002f8c: 36 01 00 8c addi r1,r16,140 8002f90: f8 00 0e f5 calli 8006b64 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8002f94: 5a 01 00 b0 sw (r16+176),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8002f98: 78 01 08 01 mvhi r1,0x801 8002f9c: 38 21 f9 40 ori r1,r1,0xf940 8002fa0: 36 02 00 a4 addi r2,r16,164 8002fa4: f8 00 10 25 calli 8007038 <_Watchdog_Insert> 8002fa8: e3 ff ff f4 bi 8002f78 0800bb70 : void pthread_exit( void *value_ptr ) { 800bb70: 37 9c ff fc addi sp,sp,-4 800bb74: 5b 9d 00 04 sw (sp+4),ra _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 800bb78: 78 03 08 01 mvhi r3,0x801 800bb7c: 38 63 e9 60 ori r3,r3,0xe960 } void pthread_exit( void *value_ptr ) { 800bb80: b8 20 10 00 mv r2,r1 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 800bb84: 28 61 00 00 lw r1,(r3+0) 800bb88: fb ff ff d4 calli 800bad8 <_POSIX_Thread_Exit> } 800bb8c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800bb90: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 800bb94: c3 a0 00 00 ret <== NOT EXECUTED 08002374 : int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { if ( !attr ) 8002374: 44 20 00 08 be r1,r0,8002394 return EINVAL; if ( !attr->is_initialized ) 8002378: 28 23 00 00 lw r3,(r1+0) 800237c: 44 60 00 06 be r3,r0,8002394 return EINVAL; if ( !type ) 8002380: 44 40 00 05 be r2,r0,8002394 <== NEVER TAKEN return EINVAL; *type = attr->type; 8002384: 28 21 00 10 lw r1,(r1+16) 8002388: 58 41 00 00 sw (r2+0),r1 800238c: 34 01 00 00 mvi r1,0 return 0; 8002390: c3 a0 00 00 ret 8002394: 34 01 00 16 mvi r1,22 } 8002398: c3 a0 00 00 ret 080052cc : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) 80052cc: 44 20 00 08 be r1,r0,80052ec 80052d0: 28 23 00 00 lw r3,(r1+0) 80052d4: 44 60 00 06 be r3,r0,80052ec return EINVAL; switch ( pshared ) { 80052d8: 34 03 00 01 mvi r3,1 80052dc: 54 43 00 04 bgu r2,r3,80052ec <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 80052e0: 58 22 00 04 sw (r1+4),r2 80052e4: 34 01 00 00 mvi r1,0 return 0; 80052e8: c3 a0 00 00 ret 80052ec: 34 01 00 16 mvi r1,22 default: return EINVAL; } } 80052f0: c3 a0 00 00 ret 080023e8 : int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { if ( !attr || !attr->is_initialized ) 80023e8: 44 20 00 08 be r1,r0,8002408 80023ec: 28 23 00 00 lw r3,(r1+0) 80023f0: 44 60 00 06 be r3,r0,8002408 <== NEVER TAKEN return EINVAL; switch ( type ) { 80023f4: 34 03 00 03 mvi r3,3 80023f8: 54 43 00 04 bgu r2,r3,8002408 case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 80023fc: 58 22 00 10 sw (r1+16),r2 8002400: 34 01 00 00 mvi r1,0 return 0; 8002404: c3 a0 00 00 ret 8002408: 34 01 00 16 mvi r1,22 default: return EINVAL; } } 800240c: c3 a0 00 00 ret 080034d0 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 80034d0: 37 9c ff ec addi sp,sp,-20 80034d4: 5b 8b 00 10 sw (sp+16),r11 80034d8: 5b 8c 00 0c sw (sp+12),r12 80034dc: 5b 8d 00 08 sw (sp+8),r13 80034e0: 5b 9d 00 04 sw (sp+4),ra if ( !once_control || !init_routine ) 80034e4: 64 43 00 00 cmpei r3,r2,0 int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 80034e8: b8 40 60 00 mv r12,r2 if ( !once_control || !init_routine ) 80034ec: 64 22 00 00 cmpei r2,r1,0 int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 80034f0: b8 20 58 00 mv r11,r1 if ( !once_control || !init_routine ) 80034f4: b8 62 18 00 or r3,r3,r2 80034f8: 34 01 00 16 mvi r1,22 80034fc: 5c 60 00 04 bne r3,r0,800350c return EINVAL; if ( !once_control->init_executed ) { 8003500: 29 6d 00 04 lw r13,(r11+4) 8003504: b8 60 08 00 mv r1,r3 8003508: 45 a3 00 07 be r13,r3,8003524 (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; } 800350c: 2b 9d 00 04 lw ra,(sp+4) 8003510: 2b 8b 00 10 lw r11,(sp+16) 8003514: 2b 8c 00 0c lw r12,(sp+12) 8003518: 2b 8d 00 08 lw r13,(sp+8) 800351c: 37 9c 00 14 addi sp,sp,20 8003520: c3 a0 00 00 ret if ( !once_control || !init_routine ) return EINVAL; if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 8003524: 34 01 01 00 mvi r1,256 8003528: b8 20 10 00 mv r2,r1 800352c: 37 83 00 14 addi r3,sp,20 8003530: f8 00 01 1d calli 80039a4 if ( !once_control->init_executed ) { 8003534: 29 61 00 04 lw r1,(r11+4) 8003538: 44 2d 00 0c be r1,r13,8003568 <== ALWAYS TAKEN once_control->is_initialized = true; once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 800353c: 2b 81 00 14 lw r1,(sp+20) 8003540: 34 02 01 00 mvi r2,256 8003544: 37 83 00 14 addi r3,sp,20 8003548: f8 00 01 17 calli 80039a4 800354c: 34 01 00 00 mvi r1,0 } return 0; } 8003550: 2b 9d 00 04 lw ra,(sp+4) 8003554: 2b 8b 00 10 lw r11,(sp+16) 8003558: 2b 8c 00 0c lw r12,(sp+12) 800355c: 2b 8d 00 08 lw r13,(sp+8) 8003560: 37 9c 00 14 addi sp,sp,20 8003564: c3 a0 00 00 ret if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( !once_control->init_executed ) { once_control->is_initialized = true; 8003568: 34 01 00 01 mvi r1,1 once_control->init_executed = true; 800356c: 59 61 00 04 sw (r11+4),r1 if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( !once_control->init_executed ) { once_control->is_initialized = true; 8003570: 59 61 00 00 sw (r11+0),r1 once_control->init_executed = true; (*init_routine)(); 8003574: d9 80 00 00 call r12 8003578: e3 ff ff f1 bi 800353c 08003f0c : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 8003f0c: 37 9c ff dc addi sp,sp,-36 8003f10: 5b 8b 00 18 sw (sp+24),r11 8003f14: 5b 8c 00 14 sw (sp+20),r12 8003f18: 5b 8d 00 10 sw (sp+16),r13 8003f1c: 5b 8e 00 0c sw (sp+12),r14 8003f20: 5b 8f 00 08 sw (sp+8),r15 8003f24: 5b 9d 00 04 sw (sp+4),ra 8003f28: b8 20 60 00 mv r12,r1 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 8003f2c: 44 20 00 07 be r1,r0,8003f48 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 8003f30: b8 40 18 00 mv r3,r2 8003f34: 44 40 00 33 be r2,r0,8004000 <== NEVER TAKEN } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 8003f38: 28 61 00 00 lw r1,(r3+0) 8003f3c: 44 20 00 03 be r1,r0,8003f48 <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { 8003f40: 28 6b 00 04 lw r11,(r3+4) 8003f44: 45 60 00 0a be r11,r0,8003f6c <== ALWAYS TAKEN ); *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); return 0; 8003f48: 34 01 00 16 mvi r1,22 } 8003f4c: 2b 9d 00 04 lw ra,(sp+4) 8003f50: 2b 8b 00 18 lw r11,(sp+24) 8003f54: 2b 8c 00 14 lw r12,(sp+20) 8003f58: 2b 8d 00 10 lw r13,(sp+16) 8003f5c: 2b 8e 00 0c lw r14,(sp+12) 8003f60: 2b 8f 00 08 lw r15,(sp+8) 8003f64: 37 9c 00 24 addi sp,sp,36 8003f68: c3 a0 00 00 ret rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8003f6c: 78 01 08 02 mvhi r1,0x802 8003f70: 38 21 28 74 ori r1,r1,0x2874 8003f74: 28 22 00 00 lw r2,(r1+0) 8003f78: 34 42 00 01 addi r2,r2,1 8003f7c: 58 22 00 00 sw (r1+0),r2 * This function allocates a RWLock control block from * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) 8003f80: 78 01 08 02 mvhi r1,0x802 8003f84: 38 21 2a 34 ori r1,r1,0x2a34 8003f88: f8 00 09 4b calli 80064b4 <_Objects_Allocate> 8003f8c: b8 20 68 00 mv r13,r1 */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 8003f90: 44 2b 00 19 be r1,r11,8003ff4 _Thread_Enable_dispatch(); return EAGAIN; } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 8003f94: 37 82 00 24 addi r2,sp,36 8003f98: 34 21 00 10 addi r1,r1,16 8003f9c: f8 00 06 97 calli 80059f8 <_CORE_RWLock_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8003fa0: 78 01 08 02 mvhi r1,0x802 8003fa4: 29 ae 00 08 lw r14,(r13+8) 8003fa8: 38 21 2a 34 ori r1,r1,0x2a34 8003fac: 28 2f 00 1c lw r15,(r1+28) 8003fb0: 34 02 00 02 mvi r2,2 8003fb4: 21 c1 ff ff andi r1,r14,0xffff 8003fb8: fb ff f7 c0 calli 8001eb8 <__ashlsi3> 8003fbc: b5 e1 08 00 add r1,r15,r1 8003fc0: 58 2d 00 00 sw (r1+0),r13 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 8003fc4: 59 ab 00 0c sw (r13+12),r11 &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 8003fc8: 59 8e 00 00 sw (r12+0),r14 _Thread_Enable_dispatch(); 8003fcc: f8 00 0c be calli 80072c4 <_Thread_Enable_dispatch> 8003fd0: b9 60 08 00 mv r1,r11 return 0; } 8003fd4: 2b 9d 00 04 lw ra,(sp+4) 8003fd8: 2b 8b 00 18 lw r11,(sp+24) 8003fdc: 2b 8c 00 14 lw r12,(sp+20) 8003fe0: 2b 8d 00 10 lw r13,(sp+16) 8003fe4: 2b 8e 00 0c lw r14,(sp+12) 8003fe8: 2b 8f 00 08 lw r15,(sp+8) 8003fec: 37 9c 00 24 addi sp,sp,36 8003ff0: c3 a0 00 00 ret _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { _Thread_Enable_dispatch(); 8003ff4: f8 00 0c b4 calli 80072c4 <_Thread_Enable_dispatch> 8003ff8: 34 01 00 0b mvi r1,11 return EAGAIN; 8003ffc: e3 ff ff d4 bi 8003f4c * If the user passed in NULL, use the default attributes */ if ( attr ) { the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 8004000: 37 8b 00 1c addi r11,sp,28 8004004: b9 60 08 00 mv r1,r11 8004008: f8 00 02 ec calli 8004bb8 800400c: b9 60 18 00 mv r3,r11 8004010: e3 ff ff ca bi 8003f38 08004094 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 8004094: 37 9c ff e8 addi sp,sp,-24 8004098: 5b 8b 00 10 sw (sp+16),r11 800409c: 5b 8c 00 0c sw (sp+12),r12 80040a0: 5b 8d 00 08 sw (sp+8),r13 80040a4: 5b 9d 00 04 sw (sp+4),ra 80040a8: b8 20 58 00 mv r11,r1 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 80040ac: 44 20 00 0c be r1,r0,80040dc * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 80040b0: b8 40 08 00 mv r1,r2 80040b4: 37 82 00 14 addi r2,sp,20 80040b8: f8 00 1c 84 calli 800b2c8 <_POSIX_Absolute_timeout_to_ticks> 80040bc: 29 62 00 00 lw r2,(r11+0) 80040c0: b8 20 68 00 mv r13,r1 80040c4: 78 01 08 02 mvhi r1,0x802 80040c8: 38 21 2a 34 ori r1,r1,0x2a34 80040cc: 37 83 00 18 addi r3,sp,24 80040d0: f8 00 0a 49 calli 80069f4 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 80040d4: 2b 8c 00 18 lw r12,(sp+24) 80040d8: 45 80 00 08 be r12,r0,80040f8 break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 80040dc: 34 01 00 16 mvi r1,22 case OBJECTS_ERROR: break; } return EINVAL; } 80040e0: 2b 9d 00 04 lw ra,(sp+4) 80040e4: 2b 8b 00 10 lw r11,(sp+16) 80040e8: 2b 8c 00 0c lw r12,(sp+12) 80040ec: 2b 8d 00 08 lw r13,(sp+8) 80040f0: 37 9c 00 18 addi sp,sp,24 80040f4: c3 a0 00 00 ret the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 80040f8: 29 62 00 00 lw r2,(r11+0) 80040fc: 2b 84 00 14 lw r4,(sp+20) int _EXFUN(pthread_rwlock_init, (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedrdlock, 8004100: 65 ab 00 03 cmpei r11,r13,3 8004104: 34 21 00 10 addi r1,r1,16 8004108: b9 60 18 00 mv r3,r11 800410c: b9 80 28 00 mv r5,r12 8004110: f8 00 06 48 calli 8005a30 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 8004114: f8 00 0c 6c calli 80072c4 <_Thread_Enable_dispatch> if ( !do_wait ) { 8004118: 5d 6c 00 12 bne r11,r12,8004160 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 800411c: 78 01 08 02 mvhi r1,0x802 8004120: 38 21 29 30 ori r1,r1,0x2930 8004124: 28 21 00 00 lw r1,(r1+0) 8004128: 34 02 00 02 mvi r2,2 800412c: 28 21 00 34 lw r1,(r1+52) 8004130: 44 22 00 08 be r1,r2,8004150 break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 8004134: f8 00 00 4a calli 800425c <_POSIX_RWLock_Translate_core_RWLock_return_code> case OBJECTS_ERROR: break; } return EINVAL; } 8004138: 2b 9d 00 04 lw ra,(sp+4) 800413c: 2b 8b 00 10 lw r11,(sp+16) 8004140: 2b 8c 00 0c lw r12,(sp+12) 8004144: 2b 8d 00 08 lw r13,(sp+8) 8004148: 37 9c 00 18 addi sp,sp,24 800414c: c3 a0 00 00 ret ); _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { switch (status) { 8004150: 45 ab ff e3 be r13,r11,80040dc <== NEVER TAKEN 8004154: 55 a1 ff f8 bgu r13,r1,8004134 <== NEVER TAKEN 8004158: 34 01 00 74 mvi r1,116 800415c: e3 ff ff e1 bi 80040e0 8004160: 78 01 08 02 mvhi r1,0x802 8004164: 38 21 29 30 ori r1,r1,0x2930 8004168: 28 21 00 00 lw r1,(r1+0) 800416c: 28 21 00 34 lw r1,(r1+52) break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 8004170: f8 00 00 3b calli 800425c <_POSIX_RWLock_Translate_core_RWLock_return_code> 8004174: e3 ff ff f1 bi 8004138 08004178 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 8004178: 37 9c ff e8 addi sp,sp,-24 800417c: 5b 8b 00 10 sw (sp+16),r11 8004180: 5b 8c 00 0c sw (sp+12),r12 8004184: 5b 8d 00 08 sw (sp+8),r13 8004188: 5b 9d 00 04 sw (sp+4),ra 800418c: b8 20 58 00 mv r11,r1 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 8004190: 44 20 00 0c be r1,r0,80041c0 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 8004194: b8 40 08 00 mv r1,r2 8004198: 37 82 00 14 addi r2,sp,20 800419c: f8 00 1c 4b calli 800b2c8 <_POSIX_Absolute_timeout_to_ticks> 80041a0: 29 62 00 00 lw r2,(r11+0) 80041a4: b8 20 68 00 mv r13,r1 80041a8: 78 01 08 02 mvhi r1,0x802 80041ac: 38 21 2a 34 ori r1,r1,0x2a34 80041b0: 37 83 00 18 addi r3,sp,24 80041b4: f8 00 0a 10 calli 80069f4 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 80041b8: 2b 8c 00 18 lw r12,(sp+24) 80041bc: 45 80 00 08 be r12,r0,80041dc case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 80041c0: 34 01 00 16 mvi r1,22 case OBJECTS_ERROR: break; } return EINVAL; } 80041c4: 2b 9d 00 04 lw ra,(sp+4) 80041c8: 2b 8b 00 10 lw r11,(sp+16) 80041cc: 2b 8c 00 0c lw r12,(sp+12) 80041d0: 2b 8d 00 08 lw r13,(sp+8) 80041d4: 37 9c 00 18 addi sp,sp,24 80041d8: c3 a0 00 00 ret the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 80041dc: 29 62 00 00 lw r2,(r11+0) 80041e0: 2b 84 00 14 lw r4,(sp+20) (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedwrlock, 80041e4: 65 ab 00 03 cmpei r11,r13,3 80041e8: 34 21 00 10 addi r1,r1,16 80041ec: b9 60 18 00 mv r3,r11 80041f0: b9 80 28 00 mv r5,r12 80041f4: f8 00 06 5e calli 8005b6c <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 80041f8: f8 00 0c 33 calli 80072c4 <_Thread_Enable_dispatch> if ( !do_wait && 80041fc: 5d 6c 00 12 bne r11,r12,8004244 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 8004200: 78 01 08 02 mvhi r1,0x802 8004204: 38 21 29 30 ori r1,r1,0x2930 8004208: 28 21 00 00 lw r1,(r1+0) ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 800420c: 34 02 00 02 mvi r2,2 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 8004210: 28 21 00 34 lw r1,(r1+52) ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 8004214: 44 22 00 08 be r1,r2,8004234 case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 8004218: f8 00 00 11 calli 800425c <_POSIX_RWLock_Translate_core_RWLock_return_code> case OBJECTS_ERROR: break; } return EINVAL; } 800421c: 2b 9d 00 04 lw ra,(sp+4) 8004220: 2b 8b 00 10 lw r11,(sp+16) 8004224: 2b 8c 00 0c lw r12,(sp+12) 8004228: 2b 8d 00 08 lw r13,(sp+8) 800422c: 37 9c 00 18 addi sp,sp,24 8004230: c3 a0 00 00 ret ); _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { switch (status) { 8004234: 45 ab ff e3 be r13,r11,80041c0 <== NEVER TAKEN 8004238: 55 a1 ff f8 bgu r13,r1,8004218 <== NEVER TAKEN 800423c: 34 01 00 74 mvi r1,116 8004240: e3 ff ff e1 bi 80041c4 8004244: 78 01 08 02 mvhi r1,0x802 8004248: 38 21 29 30 ori r1,r1,0x2930 800424c: 28 21 00 00 lw r1,(r1+0) 8004250: 28 21 00 34 lw r1,(r1+52) case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 8004254: f8 00 00 02 calli 800425c <_POSIX_RWLock_Translate_core_RWLock_return_code> 8004258: e3 ff ff f1 bi 800421c 08004bdc : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { if ( !attr ) 8004bdc: 44 20 00 08 be r1,r0,8004bfc return EINVAL; if ( !attr->is_initialized ) 8004be0: 28 23 00 00 lw r3,(r1+0) 8004be4: 44 60 00 06 be r3,r0,8004bfc return EINVAL; switch ( pshared ) { 8004be8: 34 03 00 01 mvi r3,1 8004bec: 54 43 00 04 bgu r2,r3,8004bfc <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 8004bf0: 58 22 00 04 sw (r1+4),r2 8004bf4: 34 01 00 00 mvi r1,0 return 0; 8004bf8: c3 a0 00 00 ret 8004bfc: 34 01 00 16 mvi r1,22 default: return EINVAL; } } 8004c00: c3 a0 00 00 ret 08002488 : int pthread_setcancelstate( int state, int *oldstate ) { 8002488: 37 9c ff f8 addi sp,sp,-8 800248c: 5b 8b 00 08 sw (sp+8),r11 8002490: 5b 9d 00 04 sw (sp+4),ra * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 8002494: 78 03 08 01 mvhi r3,0x801 8002498: 38 63 f8 fc ori r3,r3,0xf8fc 800249c: 28 6b 00 00 lw r11,(r3+0) int pthread_setcancelstate( int state, int *oldstate ) { 80024a0: b8 20 18 00 mv r3,r1 * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 80024a4: 34 01 00 47 mvi r1,71 80024a8: 5d 60 00 18 bne r11,r0,8002508 return EPROTO; if ( !oldstate ) 80024ac: 44 4b 00 16 be r2,r11,8002504 <== NEVER TAKEN return EINVAL; if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE ) 80024b0: 34 01 00 01 mvi r1,1 80024b4: 54 61 00 14 bgu r3,r1,8002504 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80024b8: 78 04 08 01 mvhi r4,0x801 80024bc: 38 84 f8 64 ori r4,r4,0xf864 return EINVAL; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 80024c0: 78 01 08 01 mvhi r1,0x801 80024c4: 28 85 00 00 lw r5,(r4+0) 80024c8: 38 21 f9 20 ori r1,r1,0xf920 80024cc: 28 26 00 00 lw r6,(r1+0) 80024d0: 34 a5 00 01 addi r5,r5,1 80024d4: 58 85 00 00 sw (r4+0),r5 80024d8: 28 c4 01 2c lw r4,(r6+300) _Thread_Disable_dispatch(); *oldstate = thread_support->cancelability_state; 80024dc: 28 85 00 d4 lw r5,(r4+212) thread_support->cancelability_state = state; _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); 80024e0: 28 21 00 00 lw r1,(r1+0) return EINVAL; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; _Thread_Disable_dispatch(); *oldstate = thread_support->cancelability_state; 80024e4: 58 45 00 00 sw (r2+0),r5 thread_support->cancelability_state = state; 80024e8: 58 83 00 d4 sw (r4+212),r3 _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); 80024ec: f8 00 13 51 calli 8007230 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch> 80024f0: b9 60 08 00 mv r1,r11 /* * _Thread_Enable_dispatch is invoked by above call. */ return 0; } 80024f4: 2b 9d 00 04 lw ra,(sp+4) 80024f8: 2b 8b 00 08 lw r11,(sp+8) 80024fc: 37 9c 00 08 addi sp,sp,8 8002500: c3 a0 00 00 ret /* * _Thread_Enable_dispatch is invoked by above call. */ return 0; 8002504: 34 01 00 16 mvi r1,22 } 8002508: 2b 9d 00 04 lw ra,(sp+4) 800250c: 2b 8b 00 08 lw r11,(sp+8) 8002510: 37 9c 00 08 addi sp,sp,8 8002514: c3 a0 00 00 ret 08006358 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 8006358: 37 9c ff dc addi sp,sp,-36 800635c: 5b 8b 00 18 sw (sp+24),r11 8006360: 5b 8c 00 14 sw (sp+20),r12 8006364: 5b 8d 00 10 sw (sp+16),r13 8006368: 5b 8e 00 0c sw (sp+12),r14 800636c: 5b 8f 00 08 sw (sp+8),r15 8006370: 5b 9d 00 04 sw (sp+4),ra int rc; /* * Check all the parameters */ if ( !param ) 8006374: 34 0c 00 16 mvi r12,22 int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 8006378: b8 60 58 00 mv r11,r3 800637c: b8 20 68 00 mv r13,r1 8006380: b8 40 70 00 mv r14,r2 int rc; /* * Check all the parameters */ if ( !param ) 8006384: 44 60 00 08 be r3,r0,80063a4 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 8006388: b8 40 08 00 mv r1,r2 800638c: 37 84 00 20 addi r4,sp,32 8006390: b8 60 10 00 mv r2,r3 8006394: 37 83 00 24 addi r3,sp,36 8006398: f8 00 19 ba calli 800ca80 <_POSIX_Thread_Translate_sched_param> 800639c: b8 20 60 00 mv r12,r1 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 80063a0: 44 20 00 0a be r1,r0,80063c8 case OBJECTS_ERROR: break; } return ESRCH; } 80063a4: b9 80 08 00 mv r1,r12 80063a8: 2b 9d 00 04 lw ra,(sp+4) 80063ac: 2b 8b 00 18 lw r11,(sp+24) 80063b0: 2b 8c 00 14 lw r12,(sp+20) 80063b4: 2b 8d 00 10 lw r13,(sp+16) 80063b8: 2b 8e 00 0c lw r14,(sp+12) 80063bc: 2b 8f 00 08 lw r15,(sp+8) 80063c0: 37 9c 00 24 addi sp,sp,36 80063c4: c3 a0 00 00 ret 80063c8: 78 01 08 02 mvhi r1,0x802 80063cc: 38 21 4a c4 ori r1,r1,0x4ac4 80063d0: b9 a0 10 00 mv r2,r13 80063d4: 37 83 00 1c addi r3,sp,28 80063d8: f8 00 07 1a calli 8008040 <_Objects_Get> 80063dc: b8 20 78 00 mv r15,r1 /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 80063e0: 2b 81 00 1c lw r1,(sp+28) 80063e4: 44 2c 00 03 be r1,r12,80063f0 80063e8: 34 0c 00 03 mvi r12,3 80063ec: e3 ff ff ee bi 80063a4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 80063f0: 29 ed 01 2c lw r13,(r15+300) if ( api->schedpolicy == SCHED_SPORADIC ) 80063f4: 34 01 00 04 mvi r1,4 80063f8: 29 a2 00 80 lw r2,(r13+128) 80063fc: 44 41 00 32 be r2,r1,80064c4 (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; 8006400: 2b 82 00 24 lw r2,(sp+36) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; 8006404: 59 ae 00 80 sw (r13+128),r14 api->schedparam = *param; 8006408: 29 61 00 00 lw r1,(r11+0) the_thread->budget_algorithm = budget_algorithm; 800640c: 59 e2 00 7c sw (r15+124),r2 the_thread->budget_callout = budget_callout; 8006410: 2b 82 00 20 lw r2,(sp+32) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 8006414: 59 a1 00 84 sw (r13+132),r1 the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; 8006418: 59 e2 00 80 sw (r15+128),r2 if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 800641c: 29 62 00 04 lw r2,(r11+4) 8006420: 59 a2 00 88 sw (r13+136),r2 8006424: 29 62 00 08 lw r2,(r11+8) 8006428: 59 a2 00 8c sw (r13+140),r2 800642c: 29 62 00 0c lw r2,(r11+12) 8006430: 59 a2 00 90 sw (r13+144),r2 8006434: 29 62 00 10 lw r2,(r11+16) 8006438: 59 a2 00 94 sw (r13+148),r2 800643c: 29 62 00 14 lw r2,(r11+20) 8006440: 59 a2 00 98 sw (r13+152),r2 8006444: 29 6b 00 18 lw r11,(r11+24) 8006448: 59 ab 00 9c sw (r13+156),r11 the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 800644c: 48 0e 00 05 bg r0,r14,8006460 <== NEVER TAKEN 8006450: 34 02 00 02 mvi r2,2 8006454: 4c 4e 00 0d bge r2,r14,8006488 8006458: 34 02 00 04 mvi r2,4 800645c: 45 c2 00 03 be r14,r2,8006468 <== ALWAYS TAKEN _Watchdog_Remove( &api->Sporadic_timer ); _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); break; } _Thread_Enable_dispatch(); 8006460: f8 00 09 63 calli 80089ec <_Thread_Enable_dispatch> <== NOT EXECUTED return 0; 8006464: e3 ff ff d0 bi 80063a4 <== NOT EXECUTED true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 8006468: 59 a1 00 a0 sw (r13+160),r1 _Watchdog_Remove( &api->Sporadic_timer ); 800646c: 35 a1 00 a4 addi r1,r13,164 8006470: f8 00 0f 5b calli 800a1dc <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 8006474: b9 e0 10 00 mv r2,r15 8006478: 34 01 00 00 mvi r1,0 800647c: fb ff ff 90 calli 80062bc <_POSIX_Threads_Sporadic_budget_TSR> break; } _Thread_Enable_dispatch(); 8006480: f8 00 09 5b calli 80089ec <_Thread_Enable_dispatch> 8006484: e3 ff ff c8 bi 80063a4 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006488: 78 01 08 02 mvhi r1,0x802 800648c: 38 21 48 54 ori r1,r1,0x4854 8006490: 28 21 00 00 lw r1,(r1+0) 8006494: 29 a2 00 84 lw r2,(r13+132) the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 8006498: 34 03 00 01 mvi r3,1 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 800649c: 59 e1 00 78 sw (r15+120),r1 80064a0: 78 01 08 02 mvhi r1,0x802 80064a4: 38 21 40 e4 ori r1,r1,0x40e4 80064a8: 40 24 00 00 lbu r4,(r1+0) the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 80064ac: b9 e0 08 00 mv r1,r15 80064b0: c8 82 10 00 sub r2,r4,r2 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; the_thread->real_priority = 80064b4: 59 e2 00 18 sw (r15+24),r2 _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 80064b8: f8 00 07 c2 calli 80083c0 <_Thread_Change_priority> _Watchdog_Remove( &api->Sporadic_timer ); _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); break; } _Thread_Enable_dispatch(); 80064bc: f8 00 09 4c calli 80089ec <_Thread_Enable_dispatch> 80064c0: e3 ff ff b9 bi 80063a4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 80064c4: 35 a1 00 a4 addi r1,r13,164 80064c8: f8 00 0f 45 calli 800a1dc <_Watchdog_Remove> 80064cc: e3 ff ff cd bi 8006400 080030b0 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 80030b0: 37 9c ff f8 addi sp,sp,-8 80030b4: 5b 8b 00 08 sw (sp+8),r11 80030b8: 5b 9d 00 04 sw (sp+4),ra * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 80030bc: 78 01 08 02 mvhi r1,0x802 80030c0: 38 21 08 f4 ori r1,r1,0x8f4 80030c4: 28 22 00 00 lw r2,(r1+0) 80030c8: 5c 40 00 12 bne r2,r0,8003110 <== NEVER TAKEN 80030cc: 78 01 08 02 mvhi r1,0x802 80030d0: 38 21 08 5c ori r1,r1,0x85c return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 80030d4: 78 0b 08 02 mvhi r11,0x802 80030d8: 28 23 00 00 lw r3,(r1+0) 80030dc: 39 6b 09 18 ori r11,r11,0x918 80030e0: 29 64 00 00 lw r4,(r11+0) 80030e4: 34 63 00 01 addi r3,r3,1 80030e8: 58 23 00 00 sw (r1+0),r3 80030ec: 28 83 01 2c lw r3,(r4+300) _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 80030f0: 28 61 00 d4 lw r1,(r3+212) 80030f4: 5c 22 00 0b bne r1,r2,8003120 <== NEVER TAKEN thread_support->cancelation_requested ) 80030f8: 28 62 00 dc lw r2,(r3+220) 80030fc: 44 41 00 09 be r2,r1,8003120 cancel = true; _Thread_Enable_dispatch(); 8003100: f8 00 08 2b calli 80051ac <_Thread_Enable_dispatch> if ( cancel ) _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 8003104: 29 61 00 00 lw r1,(r11+0) 8003108: 34 02 ff ff mvi r2,-1 800310c: f8 00 18 92 calli 8009354 <_POSIX_Thread_Exit> } 8003110: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8003114: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8003118: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 800311c: c3 a0 00 00 ret <== NOT EXECUTED _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 8003120: f8 00 08 23 calli 80051ac <_Thread_Enable_dispatch> if ( cancel ) _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); } 8003124: 2b 9d 00 04 lw ra,(sp+4) 8003128: 2b 8b 00 08 lw r11,(sp+8) 800312c: 37 9c 00 08 addi sp,sp,8 8003130: c3 a0 00 00 ret 08010400 : * error code - if unsuccessful */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { 8010400: b8 20 18 00 mv r3,r1 if ( !routine ) 8010404: 34 01 00 09 mvi r1,9 8010408: 44 60 00 05 be r3,r0,801041c <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _Watchdog_Nanoseconds_since_tick_handler = routine; 801040c: 78 02 08 04 mvhi r2,0x804 <== NOT EXECUTED 8010410: 38 42 0e 4c ori r2,r2,0xe4c <== NOT EXECUTED 8010414: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED 8010418: 34 01 00 00 mvi r1,0 <== NOT EXECUTED return RTEMS_SUCCESSFUL; } 801041c: c3 a0 00 00 ret 0800c208 : rtems_status_code rtems_io_read( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 800c208: 37 9c ff ec addi sp,sp,-20 800c20c: 5b 8b 00 10 sw (sp+16),r11 800c210: 5b 8c 00 0c sw (sp+12),r12 800c214: 5b 8d 00 08 sw (sp+8),r13 800c218: 5b 9d 00 04 sw (sp+4),ra rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 800c21c: 78 04 08 01 mvhi r4,0x801 800c220: 38 84 f1 90 ori r4,r4,0xf190 800c224: 28 84 00 00 lw r4,(r4+0) rtems_status_code rtems_io_read( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 800c228: b8 20 58 00 mv r11,r1 800c22c: b8 40 60 00 mv r12,r2 rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 800c230: 54 81 00 08 bgu r4,r1,800c250 800c234: 34 01 00 0a mvi r1,10 return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].read_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; } 800c238: 2b 9d 00 04 lw ra,(sp+4) 800c23c: 2b 8b 00 10 lw r11,(sp+16) 800c240: 2b 8c 00 0c lw r12,(sp+12) 800c244: 2b 8d 00 08 lw r13,(sp+8) 800c248: 37 9c 00 14 addi sp,sp,20 800c24c: c3 a0 00 00 ret rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].read_entry; 800c250: 78 01 08 01 mvhi r1,0x801 800c254: 38 21 f1 94 ori r1,r1,0xf194 800c258: 28 2d 00 00 lw r13,(r1+0) 800c25c: b5 6b 08 00 add r1,r11,r11 800c260: b4 2b 08 00 add r1,r1,r11 800c264: 34 02 00 03 mvi r2,3 800c268: 5b 83 00 14 sw (sp+20),r3 800c26c: fb ff cf e1 calli 80001f0 <__ashlsi3> 800c270: b5 a1 08 00 add r1,r13,r1 800c274: 28 24 00 0c lw r4,(r1+12) return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 800c278: 2b 83 00 14 lw r3,(sp+20) 800c27c: b8 80 08 00 mv r1,r4 800c280: 44 80 ff ee be r4,r0,800c238 <== NEVER TAKEN 800c284: b9 60 08 00 mv r1,r11 800c288: b9 80 10 00 mv r2,r12 800c28c: d8 80 00 00 call r4 } 800c290: 2b 9d 00 04 lw ra,(sp+4) 800c294: 2b 8b 00 10 lw r11,(sp+16) 800c298: 2b 8c 00 0c lw r12,(sp+12) 800c29c: 2b 8d 00 08 lw r13,(sp+8) 800c2a0: 37 9c 00 14 addi sp,sp,20 800c2a4: c3 a0 00 00 ret 08004e08 : rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 8004e08: 37 9c ff ec addi sp,sp,-20 8004e0c: 5b 8b 00 10 sw (sp+16),r11 8004e10: 5b 8c 00 0c sw (sp+12),r12 8004e14: 5b 8d 00 08 sw (sp+8),r13 8004e18: 5b 9d 00 04 sw (sp+4),ra rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 8004e1c: 78 04 08 02 mvhi r4,0x802 8004e20: 38 84 69 dc ori r4,r4,0x69dc 8004e24: 28 85 00 00 lw r5,(r4+0) rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; 8004e28: 78 04 08 02 mvhi r4,0x802 8004e2c: 38 84 72 a4 ori r4,r4,0x72a4 rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 8004e30: b8 20 58 00 mv r11,r1 8004e34: b8 40 60 00 mv r12,r2 rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 8004e38: 34 01 00 12 mvi r1,18 rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; 8004e3c: 28 82 00 00 lw r2,(r4+0) if ( rtems_interrupt_is_in_progress() ) 8004e40: 5c a0 00 08 bne r5,r0,8004e60 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 8004e44: 44 65 00 52 be r3,r5,8004f8c return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 8004e48: 58 62 00 00 sw (r3+0),r2 if ( driver_table == NULL ) 8004e4c: 45 80 00 50 be r12,r0,8004f8c static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8004e50: 29 81 00 00 lw r1,(r12+0) 8004e54: 44 20 00 4c be r1,r0,8004f84 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 8004e58: 54 4b 00 08 bgu r2,r11,8004e78 8004e5c: 34 01 00 0a mvi r1,10 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 8004e60: 2b 9d 00 04 lw ra,(sp+4) 8004e64: 2b 8b 00 10 lw r11,(sp+16) 8004e68: 2b 8c 00 0c lw r12,(sp+12) 8004e6c: 2b 8d 00 08 lw r13,(sp+8) 8004e70: 37 9c 00 14 addi sp,sp,20 8004e74: c3 a0 00 00 ret rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8004e78: 78 01 08 02 mvhi r1,0x802 8004e7c: 38 21 69 44 ori r1,r1,0x6944 8004e80: 28 22 00 00 lw r2,(r1+0) 8004e84: 34 42 00 01 addi r2,r2,1 8004e88: 58 22 00 00 sw (r1+0),r2 if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 8004e8c: 5d 60 00 2a bne r11,r0,8004f34 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 8004e90: 28 84 00 00 lw r4,(r4+0) rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 8004e94: 44 8b 00 48 be r4,r11,8004fb4 <== NEVER TAKEN 8004e98: 78 01 08 02 mvhi r1,0x802 8004e9c: 38 21 72 a8 ori r1,r1,0x72a8 8004ea0: 28 2d 00 00 lw r13,(r1+0) 8004ea4: b9 a0 08 00 mv r1,r13 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8004ea8: 28 22 00 00 lw r2,(r1+0) 8004eac: 44 40 00 3f be r2,r0,8004fa8 rtems_device_major_number n = _IO_Number_of_drivers; rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 8004eb0: 35 6b 00 01 addi r11,r11,1 8004eb4: 34 21 00 18 addi r1,r1,24 8004eb8: 54 8b ff fc bgu r4,r11,8004ea8 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 8004ebc: 58 6b 00 00 sw (r3+0),r11 if ( m != n ) 8004ec0: 44 8b 00 3e be r4,r11,8004fb8 8004ec4: b5 6b 08 00 add r1,r11,r11 8004ec8: b4 2b 08 00 add r1,r1,r11 8004ecc: 34 02 00 03 mvi r2,3 8004ed0: fb ff ef 45 calli 8000be4 <__ashlsi3> 8004ed4: b5 a1 08 00 add r1,r13,r1 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 8004ed8: 29 82 00 00 lw r2,(r12+0) 8004edc: 58 22 00 00 sw (r1+0),r2 8004ee0: 29 82 00 04 lw r2,(r12+4) 8004ee4: 58 22 00 04 sw (r1+4),r2 8004ee8: 29 82 00 08 lw r2,(r12+8) 8004eec: 58 22 00 08 sw (r1+8),r2 8004ef0: 29 82 00 0c lw r2,(r12+12) 8004ef4: 58 22 00 0c sw (r1+12),r2 8004ef8: 29 82 00 10 lw r2,(r12+16) 8004efc: 58 22 00 10 sw (r1+16),r2 8004f00: 29 8c 00 14 lw r12,(r12+20) 8004f04: 58 2c 00 14 sw (r1+20),r12 _Thread_Enable_dispatch(); 8004f08: f8 00 07 eb calli 8006eb4 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 8004f0c: 34 02 00 00 mvi r2,0 8004f10: b9 60 08 00 mv r1,r11 8004f14: b8 40 18 00 mv r3,r2 8004f18: f8 00 2b 5d calli 800fc8c } 8004f1c: 2b 9d 00 04 lw ra,(sp+4) 8004f20: 2b 8b 00 10 lw r11,(sp+16) 8004f24: 2b 8c 00 0c lw r12,(sp+12) 8004f28: 2b 8d 00 08 lw r13,(sp+8) 8004f2c: 37 9c 00 14 addi sp,sp,20 8004f30: c3 a0 00 00 ret _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 8004f34: b5 6b 08 00 add r1,r11,r11 8004f38: 34 02 00 03 mvi r2,3 8004f3c: 78 0d 08 02 mvhi r13,0x802 8004f40: b4 2b 08 00 add r1,r1,r11 8004f44: 5b 83 00 14 sw (sp+20),r3 8004f48: 39 ad 72 a8 ori r13,r13,0x72a8 8004f4c: fb ff ef 26 calli 8000be4 <__ashlsi3> 8004f50: 29 a2 00 00 lw r2,(r13+0) static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8004f54: 2b 83 00 14 lw r3,(sp+20) _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 8004f58: b4 41 08 00 add r1,r2,r1 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8004f5c: 28 22 00 00 lw r2,(r1+0) 8004f60: 44 40 00 19 be r2,r0,8004fc4 major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); 8004f64: f8 00 07 d4 calli 8006eb4 <_Thread_Enable_dispatch> 8004f68: 34 01 00 0c mvi r1,12 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 8004f6c: 2b 9d 00 04 lw ra,(sp+4) 8004f70: 2b 8b 00 10 lw r11,(sp+16) 8004f74: 2b 8c 00 0c lw r12,(sp+12) 8004f78: 2b 8d 00 08 lw r13,(sp+8) 8004f7c: 37 9c 00 14 addi sp,sp,20 8004f80: c3 a0 00 00 ret static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8004f84: 29 85 00 04 lw r5,(r12+4) 8004f88: 5c a1 ff b4 bne r5,r1,8004e58 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 8004f8c: 34 01 00 09 mvi r1,9 } 8004f90: 2b 9d 00 04 lw ra,(sp+4) 8004f94: 2b 8b 00 10 lw r11,(sp+16) 8004f98: 2b 8c 00 0c lw r12,(sp+12) 8004f9c: 2b 8d 00 08 lw r13,(sp+8) 8004fa0: 37 9c 00 14 addi sp,sp,20 8004fa4: c3 a0 00 00 ret static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8004fa8: 28 25 00 04 lw r5,(r1+4) 8004fac: 5c a2 ff c1 bne r5,r2,8004eb0 8004fb0: e3 ff ff c3 bi 8004ebc if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 8004fb4: 58 6b 00 00 sw (r3+0),r11 <== NOT EXECUTED if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 8004fb8: f8 00 07 bf calli 8006eb4 <_Thread_Enable_dispatch> 8004fbc: 34 01 00 05 mvi r1,5 return sc; 8004fc0: e3 ff ff a8 bi 8004e60 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 8004fc4: 28 24 00 04 lw r4,(r1+4) 8004fc8: 5c 82 ff e7 bne r4,r2,8004f64 if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 8004fcc: 58 6b 00 00 sw (r3+0),r11 8004fd0: e3 ff ff c2 bi 8004ed8 080056e8 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 80056e8: 37 9c ff e4 addi sp,sp,-28 80056ec: 5b 8b 00 1c sw (sp+28),r11 80056f0: 5b 8c 00 18 sw (sp+24),r12 80056f4: 5b 8d 00 14 sw (sp+20),r13 80056f8: 5b 8e 00 10 sw (sp+16),r14 80056fc: 5b 8f 00 0c sw (sp+12),r15 8005700: 5b 90 00 08 sw (sp+8),r16 8005704: 5b 9d 00 04 sw (sp+4),ra 8005708: b8 20 78 00 mv r15,r1 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 800570c: 44 20 00 18 be r1,r0,800576c <== NEVER TAKEN 8005710: 78 0e 08 02 mvhi r14,0x802 8005714: 39 ce c6 40 ori r14,r14,0xc640 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 8005718: 35 d0 00 10 addi r16,r14,16 if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 800571c: 29 c1 00 00 lw r1,(r14+0) 8005720: 44 20 00 11 be r1,r0,8005764 continue; information = _Objects_Information_table[ api_index ][ 1 ]; 8005724: 28 2d 00 04 lw r13,(r1+4) if ( !information ) 8005728: 45 a0 00 0f be r13,r0,8005764 continue; for ( i=1 ; i <= information->maximum ; i++ ) { 800572c: 2d a3 00 10 lhu r3,(r13+16) 8005730: 44 60 00 0d be r3,r0,8005764 8005734: 34 0c 00 04 mvi r12,4 8005738: 34 0b 00 01 mvi r11,1 the_thread = (Thread_Control *)information->local_table[ i ]; 800573c: 29 a2 00 1c lw r2,(r13+28) information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 8005740: 35 6b 00 01 addi r11,r11,1 the_thread = (Thread_Control *)information->local_table[ i ]; 8005744: b4 4c 10 00 add r2,r2,r12 8005748: 28 42 00 00 lw r2,(r2+0) information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 800574c: 35 8c 00 04 addi r12,r12,4 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) continue; (*routine)(the_thread); 8005750: 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 ) 8005754: 44 40 00 03 be r2,r0,8005760 <== NEVER TAKEN continue; (*routine)(the_thread); 8005758: d9 e0 00 00 call r15 800575c: 2d a3 00 10 lhu r3,(r13+16) information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 8005760: 50 6b ff f7 bgeu r3,r11,800573c 8005764: 35 ce 00 04 addi r14,r14,4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 8005768: 5d d0 ff ed bne r14,r16,800571c (*routine)(the_thread); } } } 800576c: 2b 9d 00 04 lw ra,(sp+4) 8005770: 2b 8b 00 1c lw r11,(sp+28) 8005774: 2b 8c 00 18 lw r12,(sp+24) 8005778: 2b 8d 00 14 lw r13,(sp+20) 800577c: 2b 8e 00 10 lw r14,(sp+16) 8005780: 2b 8f 00 0c lw r15,(sp+12) 8005784: 2b 90 00 08 lw r16,(sp+8) 8005788: 37 9c 00 1c addi sp,sp,28 800578c: c3 a0 00 00 ret 080044d8 : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 80044d8: 37 9c ff e8 addi sp,sp,-24 80044dc: 5b 8b 00 18 sw (sp+24),r11 80044e0: 5b 8c 00 14 sw (sp+20),r12 80044e4: 5b 8d 00 10 sw (sp+16),r13 80044e8: 5b 8e 00 0c sw (sp+12),r14 80044ec: 5b 8f 00 08 sw (sp+8),r15 80044f0: 5b 9d 00 04 sw (sp+4),ra 80044f4: b8 60 70 00 mv r14,r3 int i; /* * Validate parameters and look up information structure. */ if ( !info ) 80044f8: 34 03 00 09 mvi r3,9 80044fc: 45 c0 00 1e be r14,r0,8004574 return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 8004500: f8 00 07 0d calli 8006134 <_Objects_Get_information> 8004504: b8 20 10 00 mv r2,r1 if ( !obj_info ) 8004508: 34 03 00 0a mvi r3,10 800450c: 44 20 00 1a be r1,r0,8004574 return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 8004510: 28 21 00 08 lw r1,(r1+8) info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 8004514: 2c 4d 00 10 lhu r13,(r2+16) return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 8004518: 59 c1 00 00 sw (r14+0),r1 info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; 800451c: 40 41 00 12 lbu r1,(r2+18) info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 8004520: b9 a0 60 00 mv r12,r13 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; 8004524: 31 c1 00 0c sb (r14+12),r1 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; 8004528: 28 41 00 0c lw r1,(r2+12) info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 800452c: 59 cd 00 08 sw (r14+8),r13 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; 8004530: 59 c1 00 04 sw (r14+4),r1 info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 8004534: 45 a0 00 0e be r13,r0,800456c <== NEVER TAKEN 8004538: 28 4f 00 1c lw r15,(r2+28) 800453c: 34 01 00 01 mvi r1,1 8004540: b8 20 58 00 mv r11,r1 8004544: 34 0c 00 00 mvi r12,0 if ( !obj_info->local_table[i] ) 8004548: 34 02 00 02 mvi r2,2 800454c: fb ff f6 92 calli 8001f94 <__ashlsi3> 8004550: b5 e1 08 00 add r1,r15,r1 8004554: 28 22 00 00 lw r2,(r1+0) info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 8004558: 35 6b 00 01 addi r11,r11,1 800455c: b9 60 08 00 mv r1,r11 if ( !obj_info->local_table[i] ) unallocated++; 8004560: 64 42 00 00 cmpei r2,r2,0 8004564: b5 82 60 00 add r12,r12,r2 info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 8004568: 51 ab ff f8 bgeu r13,r11,8004548 if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 800456c: 59 cc 00 10 sw (r14+16),r12 8004570: 34 03 00 00 mvi r3,0 return RTEMS_SUCCESSFUL; } 8004574: b8 60 08 00 mv r1,r3 8004578: 2b 9d 00 04 lw ra,(sp+4) 800457c: 2b 8b 00 18 lw r11,(sp+24) 8004580: 2b 8c 00 14 lw r12,(sp+20) 8004584: 2b 8d 00 10 lw r13,(sp+16) 8004588: 2b 8e 00 0c lw r14,(sp+12) 800458c: 2b 8f 00 08 lw r15,(sp+8) 8004590: 37 9c 00 18 addi sp,sp,24 8004594: c3 a0 00 00 ret 08011490 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 8011490: 37 9c ff d8 addi sp,sp,-40 8011494: 5b 8b 00 18 sw (sp+24),r11 8011498: 5b 8c 00 14 sw (sp+20),r12 801149c: 5b 8d 00 10 sw (sp+16),r13 80114a0: 5b 8e 00 0c sw (sp+12),r14 80114a4: 5b 8f 00 08 sw (sp+8),r15 80114a8: 5b 9d 00 04 sw (sp+4),ra register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 80114ac: 34 07 00 03 mvi r7,3 uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 80114b0: b8 20 60 00 mv r12,r1 80114b4: b8 40 58 00 mv r11,r2 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 80114b8: 44 20 00 3c be r1,r0,80115a8 return RTEMS_INVALID_NAME; if ( !starting_address ) 80114bc: 44 40 00 46 be r2,r0,80115d4 return RTEMS_INVALID_ADDRESS; if ( !id ) 80114c0: 44 c0 00 45 be r6,r0,80115d4 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 80114c4: 64 82 00 00 cmpei r2,r4,0 80114c8: 64 61 00 00 cmpei r1,r3,0 80114cc: b8 41 08 00 or r1,r2,r1 80114d0: 5c 20 00 3f bne r1,r0,80115cc 80114d4: 54 83 00 3e bgu r4,r3,80115cc 80114d8: 20 81 00 07 andi r1,r4,0x7 80114dc: 5c 20 00 3c bne r1,r0,80115cc !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 80114e0: 21 6e 00 07 andi r14,r11,0x7 80114e4: 5d c1 00 3c bne r14,r1,80115d4 80114e8: 78 01 08 04 mvhi r1,0x804 80114ec: 38 21 0c ac ori r1,r1,0xcac 80114f0: 28 22 00 00 lw r2,(r1+0) 80114f4: 34 42 00 01 addi r2,r2,1 80114f8: 58 22 00 00 sw (r1+0),r2 * This function allocates a partition control block from * the inactive chain of free partition control blocks. */ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void ) { return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); 80114fc: 78 01 08 04 mvhi r1,0x804 8011500: 38 21 0a f4 ori r1,r1,0xaf4 8011504: 5b 83 00 28 sw (sp+40),r3 8011508: 5b 84 00 20 sw (sp+32),r4 801150c: 5b 85 00 24 sw (sp+36),r5 8011510: 5b 86 00 1c sw (sp+28),r6 8011514: f8 00 17 65 calli 80172a8 <_Objects_Allocate> 8011518: b8 20 68 00 mv r13,r1 _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 801151c: 2b 83 00 28 lw r3,(sp+40) 8011520: 2b 84 00 20 lw r4,(sp+32) 8011524: 2b 85 00 24 lw r5,(sp+36) 8011528: 2b 86 00 1c lw r6,(sp+28) 801152c: 44 2e 00 2c be r1,r14,80115dc #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 8011530: 58 25 00 1c sw (r1+28),r5 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 8011534: 58 2b 00 10 sw (r1+16),r11 the_partition->length = length; 8011538: 58 23 00 14 sw (r1+20),r3 the_partition->buffer_size = buffer_size; 801153c: 58 24 00 18 sw (r1+24),r4 the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 8011540: b8 80 10 00 mv r2,r4 the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 8011544: 58 2e 00 20 sw (r1+32),r14 _Chain_Initialize( &the_partition->Memory, starting_address, 8011548: b8 60 08 00 mv r1,r3 801154c: 5b 86 00 1c sw (sp+28),r6 8011550: 5b 84 00 20 sw (sp+32),r4 8011554: f8 00 81 6d calli 8031b08 <__udivsi3> 8011558: 2b 84 00 20 lw r4,(sp+32) 801155c: 35 af 00 24 addi r15,r13,36 8011560: b8 20 18 00 mv r3,r1 8011564: b9 60 10 00 mv r2,r11 8011568: b9 e0 08 00 mv r1,r15 801156c: f8 00 10 8d calli 80157a0 <_Chain_Initialize> 8011570: 29 ab 00 08 lw r11,(r13+8) 8011574: 78 01 08 04 mvhi r1,0x804 8011578: 38 21 0a f4 ori r1,r1,0xaf4 801157c: 28 2f 00 1c lw r15,(r1+28) 8011580: 34 02 00 02 mvi r2,2 8011584: 21 61 ff ff andi r1,r11,0xffff 8011588: fb ff f2 5c calli 800def8 <__ashlsi3> &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 801158c: 2b 86 00 1c lw r6,(sp+28) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 8011590: 59 ac 00 0c sw (r13+12),r12 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8011594: b5 e1 08 00 add r1,r15,r1 8011598: 58 cb 00 00 sw (r6+0),r11 801159c: 58 2d 00 00 sw (r1+0),r13 name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 80115a0: f8 00 1c 37 calli 801867c <_Thread_Enable_dispatch> 80115a4: b9 c0 38 00 mv r7,r14 return RTEMS_SUCCESSFUL; } 80115a8: b8 e0 08 00 mv r1,r7 80115ac: 2b 9d 00 04 lw ra,(sp+4) 80115b0: 2b 8b 00 18 lw r11,(sp+24) 80115b4: 2b 8c 00 14 lw r12,(sp+20) 80115b8: 2b 8d 00 10 lw r13,(sp+16) 80115bc: 2b 8e 00 0c lw r14,(sp+12) 80115c0: 2b 8f 00 08 lw r15,(sp+8) 80115c4: 37 9c 00 28 addi sp,sp,40 80115c8: c3 a0 00 00 ret 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 80115cc: 34 07 00 08 mvi r7,8 80115d0: e3 ff ff f6 bi 80115a8 80115d4: 34 07 00 09 mvi r7,9 80115d8: e3 ff ff f4 bi 80115a8 _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { _Thread_Enable_dispatch(); 80115dc: f8 00 1c 28 calli 801867c <_Thread_Enable_dispatch> 80115e0: 34 07 00 05 mvi r7,5 return RTEMS_TOO_MANY; 80115e4: e3 ff ff f1 bi 80115a8 08041eec : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 8041eec: 37 9c ff e0 addi sp,sp,-32 8041ef0: 5b 8b 00 18 sw (sp+24),r11 8041ef4: 5b 8c 00 14 sw (sp+20),r12 8041ef8: 5b 8d 00 10 sw (sp+16),r13 8041efc: 5b 8e 00 0c sw (sp+12),r14 8041f00: 5b 8f 00 08 sw (sp+8),r15 8041f04: 5b 9d 00 04 sw (sp+4),ra 8041f08: b8 20 70 00 mv r14,r1 8041f0c: 78 01 08 07 mvhi r1,0x807 8041f10: b8 40 68 00 mv r13,r2 8041f14: 38 21 6b c0 ori r1,r1,0x6bc0 8041f18: b9 c0 10 00 mv r2,r14 8041f1c: 37 83 00 20 addi r3,sp,32 8041f20: fb ff 23 c8 calli 800ae40 <_Objects_Get> 8041f24: 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 ) { 8041f28: 2b 81 00 20 lw r1,(sp+32) 8041f2c: 44 20 00 0a be r1,r0,8041f54 the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 8041f30: 34 01 00 04 mvi r1,4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8041f34: 2b 9d 00 04 lw ra,(sp+4) 8041f38: 2b 8b 00 18 lw r11,(sp+24) 8041f3c: 2b 8c 00 14 lw r12,(sp+20) 8041f40: 2b 8d 00 10 lw r13,(sp+16) 8041f44: 2b 8e 00 0c lw r14,(sp+12) 8041f48: 2b 8f 00 08 lw r15,(sp+8) 8041f4c: 37 9c 00 20 addi sp,sp,32 8041f50: c3 a0 00 00 ret the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 8041f54: 78 0c 08 07 mvhi r12,0x807 8041f58: 39 8c 61 58 ori r12,r12,0x6158 8041f5c: 29 62 00 40 lw r2,(r11+64) 8041f60: 29 81 00 00 lw r1,(r12+0) 8041f64: 44 41 00 0b be r2,r1,8041f90 _Thread_Enable_dispatch(); 8041f68: fb ff 26 98 calli 800b9c8 <_Thread_Enable_dispatch> 8041f6c: 34 01 00 17 mvi r1,23 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8041f70: 2b 9d 00 04 lw ra,(sp+4) 8041f74: 2b 8b 00 18 lw r11,(sp+24) 8041f78: 2b 8c 00 14 lw r12,(sp+20) 8041f7c: 2b 8d 00 10 lw r13,(sp+16) 8041f80: 2b 8e 00 0c lw r14,(sp+12) 8041f84: 2b 8f 00 08 lw r15,(sp+8) 8041f88: 37 9c 00 20 addi sp,sp,32 8041f8c: c3 a0 00 00 ret if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { 8041f90: 45 a0 00 32 be r13,r0,8042058 } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 8041f94: 90 00 78 00 rcsr r15,IE 8041f98: 34 01 ff fe mvi r1,-2 8041f9c: a1 e1 08 00 and r1,r15,r1 8041fa0: d0 01 00 00 wcsr IE,r1 switch ( the_period->state ) { 8041fa4: 29 61 00 38 lw r1,(r11+56) 8041fa8: 34 02 00 02 mvi r2,2 8041fac: 44 22 00 30 be r1,r2,804206c 8041fb0: 34 02 00 04 mvi r2,4 8041fb4: 44 22 00 19 be r1,r2,8042018 8041fb8: 5c 20 ff de bne r1,r0,8041f30 <== NEVER TAKEN case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 8041fbc: d0 0f 00 00 wcsr IE,r15 /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 8041fc0: b9 60 08 00 mv r1,r11 8041fc4: fb ff ff 1b calli 8041c30 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8041fc8: 78 02 08 04 mvhi r2,0x804 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8041fcc: 34 0c 00 00 mvi r12,0 the_watchdog->routine = routine; 8041fd0: 38 42 20 f8 ori r2,r2,0x20f8 the_period->state = RATE_MONOTONIC_ACTIVE; 8041fd4: 34 03 00 02 mvi r3,2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8041fd8: 78 01 08 07 mvhi r1,0x807 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8041fdc: 59 62 00 2c sw (r11+44),r2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8041fe0: 38 21 61 78 ori r1,r1,0x6178 8041fe4: 59 63 00 38 sw (r11+56),r3 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 8041fe8: 59 6e 00 30 sw (r11+48),r14 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8041fec: 59 6d 00 1c sw (r11+28),r13 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8041ff0: 35 62 00 10 addi r2,r11,16 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8041ff4: 59 6c 00 18 sw (r11+24),r12 the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 8041ff8: 59 6c 00 34 sw (r11+52),r12 _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 8041ffc: 59 6d 00 3c sw (r11+60),r13 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8042000: fb ff 2b cd calli 800cf34 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 8042004: b9 80 08 00 mv r1,r12 8042008: 5b 81 00 1c sw (sp+28),r1 804200c: fb ff 26 6f calli 800b9c8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8042010: 2b 81 00 1c lw r1,(sp+28) 8042014: e3 ff ff d7 bi 8041f70 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 8042018: b9 60 08 00 mv r1,r11 804201c: fb ff ff 6a calli 8041dc4 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 8042020: d0 0f 00 00 wcsr IE,r15 the_period->state = RATE_MONOTONIC_ACTIVE; 8042024: 34 02 00 02 mvi r2,2 8042028: 78 01 08 07 mvhi r1,0x807 804202c: 59 62 00 38 sw (r11+56),r2 8042030: 38 21 61 78 ori r1,r1,0x6178 8042034: 35 62 00 10 addi r2,r11,16 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8042038: 59 6d 00 1c sw (r11+28),r13 the_period->next_length = length; 804203c: 59 6d 00 3c sw (r11+60),r13 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8042040: fb ff 2b bd calli 800cf34 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 8042044: 34 01 00 06 mvi r1,6 8042048: 5b 81 00 1c sw (sp+28),r1 804204c: fb ff 26 5f calli 800b9c8 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 8042050: 2b 81 00 1c lw r1,(sp+28) 8042054: e3 ff ff c7 bi 8041f70 _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 8042058: 29 61 00 38 lw r1,(r11+56) 804205c: 34 02 00 04 mvi r2,4 8042060: 50 41 00 1b bgeu r2,r1,80420cc <== ALWAYS TAKEN 8042064: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8042068: e3 ff ff e8 bi 8042008 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 804206c: b9 60 08 00 mv r1,r11 8042070: fb ff ff 55 calli 8041dc4 <_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; 8042074: 34 01 00 01 mvi r1,1 the_period->next_length = length; 8042078: 59 6d 00 3c sw (r11+60),r13 /* * 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; 804207c: 59 61 00 38 sw (r11+56),r1 the_period->next_length = length; _ISR_Enable( level ); 8042080: d0 0f 00 00 wcsr IE,r15 _Thread_Executing->Wait.id = the_period->Object.id; 8042084: 29 81 00 00 lw r1,(r12+0) 8042088: 29 63 00 08 lw r3,(r11+8) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 804208c: 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; 8042090: 58 23 00 20 sw (r1+32),r3 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 8042094: fb ff 29 57 calli 800c5f0 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 8042098: 90 00 08 00 rcsr r1,IE 804209c: 34 02 ff fe mvi r2,-2 80420a0: a0 22 10 00 and r2,r1,r2 80420a4: d0 02 00 00 wcsr IE,r2 local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 80420a8: 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; 80420ac: 29 62 00 38 lw r2,(r11+56) the_period->state = RATE_MONOTONIC_ACTIVE; 80420b0: 59 63 00 38 sw (r11+56),r3 _ISR_Enable( level ); 80420b4: 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 ) 80420b8: 34 01 00 03 mvi r1,3 80420bc: 44 41 00 0b be r2,r1,80420e8 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); _Thread_Enable_dispatch(); 80420c0: fb ff 26 42 calli 800b9c8 <_Thread_Enable_dispatch> 80420c4: 34 01 00 00 mvi r1,0 return RTEMS_SUCCESSFUL; 80420c8: e3 ff ff aa bi 8041f70 _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 80420cc: 78 0b 08 06 mvhi r11,0x806 80420d0: 34 02 00 02 mvi r2,2 80420d4: fb fe fc 23 calli 8001160 <__ashlsi3> 80420d8: 39 6b f8 28 ori r11,r11,0xf828 80420dc: b5 61 08 00 add r1,r11,r1 80420e0: 28 21 00 00 lw r1,(r1+0) 80420e4: e3 ff ff c9 bi 8042008 /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 80420e8: 29 81 00 00 lw r1,(r12+0) 80420ec: 34 02 40 00 mvi r2,16384 80420f0: fb ff b2 c6 calli 802ec08 <_Thread_Clear_state> 80420f4: e3 ff ff f3 bi 80420c0 0802d1a8 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 802d1a8: 37 9c ff 5c addi sp,sp,-164 802d1ac: 5b 8b 00 44 sw (sp+68),r11 802d1b0: 5b 8c 00 40 sw (sp+64),r12 802d1b4: 5b 8d 00 3c sw (sp+60),r13 802d1b8: 5b 8e 00 38 sw (sp+56),r14 802d1bc: 5b 8f 00 34 sw (sp+52),r15 802d1c0: 5b 90 00 30 sw (sp+48),r16 802d1c4: 5b 91 00 2c sw (sp+44),r17 802d1c8: 5b 92 00 28 sw (sp+40),r18 802d1cc: 5b 93 00 24 sw (sp+36),r19 802d1d0: 5b 94 00 20 sw (sp+32),r20 802d1d4: 5b 95 00 1c sw (sp+28),r21 802d1d8: 5b 96 00 18 sw (sp+24),r22 802d1dc: 5b 97 00 14 sw (sp+20),r23 802d1e0: 5b 98 00 10 sw (sp+16),r24 802d1e4: 5b 99 00 0c sw (sp+12),r25 802d1e8: 5b 9b 00 08 sw (sp+8),fp 802d1ec: 5b 9d 00 04 sw (sp+4),ra 802d1f0: b8 40 68 00 mv r13,r2 802d1f4: b8 20 78 00 mv r15,r1 rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 802d1f8: 44 40 00 2b be r2,r0,802d2a4 <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 802d1fc: 78 02 08 06 mvhi r2,0x806 802d200: 38 42 bc cc ori r2,r2,0xbccc 802d204: d9 a0 00 00 call r13 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 802d208: 78 02 08 06 mvhi r2,0x806 802d20c: 38 42 bc ec ori r2,r2,0xbcec 802d210: b9 e0 08 00 mv r1,r15 802d214: d9 a0 00 00 call r13 (*print)( context, "--- Wall times are in seconds ---\n" ); 802d218: 78 02 08 06 mvhi r2,0x806 802d21c: 38 42 bd 10 ori r2,r2,0xbd10 802d220: b9 e0 08 00 mv r1,r15 802d224: d9 a0 00 00 call r13 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 802d228: 78 02 08 06 mvhi r2,0x806 802d22c: 38 42 bd 34 ori r2,r2,0xbd34 802d230: b9 e0 08 00 mv r1,r15 802d234: d9 a0 00 00 call r13 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 802d238: 78 02 08 06 mvhi r2,0x806 802d23c: b9 e0 08 00 mv r1,r15 /* * 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 ; 802d240: 78 0c 08 07 mvhi r12,0x807 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 802d244: 38 42 bd 80 ori r2,r2,0xbd80 /* * 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 ; 802d248: 39 8c 6b c0 ori r12,r12,0x6bc0 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 802d24c: d9 a0 00 00 call r13 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 802d250: 29 81 00 0c lw r1,(r12+12) 802d254: 29 8b 00 08 lw r11,(r12+8) 802d258: 55 61 00 13 bgu r11,r1,802d2a4 <== NEVER TAKEN 802d25c: 37 90 00 48 addi r16,sp,72 status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 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 ); 802d260: 37 96 00 80 addi r22,sp,128 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 802d264: 37 91 00 a0 addi r17,sp,160 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 802d268: 78 15 08 06 mvhi r21,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 ); 802d26c: 37 94 00 60 addi r20,sp,96 802d270: 37 92 00 98 addi r18,sp,152 (*print)( context, 802d274: 78 1b 08 06 mvhi fp,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); 802d278: 37 99 00 78 addi r25,sp,120 (*print)( context, 802d27c: 78 18 08 06 mvhi r24,0x806 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 802d280: 78 13 08 06 mvhi r19,0x806 * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 802d284: b9 60 08 00 mv r1,r11 802d288: ba 00 10 00 mv r2,r16 802d28c: f8 00 52 02 calli 8041a94 802d290: b8 20 70 00 mv r14,r1 if ( status != RTEMS_SUCCESSFUL ) 802d294: 44 20 00 17 be r1,r0,802d2f0 /* * 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 ; 802d298: 29 85 00 0c lw r5,(r12+12) id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 802d29c: 35 6b 00 01 addi r11,r11,1 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 802d2a0: 50 ab ff f9 bgeu r5,r11,802d284 the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 802d2a4: 2b 9d 00 04 lw ra,(sp+4) 802d2a8: 2b 8b 00 44 lw r11,(sp+68) 802d2ac: 2b 8c 00 40 lw r12,(sp+64) 802d2b0: 2b 8d 00 3c lw r13,(sp+60) 802d2b4: 2b 8e 00 38 lw r14,(sp+56) 802d2b8: 2b 8f 00 34 lw r15,(sp+52) 802d2bc: 2b 90 00 30 lw r16,(sp+48) 802d2c0: 2b 91 00 2c lw r17,(sp+44) 802d2c4: 2b 92 00 28 lw r18,(sp+40) 802d2c8: 2b 93 00 24 lw r19,(sp+36) 802d2cc: 2b 94 00 20 lw r20,(sp+32) 802d2d0: 2b 95 00 1c lw r21,(sp+28) 802d2d4: 2b 96 00 18 lw r22,(sp+24) 802d2d8: 2b 97 00 14 lw r23,(sp+20) 802d2dc: 2b 98 00 10 lw r24,(sp+16) 802d2e0: 2b 99 00 0c lw r25,(sp+12) 802d2e4: 2b 9b 00 08 lw fp,(sp+8) 802d2e8: 37 9c 00 a4 addi sp,sp,164 802d2ec: c3 a0 00 00 ret status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 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 ); 802d2f0: ba c0 10 00 mv r2,r22 802d2f4: b9 60 08 00 mv r1,r11 802d2f8: f8 00 52 1a calli 8041b60 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 802d2fc: 2b 81 00 80 lw r1,(sp+128) 802d300: ba 20 18 00 mv r3,r17 802d304: 34 02 00 05 mvi r2,5 802d308: fb ff 6d d0 calli 8008a48 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 802d30c: 2b 85 00 48 lw r5,(sp+72) 802d310: 2b 86 00 4c lw r6,(sp+76) 802d314: ba a0 10 00 mv r2,r21 802d318: b9 60 18 00 mv r3,r11 802d31c: 38 42 bd cc ori r2,r2,0xbdcc 802d320: b9 e0 08 00 mv r1,r15 802d324: ba 20 20 00 mv r4,r17 802d328: d9 a0 00 00 call r13 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 802d32c: 2b 85 00 48 lw r5,(sp+72) (*print)( context, "\n" ); 802d330: ba 60 10 00 mv r2,r19 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 ); 802d334: ba 40 18 00 mv r3,r18 802d338: ba 80 08 00 mv r1,r20 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 802d33c: 38 42 d7 64 ori r2,r2,0xd764 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 802d340: 5c ae 00 04 bne r5,r14,802d350 (*print)( context, "\n" ); 802d344: b9 e0 08 00 mv r1,r15 802d348: d9 a0 00 00 call r13 continue; 802d34c: e3 ff ff d3 bi 802d298 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 ); 802d350: b8 a0 10 00 mv r2,r5 802d354: f8 00 08 02 calli 802f35c <_Timespec_Divide_by_integer> (*print)( context, 802d358: 2b 81 00 54 lw r1,(sp+84) 802d35c: 34 02 03 e8 mvi r2,1000 802d360: f8 00 df 5b calli 80650cc <__divsi3> 802d364: b8 20 b8 00 mv r23,r1 802d368: 2b 81 00 5c lw r1,(sp+92) 802d36c: 34 02 03 e8 mvi r2,1000 802d370: f8 00 df 57 calli 80650cc <__divsi3> 802d374: b8 20 70 00 mv r14,r1 802d378: 2b 81 00 9c lw r1,(sp+156) 802d37c: 34 02 03 e8 mvi r2,1000 802d380: f8 00 df 53 calli 80650cc <__divsi3> 802d384: 2b 85 00 58 lw r5,(sp+88) 802d388: 2b 87 00 98 lw r7,(sp+152) 802d38c: 2b 83 00 50 lw r3,(sp+80) 802d390: bb 60 10 00 mv r2,fp 802d394: b8 20 40 00 mv r8,r1 802d398: ba e0 20 00 mv r4,r23 802d39c: b9 c0 30 00 mv r6,r14 802d3a0: b9 e0 08 00 mv r1,r15 802d3a4: 38 42 bd e4 ori r2,r2,0xbde4 802d3a8: d9 a0 00 00 call r13 struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 802d3ac: 2b 82 00 48 lw r2,(sp+72) 802d3b0: ba 40 18 00 mv r3,r18 802d3b4: bb 20 08 00 mv r1,r25 802d3b8: f8 00 07 e9 calli 802f35c <_Timespec_Divide_by_integer> (*print)( context, 802d3bc: 2b 81 00 6c lw r1,(sp+108) 802d3c0: 34 02 03 e8 mvi r2,1000 802d3c4: f8 00 df 42 calli 80650cc <__divsi3> 802d3c8: b8 20 b8 00 mv r23,r1 802d3cc: 2b 81 00 74 lw r1,(sp+116) 802d3d0: 34 02 03 e8 mvi r2,1000 802d3d4: f8 00 df 3e calli 80650cc <__divsi3> 802d3d8: b8 20 70 00 mv r14,r1 802d3dc: 2b 81 00 9c lw r1,(sp+156) 802d3e0: 34 02 03 e8 mvi r2,1000 802d3e4: f8 00 df 3a calli 80650cc <__divsi3> 802d3e8: 2b 83 00 68 lw r3,(sp+104) 802d3ec: 2b 85 00 70 lw r5,(sp+112) 802d3f0: 2b 87 00 98 lw r7,(sp+152) 802d3f4: bb 00 10 00 mv r2,r24 802d3f8: b8 20 40 00 mv r8,r1 802d3fc: ba e0 20 00 mv r4,r23 802d400: b9 e0 08 00 mv r1,r15 802d404: b9 c0 30 00 mv r6,r14 802d408: 38 42 be 04 ori r2,r2,0xbe04 802d40c: d9 a0 00 00 call r13 802d410: e3 ff ff a2 bi 802d298 0802d438 : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 802d438: 37 9c ff f4 addi sp,sp,-12 802d43c: 5b 8b 00 0c sw (sp+12),r11 802d440: 5b 8c 00 08 sw (sp+8),r12 802d444: 5b 9d 00 04 sw (sp+4),ra rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 802d448: 78 01 08 07 mvhi r1,0x807 802d44c: 38 21 60 9c ori r1,r1,0x609c 802d450: 28 22 00 00 lw r2,(r1+0) 802d454: 34 42 00 01 addi r2,r2,1 802d458: 58 22 00 00 sw (r1+0),r2 /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 802d45c: 78 0c 08 07 mvhi r12,0x807 802d460: 39 8c 6b c0 ori r12,r12,0x6bc0 802d464: 29 8b 00 08 lw r11,(r12+8) 802d468: 29 81 00 0c lw r1,(r12+12) 802d46c: 55 61 00 06 bgu r11,r1,802d484 <== NEVER TAKEN id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_reset_statistics( id ); 802d470: b9 60 08 00 mv r1,r11 802d474: f8 00 00 0a calli 802d49c /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 802d478: 29 81 00 0c lw r1,(r12+12) id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 802d47c: 35 6b 00 01 addi r11,r11,1 /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 802d480: 50 2b ff fc bgeu r1,r11,802d470 } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 802d484: fb ff 79 51 calli 800b9c8 <_Thread_Enable_dispatch> } 802d488: 2b 9d 00 04 lw ra,(sp+4) 802d48c: 2b 8b 00 0c lw r11,(sp+12) 802d490: 2b 8c 00 08 lw r12,(sp+8) 802d494: 37 9c 00 0c addi sp,sp,12 802d498: c3 a0 00 00 ret 08012808 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 8012808: 37 9c ff e8 addi sp,sp,-24 801280c: 5b 8b 00 14 sw (sp+20),r11 8012810: 5b 8c 00 10 sw (sp+16),r12 8012814: 5b 8d 00 0c sw (sp+12),r13 8012818: 5b 8e 00 08 sw (sp+8),r14 801281c: 5b 9d 00 04 sw (sp+4),ra 8012820: b8 40 60 00 mv r12,r2 8012824: b8 20 68 00 mv r13,r1 8012828: b8 60 70 00 mv r14,r3 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 801282c: 44 40 00 1b be r2,r0,8012898 return RTEMS_INVALID_ADDRESS; if ( !size ) 8012830: 44 60 00 1a be r3,r0,8012898 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 8012834: 78 0b 08 04 mvhi r11,0x804 8012838: 39 6b 0d 60 ori r11,r11,0xd60 801283c: 29 61 00 00 lw r1,(r11+0) 8012840: f8 00 0b 90 calli 8015680 <_API_Mutex_Lock> 8012844: 78 01 08 04 mvhi r1,0x804 8012848: b9 a0 10 00 mv r2,r13 801284c: 38 21 0b 74 ori r1,r1,0xb74 8012850: 37 83 00 18 addi r3,sp,24 8012854: f8 00 14 4a calli 801797c <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 8012858: 2b 8d 00 18 lw r13,(sp+24) 801285c: 45 a0 00 18 be r13,r0,80128bc 8012860: 34 01 00 01 mvi r1,1 8012864: 34 0c 00 04 mvi r12,4 8012868: 45 a1 00 02 be r13,r1,8012870 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 801286c: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 8012870: 29 61 00 00 lw r1,(r11+0) 8012874: f8 00 0b 9f calli 80156f0 <_API_Mutex_Unlock> return return_status; } 8012878: b9 80 08 00 mv r1,r12 801287c: 2b 9d 00 04 lw ra,(sp+4) 8012880: 2b 8b 00 14 lw r11,(sp+20) 8012884: 2b 8c 00 10 lw r12,(sp+16) 8012888: 2b 8d 00 0c lw r13,(sp+12) 801288c: 2b 8e 00 08 lw r14,(sp+8) 8012890: 37 9c 00 18 addi sp,sp,24 8012894: c3 a0 00 00 ret return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); return return_status; 8012898: 34 0c 00 09 mvi r12,9 } 801289c: b9 80 08 00 mv r1,r12 80128a0: 2b 9d 00 04 lw ra,(sp+4) 80128a4: 2b 8b 00 14 lw r11,(sp+20) 80128a8: 2b 8c 00 10 lw r12,(sp+16) 80128ac: 2b 8d 00 0c lw r13,(sp+12) 80128b0: 2b 8e 00 08 lw r14,(sp+8) 80128b4: 37 9c 00 18 addi sp,sp,24 80128b8: c3 a0 00 00 ret the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 80128bc: b9 80 10 00 mv r2,r12 80128c0: 34 21 00 68 addi r1,r1,104 80128c4: b9 c0 18 00 mv r3,r14 80128c8: f8 00 12 13 calli 8017114 <_Heap_Size_of_alloc_area> 80128cc: 34 0c 00 09 mvi r12,9 80128d0: 44 2d ff e8 be r1,r13,8012870 <== NEVER TAKEN 80128d4: 34 0c 00 00 mvi r12,0 80128d8: e3 ff ff e6 bi 8012870 0801318c : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 801318c: 37 9c ff f4 addi sp,sp,-12 8013190: 5b 8b 00 08 sw (sp+8),r11 8013194: 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 ) 8013198: 34 03 00 0a mvi r3,10 rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 801319c: 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 ) 80131a0: 5c 40 00 06 bne r2,r0,80131b8 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80131a4: b8 60 08 00 mv r1,r3 80131a8: 2b 9d 00 04 lw ra,(sp+4) 80131ac: 2b 8b 00 08 lw r11,(sp+8) 80131b0: 37 9c 00 0c addi sp,sp,12 80131b4: c3 a0 00 00 ret ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 80131b8: 37 82 00 0c addi r2,sp,12 80131bc: f8 00 15 50 calli 80186fc <_Thread_Get> switch ( location ) { 80131c0: 2b 84 00 0c lw r4,(sp+12) 80131c4: 34 03 00 04 mvi r3,4 80131c8: 5c 80 ff f7 bne r4,r0,80131a4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 80131cc: 28 22 01 28 lw r2,(r1+296) asr = &api->Signal; 80131d0: 28 43 00 0c lw r3,(r2+12) 80131d4: 44 64 00 28 be r3,r4,8013274 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 80131d8: 40 43 00 08 lbu r3,(r2+8) 80131dc: 44 60 00 17 be r3,r0,8013238 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 80131e0: 90 00 18 00 rcsr r3,IE 80131e4: 34 04 ff fe mvi r4,-2 80131e8: a0 64 20 00 and r4,r3,r4 80131ec: d0 04 00 00 wcsr IE,r4 *signal_set |= signals; 80131f0: 28 44 00 14 lw r4,(r2+20) 80131f4: b8 8b 58 00 or r11,r4,r11 80131f8: 58 4b 00 14 sw (r2+20),r11 _ISR_Enable( _level ); 80131fc: d0 03 00 00 wcsr IE,r3 _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 ) ) 8013200: 78 02 08 04 mvhi r2,0x804 8013204: 38 42 0d 44 ori r2,r2,0xd44 8013208: 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; 801320c: 34 03 00 01 mvi r3,1 8013210: 30 23 00 74 sb (r1+116),r3 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 8013214: 44 40 00 11 be r2,r0,8013258 8013218: 78 02 08 04 mvhi r2,0x804 801321c: 38 42 0d 68 ori r2,r2,0xd68 8013220: 28 42 00 00 lw r2,(r2+0) 8013224: 5c 22 00 0d bne r1,r2,8013258 <== NEVER TAKEN _ISR_Signals_to_thread_executing = true; 8013228: 78 01 08 04 mvhi r1,0x804 801322c: 38 21 0e 00 ori r1,r1,0xe00 8013230: 30 23 00 00 sb (r1+0),r3 8013234: e0 00 00 09 bi 8013258 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 8013238: 90 00 08 00 rcsr r1,IE 801323c: 34 03 ff fe mvi r3,-2 8013240: a0 23 18 00 and r3,r1,r3 8013244: d0 03 00 00 wcsr IE,r3 *signal_set |= signals; 8013248: 28 43 00 18 lw r3,(r2+24) 801324c: b8 6b 58 00 or r11,r3,r11 8013250: 58 4b 00 18 sw (r2+24),r11 _ISR_Enable( _level ); 8013254: d0 01 00 00 wcsr IE,r1 } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 8013258: f8 00 15 09 calli 801867c <_Thread_Enable_dispatch> 801325c: 34 03 00 00 mvi r3,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8013260: b8 60 08 00 mv r1,r3 8013264: 2b 9d 00 04 lw ra,(sp+4) 8013268: 2b 8b 00 08 lw r11,(sp+8) 801326c: 37 9c 00 0c addi sp,sp,12 8013270: c3 a0 00 00 ret _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 8013274: f8 00 15 02 calli 801867c <_Thread_Enable_dispatch> 8013278: 34 03 00 0b mvi r3,11 return RTEMS_NOT_DEFINED; 801327c: e3 ff ff ca bi 80131a4 0800be3c : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 800be3c: 37 9c ff e0 addi sp,sp,-32 800be40: 5b 8b 00 20 sw (sp+32),r11 800be44: 5b 8c 00 1c sw (sp+28),r12 800be48: 5b 8d 00 18 sw (sp+24),r13 800be4c: 5b 8e 00 14 sw (sp+20),r14 800be50: 5b 8f 00 10 sw (sp+16),r15 800be54: 5b 90 00 0c sw (sp+12),r16 800be58: 5b 91 00 08 sw (sp+8),r17 800be5c: 5b 9d 00 04 sw (sp+4),ra 800be60: b8 40 68 00 mv r13,r2 800be64: b8 60 80 00 mv r16,r3 800be68: b8 20 78 00 mv r15,r1 ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 800be6c: 34 02 00 09 mvi r2,9 800be70: 44 60 00 44 be r3,r0,800bf80 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 800be74: 78 02 08 01 mvhi r2,0x801 800be78: 38 42 e9 60 ori r2,r2,0xe960 800be7c: 28 4b 00 00 lw r11,(r2+0) api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800be80: 34 0e 00 00 mvi r14,0 800be84: 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 ]; 800be88: 29 6c 01 28 lw r12,(r11+296) asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800be8c: 44 2e 00 55 be r1,r14,800bfe0 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800be90: 29 61 00 7c lw r1,(r11+124) 800be94: 5c 20 00 4e bne r1,r0,800bfcc if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 800be98: 41 81 00 08 lbu r1,(r12+8) 800be9c: 34 11 00 00 mvi r17,0 800bea0: 44 31 00 43 be r1,r17,800bfac 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(); 800bea4: fb ff e8 ec calli 8006254 <_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; 800bea8: ba 21 88 00 or r17,r17,r1 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 800beac: ba 2e 88 00 or r17,r17,r14 800beb0: 5a 11 00 00 sw (r16+0),r17 /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 800beb4: 21 a1 01 00 andi r1,r13,0x100 800beb8: 44 20 00 07 be r1,r0,800bed4 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 800bebc: b9 e0 08 00 mv r1,r15 800bec0: 34 02 00 08 mvi r2,8 800bec4: fb ff d0 f3 calli 8000290 <__lshrsi3> 800bec8: 18 21 00 01 xori r1,r1,0x1 800becc: 20 21 00 01 andi r1,r1,0x1 800bed0: 31 61 00 75 sb (r11+117),r1 if ( mask & RTEMS_TIMESLICE_MASK ) { 800bed4: 21 a1 02 00 andi r1,r13,0x200 800bed8: 44 20 00 09 be r1,r0,800befc if ( _Modes_Is_timeslice(mode_set) ) { 800bedc: 21 e1 02 00 andi r1,r15,0x200 800bee0: 44 20 00 44 be r1,r0,800bff0 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800bee4: 78 01 08 01 mvhi r1,0x801 800bee8: 38 21 e8 34 ori r1,r1,0xe834 800beec: 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; 800bef0: 34 02 00 01 mvi r2,1 800bef4: 59 62 00 7c sw (r11+124),r2 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800bef8: 59 61 00 78 sw (r11+120),r1 /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 800befc: 21 a1 00 01 andi r1,r13,0x1 800bf00: 44 20 00 04 be r1,r0,800bf10 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 800bf04: 19 e1 00 01 xori r1,r15,0x1 800bf08: 20 21 00 01 andi r1,r1,0x1 800bf0c: d0 01 00 00 wcsr IE,r1 */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 800bf10: 21 ad 04 00 andi r13,r13,0x400 800bf14: 45 a0 00 14 be r13,r0,800bf64 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 800bf18: 34 02 00 0a mvi r2,10 800bf1c: b9 e0 08 00 mv r1,r15 800bf20: fb ff d0 dc calli 8000290 <__lshrsi3> if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 800bf24: 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( 800bf28: 18 21 00 01 xori r1,r1,0x1 800bf2c: 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; 800bf30: 44 41 00 0d be r2,r1,800bf64 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; 800bf34: 31 81 00 08 sb (r12+8),r1 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 800bf38: 90 00 08 00 rcsr r1,IE 800bf3c: 34 02 ff fe mvi r2,-2 800bf40: a0 22 10 00 and r2,r1,r2 800bf44: d0 02 00 00 wcsr IE,r2 _signals = information->signals_pending; 800bf48: 29 82 00 18 lw r2,(r12+24) information->signals_pending = information->signals_posted; 800bf4c: 29 83 00 14 lw r3,(r12+20) information->signals_posted = _signals; 800bf50: 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; 800bf54: 59 83 00 18 sw (r12+24),r3 information->signals_posted = _signals; _ISR_Enable( _level ); 800bf58: 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; 800bf5c: 29 81 00 14 lw r1,(r12+20) 800bf60: 5c 20 00 2e bne r1,r0,800c018 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; 800bf64: 34 0b 00 00 mvi r11,0 } } } if ( _System_state_Is_up( _System_state_Get() ) ) 800bf68: 78 01 08 01 mvhi r1,0x801 800bf6c: 38 21 ea 40 ori r1,r1,0xea40 800bf70: 28 22 00 00 lw r2,(r1+0) 800bf74: 34 01 00 03 mvi r1,3 800bf78: 44 41 00 22 be r2,r1,800c000 <== ALWAYS TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); 800bf7c: 34 02 00 00 mvi r2,0 return RTEMS_SUCCESSFUL; } 800bf80: b8 40 08 00 mv r1,r2 800bf84: 2b 9d 00 04 lw ra,(sp+4) 800bf88: 2b 8b 00 20 lw r11,(sp+32) 800bf8c: 2b 8c 00 1c lw r12,(sp+28) 800bf90: 2b 8d 00 18 lw r13,(sp+24) 800bf94: 2b 8e 00 14 lw r14,(sp+20) 800bf98: 2b 8f 00 10 lw r15,(sp+16) 800bf9c: 2b 90 00 0c lw r16,(sp+12) 800bfa0: 2b 91 00 08 lw r17,(sp+8) 800bfa4: 37 9c 00 20 addi sp,sp,32 800bfa8: c3 a0 00 00 ret 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(); 800bfac: fb ff e8 aa calli 8006254 <_CPU_ISR_Get_level> if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 800bfb0: 34 11 04 00 mvi r17,1024 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; 800bfb4: ba 21 88 00 or r17,r17,r1 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 800bfb8: ba 2e 88 00 or r17,r17,r14 800bfbc: 5a 11 00 00 sw (r16+0),r17 /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 800bfc0: 21 a1 01 00 andi r1,r13,0x100 800bfc4: 44 20 ff c4 be r1,r0,800bed4 800bfc8: e3 ff ff bd bi 800bebc if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 800bfcc: 41 81 00 08 lbu r1,(r12+8) 800bfd0: 34 11 00 00 mvi r17,0 old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 800bfd4: 39 ce 02 00 ori r14,r14,0x200 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 800bfd8: 5c 31 ff b3 bne r1,r17,800bea4 800bfdc: e3 ff ff f4 bi 800bfac old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800bfe0: 29 61 00 7c lw r1,(r11+124) executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800bfe4: 34 0e 01 00 mvi r14,256 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800bfe8: 44 20 ff ac be r1,r0,800be98 800bfec: e3 ff ff f8 bi 800bfcc if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800bff0: 59 61 00 7c sw (r11+124),r1 /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 800bff4: 21 a1 00 01 andi r1,r13,0x1 800bff8: 44 20 ff c6 be r1,r0,800bf10 800bffc: e3 ff ff c2 bi 800bf04 } } } if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 800c000: f8 00 01 23 calli 800c48c <_Thread_Evaluate_mode> 800c004: 5c 20 00 02 bne r1,r0,800c00c 800c008: 45 61 ff dd be r11,r1,800bf7c _Thread_Dispatch(); 800c00c: fb ff e1 50 calli 800454c <_Thread_Dispatch> 800c010: 34 02 00 00 mvi r2,0 800c014: e3 ff ff db bi 800bf80 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; 800c018: 34 01 00 01 mvi r1,1 800c01c: 31 61 00 74 sb (r11+116),r1 800c020: b8 20 58 00 mv r11,r1 800c024: e3 ff ff d1 bi 800bf68 08008f28 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 8008f28: 37 9c ff f0 addi sp,sp,-16 8008f2c: 5b 8b 00 0c sw (sp+12),r11 8008f30: 5b 8c 00 08 sw (sp+8),r12 8008f34: 5b 9d 00 04 sw (sp+4),ra 8008f38: b8 40 58 00 mv r11,r2 8008f3c: b8 60 60 00 mv r12,r3 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 8008f40: 44 40 00 0c be r2,r0,8008f70 */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 8008f44: 78 02 08 02 mvhi r2,0x802 8008f48: 38 42 70 c0 ori r2,r2,0x70c0 8008f4c: 40 42 00 00 lbu r2,(r2+0) 8008f50: 50 4b 00 08 bgeu r2,r11,8008f70 8008f54: 34 04 00 13 mvi r4,19 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8008f58: b8 80 08 00 mv r1,r4 8008f5c: 2b 9d 00 04 lw ra,(sp+4) 8008f60: 2b 8b 00 0c lw r11,(sp+12) 8008f64: 2b 8c 00 08 lw r12,(sp+8) 8008f68: 37 9c 00 10 addi sp,sp,16 8008f6c: c3 a0 00 00 ret if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 8008f70: 34 04 00 09 mvi r4,9 8008f74: 45 80 ff f9 be r12,r0,8008f58 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 8008f78: 37 82 00 10 addi r2,sp,16 8008f7c: f8 00 0a 43 calli 800b888 <_Thread_Get> switch ( location ) { 8008f80: 2b 82 00 10 lw r2,(sp+16) 8008f84: 34 04 00 04 mvi r4,4 8008f88: 5c 40 ff f4 bne r2,r0,8008f58 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 8008f8c: 28 23 00 14 lw r3,(r1+20) 8008f90: 59 83 00 00 sw (r12+0),r3 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 8008f94: 45 62 00 09 be r11,r2,8008fb8 the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 8008f98: 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; 8008f9c: 58 2b 00 18 sw (r1+24),r11 if ( the_thread->resource_count == 0 || 8008fa0: 44 40 00 03 be r2,r0,8008fac the_thread->current_priority > new_priority ) 8008fa4: 28 22 00 14 lw r2,(r1+20) 8008fa8: 51 62 00 04 bgeu r11,r2,8008fb8 <== ALWAYS TAKEN _Thread_Change_priority( the_thread, new_priority, false ); 8008fac: b9 60 10 00 mv r2,r11 8008fb0: 34 03 00 00 mvi r3,0 8008fb4: f8 00 08 56 calli 800b10c <_Thread_Change_priority> } _Thread_Enable_dispatch(); 8008fb8: f8 00 0a 14 calli 800b808 <_Thread_Enable_dispatch> 8008fbc: 34 04 00 00 mvi r4,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8008fc0: b8 80 08 00 mv r1,r4 8008fc4: 2b 9d 00 04 lw ra,(sp+4) 8008fc8: 2b 8b 00 0c lw r11,(sp+12) 8008fcc: 2b 8c 00 08 lw r12,(sp+8) 8008fd0: 37 9c 00 10 addi sp,sp,16 8008fd4: c3 a0 00 00 ret 0802db70 : rtems_status_code rtems_task_variable_add( rtems_id tid, void **ptr, void (*dtor)(void *) ) { 802db70: 37 9c ff ec addi sp,sp,-20 802db74: 5b 8b 00 10 sw (sp+16),r11 802db78: 5b 8c 00 0c sw (sp+12),r12 802db7c: 5b 8d 00 08 sw (sp+8),r13 802db80: 5b 9d 00 04 sw (sp+4),ra 802db84: b8 40 58 00 mv r11,r2 802db88: b8 60 68 00 mv r13,r3 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *new; if ( !ptr ) 802db8c: 34 02 00 09 mvi r2,9 802db90: 45 60 00 07 be r11,r0,802dbac return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 802db94: 37 82 00 14 addi r2,sp,20 802db98: fb ff 77 99 calli 800b9fc <_Thread_Get> 802db9c: b8 20 60 00 mv r12,r1 switch (location) { 802dba0: 2b 81 00 14 lw r1,(sp+20) 802dba4: 34 02 00 04 mvi r2,4 802dba8: 44 20 00 08 be r1,r0,802dbc8 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 802dbac: b8 40 08 00 mv r1,r2 802dbb0: 2b 9d 00 04 lw ra,(sp+4) 802dbb4: 2b 8b 00 10 lw r11,(sp+16) 802dbb8: 2b 8c 00 0c lw r12,(sp+12) 802dbbc: 2b 8d 00 08 lw r13,(sp+8) 802dbc0: 37 9c 00 14 addi sp,sp,20 802dbc4: c3 a0 00 00 ret case OBJECTS_LOCAL: /* * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; 802dbc8: 29 84 01 38 lw r4,(r12+312) while (tvp) { 802dbcc: 44 81 00 08 be r4,r1,802dbec if (tvp->ptr == ptr) { 802dbd0: 28 81 00 04 lw r1,(r4+4) 802dbd4: 5c 2b 00 04 bne r1,r11,802dbe4 802dbd8: e0 00 00 18 bi 802dc38 802dbdc: 28 82 00 04 lw r2,(r4+4) 802dbe0: 44 4b 00 16 be r2,r11,802dc38 <== NEVER TAKEN tvp->dtor = dtor; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; 802dbe4: 28 84 00 00 lw r4,(r4+0) case OBJECTS_LOCAL: /* * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; while (tvp) { 802dbe8: 5c 80 ff fd bne r4,r0,802dbdc } /* * Now allocate memory for this task variable. */ new = (rtems_task_variable_t *) 802dbec: 34 01 00 14 mvi r1,20 802dbf0: fb ff 7d ba calli 800d2d8 <_Workspace_Allocate> _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { 802dbf4: 44 20 00 1b be r1,r0,802dc60 } new->gval = *ptr; new->ptr = ptr; new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; 802dbf8: 29 82 01 38 lw r2,(r12+312) if (new == NULL) { _Thread_Enable_dispatch(); return RTEMS_NO_MEMORY; } new->gval = *ptr; new->ptr = ptr; 802dbfc: 58 2b 00 04 sw (r1+4),r11 new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; the_thread->task_variables = new; 802dc00: 59 81 01 38 sw (r12+312),r1 } new->gval = *ptr; new->ptr = ptr; new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; 802dc04: 58 22 00 00 sw (r1+0),r2 _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { _Thread_Enable_dispatch(); return RTEMS_NO_MEMORY; } new->gval = *ptr; 802dc08: 29 62 00 00 lw r2,(r11+0) new->ptr = ptr; new->dtor = dtor; 802dc0c: 58 2d 00 10 sw (r1+16),r13 _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { _Thread_Enable_dispatch(); return RTEMS_NO_MEMORY; } new->gval = *ptr; 802dc10: 58 22 00 08 sw (r1+8),r2 new->ptr = ptr; new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; the_thread->task_variables = new; _Thread_Enable_dispatch(); 802dc14: fb ff 77 6d calli 800b9c8 <_Thread_Enable_dispatch> 802dc18: 34 02 00 00 mvi r2,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 802dc1c: b8 40 08 00 mv r1,r2 802dc20: 2b 9d 00 04 lw ra,(sp+4) 802dc24: 2b 8b 00 10 lw r11,(sp+16) 802dc28: 2b 8c 00 0c lw r12,(sp+12) 802dc2c: 2b 8d 00 08 lw r13,(sp+8) 802dc30: 37 9c 00 14 addi sp,sp,20 802dc34: c3 a0 00 00 ret * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; while (tvp) { if (tvp->ptr == ptr) { tvp->dtor = dtor; 802dc38: 58 8d 00 10 sw (r4+16),r13 _Thread_Enable_dispatch(); 802dc3c: fb ff 77 63 calli 800b9c8 <_Thread_Enable_dispatch> 802dc40: 34 02 00 00 mvi r2,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 802dc44: b8 40 08 00 mv r1,r2 802dc48: 2b 9d 00 04 lw ra,(sp+4) 802dc4c: 2b 8b 00 10 lw r11,(sp+16) 802dc50: 2b 8c 00 0c lw r12,(sp+12) 802dc54: 2b 8d 00 08 lw r13,(sp+8) 802dc58: 37 9c 00 14 addi sp,sp,20 802dc5c: c3 a0 00 00 ret * Now allocate memory for this task variable. */ new = (rtems_task_variable_t *) _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { _Thread_Enable_dispatch(); 802dc60: fb ff 77 5a calli 800b9c8 <_Thread_Enable_dispatch> 802dc64: 34 02 00 1a mvi r2,26 return RTEMS_NO_MEMORY; 802dc68: e3 ff ff d1 bi 802dbac 0802dc6c : rtems_status_code rtems_task_variable_delete( rtems_id tid, void **ptr ) { 802dc6c: 37 9c ff f4 addi sp,sp,-12 802dc70: 5b 8b 00 08 sw (sp+8),r11 802dc74: 5b 9d 00 04 sw (sp+4),ra 802dc78: b8 40 58 00 mv r11,r2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) 802dc7c: 34 02 00 09 mvi r2,9 802dc80: 45 60 00 06 be r11,r0,802dc98 return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); 802dc84: 37 82 00 0c addi r2,sp,12 802dc88: fb ff 77 5d calli 800b9fc <_Thread_Get> switch (location) { 802dc8c: 2b 84 00 0c lw r4,(sp+12) 802dc90: 34 02 00 04 mvi r2,4 802dc94: 44 80 00 06 be r4,r0,802dcac case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 802dc98: b8 40 08 00 mv r1,r2 802dc9c: 2b 9d 00 04 lw ra,(sp+4) 802dca0: 2b 8b 00 08 lw r11,(sp+8) 802dca4: 37 9c 00 0c addi sp,sp,12 802dca8: c3 a0 00 00 ret the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; 802dcac: 28 23 01 38 lw r3,(r1+312) while (tvp) { 802dcb0: 44 64 00 09 be r3,r4,802dcd4 if (tvp->ptr == ptr) { 802dcb4: 28 62 00 04 lw r2,(r3+4) 802dcb8: 5c 4b 00 04 bne r2,r11,802dcc8 802dcbc: e0 00 00 18 bi 802dd1c 802dcc0: 28 64 00 04 lw r4,(r3+4) 802dcc4: 44 8b 00 0b be r4,r11,802dcf0 else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 802dcc8: b8 60 10 00 mv r2,r3 } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; 802dccc: 28 63 00 00 lw r3,(r3+0) the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { 802dcd0: 5c 60 ff fc bne r3,r0,802dcc0 <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 802dcd4: fb ff 77 3d calli 800b9c8 <_Thread_Enable_dispatch> 802dcd8: 34 02 00 09 mvi r2,9 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 802dcdc: b8 40 08 00 mv r1,r2 802dce0: 2b 9d 00 04 lw ra,(sp+4) 802dce4: 2b 8b 00 08 lw r11,(sp+8) 802dce8: 37 9c 00 0c addi sp,sp,12 802dcec: c3 a0 00 00 ret case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { if (tvp->ptr == ptr) { if (prev) prev->next = tvp->next; 802dcf0: 28 64 00 00 lw r4,(r3+0) 802dcf4: 58 44 00 00 sw (r2+0),r4 else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 802dcf8: b8 60 10 00 mv r2,r3 802dcfc: f8 00 00 3b calli 802dde8 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 802dd00: fb ff 77 32 calli 800b9c8 <_Thread_Enable_dispatch> 802dd04: 34 02 00 00 mvi r2,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 802dd08: b8 40 08 00 mv r1,r2 802dd0c: 2b 9d 00 04 lw ra,(sp+4) 802dd10: 2b 8b 00 08 lw r11,(sp+8) 802dd14: 37 9c 00 0c addi sp,sp,12 802dd18: c3 a0 00 00 ret while (tvp) { if (tvp->ptr == ptr) { if (prev) prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; 802dd1c: 28 62 00 00 lw r2,(r3+0) 802dd20: 58 22 01 38 sw (r1+312),r2 802dd24: e3 ff ff f5 bi 802dcf8 0802dd28 : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 802dd28: 37 9c ff f0 addi sp,sp,-16 802dd2c: 5b 8b 00 0c sw (sp+12),r11 802dd30: 5b 8c 00 08 sw (sp+8),r12 802dd34: 5b 9d 00 04 sw (sp+4),ra 802dd38: b8 40 58 00 mv r11,r2 802dd3c: b8 60 60 00 mv r12,r3 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 802dd40: 44 40 00 1d be r2,r0,802ddb4 return RTEMS_INVALID_ADDRESS; if ( !result ) 802dd44: 44 60 00 1c be r3,r0,802ddb4 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 802dd48: 37 82 00 10 addi r2,sp,16 802dd4c: fb ff 77 2c calli 800b9fc <_Thread_Get> switch (location) { 802dd50: 2b 82 00 10 lw r2,(sp+16) return RTEMS_INVALID_ADDRESS; if ( !result ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 802dd54: b8 20 18 00 mv r3,r1 switch (location) { 802dd58: 34 01 00 04 mvi r1,4 802dd5c: 44 40 00 06 be r2,r0,802dd74 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 802dd60: 2b 9d 00 04 lw ra,(sp+4) 802dd64: 2b 8b 00 0c lw r11,(sp+12) 802dd68: 2b 8c 00 08 lw r12,(sp+8) 802dd6c: 37 9c 00 10 addi sp,sp,16 802dd70: c3 a0 00 00 ret case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 802dd74: 28 61 01 38 lw r1,(r3+312) while (tvp) { 802dd78: 5c 22 00 04 bne r1,r2,802dd88 802dd7c: e0 00 00 14 bi 802ddcc */ *result = tvp->tval; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; 802dd80: 28 21 00 00 lw r1,(r1+0) case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; while (tvp) { 802dd84: 44 20 00 12 be r1,r0,802ddcc <== NEVER TAKEN if (tvp->ptr == ptr) { 802dd88: 28 22 00 04 lw r2,(r1+4) 802dd8c: 5c 4b ff fd bne r2,r11,802dd80 /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; 802dd90: 28 21 00 0c lw r1,(r1+12) 802dd94: 59 81 00 00 sw (r12+0),r1 _Thread_Enable_dispatch(); 802dd98: fb ff 77 0c calli 800b9c8 <_Thread_Enable_dispatch> 802dd9c: 34 01 00 00 mvi r1,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 802dda0: 2b 9d 00 04 lw ra,(sp+4) 802dda4: 2b 8b 00 0c lw r11,(sp+12) 802dda8: 2b 8c 00 08 lw r12,(sp+8) 802ddac: 37 9c 00 10 addi sp,sp,16 802ddb0: c3 a0 00 00 ret return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); return RTEMS_INVALID_ADDRESS; 802ddb4: 34 01 00 09 mvi r1,9 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 802ddb8: 2b 9d 00 04 lw ra,(sp+4) 802ddbc: 2b 8b 00 0c lw r11,(sp+12) 802ddc0: 2b 8c 00 08 lw r12,(sp+8) 802ddc4: 37 9c 00 10 addi sp,sp,16 802ddc8: c3 a0 00 00 ret _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 802ddcc: fb ff 76 ff calli 800b9c8 <_Thread_Enable_dispatch> 802ddd0: 34 01 00 09 mvi r1,9 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 802ddd4: 2b 9d 00 04 lw ra,(sp+4) 802ddd8: 2b 8b 00 0c lw r11,(sp+12) 802dddc: 2b 8c 00 08 lw r12,(sp+8) 802dde0: 37 9c 00 10 addi sp,sp,16 802dde4: c3 a0 00 00 ret 08013f04 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 8013f04: 37 9c ff f8 addi sp,sp,-8 8013f08: 5b 9d 00 04 sw (sp+4),ra 8013f0c: b8 20 10 00 mv r2,r1 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 8013f10: 78 01 08 04 mvhi r1,0x804 8013f14: 37 83 00 08 addi r3,sp,8 8013f18: 38 21 15 a4 ori r1,r1,0x15a4 8013f1c: f8 00 0e b8 calli 80179fc <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8013f20: 2b 83 00 08 lw r3,(sp+8) 8013f24: 34 02 00 04 mvi r2,4 8013f28: 44 60 00 05 be r3,r0,8013f3c case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8013f2c: b8 40 08 00 mv r1,r2 8013f30: 2b 9d 00 04 lw ra,(sp+4) 8013f34: 37 9c 00 08 addi sp,sp,8 8013f38: c3 a0 00 00 ret the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 8013f3c: 28 23 00 38 lw r3,(r1+56) 8013f40: 44 62 00 03 be r3,r2,8013f4c <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 8013f44: 34 21 00 10 addi r1,r1,16 8013f48: f8 00 19 37 calli 801a424 <_Watchdog_Remove> _Thread_Enable_dispatch(); 8013f4c: f8 00 11 cc calli 801867c <_Thread_Enable_dispatch> 8013f50: 34 02 00 00 mvi r2,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8013f54: b8 40 08 00 mv r1,r2 8013f58: 2b 9d 00 04 lw ra,(sp+4) 8013f5c: 37 9c 00 08 addi sp,sp,8 8013f60: c3 a0 00 00 ret 08002898 : rtems_status_code rtems_timer_create( rtems_name name, rtems_id *id ) { 8002898: 37 9c ff e4 addi sp,sp,-28 800289c: 5b 8b 00 1c sw (sp+28),r11 80028a0: 5b 8c 00 18 sw (sp+24),r12 80028a4: 5b 8d 00 14 sw (sp+20),r13 80028a8: 5b 8e 00 10 sw (sp+16),r14 80028ac: 5b 8f 00 0c sw (sp+12),r15 80028b0: 5b 90 00 08 sw (sp+8),r16 80028b4: 5b 9d 00 04 sw (sp+4),ra Timer_Control *the_timer; if ( !rtems_is_name_valid( name ) ) 80028b8: 34 0c 00 00 mvi r12,0 rtems_status_code rtems_timer_create( rtems_name name, rtems_id *id ) { 80028bc: b8 20 68 00 mv r13,r1 80028c0: b8 40 70 00 mv r14,r2 Timer_Control *the_timer; if ( !rtems_is_name_valid( name ) ) 80028c4: 34 01 00 03 mvi r1,3 80028c8: 45 ac 00 20 be r13,r12,8002948 <== NEVER TAKEN return RTEMS_INVALID_NAME; if ( !id ) 80028cc: 34 01 00 09 mvi r1,9 80028d0: 44 4c 00 1e be r2,r12,8002948 <== NEVER TAKEN 80028d4: 78 03 08 01 mvhi r3,0x801 80028d8: 38 63 f8 64 ori r3,r3,0xf864 80028dc: 28 61 00 00 lw r1,(r3+0) 80028e0: 34 21 00 01 addi r1,r1,1 80028e4: 58 61 00 00 sw (r3+0),r1 * This function allocates a timer control block from * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void ) { return (Timer_Control *) _Objects_Allocate( &_Timer_Information ); 80028e8: 78 01 08 02 mvhi r1,0x802 80028ec: 38 21 01 10 ori r1,r1,0x110 80028f0: f8 00 03 91 calli 8003734 <_Objects_Allocate> 80028f4: b8 20 58 00 mv r11,r1 _Thread_Disable_dispatch(); /* to prevent deletion */ the_timer = _Timer_Allocate(); if ( !the_timer ) { 80028f8: 44 2c 00 1d be r1,r12,800296c <== NEVER TAKEN 80028fc: 28 2f 00 08 lw r15,(r1+8) 8002900: 78 01 08 02 mvhi r1,0x802 8002904: 38 21 01 10 ori r1,r1,0x110 8002908: 28 30 00 1c lw r16,(r1+28) _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } the_timer->the_class = TIMER_DORMANT; 800290c: 34 01 00 04 mvi r1,4 8002910: 59 61 00 38 sw (r11+56),r1 8002914: 34 02 00 02 mvi r2,2 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8002918: 59 6c 00 18 sw (r11+24),r12 the_watchdog->routine = routine; 800291c: 59 6c 00 2c sw (r11+44),r12 the_watchdog->id = id; 8002920: 59 6c 00 30 sw (r11+48),r12 the_watchdog->user_data = user_data; 8002924: 59 6c 00 34 sw (r11+52),r12 8002928: 21 e1 ff ff andi r1,r15,0xffff 800292c: fb ff f6 bf calli 8000428 <__ashlsi3> 8002930: b6 01 08 00 add r1,r16,r1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 8002934: 59 6d 00 0c sw (r11+12),r13 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8002938: 58 2b 00 00 sw (r1+0),r11 &_Timer_Information, &the_timer->Object, (Objects_Name) name ); *id = the_timer->Object.id; 800293c: 59 cf 00 00 sw (r14+0),r15 _Thread_Enable_dispatch(); 8002940: f8 00 06 40 calli 8004240 <_Thread_Enable_dispatch> 8002944: b9 80 08 00 mv r1,r12 return RTEMS_SUCCESSFUL; } 8002948: 2b 9d 00 04 lw ra,(sp+4) 800294c: 2b 8b 00 1c lw r11,(sp+28) 8002950: 2b 8c 00 18 lw r12,(sp+24) 8002954: 2b 8d 00 14 lw r13,(sp+20) 8002958: 2b 8e 00 10 lw r14,(sp+16) 800295c: 2b 8f 00 0c lw r15,(sp+12) 8002960: 2b 90 00 08 lw r16,(sp+8) 8002964: 37 9c 00 1c addi sp,sp,28 8002968: c3 a0 00 00 ret _Thread_Disable_dispatch(); /* to prevent deletion */ the_timer = _Timer_Allocate(); if ( !the_timer ) { _Thread_Enable_dispatch(); 800296c: f8 00 06 35 calli 8004240 <_Thread_Enable_dispatch> 8002970: 34 01 00 05 mvi r1,5 return RTEMS_TOO_MANY; 8002974: e3 ff ff f5 bi 8002948 080145a4 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 80145a4: 37 9c ff d8 addi sp,sp,-40 80145a8: 5b 8b 00 24 sw (sp+36),r11 80145ac: 5b 8c 00 20 sw (sp+32),r12 80145b0: 5b 8d 00 1c sw (sp+28),r13 80145b4: 5b 8e 00 18 sw (sp+24),r14 80145b8: 5b 8f 00 14 sw (sp+20),r15 80145bc: 5b 90 00 10 sw (sp+16),r16 80145c0: 5b 91 00 0c sw (sp+12),r17 80145c4: 5b 92 00 08 sw (sp+8),r18 80145c8: 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; 80145cc: 78 05 08 04 mvhi r5,0x804 80145d0: 38 a5 15 e4 ori r5,r5,0x15e4 80145d4: 28 ab 00 00 lw r11,(r5+0) rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 80145d8: b8 20 78 00 mv r15,r1 80145dc: b8 40 68 00 mv r13,r2 80145e0: b8 60 70 00 mv r14,r3 80145e4: b8 80 80 00 mv r16,r4 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 80145e8: 34 05 00 0e mvi r5,14 80145ec: 45 60 00 0c be r11,r0,801461c return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 80145f0: 78 05 08 04 mvhi r5,0x804 80145f4: 38 a5 0c c0 ori r5,r5,0xcc0 80145f8: 40 a6 00 00 lbu r6,(r5+0) 80145fc: 34 05 00 0b mvi r5,11 8014600: 44 c0 00 07 be r6,r0,801461c <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) 8014604: 34 05 00 09 mvi r5,9 8014608: 44 60 00 05 be r3,r0,801461c return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 801460c: b8 40 08 00 mv r1,r2 8014610: fb ff f0 06 calli 8010628 <_TOD_Validate> 8014614: 5c 20 00 0e bne r1,r0,801464c the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 8014618: 34 05 00 14 mvi r5,20 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 801461c: b8 a0 08 00 mv r1,r5 8014620: 2b 9d 00 04 lw ra,(sp+4) 8014624: 2b 8b 00 24 lw r11,(sp+36) 8014628: 2b 8c 00 20 lw r12,(sp+32) 801462c: 2b 8d 00 1c lw r13,(sp+28) 8014630: 2b 8e 00 18 lw r14,(sp+24) 8014634: 2b 8f 00 14 lw r15,(sp+20) 8014638: 2b 90 00 10 lw r16,(sp+16) 801463c: 2b 91 00 0c lw r17,(sp+12) 8014640: 2b 92 00 08 lw r18,(sp+8) 8014644: 37 9c 00 28 addi sp,sp,40 8014648: c3 a0 00 00 ret if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) 801464c: 78 0c 08 04 mvhi r12,0x804 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8014650: b9 a0 08 00 mv r1,r13 8014654: fb ff ef ad calli 8010508 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 8014658: 39 8c 0d 3c ori r12,r12,0xd3c return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 801465c: b8 20 88 00 mv r17,r1 if ( seconds <= _TOD_Seconds_since_epoch() ) 8014660: 29 81 00 00 lw r1,(r12+0) 8014664: 50 31 ff ed bgeu r1,r17,8014618 8014668: 78 01 08 04 mvhi r1,0x804 801466c: 38 21 15 a4 ori r1,r1,0x15a4 8014670: b9 e0 10 00 mv r2,r15 8014674: 37 83 00 28 addi r3,sp,40 8014678: f8 00 0c e1 calli 80179fc <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 801467c: 2b 92 00 28 lw r18,(sp+40) 8014680: b8 20 68 00 mv r13,r1 8014684: 34 05 00 04 mvi r5,4 8014688: 5e 40 ff e5 bne r18,r0,801461c case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 801468c: 34 21 00 10 addi r1,r1,16 8014690: f8 00 17 65 calli 801a424 <_Watchdog_Remove> void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 8014694: 59 af 00 30 sw (r13+48),r15 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(); 8014698: 29 81 00 00 lw r1,(r12+0) (*timer_server->schedule_operation)( timer_server, the_timer ); 801469c: 29 63 00 04 lw r3,(r11+4) 80146a0: b9 a0 10 00 mv r2,r13 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(); 80146a4: ca 21 88 00 sub r17,r17,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; 80146a8: 34 01 00 03 mvi r1,3 80146ac: 59 a1 00 38 sw (r13+56),r1 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 80146b0: 59 ae 00 2c sw (r13+44),r14 _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 ); 80146b4: b9 60 08 00 mv r1,r11 the_watchdog->id = id; the_watchdog->user_data = user_data; 80146b8: 59 b0 00 34 sw (r13+52),r16 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(); 80146bc: 59 b1 00 1c sw (r13+28),r17 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 80146c0: 59 b2 00 18 sw (r13+24),r18 (*timer_server->schedule_operation)( timer_server, the_timer ); 80146c4: d8 60 00 00 call r3 _Thread_Enable_dispatch(); 80146c8: f8 00 0f ed calli 801867c <_Thread_Enable_dispatch> 80146cc: ba 40 28 00 mv r5,r18 return RTEMS_SUCCESSFUL; 80146d0: e3 ff ff d3 bi 801461c 08003590 : #include int sched_get_priority_max( int policy ) { 8003590: 37 9c ff fc addi sp,sp,-4 8003594: 5b 9d 00 04 sw (sp+4),ra switch ( policy ) { 8003598: 48 01 00 05 bg r0,r1,80035ac 800359c: 34 02 00 02 mvi r2,2 80035a0: 4c 41 00 08 bge r2,r1,80035c0 80035a4: 34 02 00 04 mvi r2,4 80035a8: 44 22 00 06 be r1,r2,80035c0 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 80035ac: f8 00 2b 59 calli 800e310 <__errno> 80035b0: 34 02 00 16 mvi r2,22 80035b4: 58 22 00 00 sw (r1+0),r2 80035b8: 34 01 ff ff mvi r1,-1 80035bc: e0 00 00 05 bi 80035d0 } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 80035c0: 78 01 08 01 mvhi r1,0x801 80035c4: 38 21 f0 e4 ori r1,r1,0xf0e4 80035c8: 40 21 00 00 lbu r1,(r1+0) 80035cc: 34 21 ff ff addi r1,r1,-1 } 80035d0: 2b 9d 00 04 lw ra,(sp+4) 80035d4: 37 9c 00 04 addi sp,sp,4 80035d8: c3 a0 00 00 ret 080035dc : #include int sched_get_priority_min( int policy ) { 80035dc: 37 9c ff fc addi sp,sp,-4 80035e0: 5b 9d 00 04 sw (sp+4),ra switch ( policy ) { 80035e4: 48 01 00 05 bg r0,r1,80035f8 80035e8: 34 02 00 02 mvi r2,2 80035ec: 4c 41 00 08 bge r2,r1,800360c <== ALWAYS TAKEN 80035f0: 34 02 00 04 mvi r2,4 <== NOT EXECUTED 80035f4: 44 22 00 06 be r1,r2,800360c <== NOT EXECUTED case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 80035f8: f8 00 2b 46 calli 800e310 <__errno> 80035fc: 34 02 00 16 mvi r2,22 8003600: 58 22 00 00 sw (r1+0),r2 8003604: 34 01 ff ff mvi r1,-1 8003608: e0 00 00 02 bi 8003610 int sched_get_priority_min( int policy ) { switch ( policy ) { 800360c: 34 01 00 01 mvi r1,1 default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 8003610: 2b 9d 00 04 lw ra,(sp+4) 8003614: 37 9c 00 04 addi sp,sp,4 8003618: c3 a0 00 00 ret 0800361c : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 800361c: 37 9c ff f4 addi sp,sp,-12 8003620: 5b 8b 00 08 sw (sp+8),r11 8003624: 5b 9d 00 04 sw (sp+4),ra 8003628: b8 20 58 00 mv r11,r1 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 800362c: 5c 20 00 0b bne r1,r0,8003658 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) 8003630: 44 40 00 13 be r2,r0,800367c rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 8003634: 78 01 08 01 mvhi r1,0x801 8003638: 38 21 f7 f4 ori r1,r1,0xf7f4 800363c: 28 21 00 00 lw r1,(r1+0) 8003640: f8 00 0d 1a calli 8006aa8 <_Timespec_From_ticks> 8003644: 34 01 00 00 mvi r1,0 return 0; } 8003648: 2b 9d 00 04 lw ra,(sp+4) 800364c: 2b 8b 00 08 lw r11,(sp+8) 8003650: 37 9c 00 0c addi sp,sp,12 8003654: c3 a0 00 00 ret { /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 8003658: 5b 82 00 0c sw (sp+12),r2 800365c: fb ff f8 fc calli 8001a4c 8003660: 2b 82 00 0c lw r2,(sp+12) 8003664: 44 2b ff f3 be r1,r11,8003630 rtems_set_errno_and_return_minus_one( ESRCH ); 8003668: f8 00 2b 2a calli 800e310 <__errno> 800366c: 34 02 00 03 mvi r2,3 8003670: 58 22 00 00 sw (r1+0),r2 8003674: 34 01 ff ff mvi r1,-1 8003678: e3 ff ff f4 bi 8003648 if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 800367c: f8 00 2b 25 calli 800e310 <__errno> 8003680: 34 02 00 16 mvi r2,22 8003684: 58 22 00 00 sw (r1+0),r2 8003688: 34 01 ff ff mvi r1,-1 800368c: e3 ff ff ef bi 8003648 080058e0 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 80058e0: 37 9c ff c0 addi sp,sp,-64 80058e4: 5b 8b 00 18 sw (sp+24),r11 80058e8: 5b 8c 00 14 sw (sp+20),r12 80058ec: 5b 8d 00 10 sw (sp+16),r13 80058f0: 5b 8e 00 0c sw (sp+12),r14 80058f4: 5b 8f 00 08 sw (sp+8),r15 80058f8: 5b 9d 00 04 sw (sp+4),ra rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80058fc: 78 09 08 02 mvhi r9,0x802 8005900: 39 29 4a 5c ori r9,r9,0x4a5c 8005904: 29 2a 00 00 lw r10,(r9+0) 8005908: 5b 83 00 2c sw (sp+44),r3 800590c: 5b 84 00 30 sw (sp+48),r4 8005910: 35 43 00 01 addi r3,r10,1 8005914: 59 23 00 00 sw (r9+0),r3 8005918: 5b 85 00 34 sw (sp+52),r5 800591c: 5b 86 00 38 sw (sp+56),r6 8005920: 5b 87 00 3c sw (sp+60),r7 8005924: 5b 88 00 40 sw (sp+64),r8 8005928: b8 20 70 00 mv r14,r1 800592c: 5b 82 00 28 sw (sp+40),r2 8005930: b8 40 68 00 mv r13,r2 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 8005934: 20 4b 02 00 andi r11,r2,0x200 8005938: b9 60 78 00 mv r15,r11 800593c: 5d 60 00 2d bne r11,r0,80059f0 mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 8005940: b9 c0 08 00 mv r1,r14 8005944: 37 82 00 24 addi r2,sp,36 8005948: f8 00 17 e3 calli 800b8d4 <_POSIX_Semaphore_Name_to_id> 800594c: b8 20 60 00 mv r12,r1 * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "semaphore does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 8005950: 44 20 00 10 be r1,r0,8005990 /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 8005954: 34 01 00 02 mvi r1,2 8005958: 5d 81 00 02 bne r12,r1,8005960 <== NEVER TAKEN 800595c: 5d 60 00 27 bne r11,r0,80059f8 _Thread_Enable_dispatch(); 8005960: f8 00 07 f7 calli 800793c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 8005964: f8 00 2f 3e calli 801165c <__errno> 8005968: 58 2c 00 00 sw (r1+0),r12 800596c: 34 01 ff ff mvi r1,-1 id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; } 8005970: 2b 9d 00 04 lw ra,(sp+4) 8005974: 2b 8b 00 18 lw r11,(sp+24) 8005978: 2b 8c 00 14 lw r12,(sp+20) 800597c: 2b 8d 00 10 lw r13,(sp+16) 8005980: 2b 8e 00 0c lw r14,(sp+12) 8005984: 2b 8f 00 08 lw r15,(sp+8) 8005988: 37 9c 00 40 addi sp,sp,64 800598c: c3 a0 00 00 ret /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 8005990: 21 ad 0a 00 andi r13,r13,0xa00 8005994: 34 01 0a 00 mvi r1,2560 8005998: 45 a1 00 23 be r13,r1,8005a24 800599c: 2b 82 00 24 lw r2,(sp+36) 80059a0: 78 01 08 02 mvhi r1,0x802 80059a4: 37 83 00 1c addi r3,sp,28 80059a8: 38 21 4c dc ori r1,r1,0x4cdc 80059ac: f8 00 05 fe calli 80071a4 <_Objects_Get> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 80059b0: 28 22 00 18 lw r2,(r1+24) if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); 80059b4: 5b 81 00 20 sw (sp+32),r1 the_semaphore->open_count += 1; 80059b8: 34 42 00 01 addi r2,r2,1 80059bc: 58 22 00 18 sw (r1+24),r2 _Thread_Enable_dispatch(); 80059c0: f8 00 07 df calli 800793c <_Thread_Enable_dispatch> _Thread_Enable_dispatch(); 80059c4: f8 00 07 de calli 800793c <_Thread_Enable_dispatch> return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; 80059c8: 2b 81 00 20 lw r1,(sp+32) 80059cc: 34 21 00 08 addi r1,r1,8 #endif return id; } 80059d0: 2b 9d 00 04 lw ra,(sp+4) 80059d4: 2b 8b 00 18 lw r11,(sp+24) 80059d8: 2b 8c 00 14 lw r12,(sp+20) 80059dc: 2b 8d 00 10 lw r13,(sp+16) 80059e0: 2b 8e 00 0c lw r14,(sp+12) 80059e4: 2b 8f 00 08 lw r15,(sp+8) 80059e8: 37 9c 00 40 addi sp,sp,64 80059ec: c3 a0 00 00 ret _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 80059f0: 2b 8f 00 30 lw r15,(sp+48) 80059f4: e3 ff ff d3 bi 8005940 /* * At this point, the semaphore does not exist and everything has been * checked. We should go ahead and create a semaphore. */ status =_POSIX_Semaphore_Create_support( 80059f8: 34 02 00 00 mvi r2,0 80059fc: b9 e0 18 00 mv r3,r15 8005a00: 37 84 00 20 addi r4,sp,32 8005a04: b9 c0 08 00 mv r1,r14 8005a08: f8 00 17 42 calli 800b710 <_POSIX_Semaphore_Create_support> 8005a0c: b8 20 58 00 mv r11,r1 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 8005a10: f8 00 07 cb calli 800793c <_Thread_Enable_dispatch> if ( status == -1 ) 8005a14: 34 02 ff ff mvi r2,-1 8005a18: b9 60 08 00 mv r1,r11 8005a1c: 5d 62 ff eb bne r11,r2,80059c8 8005a20: e3 ff ff ec bi 80059d0 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); 8005a24: f8 00 07 c6 calli 800793c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 8005a28: f8 00 2f 0d calli 801165c <__errno> 8005a2c: 34 02 00 11 mvi r2,17 8005a30: 58 22 00 00 sw (r1+0),r2 8005a34: 34 01 ff ff mvi r1,-1 8005a38: e3 ff ff e6 bi 80059d0 08005aac : int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 8005aac: 37 9c ff f4 addi sp,sp,-12 8005ab0: 5b 8b 00 08 sw (sp+8),r11 8005ab4: 5b 9d 00 04 sw (sp+4),ra 8005ab8: b8 20 58 00 mv r11,r1 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 8005abc: b8 40 08 00 mv r1,r2 8005ac0: 37 82 00 0c addi r2,sp,12 8005ac4: f8 00 14 2c calli 800ab74 <_POSIX_Absolute_timeout_to_ticks> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 8005ac8: 34 02 00 03 mvi r2,3 8005acc: 44 22 00 09 be r1,r2,8005af0 <== ALWAYS TAKEN do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 8005ad0: 2b 83 00 0c lw r3,(sp+12) <== NOT EXECUTED 8005ad4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8005ad8: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8005adc: f8 00 17 a8 calli 800b97c <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED break; } } return lock_status; } 8005ae0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8005ae4: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8005ae8: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 8005aec: c3 a0 00 00 ret <== NOT EXECUTED */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 8005af0: 2b 83 00 0c lw r3,(sp+12) 8005af4: b9 60 08 00 mv r1,r11 8005af8: 34 02 00 01 mvi r2,1 8005afc: f8 00 17 a0 calli 800b97c <_POSIX_Semaphore_Wait_support> break; } } return lock_status; } 8005b00: 2b 9d 00 04 lw ra,(sp+4) 8005b04: 2b 8b 00 08 lw r11,(sp+8) 8005b08: 37 9c 00 0c addi sp,sp,12 8005b0c: c3 a0 00 00 ret 08003430 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 8003430: 37 9c ff ec addi sp,sp,-20 8003434: 5b 8b 00 14 sw (sp+20),r11 8003438: 5b 8c 00 10 sw (sp+16),r12 800343c: 5b 8d 00 0c sw (sp+12),r13 8003440: 5b 8e 00 08 sw (sp+8),r14 8003444: 5b 9d 00 04 sw (sp+4),ra 8003448: b8 60 68 00 mv r13,r3 800344c: b8 20 58 00 mv r11,r1 8003450: b8 40 60 00 mv r12,r2 ISR_Level level; if ( oact ) 8003454: 44 60 00 0e be r3,r0,800348c *oact = _POSIX_signals_Vectors[ sig ]; 8003458: b4 21 08 00 add r1,r1,r1 800345c: 34 02 00 02 mvi r2,2 8003460: b4 2b 08 00 add r1,r1,r11 8003464: 78 0e 08 02 mvhi r14,0x802 8003468: fb ff f5 47 calli 8000984 <__ashlsi3> 800346c: 39 ce 0d c0 ori r14,r14,0xdc0 8003470: b5 c1 08 00 add r1,r14,r1 8003474: 28 22 00 00 lw r2,(r1+0) 8003478: 59 a2 00 00 sw (r13+0),r2 800347c: 28 23 00 04 lw r3,(r1+4) 8003480: 59 a3 00 04 sw (r13+4),r3 8003484: 28 21 00 08 lw r1,(r1+8) 8003488: 59 a1 00 08 sw (r13+8),r1 if ( !sig ) 800348c: 45 60 00 04 be r11,r0,800349c rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 8003490: 35 61 ff ff addi r1,r11,-1 8003494: 34 02 00 1f mvi r2,31 8003498: 50 41 00 06 bgeu r2,r1,80034b0 * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) rtems_set_errno_and_return_minus_one( EINVAL ); 800349c: f8 00 2c 3c calli 800e58c <__errno> 80034a0: 34 02 00 16 mvi r2,22 80034a4: 58 22 00 00 sw (r1+0),r2 80034a8: 34 01 ff ff mvi r1,-1 80034ac: e0 00 00 1c bi 800351c * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 80034b0: 34 01 00 09 mvi r1,9 80034b4: 45 61 ff fa be r11,r1,800349c /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 80034b8: b9 80 08 00 mv r1,r12 80034bc: 45 80 00 18 be r12,r0,800351c <== NEVER TAKEN /* * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); 80034c0: 90 00 68 00 rcsr r13,IE 80034c4: 34 01 ff fe mvi r1,-2 80034c8: a1 a1 08 00 and r1,r13,r1 80034cc: d0 01 00 00 wcsr IE,r1 if ( act->sa_handler == SIG_DFL ) { 80034d0: 29 81 00 08 lw r1,(r12+8) 80034d4: 44 20 00 19 be r1,r0,8003538 <== NEVER TAKEN _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; } else { _POSIX_signals_Clear_process_signals( sig ); 80034d8: b9 60 08 00 mv r1,r11 80034dc: f8 00 18 ff calli 80098d8 <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 80034e0: b5 6b 08 00 add r1,r11,r11 80034e4: b4 2b 08 00 add r1,r1,r11 80034e8: 34 02 00 02 mvi r2,2 80034ec: fb ff f5 26 calli 8000984 <__ashlsi3> 80034f0: 29 82 00 00 lw r2,(r12+0) 80034f4: 78 0b 08 02 mvhi r11,0x802 80034f8: 39 6b 0d c0 ori r11,r11,0xdc0 80034fc: b5 61 08 00 add r1,r11,r1 8003500: 58 22 00 00 sw (r1+0),r2 8003504: 29 83 00 04 lw r3,(r12+4) 8003508: 58 23 00 04 sw (r1+4),r3 800350c: 29 8c 00 08 lw r12,(r12+8) 8003510: 58 2c 00 08 sw (r1+8),r12 } _ISR_Enable( level ); 8003514: d0 0d 00 00 wcsr IE,r13 8003518: 34 01 00 00 mvi r1,0 * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 800351c: 2b 9d 00 04 lw ra,(sp+4) 8003520: 2b 8b 00 14 lw r11,(sp+20) 8003524: 2b 8c 00 10 lw r12,(sp+16) 8003528: 2b 8d 00 0c lw r13,(sp+12) 800352c: 2b 8e 00 08 lw r14,(sp+8) 8003530: 37 9c 00 14 addi sp,sp,20 8003534: c3 a0 00 00 ret * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); if ( act->sa_handler == SIG_DFL ) { _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 8003538: b5 6b 08 00 add r1,r11,r11 800353c: 34 02 00 02 mvi r2,2 8003540: b4 2b 08 00 add r1,r1,r11 8003544: fb ff f5 10 calli 8000984 <__ashlsi3> 8003548: 78 02 08 01 mvhi r2,0x801 800354c: 78 03 08 02 mvhi r3,0x802 8003550: 38 42 ee a8 ori r2,r2,0xeea8 8003554: b4 41 10 00 add r2,r2,r1 8003558: 38 63 0d c0 ori r3,r3,0xdc0 800355c: b4 61 08 00 add r1,r3,r1 8003560: 28 43 00 08 lw r3,(r2+8) 8003564: 58 23 00 08 sw (r1+8),r3 8003568: 28 43 00 00 lw r3,(r2+0) 800356c: 28 42 00 04 lw r2,(r2+4) 8003570: 58 23 00 00 sw (r1+0),r3 8003574: 58 22 00 04 sw (r1+4),r2 8003578: e3 ff ff e7 bi 8003514 08005df8 : #include int sigsuspend( const sigset_t *sigmask ) { 8005df8: 37 9c ff f0 addi sp,sp,-16 8005dfc: 5b 8b 00 08 sw (sp+8),r11 8005e00: 5b 9d 00 04 sw (sp+4),ra int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 8005e04: b8 20 10 00 mv r2,r1 8005e08: 37 83 00 10 addi r3,sp,16 8005e0c: 34 01 00 01 mvi r1,1 8005e10: fb ff ff ec calli 8005dc0 (void) sigfillset( &all_signals ); 8005e14: 37 8b 00 0c addi r11,sp,12 8005e18: b9 60 08 00 mv r1,r11 8005e1c: fb ff ff ac calli 8005ccc status = sigtimedwait( &all_signals, NULL, NULL ); 8005e20: 34 02 00 00 mvi r2,0 8005e24: b8 40 18 00 mv r3,r2 8005e28: b9 60 08 00 mv r1,r11 8005e2c: f8 00 00 31 calli 8005ef0 8005e30: b8 20 58 00 mv r11,r1 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 8005e34: 34 01 00 00 mvi r1,0 8005e38: 37 82 00 10 addi r2,sp,16 8005e3c: b8 20 18 00 mv r3,r1 8005e40: fb ff ff e0 calli 8005dc0 /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) 8005e44: 34 02 ff ff mvi r2,-1 8005e48: 5d 62 00 06 bne r11,r2,8005e60 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINTR ); return status; } 8005e4c: 34 01 ff ff mvi r1,-1 8005e50: 2b 9d 00 04 lw ra,(sp+4) 8005e54: 2b 8b 00 08 lw r11,(sp+8) 8005e58: 37 9c 00 10 addi sp,sp,16 8005e5c: c3 a0 00 00 ret /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) rtems_set_errno_and_return_minus_one( EINTR ); 8005e60: f8 00 2b 14 calli 8010ab0 <__errno> 8005e64: 34 02 00 04 mvi r2,4 8005e68: 58 22 00 00 sw (r1+0),r2 8005e6c: e3 ff ff f8 bi 8005e4c 08003a68 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 8003a68: 37 9c ff d8 addi sp,sp,-40 8003a6c: 5b 8b 00 1c sw (sp+28),r11 8003a70: 5b 8c 00 18 sw (sp+24),r12 8003a74: 5b 8d 00 14 sw (sp+20),r13 8003a78: 5b 8e 00 10 sw (sp+16),r14 8003a7c: 5b 8f 00 0c sw (sp+12),r15 8003a80: 5b 90 00 08 sw (sp+8),r16 8003a84: 5b 9d 00 04 sw (sp+4),ra 8003a88: b8 20 68 00 mv r13,r1 8003a8c: b8 40 60 00 mv r12,r2 8003a90: b8 60 58 00 mv r11,r3 ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 8003a94: 44 20 00 6b be r1,r0,8003c40 <== NEVER TAKEN /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 8003a98: 44 60 00 59 be r3,r0,8003bfc if ( !_Timespec_Is_valid( timeout ) ) 8003a9c: b8 60 08 00 mv r1,r3 8003aa0: f8 00 0d 38 calli 8006f80 <_Timespec_Is_valid> 8003aa4: 44 20 00 67 be r1,r0,8003c40 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 8003aa8: b9 60 08 00 mv r1,r11 8003aac: f8 00 0d 55 calli 8007000 <_Timespec_To_ticks> 8003ab0: b8 20 28 00 mv r5,r1 if ( !interval ) 8003ab4: 44 20 00 63 be r1,r0,8003c40 <== NEVER TAKEN /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 8003ab8: 37 8b 00 20 addi r11,sp,32 8003abc: 45 80 00 02 be r12,r0,8003ac4 8003ac0: b9 80 58 00 mv r11,r12 the_thread = _Thread_Executing; 8003ac4: 78 0c 08 02 mvhi r12,0x802 8003ac8: 39 8c 19 70 ori r12,r12,0x1970 8003acc: 29 84 00 00 lw r4,(r12+0) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8003ad0: 28 8f 01 2c lw r15,(r4+300) * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 8003ad4: 90 00 80 00 rcsr r16,IE 8003ad8: 34 01 ff fe mvi r1,-2 8003adc: a2 01 08 00 and r1,r16,r1 8003ae0: d0 01 00 00 wcsr IE,r1 if ( *set & api->signals_pending ) { 8003ae4: 29 a2 00 00 lw r2,(r13+0) 8003ae8: 29 e1 00 d0 lw r1,(r15+208) 8003aec: a0 41 70 00 and r14,r2,r1 8003af0: 5d c0 00 45 bne r14,r0,8003c04 return the_info->si_signo; } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 8003af4: 78 03 08 02 mvhi r3,0x802 8003af8: 38 63 1f b4 ori r3,r3,0x1fb4 8003afc: 28 61 00 00 lw r1,(r3+0) 8003b00: a0 41 10 00 and r2,r2,r1 8003b04: 5c 4e 00 2f bne r2,r14,8003bc0 8003b08: 78 01 08 02 mvhi r1,0x802 8003b0c: 38 21 18 b4 ori r1,r1,0x18b4 8003b10: 28 22 00 00 lw r2,(r1+0) the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; return signo; } the_info->si_signo = -1; 8003b14: 34 03 ff ff mvi r3,-1 8003b18: 59 63 00 00 sw (r11+0),r3 8003b1c: 34 42 00 01 addi r2,r2,1 8003b20: 58 22 00 00 sw (r1+0),r2 _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 8003b24: 34 01 00 04 mvi r1,4 8003b28: 58 81 00 34 sw (r4+52),r1 the_thread->Wait.option = *set; 8003b2c: 29 ad 00 00 lw r13,(r13+0) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 8003b30: 78 01 08 02 mvhi r1,0x802 8003b34: 38 21 1f 4c ori r1,r1,0x1f4c 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; 8003b38: 34 02 00 01 mvi r2,1 the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; 8003b3c: 58 8d 00 30 sw (r4+48),r13 8003b40: 58 22 00 30 sw (r1+48),r2 the_thread->Wait.return_argument = the_info; 8003b44: 58 8b 00 28 sw (r4+40),r11 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 8003b48: 58 81 00 44 sw (r4+68),r1 the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; the_thread->Wait.return_argument = the_info; _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); _ISR_Enable( level ); 8003b4c: d0 10 00 00 wcsr IE,r16 _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 8003b50: 78 01 08 02 mvhi r1,0x802 8003b54: 78 03 08 00 mvhi r3,0x800 8003b58: b8 a0 10 00 mv r2,r5 8003b5c: 38 63 69 9c ori r3,r3,0x699c 8003b60: 38 21 1f 4c ori r1,r1,0x1f4c 8003b64: f8 00 0a 7d calli 8006558 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 8003b68: f8 00 09 20 calli 8005fe8 <_Thread_Enable_dispatch> /* * When the thread is set free by a signal, it is need to eliminate * the signal. */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); 8003b6c: 29 62 00 00 lw r2,(r11+0) 8003b70: 34 04 00 00 mvi r4,0 8003b74: b9 60 18 00 mv r3,r11 8003b78: b8 80 28 00 mv r5,r4 8003b7c: b9 e0 08 00 mv r1,r15 8003b80: f8 00 19 af calli 800a23c <_POSIX_signals_Clear_signals> errno = _Thread_Executing->Wait.return_code; 8003b84: f8 00 2b 65 calli 800e918 <__errno> 8003b88: 29 82 00 00 lw r2,(r12+0) 8003b8c: 28 42 00 34 lw r2,(r2+52) 8003b90: 58 22 00 00 sw (r1+0),r2 return the_info->si_signo; 8003b94: 29 6c 00 00 lw r12,(r11+0) } 8003b98: b9 80 08 00 mv r1,r12 8003b9c: 2b 9d 00 04 lw ra,(sp+4) 8003ba0: 2b 8b 00 1c lw r11,(sp+28) 8003ba4: 2b 8c 00 18 lw r12,(sp+24) 8003ba8: 2b 8d 00 14 lw r13,(sp+20) 8003bac: 2b 8e 00 10 lw r14,(sp+16) 8003bb0: 2b 8f 00 0c lw r15,(sp+12) 8003bb4: 2b 90 00 08 lw r16,(sp+8) 8003bb8: 37 9c 00 28 addi sp,sp,40 8003bbc: c3 a0 00 00 ret } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 8003bc0: fb ff ff 8a calli 80039e8 <_POSIX_signals_Get_highest> 8003bc4: b8 20 60 00 mv r12,r1 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 8003bc8: b9 80 10 00 mv r2,r12 8003bcc: b9 e0 08 00 mv r1,r15 8003bd0: b9 60 18 00 mv r3,r11 8003bd4: b9 c0 28 00 mv r5,r14 8003bd8: 34 04 00 01 mvi r4,1 8003bdc: f8 00 19 98 calli 800a23c <_POSIX_signals_Clear_signals> _ISR_Enable( level ); 8003be0: d0 10 00 00 wcsr IE,r16 the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 8003be4: 34 01 00 00 mvi r1,0 8003be8: 59 61 00 08 sw (r11+8),r1 signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; the_info->si_code = SI_USER; 8003bec: 34 01 00 01 mvi r1,1 8003bf0: 59 61 00 04 sw (r11+4),r1 if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 8003bf4: 59 6c 00 00 sw (r11+0),r12 the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; return signo; 8003bf8: e3 ff ff e8 bi 8003b98 rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 8003bfc: b8 60 28 00 mv r5,r3 8003c00: e3 ff ff ae bi 8003ab8 /* API signals pending? */ _ISR_Disable( level ); if ( *set & api->signals_pending ) { /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 8003c04: fb ff ff 79 calli 80039e8 <_POSIX_signals_Get_highest> _POSIX_signals_Clear_signals( 8003c08: 34 04 00 00 mvi r4,0 /* API signals pending? */ _ISR_Disable( level ); if ( *set & api->signals_pending ) { /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 8003c0c: b8 20 10 00 mv r2,r1 8003c10: 59 61 00 00 sw (r11+0),r1 _POSIX_signals_Clear_signals( 8003c14: b9 60 18 00 mv r3,r11 8003c18: b9 e0 08 00 mv r1,r15 8003c1c: b8 80 28 00 mv r5,r4 8003c20: f8 00 19 87 calli 800a23c <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 8003c24: d0 10 00 00 wcsr IE,r16 the_info->si_code = SI_USER; 8003c28: 34 01 00 01 mvi r1,1 8003c2c: 59 61 00 04 sw (r11+4),r1 the_info->si_value.sival_int = 0; 8003c30: 34 01 00 00 mvi r1,0 8003c34: 59 61 00 08 sw (r11+8),r1 return the_info->si_signo; 8003c38: 29 6c 00 00 lw r12,(r11+0) 8003c3c: e3 ff ff d7 bi 8003b98 rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 8003c40: f8 00 2b 36 calli 800e918 <__errno> 8003c44: 34 02 00 16 mvi r2,22 8003c48: 58 22 00 00 sw (r1+0),r2 8003c4c: 34 0c ff ff mvi r12,-1 8003c50: e3 ff ff d2 bi 8003b98 080060f8 : int sigwait( const sigset_t *set, int *sig ) { 80060f8: 37 9c ff f8 addi sp,sp,-8 80060fc: 5b 8b 00 08 sw (sp+8),r11 8006100: 5b 9d 00 04 sw (sp+4),ra 8006104: b8 40 58 00 mv r11,r2 int status; status = sigtimedwait( set, NULL, NULL ); 8006108: 34 02 00 00 mvi r2,0 800610c: b8 40 18 00 mv r3,r2 8006110: fb ff ff 78 calli 8005ef0 8006114: b8 20 10 00 mv r2,r1 if ( status != -1 ) { 8006118: 34 01 ff ff mvi r1,-1 800611c: 44 41 00 09 be r2,r1,8006140 if ( sig ) 8006120: b9 60 08 00 mv r1,r11 8006124: 45 60 00 03 be r11,r0,8006130 <== NEVER TAKEN *sig = status; 8006128: 59 62 00 00 sw (r11+0),r2 800612c: 34 01 00 00 mvi r1,0 return 0; } return errno; } 8006130: 2b 9d 00 04 lw ra,(sp+4) 8006134: 2b 8b 00 08 lw r11,(sp+8) 8006138: 37 9c 00 08 addi sp,sp,8 800613c: c3 a0 00 00 ret if ( sig ) *sig = status; return 0; } return errno; 8006140: f8 00 2a 5c calli 8010ab0 <__errno> 8006144: 28 21 00 00 lw r1,(r1+0) } 8006148: 2b 9d 00 04 lw ra,(sp+4) 800614c: 2b 8b 00 08 lw r11,(sp+8) 8006150: 37 9c 00 08 addi sp,sp,8 8006154: c3 a0 00 00 ret 08002828 : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 8002828: 37 9c ff e8 addi sp,sp,-24 800282c: 5b 8b 00 18 sw (sp+24),r11 8002830: 5b 8c 00 14 sw (sp+20),r12 8002834: 5b 8d 00 10 sw (sp+16),r13 8002838: 5b 8e 00 0c sw (sp+12),r14 800283c: 5b 8f 00 08 sw (sp+8),r15 8002840: 5b 9d 00 04 sw (sp+4),ra 8002844: b8 40 60 00 mv r12,r2 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 8002848: 34 02 00 01 mvi r2,1 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 800284c: b8 60 68 00 mv r13,r3 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 8002850: 5c 22 00 06 bne r1,r2,8002868 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 8002854: 44 60 00 05 be r3,r0,8002868 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 8002858: 45 80 00 16 be r12,r0,80028b0 /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 800285c: 29 82 00 00 lw r2,(r12+0) 8002860: 34 42 ff ff addi r2,r2,-1 8002864: 50 22 00 0d bgeu r1,r2,8002898 <== ALWAYS TAKEN if ( !evp->sigev_signo ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) rtems_set_errno_and_return_minus_one( EINVAL ); 8002868: f8 00 2e 09 calli 800e08c <__errno> 800286c: 34 02 00 16 mvi r2,22 8002870: 58 22 00 00 sw (r1+0),r2 8002874: 34 01 ff ff mvi r1,-1 _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); return 0; } 8002878: 2b 9d 00 04 lw ra,(sp+4) 800287c: 2b 8b 00 18 lw r11,(sp+24) 8002880: 2b 8c 00 14 lw r12,(sp+20) 8002884: 2b 8d 00 10 lw r13,(sp+16) 8002888: 2b 8e 00 0c lw r14,(sp+12) 800288c: 2b 8f 00 08 lw r15,(sp+8) 8002890: 37 9c 00 18 addi sp,sp,24 8002894: c3 a0 00 00 ret ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 8002898: 29 81 00 04 lw r1,(r12+4) 800289c: 44 20 ff f3 be r1,r0,8002868 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 80028a0: 34 21 ff ff addi r1,r1,-1 80028a4: 34 02 00 1f mvi r2,31 80028a8: 50 41 00 02 bgeu r2,r1,80028b0 <== ALWAYS TAKEN 80028ac: e3 ff ff ef bi 8002868 <== NOT EXECUTED rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80028b0: 78 01 08 02 mvhi r1,0x802 80028b4: 38 21 28 b4 ori r1,r1,0x28b4 80028b8: 28 22 00 00 lw r2,(r1+0) 80028bc: 34 42 00 01 addi r2,r2,1 80028c0: 58 22 00 00 sw (r1+0),r2 * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void ) { return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ); 80028c4: 78 01 08 02 mvhi r1,0x802 80028c8: 38 21 2b 74 ori r1,r1,0x2b74 80028cc: f8 00 05 e8 calli 800406c <_Objects_Allocate> 80028d0: b8 20 58 00 mv r11,r1 /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 80028d4: 44 20 00 2e be r1,r0,800298c rtems_set_errno_and_return_minus_one( EAGAIN ); } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 80028d8: 34 02 00 02 mvi r2,2 ptimer->thread_id = _Thread_Executing->Object.id; 80028dc: 78 01 08 02 mvhi r1,0x802 rtems_set_errno_and_return_minus_one( EAGAIN ); } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 80028e0: 31 62 00 3c sb (r11+60),r2 ptimer->thread_id = _Thread_Executing->Object.id; 80028e4: 38 21 29 70 ori r1,r1,0x2970 80028e8: 28 21 00 00 lw r1,(r1+0) 80028ec: 28 21 00 08 lw r1,(r1+8) 80028f0: 59 61 00 38 sw (r11+56),r1 if ( evp != NULL ) { 80028f4: 45 80 00 07 be r12,r0,8002910 ptimer->inf.sigev_notify = evp->sigev_notify; ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; 80028f8: 29 81 00 08 lw r1,(r12+8) 80028fc: 59 61 00 48 sw (r11+72),r1 ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; 8002900: 29 81 00 00 lw r1,(r12+0) ptimer->inf.sigev_signo = evp->sigev_signo; 8002904: 29 8c 00 04 lw r12,(r12+4) ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; 8002908: 59 61 00 40 sw (r11+64),r1 ptimer->inf.sigev_signo = evp->sigev_signo; 800290c: 59 6c 00 44 sw (r11+68),r12 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8002910: 29 6e 00 08 lw r14,(r11+8) 8002914: 78 01 08 02 mvhi r1,0x802 8002918: 38 21 2b 74 ori r1,r1,0x2b74 ptimer->inf.sigev_value = evp->sigev_value; } ptimer->overrun = 0; 800291c: 34 0c 00 00 mvi r12,0 8002920: 28 2f 00 1c lw r15,(r1+28) 8002924: 34 02 00 02 mvi r2,2 8002928: 59 6c 00 68 sw (r11+104),r12 ptimer->timer_data.it_value.tv_sec = 0; 800292c: 59 6c 00 5c sw (r11+92),r12 ptimer->timer_data.it_value.tv_nsec = 0; 8002930: 59 6c 00 60 sw (r11+96),r12 ptimer->timer_data.it_interval.tv_sec = 0; 8002934: 59 6c 00 54 sw (r11+84),r12 ptimer->timer_data.it_interval.tv_nsec = 0; 8002938: 59 6c 00 58 sw (r11+88),r12 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 800293c: 59 6c 00 18 sw (r11+24),r12 the_watchdog->routine = routine; 8002940: 59 6c 00 2c sw (r11+44),r12 the_watchdog->id = id; 8002944: 59 6c 00 30 sw (r11+48),r12 the_watchdog->user_data = user_data; 8002948: 59 6c 00 34 sw (r11+52),r12 800294c: 21 c1 ff ff andi r1,r14,0xffff 8002950: fb ff f7 1b calli 80005bc <__ashlsi3> 8002954: b5 e1 08 00 add r1,r15,r1 8002958: 58 2b 00 00 sw (r1+0),r11 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 800295c: 59 6c 00 0c sw (r11+12),r12 _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 8002960: 59 ae 00 00 sw (r13+0),r14 _Thread_Enable_dispatch(); 8002964: f8 00 08 85 calli 8004b78 <_Thread_Enable_dispatch> 8002968: b9 80 08 00 mv r1,r12 return 0; } 800296c: 2b 9d 00 04 lw ra,(sp+4) 8002970: 2b 8b 00 18 lw r11,(sp+24) 8002974: 2b 8c 00 14 lw r12,(sp+20) 8002978: 2b 8d 00 10 lw r13,(sp+16) 800297c: 2b 8e 00 0c lw r14,(sp+12) 8002980: 2b 8f 00 08 lw r15,(sp+8) 8002984: 37 9c 00 18 addi sp,sp,24 8002988: c3 a0 00 00 ret /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { _Thread_Enable_dispatch(); 800298c: f8 00 08 7b calli 8004b78 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 8002990: f8 00 2d bf calli 800e08c <__errno> 8002994: 34 02 00 0b mvi r2,11 8002998: 58 22 00 00 sw (r1+0),r2 800299c: 34 01 ff ff mvi r1,-1 80029a0: e3 ff ff f3 bi 800296c 080029a4 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 80029a4: 37 9c ff c8 addi sp,sp,-56 80029a8: 5b 8b 00 18 sw (sp+24),r11 80029ac: 5b 8c 00 14 sw (sp+20),r12 80029b0: 5b 8d 00 10 sw (sp+16),r13 80029b4: 5b 8e 00 0c sw (sp+12),r14 80029b8: 5b 8f 00 08 sw (sp+8),r15 80029bc: 5b 9d 00 04 sw (sp+4),ra 80029c0: b8 60 60 00 mv r12,r3 80029c4: b8 20 58 00 mv r11,r1 80029c8: b8 80 68 00 mv r13,r4 Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 80029cc: 44 60 00 1c be r3,r0,8002a3c <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); /* First, it verifies if the structure "value" is correct */ if ( ( value->it_value.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) || 80029d0: 28 64 00 0c lw r4,(r3+12) 80029d4: 78 03 3b 9a mvhi r3,0x3b9a 80029d8: 38 63 c9 ff ori r3,r3,0xc9ff 80029dc: 54 83 00 18 bgu r4,r3,8002a3c ( value->it_value.tv_nsec < 0 ) || ( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) || 80029e0: 29 85 00 04 lw r5,(r12+4) 80029e4: 50 65 00 02 bgeu r3,r5,80029ec <== ALWAYS TAKEN 80029e8: e0 00 00 15 bi 8002a3c <== NOT EXECUTED ( value->it_interval.tv_nsec < 0 )) { /* The number of nanoseconds is not correct */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 80029ec: 7c 43 00 00 cmpnei r3,r2,0 80029f0: 7c 41 00 04 cmpnei r1,r2,4 80029f4: a0 61 08 00 and r1,r3,r1 80029f8: 5c 20 00 11 bne r1,r0,8002a3c rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 80029fc: 29 81 00 00 lw r1,(r12+0) 8002a00: 5b 81 00 20 sw (sp+32),r1 8002a04: 29 83 00 08 lw r3,(r12+8) /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 8002a08: 34 01 00 04 mvi r1,4 if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 8002a0c: 5b 85 00 24 sw (sp+36),r5 8002a10: 5b 83 00 28 sw (sp+40),r3 8002a14: 5b 84 00 2c sw (sp+44),r4 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 8002a18: 44 41 00 45 be r2,r1,8002b2c RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 8002a1c: 78 01 08 02 mvhi r1,0x802 8002a20: b9 60 10 00 mv r2,r11 8002a24: 38 21 2b 74 ori r1,r1,0x2b74 8002a28: 37 83 00 38 addi r3,sp,56 8002a2c: f8 00 06 c8 calli 800454c <_Objects_Get> 8002a30: b8 20 58 00 mv r11,r1 * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 8002a34: 2b 81 00 38 lw r1,(sp+56) 8002a38: 44 20 00 0d be r1,r0,8002a6c #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 8002a3c: f8 00 2d 94 calli 800e08c <__errno> 8002a40: 34 02 00 16 mvi r2,22 8002a44: 58 22 00 00 sw (r1+0),r2 8002a48: 34 01 ff ff mvi r1,-1 } 8002a4c: 2b 9d 00 04 lw ra,(sp+4) 8002a50: 2b 8b 00 18 lw r11,(sp+24) 8002a54: 2b 8c 00 14 lw r12,(sp+20) 8002a58: 2b 8d 00 10 lw r13,(sp+16) 8002a5c: 2b 8e 00 0c lw r14,(sp+12) 8002a60: 2b 8f 00 08 lw r15,(sp+8) 8002a64: 37 9c 00 38 addi sp,sp,56 8002a68: c3 a0 00 00 ret ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { 8002a6c: 2b 82 00 28 lw r2,(sp+40) 8002a70: 5c 41 00 03 bne r2,r1,8002a7c 8002a74: 2b 8e 00 2c lw r14,(sp+44) 8002a78: 45 c2 00 3a be r14,r2,8002b60 _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 8002a7c: b9 80 08 00 mv r1,r12 8002a80: f8 00 0a 79 calli 8005464 <_Timespec_To_ticks> 8002a84: 59 61 00 64 sw (r11+100),r1 initial_period = _Timespec_To_ticks( &normalize.it_value ); 8002a88: 37 81 00 28 addi r1,sp,40 8002a8c: f8 00 0a 76 calli 8005464 <_Timespec_To_ticks> activated = _POSIX_Timer_Insert_helper( 8002a90: 29 63 00 08 lw r3,(r11+8) 8002a94: 78 04 08 00 mvhi r4,0x800 8002a98: b8 20 10 00 mv r2,r1 8002a9c: 38 84 2c 08 ori r4,r4,0x2c08 8002aa0: 35 61 00 10 addi r1,r11,16 8002aa4: b9 60 28 00 mv r5,r11 8002aa8: f8 00 17 6c calli 8008858 <_POSIX_Timer_Insert_helper> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 8002aac: 44 20 00 4c be r1,r0,8002bdc /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 8002ab0: 45 a0 00 09 be r13,r0,8002ad4 *ovalue = ptimer->timer_data; 8002ab4: 29 61 00 54 lw r1,(r11+84) 8002ab8: 59 a1 00 00 sw (r13+0),r1 8002abc: 29 62 00 58 lw r2,(r11+88) 8002ac0: 59 a2 00 04 sw (r13+4),r2 8002ac4: 29 63 00 5c lw r3,(r11+92) 8002ac8: 59 a3 00 08 sw (r13+8),r3 8002acc: 29 61 00 60 lw r1,(r11+96) 8002ad0: 59 a1 00 0c sw (r13+12),r1 ptimer->timer_data = normalize; 8002ad4: 2b 82 00 20 lw r2,(sp+32) /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); 8002ad8: 35 61 00 6c addi r1,r11,108 * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) *ovalue = ptimer->timer_data; ptimer->timer_data = normalize; 8002adc: 59 62 00 54 sw (r11+84),r2 8002ae0: 2b 83 00 24 lw r3,(sp+36) /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 8002ae4: 34 02 00 03 mvi r2,3 * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) *ovalue = ptimer->timer_data; ptimer->timer_data = normalize; 8002ae8: 59 63 00 58 sw (r11+88),r3 8002aec: 2b 83 00 28 lw r3,(sp+40) 8002af0: 59 63 00 5c sw (r11+92),r3 8002af4: 2b 83 00 2c lw r3,(sp+44) /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 8002af8: 31 62 00 3c sb (r11+60),r2 * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) *ovalue = ptimer->timer_data; ptimer->timer_data = normalize; 8002afc: 59 63 00 60 sw (r11+96),r3 /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); 8002b00: f8 00 03 a7 calli 800399c <_TOD_Get> _Thread_Enable_dispatch(); 8002b04: f8 00 08 1d calli 8004b78 <_Thread_Enable_dispatch> 8002b08: 34 01 00 00 mvi r1,0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 8002b0c: 2b 9d 00 04 lw ra,(sp+4) 8002b10: 2b 8b 00 18 lw r11,(sp+24) 8002b14: 2b 8c 00 14 lw r12,(sp+20) 8002b18: 2b 8d 00 10 lw r13,(sp+16) 8002b1c: 2b 8e 00 0c lw r14,(sp+12) 8002b20: 2b 8f 00 08 lw r15,(sp+8) 8002b24: 37 9c 00 38 addi sp,sp,56 8002b28: c3 a0 00 00 ret normalize = *value; /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); 8002b2c: 37 8e 00 30 addi r14,sp,48 8002b30: b9 c0 08 00 mv r1,r14 8002b34: f8 00 03 9a calli 800399c <_TOD_Get> /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 8002b38: 37 8f 00 28 addi r15,sp,40 8002b3c: b9 c0 08 00 mv r1,r14 8002b40: b9 e0 10 00 mv r2,r15 8002b44: f8 00 0a 27 calli 80053e0 <_Timespec_Greater_than> 8002b48: 5c 20 ff bd bne r1,r0,8002a3c rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 8002b4c: b9 e0 10 00 mv r2,r15 8002b50: b9 c0 08 00 mv r1,r14 8002b54: b9 e0 18 00 mv r3,r15 8002b58: f8 00 0a 2e calli 8005410 <_Timespec_Subtract> 8002b5c: e3 ff ff b0 bi 8002a1c case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 8002b60: 35 61 00 10 addi r1,r11,16 8002b64: f8 00 0b ae calli 8005a1c <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) 8002b68: 45 ae 00 09 be r13,r14,8002b8c *ovalue = ptimer->timer_data; 8002b6c: 29 61 00 54 lw r1,(r11+84) 8002b70: 59 a1 00 00 sw (r13+0),r1 8002b74: 29 62 00 58 lw r2,(r11+88) 8002b78: 59 a2 00 04 sw (r13+4),r2 8002b7c: 29 63 00 5c lw r3,(r11+92) 8002b80: 59 a3 00 08 sw (r13+8),r3 8002b84: 29 61 00 60 lw r1,(r11+96) 8002b88: 59 a1 00 0c sw (r13+12),r1 /* The new data are set */ ptimer->timer_data = normalize; 8002b8c: 2b 82 00 20 lw r2,(sp+32) /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 8002b90: 34 01 00 04 mvi r1,4 (void) _Watchdog_Remove( &ptimer->Timer ); /* The old data of the timer are returned */ if ( ovalue ) *ovalue = ptimer->timer_data; /* The new data are set */ ptimer->timer_data = normalize; 8002b94: 59 62 00 54 sw (r11+84),r2 8002b98: 2b 83 00 24 lw r3,(sp+36) 8002b9c: 59 63 00 58 sw (r11+88),r3 8002ba0: 2b 82 00 28 lw r2,(sp+40) 8002ba4: 59 62 00 5c sw (r11+92),r2 8002ba8: 2b 83 00 2c lw r3,(sp+44) /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 8002bac: 31 61 00 3c sb (r11+60),r1 (void) _Watchdog_Remove( &ptimer->Timer ); /* The old data of the timer are returned */ if ( ovalue ) *ovalue = ptimer->timer_data; /* The new data are set */ ptimer->timer_data = normalize; 8002bb0: 59 63 00 60 sw (r11+96),r3 /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; /* Returns with success */ _Thread_Enable_dispatch(); 8002bb4: f8 00 07 f1 calli 8004b78 <_Thread_Enable_dispatch> 8002bb8: 34 01 00 00 mvi r1,0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 8002bbc: 2b 9d 00 04 lw ra,(sp+4) 8002bc0: 2b 8b 00 18 lw r11,(sp+24) 8002bc4: 2b 8c 00 14 lw r12,(sp+20) 8002bc8: 2b 8d 00 10 lw r13,(sp+16) 8002bcc: 2b 8e 00 0c lw r14,(sp+12) 8002bd0: 2b 8f 00 08 lw r15,(sp+8) 8002bd4: 37 9c 00 38 addi sp,sp,56 8002bd8: c3 a0 00 00 ret ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { _Thread_Enable_dispatch(); 8002bdc: 5b 81 00 1c sw (sp+28),r1 8002be0: f8 00 07 e6 calli 8004b78 <_Thread_Enable_dispatch> 8002be4: 2b 81 00 1c lw r1,(sp+28) case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 8002be8: 2b 9d 00 04 lw ra,(sp+4) 8002bec: 2b 8b 00 18 lw r11,(sp+24) 8002bf0: 2b 8c 00 14 lw r12,(sp+20) 8002bf4: 2b 8d 00 10 lw r13,(sp+16) 8002bf8: 2b 8e 00 0c lw r14,(sp+12) 8002bfc: 2b 8f 00 08 lw r15,(sp+8) 8002c00: 37 9c 00 38 addi sp,sp,56 8002c04: c3 a0 00 00 ret 08002744 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 8002744: 37 9c ff e8 addi sp,sp,-24 8002748: 5b 8b 00 10 sw (sp+16),r11 800274c: 5b 8c 00 0c sw (sp+12),r12 8002750: 5b 8d 00 08 sw (sp+8),r13 8002754: 5b 9d 00 04 sw (sp+4),ra /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 8002758: 78 0b 08 02 mvhi r11,0x802 800275c: 39 6b 11 48 ori r11,r11,0x1148 8002760: 29 62 00 1c lw r2,(r11+28) useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 8002764: b8 20 60 00 mv r12,r1 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 8002768: 44 40 00 25 be r2,r0,80027fc _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 800276c: b9 60 08 00 mv r1,r11 8002770: f8 00 0a 97 calli 80051cc <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 8002774: 34 21 ff fe addi r1,r1,-2 8002778: 34 02 00 01 mvi r2,1 800277c: 50 41 00 28 bgeu r2,r1,800281c <== ALWAYS TAKEN 8002780: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 8002784: 45 80 00 17 be r12,r0,80027e0 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 8002788: 78 02 00 0f mvhi r2,0xf 800278c: 38 42 42 40 ori r2,r2,0x4240 8002790: b9 80 08 00 mv r1,r12 8002794: f8 00 69 8b calli 801cdc0 <__udivsi3> tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 8002798: 78 02 00 0f mvhi r2,0xf * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 800279c: 5b 81 00 14 sw (sp+20),r1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 80027a0: 38 42 42 40 ori r2,r2,0x4240 80027a4: b9 80 08 00 mv r1,r12 80027a8: f8 00 69 96 calli 801ce00 <__umodsi3> 80027ac: 34 02 03 e8 mvi r2,1000 80027b0: f8 00 69 05 calli 801cbc4 <__mulsi3> ticks = _Timespec_To_ticks( &tp ); 80027b4: 37 8c 00 14 addi r12,sp,20 */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 80027b8: 5b 81 00 18 sw (sp+24),r1 ticks = _Timespec_To_ticks( &tp ); 80027bc: b9 80 08 00 mv r1,r12 80027c0: f8 00 08 d7 calli 8004b1c <_Timespec_To_ticks> if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 80027c4: b9 80 08 00 mv r1,r12 80027c8: f8 00 08 d5 calli 8004b1c <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80027cc: 59 61 00 0c sw (r11+12),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80027d0: 78 01 08 02 mvhi r1,0x802 80027d4: 38 21 09 a0 ori r1,r1,0x9a0 80027d8: b9 60 10 00 mv r2,r11 80027dc: f8 00 0a 15 calli 8005030 <_Watchdog_Insert> } return remaining; } 80027e0: b9 a0 08 00 mv r1,r13 80027e4: 2b 9d 00 04 lw ra,(sp+4) 80027e8: 2b 8b 00 10 lw r11,(sp+16) 80027ec: 2b 8c 00 0c lw r12,(sp+12) 80027f0: 2b 8d 00 08 lw r13,(sp+8) 80027f4: 37 9c 00 18 addi sp,sp,24 80027f8: c3 a0 00 00 ret Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 80027fc: 78 01 08 00 mvhi r1,0x800 8002800: 38 21 28 60 ori r1,r1,0x2860 8002804: 59 61 00 1c sw (r11+28),r1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8002808: 59 62 00 08 sw (r11+8),r2 the_watchdog->routine = routine; the_watchdog->id = id; 800280c: 59 62 00 20 sw (r11+32),r2 the_watchdog->user_data = user_data; 8002810: 59 62 00 24 sw (r11+36),r2 8002814: b8 40 68 00 mv r13,r2 8002818: e3 ff ff db bi 8002784 * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 800281c: 29 64 00 14 lw r4,(r11+20) 8002820: 29 61 00 0c lw r1,(r11+12) /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 8002824: 29 63 00 18 lw r3,(r11+24) 8002828: 37 82 00 14 addi r2,sp,20 * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 800282c: b4 81 08 00 add r1,r4,r1 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 8002830: c8 23 08 00 sub r1,r1,r3 8002834: f8 00 08 8b calli 8004a60 <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 8002838: 2b 81 00 14 lw r1,(sp+20) 800283c: 78 02 00 0f mvhi r2,0xf 8002840: 38 42 42 40 ori r2,r2,0x4240 8002844: f8 00 68 e0 calli 801cbc4 <__mulsi3> 8002848: b8 20 68 00 mv r13,r1 remaining += tp.tv_nsec / 1000; 800284c: 2b 81 00 18 lw r1,(sp+24) 8002850: 34 02 03 e8 mvi r2,1000 8002854: f8 00 68 fc calli 801cc44 <__divsi3> 8002858: b4 2d 68 00 add r13,r1,r13 800285c: e3 ff ff ca bi 8002784