=============================================================================== 40009cf4 <_CORE_RWLock_Release>: #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 40009cf4: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing = _Thread_Executing; 40009cf8: 03 10 00 68 sethi %hi(0x4001a000), %g1 * 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 ); 40009cfc: 7f ff e6 32 call 400035c4 40009d00: fa 00 61 a0 ld [ %g1 + 0x1a0 ], %i5 ! 4001a1a0 <_Per_CPU_Information+0x10> 40009d04: 84 10 00 08 mov %o0, %g2 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 40009d08: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 40009d0c: 80 a0 60 00 cmp %g1, 0 40009d10: 12 80 00 08 bne 40009d30 <_CORE_RWLock_Release+0x3c> 40009d14: 80 a0 60 01 cmp %g1, 1 _ISR_Enable( level ); 40009d18: 7f ff e6 2f call 400035d4 40009d1c: b0 10 20 00 clr %i0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 40009d20: 82 10 20 02 mov 2, %g1 40009d24: c2 27 60 34 st %g1, [ %i5 + 0x34 ] 40009d28: 81 c7 e0 08 ret 40009d2c: 81 e8 00 00 restore return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 40009d30: 32 80 00 0b bne,a 40009d5c <_CORE_RWLock_Release+0x68> 40009d34: c0 27 60 34 clr [ %i5 + 0x34 ] the_rwlock->number_of_readers -= 1; 40009d38: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 40009d3c: 82 00 7f ff add %g1, -1, %g1 if ( the_rwlock->number_of_readers != 0 ) { 40009d40: 80 a0 60 00 cmp %g1, 0 40009d44: 02 80 00 05 be 40009d58 <_CORE_RWLock_Release+0x64> 40009d48: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* must be unlocked again */ _ISR_Enable( level ); 40009d4c: 7f ff e6 22 call 400035d4 40009d50: b0 10 20 00 clr %i0 return CORE_RWLOCK_SUCCESSFUL; 40009d54: 30 80 00 24 b,a 40009de4 <_CORE_RWLock_Release+0xf0> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 40009d58: c0 27 60 34 clr [ %i5 + 0x34 ] /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 40009d5c: c0 26 20 44 clr [ %i0 + 0x44 ] _ISR_Enable( level ); 40009d60: 7f ff e6 1d call 400035d4 40009d64: 90 10 00 02 mov %g2, %o0 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 40009d68: 40 00 07 6d call 4000bb1c <_Thread_queue_Dequeue> 40009d6c: 90 10 00 18 mov %i0, %o0 if ( next ) { 40009d70: 80 a2 20 00 cmp %o0, 0 40009d74: 22 80 00 1c be,a 40009de4 <_CORE_RWLock_Release+0xf0> 40009d78: b0 10 20 00 clr %i0 if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 40009d7c: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 40009d80: 80 a0 60 01 cmp %g1, 1 40009d84: 32 80 00 05 bne,a 40009d98 <_CORE_RWLock_Release+0xa4> 40009d88: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 40009d8c: 82 10 20 02 mov 2, %g1 return CORE_RWLOCK_SUCCESSFUL; 40009d90: 10 80 00 14 b 40009de0 <_CORE_RWLock_Release+0xec> 40009d94: c2 26 20 44 st %g1, [ %i0 + 0x44 ] } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 40009d98: 82 00 60 01 inc %g1 40009d9c: c2 26 20 48 st %g1, [ %i0 + 0x48 ] the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 40009da0: 82 10 20 01 mov 1, %g1 40009da4: c2 26 20 44 st %g1, [ %i0 + 0x44 ] /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 40009da8: 40 00 08 99 call 4000c00c <_Thread_queue_First> 40009dac: 90 10 00 18 mov %i0, %o0 if ( !next || 40009db0: 92 92 20 00 orcc %o0, 0, %o1 40009db4: 22 80 00 0c be,a 40009de4 <_CORE_RWLock_Release+0xf0> 40009db8: b0 10 20 00 clr %i0 40009dbc: c2 02 60 30 ld [ %o1 + 0x30 ], %g1 40009dc0: 80 a0 60 01 cmp %g1, 1 40009dc4: 02 80 00 07 be 40009de0 <_CORE_RWLock_Release+0xec> <== NEVER TAKEN 40009dc8: 90 10 00 18 mov %i0, %o0 next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 40009dcc: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 40009dd0: 82 00 60 01 inc %g1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 40009dd4: 40 00 08 3f call 4000bed0 <_Thread_queue_Extract> 40009dd8: c2 26 20 48 st %g1, [ %i0 + 0x48 ] } 40009ddc: 30 bf ff f3 b,a 40009da8 <_CORE_RWLock_Release+0xb4> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 40009de0: b0 10 20 00 clr %i0 40009de4: 81 c7 e0 08 ret 40009de8: 81 e8 00 00 restore =============================================================================== 40009dec <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 40009dec: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 40009df0: 90 10 00 18 mov %i0, %o0 40009df4: 40 00 06 7e call 4000b7ec <_Thread_Get> 40009df8: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40009dfc: c2 07 bf fc ld [ %fp + -4 ], %g1 40009e00: 80 a0 60 00 cmp %g1, 0 40009e04: 12 80 00 08 bne 40009e24 <_CORE_RWLock_Timeout+0x38> <== NEVER TAKEN 40009e08: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 40009e0c: 40 00 08 bd call 4000c100 <_Thread_queue_Process_timeout> 40009e10: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40009e14: 03 10 00 67 sethi %hi(0x40019c00), %g1 40009e18: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 40019c80 <_Thread_Dispatch_disable_level> --level; 40009e1c: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40009e20: c4 20 60 80 st %g2, [ %g1 + 0x80 ] 40009e24: 81 c7 e0 08 ret 40009e28: 81 e8 00 00 restore =============================================================================== 40007e84 <_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 ) { 40007e84: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 40007e88: 90 10 00 18 mov %i0, %o0 40007e8c: 40 00 07 3d call 40009b80 <_Thread_queue_Dequeue> 40007e90: ba 10 00 18 mov %i0, %i5 40007e94: 80 a2 20 00 cmp %o0, 0 40007e98: 12 80 00 0e bne 40007ed0 <_CORE_semaphore_Surrender+0x4c> 40007e9c: b0 10 20 00 clr %i0 if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 40007ea0: 7f ff e8 82 call 400020a8 40007ea4: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 40007ea8: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40007eac: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 40007eb0: 80 a0 40 02 cmp %g1, %g2 40007eb4: 1a 80 00 05 bcc 40007ec8 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN 40007eb8: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 40007ebc: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 40007ec0: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 40007ec4: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 40007ec8: 7f ff e8 7c call 400020b8 40007ecc: 01 00 00 00 nop } return status; } 40007ed0: 81 c7 e0 08 ret 40007ed4: 81 e8 00 00 restore =============================================================================== 40006b0c <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 40006b0c: 9d e3 bf a0 save %sp, -96, %sp rtems_event_set pending_events; rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; 40006b10: e0 06 20 30 ld [ %i0 + 0x30 ], %l0 _ISR_Disable( level ); 40006b14: 7f ff ed 65 call 400020a8 40006b18: ba 10 00 18 mov %i0, %i5 40006b1c: b0 10 00 08 mov %o0, %i0 RTEMS_INLINE_ROUTINE void _Event_sets_Post( rtems_event_set the_new_events, rtems_event_set *the_event_set ) { *the_event_set |= the_new_events; 40006b20: c2 06 80 00 ld [ %i2 ], %g1 40006b24: b2 16 40 01 or %i1, %g1, %i1 40006b28: f2 26 80 00 st %i1, [ %i2 ] _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; 40006b2c: c4 07 60 24 ld [ %i5 + 0x24 ], %g2 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 40006b30: 82 8e 40 02 andcc %i1, %g2, %g1 40006b34: 02 80 00 3d be 40006c28 <_Event_Surrender+0x11c> 40006b38: 07 10 00 79 sethi %hi(0x4001e400), %g3 /* * 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() && 40006b3c: 86 10 e3 10 or %g3, 0x310, %g3 ! 4001e710 <_Per_CPU_Information> 40006b40: c8 00 e0 08 ld [ %g3 + 8 ], %g4 40006b44: 80 a1 20 00 cmp %g4, 0 40006b48: 22 80 00 18 be,a 40006ba8 <_Event_Surrender+0x9c> 40006b4c: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 40006b50: c6 00 e0 10 ld [ %g3 + 0x10 ], %g3 40006b54: 80 a7 40 03 cmp %i5, %g3 40006b58: 32 80 00 14 bne,a 40006ba8 <_Event_Surrender+0x9c> 40006b5c: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 40006b60: c6 06 c0 00 ld [ %i3 ], %g3 40006b64: 86 00 ff ff add %g3, -1, %g3 /* * 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 ) && 40006b68: 80 a0 e0 01 cmp %g3, 1 40006b6c: 38 80 00 0f bgu,a 40006ba8 <_Event_Surrender+0x9c> 40006b70: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 40006b74: 80 a0 40 02 cmp %g1, %g2 40006b78: 02 80 00 04 be 40006b88 <_Event_Surrender+0x7c> 40006b7c: 80 8c 20 02 btst 2, %l0 40006b80: 02 80 00 2a be 40006c28 <_Event_Surrender+0x11c> <== NEVER TAKEN 40006b84: 01 00 00 00 nop RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 40006b88: b2 2e 40 01 andn %i1, %g1, %i1 event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40006b8c: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( 40006b90: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40006b94: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40006b98: c2 20 80 00 st %g1, [ %g2 ] *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 40006b9c: 82 10 20 03 mov 3, %g1 40006ba0: 10 80 00 22 b 40006c28 <_Event_Surrender+0x11c> 40006ba4: c2 26 c0 00 st %g1, [ %i3 ] } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 40006ba8: 80 8f 00 03 btst %i4, %g3 40006bac: 02 80 00 1f be 40006c28 <_Event_Surrender+0x11c> 40006bb0: 80 a0 40 02 cmp %g1, %g2 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 40006bb4: 02 80 00 04 be 40006bc4 <_Event_Surrender+0xb8> 40006bb8: 80 8c 20 02 btst 2, %l0 40006bbc: 02 80 00 1b be 40006c28 <_Event_Surrender+0x11c> <== NEVER TAKEN 40006bc0: 01 00 00 00 nop event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40006bc4: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 40006bc8: b2 2e 40 01 andn %i1, %g1, %i1 /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( 40006bcc: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40006bd0: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40006bd4: c2 20 80 00 st %g1, [ %g2 ] _ISR_Flash( level ); 40006bd8: 7f ff ed 38 call 400020b8 40006bdc: 90 10 00 18 mov %i0, %o0 40006be0: 7f ff ed 32 call 400020a8 40006be4: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 40006be8: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 40006bec: 80 a0 60 02 cmp %g1, 2 40006bf0: 02 80 00 06 be 40006c08 <_Event_Surrender+0xfc> 40006bf4: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 40006bf8: 7f ff ed 30 call 400020b8 40006bfc: 33 04 01 ff sethi %hi(0x1007fc00), %i1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40006c00: 10 80 00 08 b 40006c20 <_Event_Surrender+0x114> 40006c04: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 40006c08: c2 27 60 50 st %g1, [ %i5 + 0x50 ] _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 40006c0c: 7f ff ed 2b call 400020b8 40006c10: 33 04 01 ff sethi %hi(0x1007fc00), %i1 (void) _Watchdog_Remove( &the_thread->Timer ); 40006c14: 40 00 0e 6a call 4000a5bc <_Watchdog_Remove> 40006c18: 90 07 60 48 add %i5, 0x48, %o0 40006c1c: b2 16 63 f8 or %i1, 0x3f8, %i1 40006c20: 40 00 0a 2a call 400094c8 <_Thread_Clear_state> 40006c24: 91 e8 00 1d restore %g0, %i5, %o0 _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 40006c28: 7f ff ed 24 call 400020b8 40006c2c: 81 e8 00 00 restore =============================================================================== 40006c30 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 40006c30: 9d e3 bf 98 save %sp, -104, %sp ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); 40006c34: 90 10 00 18 mov %i0, %o0 40006c38: 40 00 0b 06 call 40009850 <_Thread_Get> 40006c3c: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40006c40: c2 07 bf fc ld [ %fp + -4 ], %g1 40006c44: 80 a0 60 00 cmp %g1, 0 40006c48: 12 80 00 1b bne 40006cb4 <_Event_Timeout+0x84> <== NEVER TAKEN 40006c4c: ba 10 00 08 mov %o0, %i5 * * 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 ); 40006c50: 7f ff ed 16 call 400020a8 40006c54: 01 00 00 00 nop RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 40006c58: 03 10 00 79 sethi %hi(0x4001e400), %g1 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 40006c5c: c2 00 63 20 ld [ %g1 + 0x320 ], %g1 ! 4001e720 <_Per_CPU_Information+0x10> 40006c60: 80 a7 40 01 cmp %i5, %g1 40006c64: 12 80 00 08 bne 40006c84 <_Event_Timeout+0x54> 40006c68: c0 27 60 24 clr [ %i5 + 0x24 ] if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 40006c6c: c2 06 40 00 ld [ %i1 ], %g1 40006c70: 80 a0 60 01 cmp %g1, 1 40006c74: 12 80 00 05 bne 40006c88 <_Event_Timeout+0x58> 40006c78: 82 10 20 06 mov 6, %g1 *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 40006c7c: 82 10 20 02 mov 2, %g1 40006c80: c2 26 40 00 st %g1, [ %i1 ] } the_thread->Wait.return_code = RTEMS_TIMEOUT; 40006c84: 82 10 20 06 mov 6, %g1 40006c88: c2 27 60 34 st %g1, [ %i5 + 0x34 ] _ISR_Enable( level ); 40006c8c: 7f ff ed 0b call 400020b8 40006c90: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40006c94: 90 10 00 1d mov %i5, %o0 40006c98: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40006c9c: 40 00 0a 0b call 400094c8 <_Thread_Clear_state> 40006ca0: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40006ca4: 03 10 00 78 sethi %hi(0x4001e000), %g1 40006ca8: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 4001e200 <_Thread_Dispatch_disable_level> --level; 40006cac: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40006cb0: c4 20 62 00 st %g2, [ %g1 + 0x200 ] 40006cb4: 81 c7 e0 08 ret 40006cb8: 81 e8 00 00 restore =============================================================================== 4000cba4 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4000cba4: 9d e3 bf a0 save %sp, -96, %sp /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { 4000cba8: 80 a6 60 00 cmp %i1, 0 4000cbac: 02 80 00 7a be 4000cd94 <_Heap_Free+0x1f0> 4000cbb0: 88 10 20 01 mov 1, %g4 4000cbb4: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4000cbb8: 40 00 2c c8 call 40017ed8 <.urem> 4000cbbc: 90 10 00 19 mov %i1, %o0 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 4000cbc0: f6 06 20 20 ld [ %i0 + 0x20 ], %i3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000cbc4: ba 06 7f f8 add %i1, -8, %i5 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4000cbc8: 90 27 40 08 sub %i5, %o0, %o0 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; 4000cbcc: 80 a2 00 1b cmp %o0, %i3 4000cbd0: 0a 80 00 05 bcs 4000cbe4 <_Heap_Free+0x40> 4000cbd4: 82 10 20 00 clr %g1 4000cbd8: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000cbdc: 80 a0 40 08 cmp %g1, %o0 4000cbe0: 82 60 3f ff subx %g0, -1, %g1 } alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 4000cbe4: 80 a0 60 00 cmp %g1, 0 4000cbe8: 02 80 00 6b be 4000cd94 <_Heap_Free+0x1f0> 4000cbec: 88 10 20 00 clr %g4 - 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; 4000cbf0: f8 02 20 04 ld [ %o0 + 4 ], %i4 4000cbf4: 84 0f 3f fe and %i4, -2, %g2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000cbf8: 82 02 00 02 add %o0, %g2, %g1 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; 4000cbfc: 80 a0 40 1b cmp %g1, %i3 4000cc00: 0a 80 00 05 bcs 4000cc14 <_Heap_Free+0x70> <== NEVER TAKEN 4000cc04: 86 10 20 00 clr %g3 4000cc08: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 4000cc0c: 80 a0 c0 01 cmp %g3, %g1 4000cc10: 86 60 3f ff subx %g0, -1, %g3 _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 4000cc14: 80 a0 e0 00 cmp %g3, 0 4000cc18: 02 80 00 5f be 4000cd94 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000cc1c: 88 10 20 00 clr %g4 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; 4000cc20: fa 00 60 04 ld [ %g1 + 4 ], %i5 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4000cc24: 80 8f 60 01 btst 1, %i5 4000cc28: 22 80 00 5c be,a 4000cd98 <_Heap_Free+0x1f4> <== NEVER TAKEN 4000cc2c: b0 09 20 01 and %g4, 1, %i0 <== NOT EXECUTED if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4000cc30: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4000cc34: 80 a0 40 04 cmp %g1, %g4 4000cc38: 02 80 00 07 be 4000cc54 <_Heap_Free+0xb0> 4000cc3c: ba 0f 7f fe and %i5, -2, %i5 4000cc40: 86 00 40 1d add %g1, %i5, %g3 4000cc44: f4 00 e0 04 ld [ %g3 + 4 ], %i2 4000cc48: b4 1e a0 01 xor %i2, 1, %i2 4000cc4c: 10 80 00 03 b 4000cc58 <_Heap_Free+0xb4> 4000cc50: b4 0e a0 01 and %i2, 1, %i2 4000cc54: b4 10 20 00 clr %i2 if ( !_Heap_Is_prev_used( block ) ) { 4000cc58: 80 8f 20 01 btst 1, %i4 4000cc5c: 12 80 00 26 bne 4000ccf4 <_Heap_Free+0x150> 4000cc60: 80 8e a0 ff btst 0xff, %i2 uintptr_t const prev_size = block->prev_size; 4000cc64: f8 02 00 00 ld [ %o0 ], %i4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000cc68: 86 22 00 1c sub %o0, %i4, %g3 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; 4000cc6c: 80 a0 c0 1b cmp %g3, %i3 4000cc70: 0a 80 00 04 bcs 4000cc80 <_Heap_Free+0xdc> <== NEVER TAKEN 4000cc74: b2 10 20 00 clr %i1 4000cc78: 80 a1 00 03 cmp %g4, %g3 4000cc7c: b2 60 3f ff subx %g0, -1, %i1 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 4000cc80: 80 a6 60 00 cmp %i1, 0 4000cc84: 02 80 00 44 be 4000cd94 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000cc88: 88 10 20 00 clr %g4 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; 4000cc8c: f6 00 e0 04 ld [ %g3 + 4 ], %i3 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) ) { 4000cc90: 80 8e e0 01 btst 1, %i3 4000cc94: 02 80 00 40 be 4000cd94 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000cc98: 80 8e a0 ff btst 0xff, %i2 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4000cc9c: 22 80 00 0f be,a 4000ccd8 <_Heap_Free+0x134> 4000cca0: b8 00 80 1c add %g2, %i4, %i4 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4000cca4: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = block->prev; 4000cca8: c2 00 60 0c ld [ %g1 + 0xc ], %g1 uintptr_t const size = block_size + prev_size + next_block_size; 4000ccac: ba 00 80 1d add %g2, %i5, %i5 prev->next = next; 4000ccb0: c8 20 60 08 st %g4, [ %g1 + 8 ] next->prev = prev; 4000ccb4: c2 21 20 0c st %g1, [ %g4 + 0xc ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000ccb8: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 4000ccbc: b8 07 40 1c add %i5, %i4, %i4 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000ccc0: 82 00 7f ff add %g1, -1, %g1 4000ccc4: c2 26 20 38 st %g1, [ %i0 + 0x38 ] 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; 4000ccc8: f8 20 c0 1c st %i4, [ %g3 + %i4 ] 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; 4000cccc: 82 17 20 01 or %i4, 1, %g1 4000ccd0: 10 80 00 27 b 4000cd6c <_Heap_Free+0x1c8> 4000ccd4: c2 20 e0 04 st %g1, [ %g3 + 4 ] 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; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000ccd8: 88 17 20 01 or %i4, 1, %g4 4000ccdc: c8 20 e0 04 st %g4, [ %g3 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000cce0: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = size; 4000cce4: f8 22 00 02 st %i4, [ %o0 + %g2 ] _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; 4000cce8: 86 08 ff fe and %g3, -2, %g3 4000ccec: 10 80 00 20 b 4000cd6c <_Heap_Free+0x1c8> 4000ccf0: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4000ccf4: 22 80 00 0d be,a 4000cd28 <_Heap_Free+0x184> 4000ccf8: c6 06 20 08 ld [ %i0 + 8 ], %g3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4000ccfc: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = old_block->prev; 4000cd00: c2 00 60 0c ld [ %g1 + 0xc ], %g1 new_block->next = next; 4000cd04: c8 22 20 08 st %g4, [ %o0 + 8 ] new_block->prev = prev; 4000cd08: c2 22 20 0c st %g1, [ %o0 + 0xc ] uintptr_t const size = block_size + next_block_size; 4000cd0c: 86 07 40 02 add %i5, %g2, %g3 next->prev = new_block; prev->next = new_block; 4000cd10: d0 20 60 08 st %o0, [ %g1 + 8 ] Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 4000cd14: d0 21 20 0c st %o0, [ %g4 + 0xc ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000cd18: 82 10 e0 01 or %g3, 1, %g1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4000cd1c: c6 22 00 03 st %g3, [ %o0 + %g3 ] 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; 4000cd20: 10 80 00 13 b 4000cd6c <_Heap_Free+0x1c8> 4000cd24: c2 22 20 04 st %g1, [ %o0 + 4 ] ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 4000cd28: f0 22 20 0c st %i0, [ %o0 + 0xc ] Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4000cd2c: c6 22 20 08 st %g3, [ %o0 + 8 ] new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4000cd30: d0 20 e0 0c st %o0, [ %g3 + 0xc ] 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; 4000cd34: 86 10 a0 01 or %g2, 1, %g3 4000cd38: c6 22 20 04 st %g3, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000cd3c: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = block_size; 4000cd40: c4 22 00 02 st %g2, [ %o0 + %g2 ] } 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; 4000cd44: 86 08 ff fe and %g3, -2, %g3 4000cd48: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000cd4c: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 if ( stats->max_free_blocks < stats->free_blocks ) { 4000cd50: c6 06 20 3c ld [ %i0 + 0x3c ], %g3 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; 4000cd54: 82 00 60 01 inc %g1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4000cd58: d0 26 20 08 st %o0, [ %i0 + 8 ] if ( stats->max_free_blocks < stats->free_blocks ) { 4000cd5c: 80 a0 c0 01 cmp %g3, %g1 4000cd60: 1a 80 00 03 bcc 4000cd6c <_Heap_Free+0x1c8> 4000cd64: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 4000cd68: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 4000cd6c: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 4000cd70: 82 00 7f ff add %g1, -1, %g1 4000cd74: c2 26 20 40 st %g1, [ %i0 + 0x40 ] ++stats->frees; 4000cd78: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000cd7c: 82 00 60 01 inc %g1 4000cd80: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 4000cd84: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000cd88: 84 00 40 02 add %g1, %g2, %g2 4000cd8c: c4 26 20 30 st %g2, [ %i0 + 0x30 ] * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; 4000cd90: 88 10 20 01 mov 1, %g4 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4000cd94: b0 09 20 01 and %g4, 1, %i0 4000cd98: 81 c7 e0 08 ret 4000cd9c: 81 e8 00 00 restore =============================================================================== 40009e6c <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 40009e6c: 9d e3 bf a0 save %sp, -96, %sp Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 40009e70: b6 10 20 00 clr %i3 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 40009e74: ba 10 00 18 mov %i0, %i5 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 40009e78: 10 80 00 11 b 40009ebc <_Heap_Greedy_allocate+0x50> 40009e7c: b8 10 20 00 clr %i4 * @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 ); 40009e80: d2 06 40 01 ld [ %i1 + %g1 ], %o1 40009e84: 90 10 00 1d mov %i5, %o0 40009e88: 94 10 20 00 clr %o2 40009e8c: 40 00 1d 02 call 40011294 <_Heap_Allocate_aligned_with_boundary> 40009e90: 96 10 20 00 clr %o3 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 40009e94: 82 92 20 00 orcc %o0, 0, %g1 40009e98: 22 80 00 09 be,a 40009ebc <_Heap_Greedy_allocate+0x50> <== NEVER TAKEN 40009e9c: b6 06 e0 01 inc %i3 <== NOT EXECUTED RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 40009ea0: d2 07 60 10 ld [ %i5 + 0x10 ], %o1 40009ea4: 40 00 34 08 call 40016ec4 <.urem> 40009ea8: b0 00 7f f8 add %g1, -8, %i0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 40009eac: 90 26 00 08 sub %i0, %o0, %o0 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 40009eb0: f8 22 20 08 st %i4, [ %o0 + 8 ] 40009eb4: b8 10 00 08 mov %o0, %i4 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 40009eb8: b6 06 e0 01 inc %i3 40009ebc: 80 a6 c0 1a cmp %i3, %i2 40009ec0: 12 bf ff f0 bne 40009e80 <_Heap_Greedy_allocate+0x14> 40009ec4: 83 2e e0 02 sll %i3, 2, %g1 40009ec8: 10 80 00 0a b 40009ef0 <_Heap_Greedy_allocate+0x84> 40009ecc: b0 10 20 00 clr %i0 allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 40009ed0: 90 10 00 1d mov %i5, %o0 } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 40009ed4: 96 0a ff fe and %o3, -2, %o3 40009ed8: 92 10 00 1b mov %i3, %o1 40009edc: 94 06 e0 08 add %i3, 8, %o2 40009ee0: 40 00 00 cb call 4000a20c <_Heap_Block_allocate> 40009ee4: 96 02 ff f8 add %o3, -8, %o3 current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 40009ee8: f0 26 e0 08 st %i0, [ %i3 + 8 ] 40009eec: b0 10 00 1b mov %i3, %i0 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40009ef0: f6 07 60 08 ld [ %i5 + 8 ], %i3 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 40009ef4: 80 a6 c0 1d cmp %i3, %i5 40009ef8: 32 bf ff f6 bne,a 40009ed0 <_Heap_Greedy_allocate+0x64> 40009efc: d6 06 e0 04 ld [ %i3 + 4 ], %o3 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 40009f00: 10 80 00 07 b 40009f1c <_Heap_Greedy_allocate+0xb0> 40009f04: 80 a7 20 00 cmp %i4, 0 current = allocated_blocks; allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 40009f08: 92 07 20 08 add %i4, 8, %o1 40009f0c: 90 10 00 1d mov %i5, %o0 40009f10: 40 00 1d 52 call 40011458 <_Heap_Free> 40009f14: b8 10 00 1b mov %i3, %i4 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 40009f18: 80 a7 20 00 cmp %i4, 0 40009f1c: 32 bf ff fb bne,a 40009f08 <_Heap_Greedy_allocate+0x9c> 40009f20: f6 07 20 08 ld [ %i4 + 8 ], %i3 allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 40009f24: 81 c7 e0 08 ret 40009f28: 81 e8 00 00 restore =============================================================================== 40012608 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 40012608: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; 4001260c: 90 10 20 00 clr %o0 <== NOT EXECUTED Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { Heap_Block *current = heap->first_block; 40012610: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 <== NOT EXECUTED Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 40012614: 10 80 00 0a b 4001263c <_Heap_Iterate+0x34> <== NOT EXECUTED 40012618: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 <== NOT EXECUTED uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 4001261c: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED 40012620: 92 0a 7f fe and %o1, -2, %o1 <== NOT EXECUTED RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40012624: ba 00 40 09 add %g1, %o1, %i5 <== NOT EXECUTED 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; 40012628: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED 4001262c: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 40012630: 9f c6 40 00 call %i1 <== NOT EXECUTED 40012634: 94 0a a0 01 and %o2, 1, %o2 <== NOT EXECUTED 40012638: 82 10 00 1d mov %i5, %g1 <== NOT EXECUTED { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 4001263c: 80 a0 40 1c cmp %g1, %i4 <== NOT EXECUTED 40012640: 02 80 00 05 be 40012654 <_Heap_Iterate+0x4c> <== NOT EXECUTED 40012644: 90 1a 20 01 xor %o0, 1, %o0 <== NOT EXECUTED 40012648: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 4001264c: 32 bf ff f4 bne,a 4001261c <_Heap_Iterate+0x14> <== NOT EXECUTED 40012650: d2 00 60 04 ld [ %g1 + 4 ], %o1 <== NOT EXECUTED 40012654: 81 c7 e0 08 ret <== NOT EXECUTED 40012658: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001b440 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 4001b440: 9d e3 bf a0 save %sp, -96, %sp RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4001b444: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4001b448: 7f ff f2 a4 call 40017ed8 <.urem> 4001b44c: 90 10 00 19 mov %i1, %o0 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 4001b450: c8 06 20 20 ld [ %i0 + 0x20 ], %g4 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4001b454: ba 06 7f f8 add %i1, -8, %i5 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4001b458: 90 27 40 08 sub %i5, %o0, %o0 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; 4001b45c: 80 a2 00 04 cmp %o0, %g4 4001b460: 0a 80 00 05 bcs 4001b474 <_Heap_Size_of_alloc_area+0x34> 4001b464: 82 10 20 00 clr %g1 4001b468: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001b46c: 80 a0 40 08 cmp %g1, %o0 4001b470: 82 60 3f ff subx %g0, -1, %g1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 4001b474: 80 a0 60 00 cmp %g1, 0 4001b478: 02 80 00 15 be 4001b4cc <_Heap_Size_of_alloc_area+0x8c> 4001b47c: 86 10 20 00 clr %g3 - 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; 4001b480: c2 02 20 04 ld [ %o0 + 4 ], %g1 4001b484: 82 08 7f fe and %g1, -2, %g1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4001b488: 82 02 00 01 add %o0, %g1, %g1 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; 4001b48c: 80 a0 40 04 cmp %g1, %g4 4001b490: 0a 80 00 05 bcs 4001b4a4 <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN 4001b494: 84 10 20 00 clr %g2 4001b498: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 4001b49c: 80 a0 80 01 cmp %g2, %g1 4001b4a0: 84 60 3f ff subx %g0, -1, %g2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 4001b4a4: 80 a0 a0 00 cmp %g2, 0 4001b4a8: 02 80 00 09 be 4001b4cc <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001b4ac: 86 10 20 00 clr %g3 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; 4001b4b0: c4 00 60 04 ld [ %g1 + 4 ], %g2 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 4001b4b4: 80 88 a0 01 btst 1, %g2 4001b4b8: 02 80 00 05 be 4001b4cc <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001b4bc: 82 20 40 19 sub %g1, %i1, %g1 return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; 4001b4c0: 86 10 20 01 mov 1, %g3 || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 4001b4c4: 82 00 60 04 add %g1, 4, %g1 4001b4c8: c2 26 80 00 st %g1, [ %i2 ] return true; } 4001b4cc: b0 08 e0 01 and %g3, 1, %i0 4001b4d0: 81 c7 e0 08 ret 4001b4d4: 81 e8 00 00 restore =============================================================================== 40008c6c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 40008c6c: 9d e3 bf 80 save %sp, -128, %sp 40008c70: ac 10 00 19 mov %i1, %l6 uintptr_t const page_size = heap->page_size; 40008c74: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 uintptr_t const min_block_size = heap->min_block_size; 40008c78: f6 06 20 14 ld [ %i0 + 0x14 ], %i3 Heap_Block *const first_block = heap->first_block; 40008c7c: f2 06 20 20 ld [ %i0 + 0x20 ], %i1 Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 40008c80: 80 a6 a0 00 cmp %i2, 0 40008c84: 02 80 00 05 be 40008c98 <_Heap_Walk+0x2c> 40008c88: e0 06 20 24 ld [ %i0 + 0x24 ], %l0 40008c8c: 3b 10 00 23 sethi %hi(0x40008c00), %i5 40008c90: 10 80 00 04 b 40008ca0 <_Heap_Walk+0x34> 40008c94: ba 17 60 1c or %i5, 0x1c, %i5 ! 40008c1c <_Heap_Walk_print> 40008c98: 3b 10 00 23 sethi %hi(0x40008c00), %i5 40008c9c: ba 17 60 14 or %i5, 0x14, %i5 ! 40008c14 <_Heap_Walk_print_nothing> if ( !_System_state_Is_up( _System_state_Get() ) ) { 40008ca0: 05 10 00 61 sethi %hi(0x40018400), %g2 40008ca4: c4 00 a3 48 ld [ %g2 + 0x348 ], %g2 ! 40018748 <_System_state_Current> 40008ca8: 80 a0 a0 03 cmp %g2, 3 40008cac: 22 80 00 04 be,a 40008cbc <_Heap_Walk+0x50> 40008cb0: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 return true; 40008cb4: 10 80 01 2a b 4000915c <_Heap_Walk+0x4f0> 40008cb8: b0 10 20 01 mov 1, %i0 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)( 40008cbc: da 06 20 18 ld [ %i0 + 0x18 ], %o5 40008cc0: c4 23 a0 5c st %g2, [ %sp + 0x5c ] 40008cc4: f2 23 a0 60 st %i1, [ %sp + 0x60 ] 40008cc8: e0 23 a0 64 st %l0, [ %sp + 0x64 ] 40008ccc: c4 06 20 08 ld [ %i0 + 8 ], %g2 40008cd0: 90 10 00 16 mov %l6, %o0 40008cd4: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 40008cd8: c4 06 20 0c ld [ %i0 + 0xc ], %g2 40008cdc: 92 10 20 00 clr %o1 40008ce0: c4 23 a0 6c st %g2, [ %sp + 0x6c ] 40008ce4: 15 10 00 56 sethi %hi(0x40015800), %o2 40008ce8: 96 10 00 1c mov %i4, %o3 40008cec: 94 12 a1 08 or %o2, 0x108, %o2 40008cf0: 9f c7 40 00 call %i5 40008cf4: 98 10 00 1b mov %i3, %o4 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 40008cf8: 80 a7 20 00 cmp %i4, 0 40008cfc: 12 80 00 07 bne 40008d18 <_Heap_Walk+0xac> 40008d00: 80 8f 20 07 btst 7, %i4 (*printer)( source, true, "page size is zero\n" ); 40008d04: 15 10 00 56 sethi %hi(0x40015800), %o2 40008d08: 90 10 00 16 mov %l6, %o0 40008d0c: 92 10 20 01 mov 1, %o1 40008d10: 10 80 00 37 b 40008dec <_Heap_Walk+0x180> 40008d14: 94 12 a1 a0 or %o2, 0x1a0, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 40008d18: 22 80 00 08 be,a 40008d38 <_Heap_Walk+0xcc> 40008d1c: 90 10 00 1b mov %i3, %o0 (*printer)( 40008d20: 15 10 00 56 sethi %hi(0x40015800), %o2 40008d24: 90 10 00 16 mov %l6, %o0 40008d28: 92 10 20 01 mov 1, %o1 40008d2c: 94 12 a1 b8 or %o2, 0x1b8, %o2 40008d30: 10 80 01 12 b 40009178 <_Heap_Walk+0x50c> 40008d34: 96 10 00 1c mov %i4, %o3 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40008d38: 7f ff e3 93 call 40001b84 <.urem> 40008d3c: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40008d40: 80 a2 20 00 cmp %o0, 0 40008d44: 22 80 00 08 be,a 40008d64 <_Heap_Walk+0xf8> 40008d48: 90 06 60 08 add %i1, 8, %o0 (*printer)( 40008d4c: 15 10 00 56 sethi %hi(0x40015800), %o2 40008d50: 90 10 00 16 mov %l6, %o0 40008d54: 92 10 20 01 mov 1, %o1 40008d58: 94 12 a1 d8 or %o2, 0x1d8, %o2 40008d5c: 10 80 01 07 b 40009178 <_Heap_Walk+0x50c> 40008d60: 96 10 00 1b mov %i3, %o3 40008d64: 7f ff e3 88 call 40001b84 <.urem> 40008d68: 92 10 00 1c mov %i4, %o1 ); return false; } if ( 40008d6c: 80 a2 20 00 cmp %o0, 0 40008d70: 22 80 00 07 be,a 40008d8c <_Heap_Walk+0x120> 40008d74: c4 06 60 04 ld [ %i1 + 4 ], %g2 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40008d78: 15 10 00 56 sethi %hi(0x40015800), %o2 40008d7c: 90 10 00 16 mov %l6, %o0 40008d80: 92 10 20 01 mov 1, %o1 40008d84: 10 80 00 fc b 40009174 <_Heap_Walk+0x508> 40008d88: 94 12 a2 00 or %o2, 0x200, %o2 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 40008d8c: 80 88 a0 01 btst 1, %g2 40008d90: 32 80 00 07 bne,a 40008dac <_Heap_Walk+0x140> 40008d94: f4 04 20 04 ld [ %l0 + 4 ], %i2 (*printer)( 40008d98: 15 10 00 56 sethi %hi(0x40015800), %o2 40008d9c: 90 10 00 16 mov %l6, %o0 40008da0: 92 10 20 01 mov 1, %o1 40008da4: 10 80 00 12 b 40008dec <_Heap_Walk+0x180> 40008da8: 94 12 a2 38 or %o2, 0x238, %o2 - 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; 40008dac: b4 0e bf fe and %i2, -2, %i2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40008db0: b4 04 00 1a add %l0, %i2, %i2 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; 40008db4: c4 06 a0 04 ld [ %i2 + 4 ], %g2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40008db8: 80 88 a0 01 btst 1, %g2 40008dbc: 12 80 00 07 bne 40008dd8 <_Heap_Walk+0x16c> 40008dc0: 80 a6 80 19 cmp %i2, %i1 (*printer)( 40008dc4: 15 10 00 56 sethi %hi(0x40015800), %o2 40008dc8: 90 10 00 16 mov %l6, %o0 40008dcc: 92 10 20 01 mov 1, %o1 40008dd0: 10 80 00 07 b 40008dec <_Heap_Walk+0x180> 40008dd4: 94 12 a2 68 or %o2, 0x268, %o2 ); return false; } if ( 40008dd8: 02 80 00 0a be 40008e00 <_Heap_Walk+0x194> 40008ddc: 15 10 00 56 sethi %hi(0x40015800), %o2 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 40008de0: 90 10 00 16 mov %l6, %o0 40008de4: 92 10 20 01 mov 1, %o1 40008de8: 94 12 a2 80 or %o2, 0x280, %o2 40008dec: 9f c7 40 00 call %i5 40008df0: b0 10 20 00 clr %i0 40008df4: b0 0e 20 ff and %i0, 0xff, %i0 40008df8: 81 c7 e0 08 ret 40008dfc: 81 e8 00 00 restore int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 40008e00: e2 06 20 10 ld [ %i0 + 0x10 ], %l1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40008e04: d6 06 20 08 ld [ %i0 + 8 ], %o3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 40008e08: 10 80 00 30 b 40008ec8 <_Heap_Walk+0x25c> 40008e0c: b2 10 00 18 mov %i0, %i1 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; 40008e10: 80 a0 c0 0b cmp %g3, %o3 40008e14: 18 80 00 05 bgu 40008e28 <_Heap_Walk+0x1bc> 40008e18: 84 10 20 00 clr %g2 40008e1c: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 40008e20: 80 a0 80 0b cmp %g2, %o3 40008e24: 84 60 3f ff subx %g0, -1, %g2 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 40008e28: 80 a0 a0 00 cmp %g2, 0 40008e2c: 32 80 00 07 bne,a 40008e48 <_Heap_Walk+0x1dc> 40008e30: 90 02 e0 08 add %o3, 8, %o0 (*printer)( 40008e34: 15 10 00 56 sethi %hi(0x40015800), %o2 40008e38: 90 10 00 16 mov %l6, %o0 40008e3c: 92 10 20 01 mov 1, %o1 40008e40: 10 80 00 ce b 40009178 <_Heap_Walk+0x50c> 40008e44: 94 12 a2 b0 or %o2, 0x2b0, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40008e48: d6 27 bf fc st %o3, [ %fp + -4 ] 40008e4c: 7f ff e3 4e call 40001b84 <.urem> 40008e50: 92 10 00 11 mov %l1, %o1 ); return false; } if ( 40008e54: 80 a2 20 00 cmp %o0, 0 40008e58: 02 80 00 07 be 40008e74 <_Heap_Walk+0x208> 40008e5c: d6 07 bf fc ld [ %fp + -4 ], %o3 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 40008e60: 15 10 00 56 sethi %hi(0x40015800), %o2 40008e64: 90 10 00 16 mov %l6, %o0 40008e68: 92 10 20 01 mov 1, %o1 40008e6c: 10 80 00 c3 b 40009178 <_Heap_Walk+0x50c> 40008e70: 94 12 a2 d0 or %o2, 0x2d0, %o2 - 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; 40008e74: c4 02 e0 04 ld [ %o3 + 4 ], %g2 40008e78: 84 08 bf fe and %g2, -2, %g2 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; 40008e7c: 84 02 c0 02 add %o3, %g2, %g2 40008e80: c4 00 a0 04 ld [ %g2 + 4 ], %g2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40008e84: 80 88 a0 01 btst 1, %g2 40008e88: 22 80 00 07 be,a 40008ea4 <_Heap_Walk+0x238> 40008e8c: d8 02 e0 0c ld [ %o3 + 0xc ], %o4 (*printer)( 40008e90: 15 10 00 56 sethi %hi(0x40015800), %o2 40008e94: 90 10 00 16 mov %l6, %o0 40008e98: 92 10 20 01 mov 1, %o1 40008e9c: 10 80 00 b7 b 40009178 <_Heap_Walk+0x50c> 40008ea0: 94 12 a3 00 or %o2, 0x300, %o2 ); return false; } if ( free_block->prev != prev_block ) { 40008ea4: 80 a3 00 19 cmp %o4, %i1 40008ea8: 02 80 00 07 be 40008ec4 <_Heap_Walk+0x258> 40008eac: b2 10 00 0b mov %o3, %i1 (*printer)( 40008eb0: 15 10 00 56 sethi %hi(0x40015800), %o2 40008eb4: 90 10 00 16 mov %l6, %o0 40008eb8: 92 10 20 01 mov 1, %o1 40008ebc: 10 80 00 4d b 40008ff0 <_Heap_Walk+0x384> 40008ec0: 94 12 a3 20 or %o2, 0x320, %o2 return false; } prev_block = free_block; free_block = free_block->next; 40008ec4: d6 02 e0 08 ld [ %o3 + 8 ], %o3 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 ) { 40008ec8: 80 a2 c0 18 cmp %o3, %i0 40008ecc: 32 bf ff d1 bne,a 40008e10 <_Heap_Walk+0x1a4> 40008ed0: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 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)( 40008ed4: 2b 10 00 57 sethi %hi(0x40015c00), %l5 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 ) { 40008ed8: b2 10 00 1a mov %i2, %i1 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)( 40008edc: aa 15 60 20 or %l5, 0x20, %l5 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 40008ee0: 23 10 00 57 sethi %hi(0x40015c00), %l1 40008ee4: 2f 10 00 56 sethi %hi(0x40015800), %l7 - 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; 40008ee8: e4 06 60 04 ld [ %i1 + 4 ], %l2 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; 40008eec: d8 06 20 20 ld [ %i0 + 0x20 ], %o4 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 40008ef0: 9e 1e 40 10 xor %i1, %l0, %o7 40008ef4: 80 a0 00 0f cmp %g0, %o7 - 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; 40008ef8: a8 0c bf fe and %l2, -2, %l4 40008efc: 9a 40 20 00 addx %g0, 0, %o5 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40008f00: a6 06 40 14 add %i1, %l4, %l3 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; 40008f04: a4 0c a0 01 and %l2, 1, %l2 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; 40008f08: 80 a3 00 13 cmp %o4, %l3 40008f0c: 18 80 00 05 bgu 40008f20 <_Heap_Walk+0x2b4> <== NEVER TAKEN 40008f10: 9e 10 20 00 clr %o7 40008f14: de 06 20 24 ld [ %i0 + 0x24 ], %o7 40008f18: 80 a3 c0 13 cmp %o7, %l3 40008f1c: 9e 60 3f ff subx %g0, -1, %o7 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 40008f20: 80 a3 e0 00 cmp %o7, 0 40008f24: 32 80 00 07 bne,a 40008f40 <_Heap_Walk+0x2d4> 40008f28: da 27 bf f8 st %o5, [ %fp + -8 ] (*printer)( 40008f2c: 15 10 00 56 sethi %hi(0x40015800), %o2 40008f30: 90 10 00 16 mov %l6, %o0 40008f34: 92 10 20 01 mov 1, %o1 40008f38: 10 80 00 2c b 40008fe8 <_Heap_Walk+0x37c> 40008f3c: 94 12 a3 58 or %o2, 0x358, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40008f40: 90 10 00 14 mov %l4, %o0 40008f44: 7f ff e3 10 call 40001b84 <.urem> 40008f48: 92 10 00 1c mov %i4, %o1 40008f4c: da 07 bf f8 ld [ %fp + -8 ], %o5 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 40008f50: 80 a2 20 00 cmp %o0, 0 40008f54: 02 80 00 0c be 40008f84 <_Heap_Walk+0x318> 40008f58: 9e 0b 60 ff and %o5, 0xff, %o7 40008f5c: 80 a3 e0 00 cmp %o7, 0 40008f60: 02 80 00 19 be 40008fc4 <_Heap_Walk+0x358> 40008f64: 80 a6 40 13 cmp %i1, %l3 (*printer)( 40008f68: 15 10 00 56 sethi %hi(0x40015800), %o2 40008f6c: 90 10 00 16 mov %l6, %o0 40008f70: 92 10 20 01 mov 1, %o1 40008f74: 94 12 a3 88 or %o2, 0x388, %o2 40008f78: 96 10 00 19 mov %i1, %o3 40008f7c: 10 80 00 1d b 40008ff0 <_Heap_Walk+0x384> 40008f80: 98 10 00 14 mov %l4, %o4 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 40008f84: 80 a3 e0 00 cmp %o7, 0 40008f88: 02 80 00 0f be 40008fc4 <_Heap_Walk+0x358> 40008f8c: 80 a6 40 13 cmp %i1, %l3 40008f90: 80 a5 00 1b cmp %l4, %i3 40008f94: 1a 80 00 0c bcc 40008fc4 <_Heap_Walk+0x358> 40008f98: 80 a6 40 13 cmp %i1, %l3 (*printer)( 40008f9c: 90 10 00 16 mov %l6, %o0 40008fa0: 92 10 20 01 mov 1, %o1 40008fa4: 15 10 00 56 sethi %hi(0x40015800), %o2 40008fa8: 96 10 00 19 mov %i1, %o3 40008fac: 94 12 a3 b8 or %o2, 0x3b8, %o2 40008fb0: 98 10 00 14 mov %l4, %o4 40008fb4: 9f c7 40 00 call %i5 40008fb8: 9a 10 00 1b mov %i3, %o5 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 40008fbc: 10 80 00 68 b 4000915c <_Heap_Walk+0x4f0> 40008fc0: b0 10 20 00 clr %i0 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 40008fc4: 2a 80 00 10 bcs,a 40009004 <_Heap_Walk+0x398> 40008fc8: de 04 e0 04 ld [ %l3 + 4 ], %o7 40008fcc: 80 8b 60 ff btst 0xff, %o5 40008fd0: 22 80 00 0d be,a 40009004 <_Heap_Walk+0x398> 40008fd4: de 04 e0 04 ld [ %l3 + 4 ], %o7 (*printer)( 40008fd8: 15 10 00 56 sethi %hi(0x40015800), %o2 40008fdc: 90 10 00 16 mov %l6, %o0 40008fe0: 92 10 20 01 mov 1, %o1 40008fe4: 94 12 a3 e8 or %o2, 0x3e8, %o2 40008fe8: 96 10 00 19 mov %i1, %o3 40008fec: 98 10 00 13 mov %l3, %o4 40008ff0: 9f c7 40 00 call %i5 40008ff4: b0 10 20 00 clr %i0 40008ff8: b0 0e 20 ff and %i0, 0xff, %i0 40008ffc: 81 c7 e0 08 ret 40009000: 81 e8 00 00 restore ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 40009004: 80 8b e0 01 btst 1, %o7 40009008: 12 80 00 3f bne 40009104 <_Heap_Walk+0x498> 4000900c: 90 10 00 16 mov %l6, %o0 false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 40009010: da 06 60 0c ld [ %i1 + 0xc ], %o5 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)( 40009014: d8 06 20 08 ld [ %i0 + 8 ], %o4 40009018: 80 a3 40 0c cmp %o5, %o4 4000901c: 02 80 00 08 be 4000903c <_Heap_Walk+0x3d0> 40009020: de 06 20 0c ld [ %i0 + 0xc ], %o7 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 40009024: 80 a3 40 18 cmp %o5, %i0 40009028: 12 80 00 07 bne 40009044 <_Heap_Walk+0x3d8> 4000902c: 96 14 60 90 or %l1, 0x90, %o3 40009030: 17 10 00 56 sethi %hi(0x40015800), %o3 40009034: 10 80 00 04 b 40009044 <_Heap_Walk+0x3d8> 40009038: 96 12 e0 d8 or %o3, 0xd8, %o3 ! 400158d8 <__log2table+0x130> 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)( 4000903c: 03 10 00 56 sethi %hi(0x40015800), %g1 40009040: 96 10 60 c8 or %g1, 0xc8, %o3 ! 400158c8 <__log2table+0x120> block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 40009044: d8 06 60 08 ld [ %i1 + 8 ], %o4 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)( 40009048: 80 a3 00 0f cmp %o4, %o7 4000904c: 02 80 00 06 be 40009064 <_Heap_Walk+0x3f8> 40009050: 80 a3 00 18 cmp %o4, %i0 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 40009054: 12 80 00 06 bne 4000906c <_Heap_Walk+0x400> 40009058: 9e 14 60 90 or %l1, 0x90, %o7 4000905c: 10 80 00 04 b 4000906c <_Heap_Walk+0x400> 40009060: 9e 15 e0 f8 or %l7, 0xf8, %o7 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)( 40009064: 03 10 00 56 sethi %hi(0x40015800), %g1 40009068: 9e 10 60 e8 or %g1, 0xe8, %o7 ! 400158e8 <__log2table+0x140> 4000906c: d6 23 a0 5c st %o3, [ %sp + 0x5c ] 40009070: d8 23 a0 60 st %o4, [ %sp + 0x60 ] 40009074: de 23 a0 64 st %o7, [ %sp + 0x64 ] 40009078: 90 10 00 16 mov %l6, %o0 4000907c: 92 10 20 00 clr %o1 40009080: 94 10 00 15 mov %l5, %o2 40009084: 96 10 00 19 mov %i1, %o3 40009088: 9f c7 40 00 call %i5 4000908c: 98 10 00 14 mov %l4, %o4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 40009090: da 04 c0 00 ld [ %l3 ], %o5 40009094: 80 a5 00 0d cmp %l4, %o5 40009098: 02 80 00 0c be 400090c8 <_Heap_Walk+0x45c> 4000909c: 80 a4 a0 00 cmp %l2, 0 (*printer)( 400090a0: e6 23 a0 5c st %l3, [ %sp + 0x5c ] 400090a4: 90 10 00 16 mov %l6, %o0 400090a8: 92 10 20 01 mov 1, %o1 400090ac: 15 10 00 57 sethi %hi(0x40015c00), %o2 400090b0: 96 10 00 19 mov %i1, %o3 400090b4: 94 12 a0 58 or %o2, 0x58, %o2 400090b8: 9f c7 40 00 call %i5 400090bc: 98 10 00 14 mov %l4, %o4 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 400090c0: 10 bf ff ce b 40008ff8 <_Heap_Walk+0x38c> 400090c4: b0 10 20 00 clr %i0 ); return false; } if ( !prev_used ) { 400090c8: 32 80 00 0a bne,a 400090f0 <_Heap_Walk+0x484> 400090cc: c6 06 20 08 ld [ %i0 + 8 ], %g3 (*printer)( 400090d0: 15 10 00 57 sethi %hi(0x40015c00), %o2 400090d4: 90 10 00 16 mov %l6, %o0 400090d8: 92 10 20 01 mov 1, %o1 400090dc: 10 80 00 26 b 40009174 <_Heap_Walk+0x508> 400090e0: 94 12 a0 98 or %o2, 0x98, %o2 { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 400090e4: 22 80 00 19 be,a 40009148 <_Heap_Walk+0x4dc> 400090e8: b2 10 00 13 mov %l3, %i1 return true; } free_block = free_block->next; 400090ec: c6 00 e0 08 ld [ %g3 + 8 ], %g3 ) { 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 ) { 400090f0: 80 a0 c0 18 cmp %g3, %i0 400090f4: 12 bf ff fc bne 400090e4 <_Heap_Walk+0x478> 400090f8: 80 a0 c0 19 cmp %g3, %i1 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 400090fc: 10 80 00 1b b 40009168 <_Heap_Walk+0x4fc> 40009100: 15 10 00 57 sethi %hi(0x40015c00), %o2 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 40009104: 80 a4 a0 00 cmp %l2, 0 40009108: 02 80 00 09 be 4000912c <_Heap_Walk+0x4c0> 4000910c: 92 10 20 00 clr %o1 (*printer)( 40009110: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009114: 96 10 00 19 mov %i1, %o3 40009118: 94 12 a0 c8 or %o2, 0xc8, %o2 4000911c: 9f c7 40 00 call %i5 40009120: 98 10 00 14 mov %l4, %o4 40009124: 10 80 00 09 b 40009148 <_Heap_Walk+0x4dc> 40009128: b2 10 00 13 mov %l3, %i1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 4000912c: da 06 40 00 ld [ %i1 ], %o5 40009130: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009134: 96 10 00 19 mov %i1, %o3 40009138: 94 12 a0 e0 or %o2, 0xe0, %o2 4000913c: 9f c7 40 00 call %i5 40009140: 98 10 00 14 mov %l4, %o4 40009144: b2 10 00 13 mov %l3, %i1 block->prev_size ); } block = next_block; } while ( block != first_block ); 40009148: 80 a4 c0 1a cmp %l3, %i2 4000914c: 32 bf ff 68 bne,a 40008eec <_Heap_Walk+0x280> 40009150: e4 06 60 04 ld [ %i1 + 4 ], %l2 40009154: 10 80 00 02 b 4000915c <_Heap_Walk+0x4f0> 40009158: b0 10 20 01 mov 1, %i0 4000915c: b0 0e 20 ff and %i0, 0xff, %i0 40009160: 81 c7 e0 08 ret 40009164: 81 e8 00 00 restore return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 40009168: 90 10 00 16 mov %l6, %o0 4000916c: 92 10 20 01 mov 1, %o1 40009170: 94 12 a1 08 or %o2, 0x108, %o2 40009174: 96 10 00 19 mov %i1, %o3 40009178: 9f c7 40 00 call %i5 4000917c: b0 10 20 00 clr %i0 40009180: b0 0e 20 ff and %i0, 0xff, %i0 40009184: 81 c7 e0 08 ret 40009188: 81 e8 00 00 restore =============================================================================== 400083a8 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 400083a8: 9d e3 bf 90 save %sp, -112, %sp Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 400083ac: 13 10 00 28 sethi %hi(0x4000a000), %o1 400083b0: 90 07 bf f4 add %fp, -12, %o0 400083b4: 92 12 63 30 or %o1, 0x330, %o1 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 400083b8: f0 27 bf f4 st %i0, [ %fp + -12 ] 400083bc: f2 2f bf f8 stb %i1, [ %fp + -8 ] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 400083c0: 40 00 07 e7 call 4000a35c <_User_extensions_Iterate> 400083c4: f4 27 bf fc st %i2, [ %fp + -4 ] _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 400083c8: 05 10 00 79 sethi %hi(0x4001e400), %g2 <== NOT EXECUTED 400083cc: 82 10 a2 fc or %g2, 0x2fc, %g1 ! 4001e6fc <_Internal_errors_What_happened><== NOT EXECUTED 400083d0: f0 20 a2 fc st %i0, [ %g2 + 0x2fc ] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 400083d4: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 400083d8: f4 20 60 08 st %i2, [ %g1 + 8 ] <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 400083dc: 84 10 20 05 mov 5, %g2 <== NOT EXECUTED 400083e0: 03 10 00 79 sethi %hi(0x4001e400), %g1 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 400083e4: 7f ff e7 31 call 400020a8 <== NOT EXECUTED 400083e8: c4 20 63 08 st %g2, [ %g1 + 0x308 ] ! 4001e708 <_System_state_Current><== NOT EXECUTED 400083ec: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED 400083f0: 30 80 00 00 b,a 400083f0 <_Internal_error_Occurred+0x48> <== NOT EXECUTED =============================================================================== 4000845c <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 4000845c: 9d e3 bf a0 save %sp, -96, %sp * 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 ) 40008460: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008464: 80 a0 60 00 cmp %g1, 0 40008468: 12 80 00 04 bne 40008478 <_Objects_Allocate+0x1c> <== ALWAYS TAKEN 4000846c: ba 10 00 18 mov %i0, %i5 return NULL; 40008470: 81 c7 e0 08 ret 40008474: 91 e8 20 00 restore %g0, 0, %o0 /* * 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 ); 40008478: b8 06 20 20 add %i0, 0x20, %i4 4000847c: 7f ff fd 85 call 40007a90 <_Chain_Get> 40008480: 90 10 00 1c mov %i4, %o0 if ( information->auto_extend ) { 40008484: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40008488: 80 a0 60 00 cmp %g1, 0 4000848c: 02 80 00 1d be 40008500 <_Objects_Allocate+0xa4> 40008490: b0 10 00 08 mov %o0, %i0 /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 40008494: 80 a2 20 00 cmp %o0, 0 40008498: 32 80 00 0a bne,a 400084c0 <_Objects_Allocate+0x64> 4000849c: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Objects_Extend_information( information ); 400084a0: 40 00 00 21 call 40008524 <_Objects_Extend_information> 400084a4: 90 10 00 1d mov %i5, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 400084a8: 7f ff fd 7a call 40007a90 <_Chain_Get> 400084ac: 90 10 00 1c mov %i4, %o0 } if ( the_object ) { 400084b0: b0 92 20 00 orcc %o0, 0, %i0 400084b4: 02 bf ff ef be 40008470 <_Objects_Allocate+0x14> 400084b8: 01 00 00 00 nop uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 400084bc: c4 07 60 08 ld [ %i5 + 8 ], %g2 400084c0: d0 06 20 08 ld [ %i0 + 8 ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 400084c4: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 400084c8: 03 00 00 3f sethi %hi(0xfc00), %g1 400084cc: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 400084d0: 90 0a 00 01 and %o0, %g1, %o0 400084d4: 82 08 80 01 and %g2, %g1, %g1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 400084d8: 40 00 3d d4 call 40017c28 <.udiv> 400084dc: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 400084e0: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 400084e4: 91 2a 20 02 sll %o0, 2, %o0 400084e8: c4 00 40 08 ld [ %g1 + %o0 ], %g2 400084ec: 84 00 bf ff add %g2, -1, %g2 400084f0: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; 400084f4: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1 400084f8: 82 00 7f ff add %g1, -1, %g1 400084fc: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 40008500: 81 c7 e0 08 ret 40008504: 81 e8 00 00 restore =============================================================================== 4000888c <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 4000888c: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 40008890: 80 a6 60 00 cmp %i1, 0 40008894: 12 80 00 04 bne 400088a4 <_Objects_Get_information+0x18> 40008898: 01 00 00 00 nop return NULL; 4000889c: 81 c7 e0 08 ret 400088a0: 91 e8 20 00 restore %g0, 0, %o0 /* * 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 ); 400088a4: 40 00 11 3f call 4000cda0 <_Objects_API_maximum_class> 400088a8: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 400088ac: 80 a2 20 00 cmp %o0, 0 400088b0: 02 bf ff fb be 4000889c <_Objects_Get_information+0x10> 400088b4: 80 a6 40 08 cmp %i1, %o0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 400088b8: 18 bf ff f9 bgu 4000889c <_Objects_Get_information+0x10> 400088bc: 03 10 00 78 sethi %hi(0x4001e000), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 400088c0: b1 2e 20 02 sll %i0, 2, %i0 400088c4: 82 10 61 64 or %g1, 0x164, %g1 400088c8: c2 00 40 18 ld [ %g1 + %i0 ], %g1 400088cc: 80 a0 60 00 cmp %g1, 0 400088d0: 02 bf ff f3 be 4000889c <_Objects_Get_information+0x10> <== NEVER TAKEN 400088d4: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 400088d8: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 400088dc: 80 a6 20 00 cmp %i0, 0 400088e0: 02 bf ff ef be 4000889c <_Objects_Get_information+0x10> <== NEVER TAKEN 400088e4: 01 00 00 00 nop * 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 ) 400088e8: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 400088ec: 80 a0 60 00 cmp %g1, 0 400088f0: 02 bf ff eb be 4000889c <_Objects_Get_information+0x10> 400088f4: 01 00 00 00 nop return NULL; #endif return info; } 400088f8: 81 c7 e0 08 ret 400088fc: 81 e8 00 00 restore =============================================================================== 4001ac84 <_Objects_Get_no_protection>: /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 4001ac84: c2 02 20 08 ld [ %o0 + 8 ], %g1 4001ac88: 92 22 40 01 sub %o1, %g1, %o1 if ( information->maximum >= index ) { 4001ac8c: c2 12 20 10 lduh [ %o0 + 0x10 ], %g1 /* * 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; 4001ac90: 92 02 60 01 inc %o1 if ( information->maximum >= index ) { 4001ac94: 80 a0 40 09 cmp %g1, %o1 4001ac98: 0a 80 00 09 bcs 4001acbc <_Objects_Get_no_protection+0x38> 4001ac9c: 93 2a 60 02 sll %o1, 2, %o1 if ( (the_object = information->local_table[ index ]) != NULL ) { 4001aca0: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4001aca4: d0 00 40 09 ld [ %g1 + %o1 ], %o0 4001aca8: 80 a2 20 00 cmp %o0, 0 4001acac: 02 80 00 05 be 4001acc0 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 4001acb0: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 4001acb4: 81 c3 e0 08 retl 4001acb8: c0 22 80 00 clr [ %o2 ] /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 4001acbc: 82 10 20 01 mov 1, %g1 return NULL; 4001acc0: 90 10 20 00 clr %o0 } 4001acc4: 81 c3 e0 08 retl 4001acc8: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 4000c9b0 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4000c9b0: 9d e3 bf 98 save %sp, -104, %sp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4000c9b4: 80 a6 20 00 cmp %i0, 0 4000c9b8: 12 80 00 06 bne 4000c9d0 <_Objects_Id_to_name+0x20> 4000c9bc: 83 36 20 18 srl %i0, 0x18, %g1 4000c9c0: 03 10 00 bb sethi %hi(0x4002ec00), %g1 4000c9c4: c2 00 60 40 ld [ %g1 + 0x40 ], %g1 ! 4002ec40 <_Per_CPU_Information+0x10> 4000c9c8: f0 00 60 08 ld [ %g1 + 8 ], %i0 4000c9cc: 83 36 20 18 srl %i0, 0x18, %g1 4000c9d0: 82 08 60 07 and %g1, 7, %g1 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 4000c9d4: 84 00 7f ff add %g1, -1, %g2 4000c9d8: 80 a0 a0 02 cmp %g2, 2 4000c9dc: 08 80 00 18 bleu 4000ca3c <_Objects_Id_to_name+0x8c> 4000c9e0: 83 28 60 02 sll %g1, 2, %g1 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 4000c9e4: 81 c7 e0 08 ret 4000c9e8: 91 e8 20 03 restore %g0, 3, %o0 if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 4000c9ec: 85 28 a0 02 sll %g2, 2, %g2 4000c9f0: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 4000c9f4: 80 a2 20 00 cmp %o0, 0 4000c9f8: 02 bf ff fb be 4000c9e4 <_Objects_Id_to_name+0x34> <== NEVER TAKEN 4000c9fc: 01 00 00 00 nop return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 4000ca00: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1 4000ca04: 80 a0 60 00 cmp %g1, 0 4000ca08: 12 bf ff f7 bne 4000c9e4 <_Objects_Id_to_name+0x34> <== NEVER TAKEN 4000ca0c: 92 10 00 18 mov %i0, %o1 return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 4000ca10: 7f ff ff cb call 4000c93c <_Objects_Get> 4000ca14: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 4000ca18: 80 a2 20 00 cmp %o0, 0 4000ca1c: 02 bf ff f2 be 4000c9e4 <_Objects_Id_to_name+0x34> 4000ca20: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 4000ca24: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4000ca28: b0 10 20 00 clr %i0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); 4000ca2c: 40 00 03 99 call 4000d890 <_Thread_Enable_dispatch> 4000ca30: c2 26 40 00 st %g1, [ %i1 ] 4000ca34: 81 c7 e0 08 ret 4000ca38: 81 e8 00 00 restore the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 4000ca3c: 05 10 00 b9 sethi %hi(0x4002e400), %g2 4000ca40: 84 10 a2 44 or %g2, 0x244, %g2 ! 4002e644 <_Objects_Information_table> 4000ca44: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000ca48: 80 a0 60 00 cmp %g1, 0 4000ca4c: 12 bf ff e8 bne 4000c9ec <_Objects_Id_to_name+0x3c> 4000ca50: 85 36 20 1b srl %i0, 0x1b, %g2 4000ca54: 30 bf ff e4 b,a 4000c9e4 <_Objects_Id_to_name+0x34> =============================================================================== 4000e2c0 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 4000e2c0: 9d e3 bf a0 save %sp, -96, %sp Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 4000e2c4: c2 06 20 08 ld [ %i0 + 8 ], %g1 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4000e2c8: 39 00 00 3f sethi %hi(0xfc00), %i4 4000e2cc: b5 30 60 18 srl %g1, 0x18, %i2 4000e2d0: b8 17 23 ff or %i4, 0x3ff, %i4 4000e2d4: b4 0e a0 07 and %i2, 7, %i2 4000e2d8: b8 08 40 1c and %g1, %i4, %i4 4000e2dc: b4 06 a0 04 add %i2, 4, %i2 4000e2e0: b9 2f 20 02 sll %i4, 2, %i4 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4000e2e4: 37 10 00 79 sethi %hi(0x4001e400), %i3 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4000e2e8: b5 2e a0 02 sll %i2, 2, %i2 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4000e2ec: 82 16 e1 dc or %i3, 0x1dc, %g1 done = true; for ( index = 1 ; index <= max ; ++index ) { 4000e2f0: ba 10 20 01 mov 1, %i5 */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; 4000e2f4: 84 10 20 01 mov 1, %g2 for ( index = 1 ; index <= max ; ++index ) { 4000e2f8: 10 80 00 18 b 4000e358 <_POSIX_Keys_Run_destructors+0x98> 4000e2fc: f2 10 60 10 lduh [ %g1 + 0x10 ], %i1 POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; 4000e300: 86 16 e1 dc or %i3, 0x1dc, %g3 Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) 4000e304: c6 00 e0 1c ld [ %g3 + 0x1c ], %g3 4000e308: 83 28 60 02 sll %g1, 2, %g1 4000e30c: c2 00 c0 01 ld [ %g3 + %g1 ], %g1 _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { 4000e310: 80 a0 60 00 cmp %g1, 0 4000e314: 22 80 00 11 be,a 4000e358 <_POSIX_Keys_Run_destructors+0x98> 4000e318: ba 07 60 01 inc %i5 4000e31c: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000e320: 80 a0 e0 00 cmp %g3, 0 4000e324: 02 80 00 0c be 4000e354 <_POSIX_Keys_Run_destructors+0x94> 4000e328: 86 00 40 1a add %g1, %i2, %g3 void *value = key->Values [ thread_api ][ thread_index ]; 4000e32c: c6 00 e0 04 ld [ %g3 + 4 ], %g3 4000e330: d0 00 c0 1c ld [ %g3 + %i4 ], %o0 if ( value != NULL ) { 4000e334: 80 a2 20 00 cmp %o0, 0 4000e338: 22 80 00 08 be,a 4000e358 <_POSIX_Keys_Run_destructors+0x98><== ALWAYS TAKEN 4000e33c: ba 07 60 01 inc %i5 key->Values [ thread_api ][ thread_index ] = NULL; 4000e340: c0 20 c0 1c clr [ %g3 + %i4 ] <== NOT EXECUTED (*key->destructor)( value ); 4000e344: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 <== NOT EXECUTED 4000e348: 9f c0 40 00 call %g1 <== NOT EXECUTED 4000e34c: 01 00 00 00 nop <== NOT EXECUTED done = false; 4000e350: 84 10 20 00 clr %g2 ! 0 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4000e354: ba 07 60 01 inc %i5 4000e358: 83 2f 60 10 sll %i5, 0x10, %g1 4000e35c: 83 30 60 10 srl %g1, 0x10, %g1 4000e360: 80 a0 40 19 cmp %g1, %i1 4000e364: 08 bf ff e7 bleu 4000e300 <_POSIX_Keys_Run_destructors+0x40> 4000e368: 80 88 a0 ff btst 0xff, %g2 * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { 4000e36c: 02 bf ff e1 be 4000e2f0 <_POSIX_Keys_Run_destructors+0x30><== NEVER TAKEN 4000e370: 82 16 e1 dc or %i3, 0x1dc, %g1 done = false; } } } } } 4000e374: 81 c7 e0 08 ret 4000e378: 81 e8 00 00 restore =============================================================================== 4000bdfc <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4000bdfc: 9d e3 bf 98 save %sp, -104, %sp 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( 4000be00: 11 10 00 a0 sethi %hi(0x40028000), %o0 4000be04: 92 10 00 18 mov %i0, %o1 4000be08: 90 12 21 a0 or %o0, 0x1a0, %o0 4000be0c: 40 00 0c c3 call 4000f118 <_Objects_Get> 4000be10: 94 07 bf f8 add %fp, -8, %o2 Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4000be14: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000be18: 80 a0 60 00 cmp %g1, 0 4000be1c: 12 80 00 40 bne 4000bf1c <_POSIX_Message_queue_Receive_support+0x120> 4000be20: 01 00 00 00 nop case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4000be24: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000be28: 84 08 60 03 and %g1, 3, %g2 4000be2c: 80 a0 a0 01 cmp %g2, 1 4000be30: 32 80 00 05 bne,a 4000be44 <_POSIX_Message_queue_Receive_support+0x48> 4000be34: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 _Thread_Enable_dispatch(); 4000be38: 40 00 10 5f call 4000ffb4 <_Thread_Enable_dispatch> 4000be3c: 01 00 00 00 nop 4000be40: 30 80 00 37 b,a 4000bf1c <_POSIX_Message_queue_Receive_support+0x120> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4000be44: c4 02 20 68 ld [ %o0 + 0x68 ], %g2 4000be48: 80 a6 80 02 cmp %i2, %g2 4000be4c: 1a 80 00 08 bcc 4000be6c <_POSIX_Message_queue_Receive_support+0x70> 4000be50: 84 10 3f ff mov -1, %g2 _Thread_Enable_dispatch(); 4000be54: 40 00 10 58 call 4000ffb4 <_Thread_Enable_dispatch> 4000be58: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4000be5c: 40 00 26 b4 call 4001592c <__errno> 4000be60: 01 00 00 00 nop 4000be64: 10 80 00 31 b 4000bf28 <_POSIX_Message_queue_Receive_support+0x12c> 4000be68: 82 10 20 7a mov 0x7a, %g1 ! 7a /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4000be6c: c4 27 bf fc st %g2, [ %fp + -4 ] /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4000be70: 80 a7 20 00 cmp %i4, 0 4000be74: 02 80 00 05 be 4000be88 <_POSIX_Message_queue_Receive_support+0x8c> 4000be78: 98 10 20 00 clr %o4 do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 4000be7c: 99 30 60 0e srl %g1, 0xe, %o4 4000be80: 98 1b 20 01 xor %o4, 1, %o4 4000be84: 98 0b 20 01 and %o4, 1, %o4 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4000be88: 90 02 20 1c add %o0, 0x1c, %o0 4000be8c: 92 10 00 18 mov %i0, %o1 4000be90: 94 10 00 19 mov %i1, %o2 4000be94: 96 07 bf fc add %fp, -4, %o3 4000be98: 98 0b 20 01 and %o4, 1, %o4 4000be9c: 40 00 08 6c call 4000e04c <_CORE_message_queue_Seize> 4000bea0: 9a 10 00 1d mov %i5, %o5 &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4000bea4: 40 00 10 44 call 4000ffb4 <_Thread_Enable_dispatch> 4000bea8: 01 00 00 00 nop if (msg_prio) { 4000beac: 80 a6 e0 00 cmp %i3, 0 4000beb0: 02 80 00 08 be 4000bed0 <_POSIX_Message_queue_Receive_support+0xd4><== NEVER TAKEN 4000beb4: 03 10 00 a0 sethi %hi(0x40028000), %g1 *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count 4000beb8: c2 00 62 30 ld [ %g1 + 0x230 ], %g1 ! 40028230 <_Per_CPU_Information+0x10> RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return (unsigned int) ((priority >= 0) ? priority : -priority); 4000bebc: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 4000bec0: 83 38 a0 1f sra %g2, 0x1f, %g1 4000bec4: 84 18 40 02 xor %g1, %g2, %g2 4000bec8: 82 20 80 01 sub %g2, %g1, %g1 timeout ); _Thread_Enable_dispatch(); if (msg_prio) { *msg_prio = _POSIX_Message_queue_Priority_from_core( 4000becc: c2 26 c0 00 st %g1, [ %i3 ] _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) 4000bed0: 3b 10 00 a0 sethi %hi(0x40028000), %i5 4000bed4: ba 17 62 20 or %i5, 0x220, %i5 ! 40028220 <_Per_CPU_Information> 4000bed8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000bedc: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 4000bee0: 80 a0 60 00 cmp %g1, 0 4000bee4: 12 80 00 05 bne 4000bef8 <_POSIX_Message_queue_Receive_support+0xfc> 4000bee8: 01 00 00 00 nop return length_out; 4000beec: f0 07 bf fc ld [ %fp + -4 ], %i0 4000bef0: 81 c7 e0 08 ret 4000bef4: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one( 4000bef8: 40 00 26 8d call 4001592c <__errno> 4000befc: b0 10 3f ff mov -1, %i0 4000bf00: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000bf04: b8 10 00 08 mov %o0, %i4 4000bf08: 40 00 00 96 call 4000c160 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4000bf0c: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 4000bf10: d0 27 00 00 st %o0, [ %i4 ] 4000bf14: 81 c7 e0 08 ret 4000bf18: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4000bf1c: 40 00 26 84 call 4001592c <__errno> 4000bf20: 01 00 00 00 nop 4000bf24: 82 10 20 09 mov 9, %g1 ! 9 4000bf28: c2 22 00 00 st %g1, [ %o0 ] 4000bf2c: b0 10 3f ff mov -1, %i0 } 4000bf30: 81 c7 e0 08 ret 4000bf34: 81 e8 00 00 restore =============================================================================== 4000e2cc <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 4000e2cc: 9d e3 bf a0 save %sp, -96, %sp POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) 4000e2d0: 80 a6 a0 00 cmp %i2, 0 4000e2d4: 22 80 00 06 be,a 4000e2ec <_POSIX_Semaphore_Create_support+0x20> 4000e2d8: 03 10 00 8b sethi %hi(0x40022c00), %g1 rtems_set_errno_and_return_minus_one( ENOSYS ); 4000e2dc: 40 00 09 ad call 40010990 <__errno> 4000e2e0: 01 00 00 00 nop 4000e2e4: 10 80 00 10 b 4000e324 <_POSIX_Semaphore_Create_support+0x58> 4000e2e8: 82 10 20 58 mov 0x58, %g1 ! 58 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000e2ec: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ++level; 4000e2f0: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4000e2f4: c4 20 60 10 st %g2, [ %g1 + 0x10 ] * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) 4000e2f8: 21 10 00 8b sethi %hi(0x40022c00), %l0 4000e2fc: 7f ff ef 6f call 4000a0b8 <_Objects_Allocate> 4000e300: 90 14 22 d4 or %l0, 0x2d4, %o0 ! 40022ed4 <_POSIX_Semaphore_Information> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 4000e304: ba 92 20 00 orcc %o0, 0, %i5 4000e308: 12 80 00 0a bne 4000e330 <_POSIX_Semaphore_Create_support+0x64> 4000e30c: 80 a6 20 00 cmp %i0, 0 _Thread_Enable_dispatch(); 4000e310: 7f ff f4 6a call 4000b4b8 <_Thread_Enable_dispatch> 4000e314: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSPC ); 4000e318: 40 00 09 9e call 40010990 <__errno> 4000e31c: 01 00 00 00 nop 4000e320: 82 10 20 1c mov 0x1c, %g1 ! 1c 4000e324: c2 22 00 00 st %g1, [ %o0 ] 4000e328: 81 c7 e0 08 ret 4000e32c: 91 e8 3f ff restore %g0, -1, %o0 /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { 4000e330: 02 80 00 10 be 4000e370 <_POSIX_Semaphore_Create_support+0xa4> 4000e334: 90 10 00 18 mov %i0, %o0 name = _Workspace_String_duplicate( name_arg, name_len ); 4000e338: 40 00 03 ca call 4000f260 <_Workspace_String_duplicate> 4000e33c: 92 10 00 19 mov %i1, %o1 if ( !name ) { 4000e340: b4 92 20 00 orcc %o0, 0, %i2 4000e344: 12 80 00 0d bne 4000e378 <_POSIX_Semaphore_Create_support+0xac><== ALWAYS TAKEN 4000e348: 80 a6 a0 00 cmp %i2, 0 RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); 4000e34c: 90 14 22 d4 or %l0, 0x2d4, %o0 <== NOT EXECUTED 4000e350: 7f ff f0 39 call 4000a434 <_Objects_Free> <== NOT EXECUTED 4000e354: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 4000e358: 7f ff f4 58 call 4000b4b8 <_Thread_Enable_dispatch> <== NOT EXECUTED 4000e35c: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 4000e360: 40 00 09 8c call 40010990 <__errno> <== NOT EXECUTED 4000e364: 01 00 00 00 nop <== NOT EXECUTED 4000e368: 10 bf ff ef b 4000e324 <_POSIX_Semaphore_Create_support+0x58><== NOT EXECUTED 4000e36c: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED } } else { name = NULL; 4000e370: b4 10 20 00 clr %i2 } the_semaphore->process_shared = pshared; if ( name ) { 4000e374: 80 a6 a0 00 cmp %i2, 0 4000e378: 02 80 00 08 be 4000e398 <_POSIX_Semaphore_Create_support+0xcc> 4000e37c: c0 27 60 10 clr [ %i5 + 0x10 ] the_semaphore->named = true; 4000e380: 82 10 20 01 mov 1, %g1 4000e384: c2 2f 60 14 stb %g1, [ %i5 + 0x14 ] the_semaphore->open_count = 1; 4000e388: 82 10 20 01 mov 1, %g1 4000e38c: c2 27 60 18 st %g1, [ %i5 + 0x18 ] the_semaphore->linked = true; 4000e390: 10 80 00 05 b 4000e3a4 <_POSIX_Semaphore_Create_support+0xd8> 4000e394: c2 2f 60 15 stb %g1, [ %i5 + 0x15 ] } else { the_semaphore->named = false; 4000e398: c0 2f 60 14 clrb [ %i5 + 0x14 ] the_semaphore->open_count = 0; 4000e39c: c0 27 60 18 clr [ %i5 + 0x18 ] the_semaphore->linked = false; 4000e3a0: c0 2f 60 15 clrb [ %i5 + 0x15 ] the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4000e3a4: 82 10 3f ff mov -1, %g1 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4000e3a8: 90 07 60 1c add %i5, 0x1c, %o0 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4000e3ac: c2 27 60 5c st %g1, [ %i5 + 0x5c ] _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4000e3b0: 92 07 60 5c add %i5, 0x5c, %o1 4000e3b4: 94 10 00 1b mov %i3, %o2 4000e3b8: 7f ff ed b5 call 40009a8c <_CORE_semaphore_Initialize> 4000e3bc: c0 27 60 60 clr [ %i5 + 0x60 ] Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 4000e3c0: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000e3c4: 05 10 00 8b sethi %hi(0x40022c00), %g2 4000e3c8: c4 00 a2 f0 ld [ %g2 + 0x2f0 ], %g2 ! 40022ef0 <_POSIX_Semaphore_Information+0x1c> 4000e3cc: 83 28 60 02 sll %g1, 2, %g1 4000e3d0: fa 20 80 01 st %i5, [ %g2 + %g1 ] the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4000e3d4: f4 27 60 0c st %i2, [ %i5 + 0xc ] &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 4000e3d8: fa 27 00 00 st %i5, [ %i4 ] _Thread_Enable_dispatch(); 4000e3dc: 7f ff f4 37 call 4000b4b8 <_Thread_Enable_dispatch> 4000e3e0: b0 10 20 00 clr %i0 return 0; } 4000e3e4: 81 c7 e0 08 ret 4000e3e8: 81 e8 00 00 restore =============================================================================== 4000b9d4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: Thread_Control *the_thread ) { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000b9d4: c2 02 21 50 ld [ %o0 + 0x150 ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4000b9d8: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2 4000b9dc: 80 a0 a0 00 cmp %g2, 0 4000b9e0: 12 80 00 12 bne 4000ba28 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54><== NEVER TAKEN 4000b9e4: 01 00 00 00 nop 4000b9e8: c4 00 60 dc ld [ %g1 + 0xdc ], %g2 4000b9ec: 80 a0 a0 01 cmp %g2, 1 4000b9f0: 12 80 00 0e bne 4000ba28 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 4000b9f4: 01 00 00 00 nop thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4000b9f8: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 4000b9fc: 80 a0 60 00 cmp %g1, 0 4000ba00: 02 80 00 0a be 4000ba28 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 4000ba04: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000ba08: 03 10 00 5b sethi %hi(0x40016c00), %g1 4000ba0c: c4 00 63 d0 ld [ %g1 + 0x3d0 ], %g2 ! 40016fd0 <_Thread_Dispatch_disable_level> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4000ba10: 92 10 3f ff mov -1, %o1 --level; 4000ba14: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000ba18: c4 20 63 d0 st %g2, [ %g1 + 0x3d0 ] 4000ba1c: 82 13 c0 00 mov %o7, %g1 4000ba20: 40 00 01 b5 call 4000c0f4 <_POSIX_Thread_Exit> 4000ba24: 9e 10 40 00 mov %g1, %o7 } else _Thread_Enable_dispatch(); 4000ba28: 82 13 c0 00 mov %o7, %g1 4000ba2c: 7f ff f6 d8 call 4000958c <_Thread_Enable_dispatch> 4000ba30: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000cd84 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4000cd84: 9d e3 bf a0 save %sp, -96, %sp if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4000cd88: 7f ff ff f4 call 4000cd58 <_POSIX_Priority_Is_valid> 4000cd8c: d0 06 40 00 ld [ %i1 ], %o0 4000cd90: 80 8a 20 ff btst 0xff, %o0 4000cd94: 32 80 00 04 bne,a 4000cda4 <_POSIX_Thread_Translate_sched_param+0x20><== ALWAYS TAKEN 4000cd98: c0 26 80 00 clr [ %i2 ] return EINVAL; 4000cd9c: 81 c7 e0 08 ret 4000cda0: 91 e8 20 16 restore %g0, 0x16, %o0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { 4000cda4: 80 a6 20 00 cmp %i0, 0 4000cda8: 12 80 00 06 bne 4000cdc0 <_POSIX_Thread_Translate_sched_param+0x3c> 4000cdac: c0 26 c0 00 clr [ %i3 ] *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4000cdb0: 82 10 20 01 mov 1, %g1 4000cdb4: c2 26 80 00 st %g1, [ %i2 ] return 0; 4000cdb8: 81 c7 e0 08 ret 4000cdbc: 81 e8 00 00 restore } if ( policy == SCHED_FIFO ) { 4000cdc0: 80 a6 20 01 cmp %i0, 1 4000cdc4: 02 80 00 29 be 4000ce68 <_POSIX_Thread_Translate_sched_param+0xe4> 4000cdc8: 80 a6 20 02 cmp %i0, 2 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4000cdcc: 12 80 00 04 bne 4000cddc <_POSIX_Thread_Translate_sched_param+0x58> 4000cdd0: 80 a6 20 04 cmp %i0, 4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4000cdd4: 10 80 00 25 b 4000ce68 <_POSIX_Thread_Translate_sched_param+0xe4> 4000cdd8: f0 26 80 00 st %i0, [ %i2 ] return 0; } if ( policy == SCHED_SPORADIC ) { 4000cddc: 12 bf ff f0 bne 4000cd9c <_POSIX_Thread_Translate_sched_param+0x18> 4000cde0: 01 00 00 00 nop if ( (param->sched_ss_repl_period.tv_sec == 0) && 4000cde4: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000cde8: 80 a0 60 00 cmp %g1, 0 4000cdec: 32 80 00 07 bne,a 4000ce08 <_POSIX_Thread_Translate_sched_param+0x84> 4000cdf0: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000cdf4: c2 06 60 0c ld [ %i1 + 0xc ], %g1 4000cdf8: 80 a0 60 00 cmp %g1, 0 4000cdfc: 02 bf ff e8 be 4000cd9c <_POSIX_Thread_Translate_sched_param+0x18> 4000ce00: 01 00 00 00 nop (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4000ce04: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000ce08: 80 a0 60 00 cmp %g1, 0 4000ce0c: 12 80 00 06 bne 4000ce24 <_POSIX_Thread_Translate_sched_param+0xa0> 4000ce10: 01 00 00 00 nop 4000ce14: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000ce18: 80 a0 60 00 cmp %g1, 0 4000ce1c: 02 bf ff e0 be 4000cd9c <_POSIX_Thread_Translate_sched_param+0x18> 4000ce20: 01 00 00 00 nop (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000ce24: 7f ff f7 d9 call 4000ad88 <_Timespec_To_ticks> 4000ce28: 90 06 60 08 add %i1, 8, %o0 4000ce2c: ba 10 00 08 mov %o0, %i5 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4000ce30: 7f ff f7 d6 call 4000ad88 <_Timespec_To_ticks> 4000ce34: 90 06 60 10 add %i1, 0x10, %o0 if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000ce38: 80 a7 40 08 cmp %i5, %o0 4000ce3c: 0a bf ff d8 bcs 4000cd9c <_POSIX_Thread_Translate_sched_param+0x18> 4000ce40: 01 00 00 00 nop _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 4000ce44: 7f ff ff c5 call 4000cd58 <_POSIX_Priority_Is_valid> 4000ce48: d0 06 60 04 ld [ %i1 + 4 ], %o0 4000ce4c: 80 8a 20 ff btst 0xff, %o0 4000ce50: 02 bf ff d3 be 4000cd9c <_POSIX_Thread_Translate_sched_param+0x18> 4000ce54: 82 10 20 03 mov 3, %g1 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4000ce58: c2 26 80 00 st %g1, [ %i2 ] *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4000ce5c: 03 10 00 1c sethi %hi(0x40007000), %g1 4000ce60: 82 10 61 a0 or %g1, 0x1a0, %g1 ! 400071a0 <_POSIX_Threads_Sporadic_budget_callout> 4000ce64: c2 26 c0 00 st %g1, [ %i3 ] return 0; } return EINVAL; } 4000ce68: 81 c7 e0 08 ret 4000ce6c: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000c11c <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 4000c11c: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 4000c120: f0 06 61 50 ld [ %i1 + 0x150 ], %i0 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 4000c124: 40 00 08 4d call 4000e258 <_POSIX_Threads_cancel_run> 4000c128: 90 10 00 19 mov %i1, %o0 /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 4000c12c: 90 10 00 19 mov %i1, %o0 4000c130: 40 00 08 64 call 4000e2c0 <_POSIX_Keys_Run_destructors> 4000c134: ba 06 20 44 add %i0, 0x44, %i5 /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000c138: 10 80 00 03 b 4000c144 <_POSIX_Threads_Delete_extension+0x28> 4000c13c: f8 06 60 28 ld [ %i1 + 0x28 ], %i4 *(void **)the_thread->Wait.return_argument = value_ptr; 4000c140: f8 20 40 00 st %i4, [ %g1 ] <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000c144: 7f ff f6 8f call 40009b80 <_Thread_queue_Dequeue> 4000c148: 90 10 00 1d mov %i5, %o0 4000c14c: 80 a2 20 00 cmp %o0, 0 4000c150: 32 bf ff fc bne,a 4000c140 <_POSIX_Threads_Delete_extension+0x24><== NEVER TAKEN 4000c154: c2 02 20 28 ld [ %o0 + 0x28 ], %g1 <== NOT EXECUTED *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 4000c158: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 4000c15c: 80 a0 60 04 cmp %g1, 4 4000c160: 32 80 00 05 bne,a 4000c174 <_POSIX_Threads_Delete_extension+0x58> 4000c164: c0 26 61 50 clr [ %i1 + 0x150 ] (void) _Watchdog_Remove( &api->Sporadic_timer ); 4000c168: 7f ff f9 15 call 4000a5bc <_Watchdog_Remove> 4000c16c: 90 06 20 a8 add %i0, 0xa8, %o0 deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 4000c170: c0 26 61 50 clr [ %i1 + 0x150 ] _Workspace_Free( api ); 4000c174: 7f ff f9 b3 call 4000a840 <_Workspace_Free> 4000c178: 81 e8 00 00 restore =============================================================================== 40006efc <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 40006efc: 9d e3 bf 58 save %sp, -168, %sp 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; 40006f00: 03 10 00 78 sethi %hi(0x4001e000), %g1 40006f04: 82 10 60 b4 or %g1, 0xb4, %g1 ! 4001e0b4 maximum = Configuration_POSIX_API.number_of_initialization_threads; 40006f08: f6 00 60 30 ld [ %g1 + 0x30 ], %i3 if ( !user_threads || maximum == 0 ) 40006f0c: 80 a6 e0 00 cmp %i3, 0 40006f10: 02 80 00 1d be 40006f84 <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 40006f14: fa 00 60 34 ld [ %g1 + 0x34 ], %i5 40006f18: 80 a7 60 00 cmp %i5, 0 40006f1c: 02 80 00 1a be 40006f84 <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 40006f20: b8 10 20 00 clr %i4 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 40006f24: 40 00 17 d3 call 4000ce70 40006f28: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 40006f2c: 92 10 20 02 mov 2, %o1 40006f30: 40 00 17 dc call 4000cea0 40006f34: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 40006f38: d2 07 60 04 ld [ %i5 + 4 ], %o1 40006f3c: 40 00 17 e8 call 4000cedc 40006f40: 90 07 bf c0 add %fp, -64, %o0 status = pthread_create( 40006f44: d4 07 40 00 ld [ %i5 ], %o2 40006f48: 90 07 bf bc add %fp, -68, %o0 40006f4c: 92 07 bf c0 add %fp, -64, %o1 40006f50: 96 10 20 00 clr %o3 40006f54: 7f ff ff 18 call 40006bb4 40006f58: ba 07 60 08 add %i5, 8, %i5 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 40006f5c: 80 a2 20 00 cmp %o0, 0 40006f60: 02 80 00 05 be 40006f74 <_POSIX_Threads_Initialize_user_threads_body+0x78> 40006f64: 94 10 00 08 mov %o0, %o2 _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 40006f68: 90 10 20 02 mov 2, %o0 40006f6c: 40 00 07 f8 call 40008f4c <_Internal_error_Occurred> 40006f70: 92 10 20 01 mov 1, %o1 * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 40006f74: b8 07 20 01 inc %i4 40006f78: 80 a7 00 1b cmp %i4, %i3 40006f7c: 12 bf ff ea bne 40006f24 <_POSIX_Threads_Initialize_user_threads_body+0x28><== NEVER TAKEN 40006f80: 01 00 00 00 nop 40006f84: 81 c7 e0 08 ret 40006f88: 81 e8 00 00 restore =============================================================================== 4000c270 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4000c270: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000c274: fa 06 61 50 ld [ %i1 + 0x150 ], %i5 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4000c278: 40 00 03 82 call 4000d080 <_Timespec_To_ticks> 4000c27c: 90 07 60 98 add %i5, 0x98, %o0 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4000c280: 03 10 00 75 sethi %hi(0x4001d400), %g1 4000c284: d2 08 62 1c ldub [ %g1 + 0x21c ], %o1 ! 4001d61c 4000c288: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 the_thread->cpu_time_budget = ticks; 4000c28c: d0 26 60 74 st %o0, [ %i1 + 0x74 ] 4000c290: 92 22 40 01 sub %o1, %g1, %o1 */ #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 ) { 4000c294: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 4000c298: 80 a0 60 00 cmp %g1, 0 4000c29c: 12 80 00 09 bne 4000c2c0 <_POSIX_Threads_Sporadic_budget_TSR+0x50><== NEVER TAKEN 4000c2a0: d2 26 60 18 st %o1, [ %i1 + 0x18 ] /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 4000c2a4: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000c2a8: 80 a0 40 09 cmp %g1, %o1 4000c2ac: 08 80 00 06 bleu 4000c2c4 <_POSIX_Threads_Sporadic_budget_TSR+0x54> 4000c2b0: 90 07 60 90 add %i5, 0x90, %o0 _Thread_Change_priority( the_thread, new_priority, true ); 4000c2b4: 90 10 00 19 mov %i1, %o0 4000c2b8: 7f ff f4 40 call 400093b8 <_Thread_Change_priority> 4000c2bc: 94 10 20 01 mov 1, %o2 #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 4000c2c0: 90 07 60 90 add %i5, 0x90, %o0 4000c2c4: 40 00 03 6f call 4000d080 <_Timespec_To_ticks> 4000c2c8: 31 10 00 78 sethi %hi(0x4001e000), %i0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000c2cc: b0 16 22 98 or %i0, 0x298, %i0 ! 4001e298 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000c2d0: d0 27 60 b4 st %o0, [ %i5 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000c2d4: 7f ff f8 62 call 4000a45c <_Watchdog_Insert> 4000c2d8: 93 ef 60 a8 restore %i5, 0xa8, %o1 =============================================================================== 4000c2dc <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000c2dc: c4 02 21 50 ld [ %o0 + 0x150 ], %g2 /* * 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 */ 4000c2e0: 86 10 3f ff mov -1, %g3 4000c2e4: c4 00 a0 8c ld [ %g2 + 0x8c ], %g2 4000c2e8: c6 22 20 74 st %g3, [ %o0 + 0x74 ] 4000c2ec: 07 10 00 75 sethi %hi(0x4001d400), %g3 4000c2f0: d2 08 e2 1c ldub [ %g3 + 0x21c ], %o1 ! 4001d61c 4000c2f4: 92 22 40 02 sub %o1, %g2, %o1 */ #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 ) { 4000c2f8: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 4000c2fc: 80 a0 a0 00 cmp %g2, 0 4000c300: 12 80 00 09 bne 4000c324 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 4000c304: d2 22 20 18 st %o1, [ %o0 + 0x18 ] /* * 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 ) { 4000c308: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000c30c: 80 a0 40 09 cmp %g1, %o1 4000c310: 1a 80 00 05 bcc 4000c324 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 4000c314: 94 10 20 01 mov 1, %o2 _Thread_Change_priority( the_thread, new_priority, true ); 4000c318: 82 13 c0 00 mov %o7, %g1 4000c31c: 7f ff f4 27 call 400093b8 <_Thread_Change_priority> 4000c320: 9e 10 40 00 mov %g1, %o7 4000c324: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 40006cb4 <_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) { 40006cb4: 9d e3 bf 98 save %sp, -104, %sp bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 40006cb8: c2 06 60 68 ld [ %i1 + 0x68 ], %g1 40006cbc: 82 00 60 01 inc %g1 40006cc0: c2 26 60 68 st %g1, [ %i1 + 0x68 ] /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40006cc4: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 40006cc8: 80 a0 60 00 cmp %g1, 0 40006ccc: 32 80 00 07 bne,a 40006ce8 <_POSIX_Timer_TSR+0x34> 40006cd0: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40006cd4: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 40006cd8: 80 a0 60 00 cmp %g1, 0 40006cdc: 02 80 00 1f be 40006d58 <_POSIX_Timer_TSR+0xa4> <== NEVER TAKEN 40006ce0: 82 10 20 04 mov 4, %g1 ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 40006ce4: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40006ce8: d4 06 60 08 ld [ %i1 + 8 ], %o2 40006cec: 90 06 60 10 add %i1, 0x10, %o0 40006cf0: 17 10 00 1b sethi %hi(0x40006c00), %o3 40006cf4: 98 10 00 19 mov %i1, %o4 40006cf8: 40 00 17 a5 call 4000cb8c <_POSIX_Timer_Insert_helper> 40006cfc: 96 12 e0 b4 or %o3, 0xb4, %o3 ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 40006d00: 80 8a 20 ff btst 0xff, %o0 40006d04: 02 80 00 1a be 40006d6c <_POSIX_Timer_TSR+0xb8> <== NEVER TAKEN 40006d08: 90 07 bf f8 add %fp, -8, %o0 40006d0c: 13 10 00 7a sethi %hi(0x4001e800), %o1 40006d10: 40 00 05 ed call 400084c4 <_TOD_Get_with_nanoseconds> 40006d14: 92 12 63 b8 or %o1, 0x3b8, %o1 ! 4001ebb8 <_TOD> /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 40006d18: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006d1c: 94 10 20 00 clr %o2 40006d20: 90 10 00 1c mov %i4, %o0 40006d24: 92 10 00 1d mov %i5, %o1 40006d28: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006d2c: 40 00 48 0b call 40018d58 <__divdi3> 40006d30: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006d34: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006d38: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006d3c: 94 10 20 00 clr %o2 40006d40: 92 10 00 1d mov %i5, %o1 40006d44: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006d48: 40 00 48 ef call 40019104 <__moddi3> 40006d4c: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 40006d50: 82 10 20 03 mov 3, %g1 40006d54: d2 26 60 70 st %o1, [ %i1 + 0x70 ] /* * 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 ) ) { 40006d58: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 40006d5c: d2 06 60 44 ld [ %i1 + 0x44 ], %o1 40006d60: 40 00 16 7a call 4000c748 40006d64: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 40006d68: c0 26 60 68 clr [ %i1 + 0x68 ] 40006d6c: 81 c7 e0 08 ret 40006d70: 81 e8 00 00 restore =============================================================================== 4000e37c <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4000e37c: 9d e3 bf 68 save %sp, -152, %sp siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4000e380: 98 10 20 01 mov 1, %o4 4000e384: 90 10 00 18 mov %i0, %o0 4000e388: 92 10 00 19 mov %i1, %o1 4000e38c: 94 07 bf cc add %fp, -52, %o2 4000e390: 40 00 00 2e call 4000e448 <_POSIX_signals_Clear_signals> 4000e394: 96 10 00 1a mov %i2, %o3 4000e398: 80 8a 20 ff btst 0xff, %o0 4000e39c: 02 80 00 28 be 4000e43c <_POSIX_signals_Check_signal+0xc0> 4000e3a0: 82 10 20 00 clr %g1 #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4000e3a4: 85 2e 60 02 sll %i1, 2, %g2 4000e3a8: 35 10 00 79 sethi %hi(0x4001e400), %i2 4000e3ac: b7 2e 60 04 sll %i1, 4, %i3 4000e3b0: b4 16 a3 70 or %i2, 0x370, %i2 4000e3b4: b6 26 c0 02 sub %i3, %g2, %i3 4000e3b8: 84 06 80 1b add %i2, %i3, %g2 4000e3bc: fa 00 a0 08 ld [ %g2 + 8 ], %i5 4000e3c0: 80 a7 60 01 cmp %i5, 1 4000e3c4: 02 80 00 1e be 4000e43c <_POSIX_signals_Check_signal+0xc0><== NEVER TAKEN 4000e3c8: 90 07 bf d8 add %fp, -40, %o0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4000e3cc: f8 06 20 d0 ld [ %i0 + 0xd0 ], %i4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000e3d0: c2 00 a0 04 ld [ %g2 + 4 ], %g1 4000e3d4: 82 10 40 1c or %g1, %i4, %g1 4000e3d8: c2 26 20 d0 st %g1, [ %i0 + 0xd0 ] /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 4000e3dc: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000e3e0: d2 00 63 20 ld [ %g1 + 0x320 ], %o1 ! 4001e720 <_Per_CPU_Information+0x10> 4000e3e4: 94 10 20 28 mov 0x28, %o2 4000e3e8: 40 00 03 f2 call 4000f3b0 4000e3ec: 92 02 60 20 add %o1, 0x20, %o1 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4000e3f0: c2 06 80 1b ld [ %i2 + %i3 ], %g1 4000e3f4: 80 a0 60 02 cmp %g1, 2 4000e3f8: 12 80 00 07 bne 4000e414 <_POSIX_signals_Check_signal+0x98> 4000e3fc: 90 10 00 19 mov %i1, %o0 case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4000e400: 92 07 bf cc add %fp, -52, %o1 4000e404: 9f c7 40 00 call %i5 4000e408: 94 10 20 00 clr %o2 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4000e40c: 10 80 00 05 b 4000e420 <_POSIX_signals_Check_signal+0xa4> 4000e410: 03 10 00 79 sethi %hi(0x4001e400), %g1 default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4000e414: 9f c7 40 00 call %i5 4000e418: 01 00 00 00 nop } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 4000e41c: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000e420: d0 00 63 20 ld [ %g1 + 0x320 ], %o0 ! 4001e720 <_Per_CPU_Information+0x10> 4000e424: 92 07 bf d8 add %fp, -40, %o1 4000e428: 90 02 20 20 add %o0, 0x20, %o0 4000e42c: 40 00 03 e1 call 4000f3b0 4000e430: 94 10 20 28 mov 0x28, %o2 /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 4000e434: 82 10 20 01 mov 1, %g1 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4000e438: f8 26 20 d0 st %i4, [ %i0 + 0xd0 ] return true; } 4000e43c: b0 08 60 01 and %g1, 1, %i0 4000e440: 81 c7 e0 08 ret 4000e444: 81 e8 00 00 restore =============================================================================== 4000e9c8 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 4000e9c8: 9d e3 bf a0 save %sp, -96, %sp 4000e9cc: 82 06 3f ff add %i0, -1, %g1 4000e9d0: ba 10 20 01 mov 1, %i5 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4000e9d4: 7f ff cd b5 call 400020a8 4000e9d8: bb 2f 40 01 sll %i5, %g1, %i5 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4000e9dc: 05 10 00 79 sethi %hi(0x4001e400), %g2 4000e9e0: 83 2e 20 02 sll %i0, 2, %g1 4000e9e4: 84 10 a3 70 or %g2, 0x370, %g2 4000e9e8: b1 2e 20 04 sll %i0, 4, %i0 4000e9ec: 82 26 00 01 sub %i0, %g1, %g1 4000e9f0: c4 00 80 01 ld [ %g2 + %g1 ], %g2 4000e9f4: 80 a0 a0 02 cmp %g2, 2 4000e9f8: 32 80 00 0c bne,a 4000ea28 <_POSIX_signals_Clear_process_signals+0x60> 4000e9fc: 03 10 00 7a sethi %hi(0x4001e800), %g1 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4000ea00: 05 10 00 7a sethi %hi(0x4001e800), %g2 4000ea04: 84 10 a1 68 or %g2, 0x168, %g2 ! 4001e968 <_POSIX_signals_Siginfo> 4000ea08: 86 00 40 02 add %g1, %g2, %g3 4000ea0c: c2 00 40 02 ld [ %g1 + %g2 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000ea10: 86 00 e0 04 add %g3, 4, %g3 4000ea14: 80 a0 40 03 cmp %g1, %g3 4000ea18: 02 80 00 04 be 4000ea28 <_POSIX_signals_Clear_process_signals+0x60><== ALWAYS TAKEN 4000ea1c: 03 10 00 7a sethi %hi(0x4001e800), %g1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 4000ea20: 7f ff cd a6 call 400020b8 4000ea24: 91 e8 00 08 restore %g0, %o0, %o0 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4000ea28: c4 00 61 64 ld [ %g1 + 0x164 ], %g2 4000ea2c: ba 28 80 1d andn %g2, %i5, %i5 4000ea30: 10 bf ff fc b 4000ea20 <_POSIX_signals_Clear_process_signals+0x58> 4000ea34: fa 20 61 64 st %i5, [ %g1 + 0x164 ] =============================================================================== 400077ac <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 400077ac: 82 10 20 1b mov 0x1b, %g1 400077b0: 84 10 20 01 mov 1, %g2 #include #include #include #include static int _POSIX_signals_Get_lowest( 400077b4: 86 00 7f ff add %g1, -1, %g3 400077b8: 87 28 80 03 sll %g2, %g3, %g3 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 400077bc: 80 88 c0 08 btst %g3, %o0 400077c0: 12 80 00 11 bne 40007804 <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 400077c4: 01 00 00 00 nop sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 400077c8: 82 00 60 01 inc %g1 400077cc: 80 a0 60 20 cmp %g1, 0x20 400077d0: 12 bf ff fa bne 400077b8 <_POSIX_signals_Get_lowest+0xc> 400077d4: 86 00 7f ff add %g1, -1, %g3 400077d8: 82 10 20 01 mov 1, %g1 400077dc: 84 10 20 01 mov 1, %g2 #include #include #include #include static int _POSIX_signals_Get_lowest( 400077e0: 86 00 7f ff add %g1, -1, %g3 400077e4: 87 28 80 03 sll %g2, %g3, %g3 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 400077e8: 80 88 c0 08 btst %g3, %o0 400077ec: 12 80 00 06 bne 40007804 <_POSIX_signals_Get_lowest+0x58> 400077f0: 01 00 00 00 nop */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 400077f4: 82 00 60 01 inc %g1 400077f8: 80 a0 60 1b cmp %g1, 0x1b 400077fc: 12 bf ff fa bne 400077e4 <_POSIX_signals_Get_lowest+0x38> <== ALWAYS TAKEN 40007800: 86 00 7f ff add %g1, -1, %g3 * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 40007804: 81 c3 e0 08 retl 40007808: 90 10 00 01 mov %g1, %o0 =============================================================================== 4000bea8 <_POSIX_signals_Post_switch_hook>: */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { 4000bea8: 9d e3 bf a0 save %sp, -96, %sp /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4000beac: 03 10 00 79 sethi %hi(0x4001e400), %g1 POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000beb0: fa 06 21 50 ld [ %i0 + 0x150 ], %i5 /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4000beb4: c2 00 63 20 ld [ %g1 + 0x320 ], %g1 /* * api may be NULL in case of a thread close in progress */ if ( !api ) 4000beb8: 80 a7 60 00 cmp %i5, 0 4000bebc: 02 80 00 11 be 4000bf00 <_POSIX_signals_Post_switch_hook+0x58><== NEVER TAKEN 4000bec0: f6 00 60 34 ld [ %g1 + 0x34 ], %i3 * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000bec4: 35 10 00 7a sethi %hi(0x4001e800), %i2 * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 4000bec8: 7f ff d8 78 call 400020a8 4000becc: 01 00 00 00 nop if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000bed0: c4 06 a1 64 ld [ %i2 + 0x164 ], %g2 4000bed4: c2 07 60 d4 ld [ %i5 + 0xd4 ], %g1 4000bed8: 82 10 80 01 or %g2, %g1, %g1 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 4000bedc: c4 07 60 d0 ld [ %i5 + 0xd0 ], %g2 4000bee0: 80 a8 40 02 andncc %g1, %g2, %g0 4000bee4: 12 80 00 09 bne 4000bf08 <_POSIX_signals_Post_switch_hook+0x60> 4000bee8: 01 00 00 00 nop (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 4000beec: 7f ff d8 73 call 400020b8 4000bef0: 01 00 00 00 nop _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; 4000bef4: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000bef8: c2 00 63 20 ld [ %g1 + 0x320 ], %g1 ! 4001e720 <_Per_CPU_Information+0x10> 4000befc: f6 20 60 34 st %i3, [ %g1 + 0x34 ] 4000bf00: 81 c7 e0 08 ret 4000bf04: 81 e8 00 00 restore if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 4000bf08: 7f ff d8 6c call 400020b8 4000bf0c: b8 10 20 1b mov 0x1b, %i4 for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000bf10: 92 10 00 1c mov %i4, %o1 4000bf14: 94 10 20 00 clr %o2 4000bf18: 40 00 09 19 call 4000e37c <_POSIX_signals_Check_signal> 4000bf1c: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000bf20: 92 10 00 1c mov %i4, %o1 4000bf24: 90 10 00 1d mov %i5, %o0 4000bf28: 40 00 09 15 call 4000e37c <_POSIX_signals_Check_signal> 4000bf2c: 94 10 20 01 mov 1, %o2 _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4000bf30: b8 07 20 01 inc %i4 4000bf34: 80 a7 20 20 cmp %i4, 0x20 4000bf38: 12 bf ff f7 bne 4000bf14 <_POSIX_signals_Post_switch_hook+0x6c> 4000bf3c: 92 10 00 1c mov %i4, %o1 4000bf40: b8 10 20 01 mov 1, %i4 _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000bf44: 92 10 00 1c mov %i4, %o1 4000bf48: 94 10 20 00 clr %o2 4000bf4c: 40 00 09 0c call 4000e37c <_POSIX_signals_Check_signal> 4000bf50: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000bf54: 92 10 00 1c mov %i4, %o1 4000bf58: 90 10 00 1d mov %i5, %o0 4000bf5c: 40 00 09 08 call 4000e37c <_POSIX_signals_Check_signal> 4000bf60: 94 10 20 01 mov 1, %o2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4000bf64: b8 07 20 01 inc %i4 4000bf68: 80 a7 20 1b cmp %i4, 0x1b 4000bf6c: 12 bf ff f7 bne 4000bf48 <_POSIX_signals_Post_switch_hook+0xa0> 4000bf70: 92 10 00 1c mov %i4, %o1 4000bf74: 30 bf ff d5 b,a 4000bec8 <_POSIX_signals_Post_switch_hook+0x20> =============================================================================== 4001b050 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4001b050: 9d e3 bf a0 save %sp, -96, %sp /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4001b054: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4001b058: 3b 04 00 20 sethi %hi(0x10008000), %i5 4001b05c: 84 06 7f ff add %i1, -1, %g2 4001b060: 86 10 20 01 mov 1, %g3 4001b064: b8 08 40 1d and %g1, %i5, %i4 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4001b068: c8 06 21 50 ld [ %i0 + 0x150 ], %g4 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4001b06c: 80 a7 00 1d cmp %i4, %i5 4001b070: 12 80 00 1e bne 4001b0e8 <_POSIX_signals_Unblock_thread+0x98> 4001b074: 85 28 c0 02 sll %g3, %g2, %g2 if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 4001b078: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4001b07c: 80 88 80 01 btst %g2, %g1 4001b080: 12 80 00 08 bne 4001b0a0 <_POSIX_signals_Unblock_thread+0x50> 4001b084: 82 10 20 04 mov 4, %g1 4001b088: c2 01 20 d0 ld [ %g4 + 0xd0 ], %g1 4001b08c: 80 a8 80 01 andncc %g2, %g1, %g0 4001b090: 32 80 00 04 bne,a 4001b0a0 <_POSIX_signals_Unblock_thread+0x50> 4001b094: 82 10 20 04 mov 4, %g1 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001b098: 10 80 00 3d b 4001b18c <_POSIX_signals_Unblock_thread+0x13c> 4001b09c: b0 10 20 00 clr %i0 */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; 4001b0a0: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4001b0a4: 80 a6 a0 00 cmp %i2, 0 4001b0a8: 12 80 00 07 bne 4001b0c4 <_POSIX_signals_Unblock_thread+0x74> 4001b0ac: d0 06 20 28 ld [ %i0 + 0x28 ], %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 4001b0b0: 82 10 20 01 mov 1, %g1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 4001b0b4: f2 22 00 00 st %i1, [ %o0 ] the_info->si_code = SI_USER; 4001b0b8: c2 22 20 04 st %g1, [ %o0 + 4 ] the_info->si_value.sival_int = 0; 4001b0bc: 10 80 00 05 b 4001b0d0 <_POSIX_signals_Unblock_thread+0x80> 4001b0c0: c0 22 20 08 clr [ %o0 + 8 ] } else { *the_info = *info; 4001b0c4: 92 10 00 1a mov %i2, %o1 4001b0c8: 7f ff d0 ba call 4000f3b0 4001b0cc: 94 10 20 0c mov 0xc, %o2 } _Thread_queue_Extract_with_proxy( the_thread ); 4001b0d0: 90 10 00 18 mov %i0, %o0 4001b0d4: 7f ff bb 98 call 40009f34 <_Thread_queue_Extract_with_proxy> 4001b0d8: b0 10 20 01 mov 1, %i0 4001b0dc: b0 0e 20 01 and %i0, 1, %i0 4001b0e0: 81 c7 e0 08 ret 4001b0e4: 81 e8 00 00 restore } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4001b0e8: c8 01 20 d0 ld [ %g4 + 0xd0 ], %g4 4001b0ec: 80 a8 80 04 andncc %g2, %g4, %g0 4001b0f0: 02 80 00 26 be 4001b188 <_POSIX_signals_Unblock_thread+0x138> 4001b0f4: 05 04 00 00 sethi %hi(0x10000000), %g2 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 4001b0f8: 80 88 40 02 btst %g1, %g2 4001b0fc: 02 80 00 17 be 4001b158 <_POSIX_signals_Unblock_thread+0x108> 4001b100: 80 a0 60 00 cmp %g1, 0 the_thread->Wait.return_code = EINTR; 4001b104: 84 10 20 04 mov 4, %g2 4001b108: c4 26 20 34 st %g2, [ %i0 + 0x34 ] /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 4001b10c: 05 00 00 ef sethi %hi(0x3bc00), %g2 4001b110: 84 10 a2 e0 or %g2, 0x2e0, %g2 ! 3bee0 4001b114: 80 88 40 02 btst %g1, %g2 4001b118: 02 80 00 06 be 4001b130 <_POSIX_signals_Unblock_thread+0xe0> 4001b11c: 80 88 60 08 btst 8, %g1 _Thread_queue_Extract_with_proxy( the_thread ); 4001b120: 7f ff bb 85 call 40009f34 <_Thread_queue_Extract_with_proxy> 4001b124: 90 10 00 18 mov %i0, %o0 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001b128: 10 80 00 19 b 4001b18c <_POSIX_signals_Unblock_thread+0x13c> 4001b12c: b0 10 20 00 clr %i0 * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else if ( _States_Is_delaying(the_thread->current_state) ) { 4001b130: 22 80 00 17 be,a 4001b18c <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN 4001b134: b0 10 20 00 clr %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4001b138: 7f ff bd 21 call 4000a5bc <_Watchdog_Remove> 4001b13c: 90 06 20 48 add %i0, 0x48, %o0 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4001b140: 90 10 00 18 mov %i0, %o0 4001b144: 13 04 01 ff sethi %hi(0x1007fc00), %o1 4001b148: 7f ff b8 e0 call 400094c8 <_Thread_Clear_state> 4001b14c: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001b150: 10 80 00 0f b 4001b18c <_POSIX_signals_Unblock_thread+0x13c> 4001b154: b0 10 20 00 clr %i0 else if ( _States_Is_delaying(the_thread->current_state) ) { (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4001b158: 32 80 00 0d bne,a 4001b18c <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN 4001b15c: b0 10 20 00 clr %i0 <== NOT EXECUTED if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4001b160: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001b164: 82 10 63 10 or %g1, 0x310, %g1 ! 4001e710 <_Per_CPU_Information> 4001b168: c4 00 60 08 ld [ %g1 + 8 ], %g2 4001b16c: 80 a0 a0 00 cmp %g2, 0 4001b170: 22 80 00 07 be,a 4001b18c <_POSIX_signals_Unblock_thread+0x13c> 4001b174: b0 10 20 00 clr %i0 4001b178: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4001b17c: 80 a6 00 02 cmp %i0, %g2 4001b180: 22 80 00 02 be,a 4001b188 <_POSIX_signals_Unblock_thread+0x138><== ALWAYS TAKEN 4001b184: c6 28 60 0c stb %g3, [ %g1 + 0xc ] _Thread_Dispatch_necessary = true; } } return false; 4001b188: b0 10 20 00 clr %i0 } 4001b18c: b0 0e 20 01 and %i0, 1, %i0 4001b190: 81 c7 e0 08 ret 4001b194: 81 e8 00 00 restore =============================================================================== 400096d8 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 400096d8: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 400096dc: 80 a6 60 00 cmp %i1, 0 400096e0: 02 80 00 69 be 40009884 <_RBTree_Extract_unprotected+0x1ac> 400096e4: 01 00 00 00 nop /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 400096e8: c2 06 20 08 ld [ %i0 + 8 ], %g1 400096ec: 80 a6 40 01 cmp %i1, %g1 400096f0: 32 80 00 07 bne,a 4000970c <_RBTree_Extract_unprotected+0x34> 400096f4: c2 06 20 0c ld [ %i0 + 0xc ], %g1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 400096f8: 90 10 00 19 mov %i1, %o0 400096fc: 40 00 01 31 call 40009bc0 <_RBTree_Next_unprotected> 40009700: 92 10 20 01 mov 1, %o1 RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 40009704: d0 26 20 08 st %o0, [ %i0 + 8 ] } /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 40009708: c2 06 20 0c ld [ %i0 + 0xc ], %g1 4000970c: 80 a6 40 01 cmp %i1, %g1 40009710: 32 80 00 07 bne,a 4000972c <_RBTree_Extract_unprotected+0x54> 40009714: fa 06 60 04 ld [ %i1 + 4 ], %i5 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 40009718: 90 10 00 19 mov %i1, %o0 4000971c: 40 00 01 29 call 40009bc0 <_RBTree_Next_unprotected> 40009720: 92 10 20 00 clr %o1 RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 40009724: d0 26 20 0c st %o0, [ %i0 + 0xc ] * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 40009728: fa 06 60 04 ld [ %i1 + 4 ], %i5 4000972c: 80 a7 60 00 cmp %i5, 0 40009730: 02 80 00 36 be 40009808 <_RBTree_Extract_unprotected+0x130> 40009734: f8 06 60 08 ld [ %i1 + 8 ], %i4 40009738: 80 a7 20 00 cmp %i4, 0 4000973c: 32 80 00 05 bne,a 40009750 <_RBTree_Extract_unprotected+0x78> 40009740: c2 07 60 08 ld [ %i5 + 8 ], %g1 40009744: 10 80 00 35 b 40009818 <_RBTree_Extract_unprotected+0x140> 40009748: b8 10 00 1d mov %i5, %i4 target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 4000974c: c2 07 60 08 ld [ %i5 + 8 ], %g1 40009750: 80 a0 60 00 cmp %g1, 0 40009754: 32 bf ff fe bne,a 4000974c <_RBTree_Extract_unprotected+0x74> 40009758: ba 10 00 01 mov %g1, %i5 * target's position (target is the right child of target->parent) * when target vacates it. if there is no child, then target->parent * should become NULL. This may cause the coloring to be violated. * For now we store the color of the node being deleted in victim_color. */ leaf = target->child[RBT_LEFT]; 4000975c: f8 07 60 04 ld [ %i5 + 4 ], %i4 if(leaf) { 40009760: 80 a7 20 00 cmp %i4, 0 40009764: 02 80 00 05 be 40009778 <_RBTree_Extract_unprotected+0xa0> 40009768: 01 00 00 00 nop leaf->parent = target->parent; 4000976c: c2 07 40 00 ld [ %i5 ], %g1 40009770: 10 80 00 04 b 40009780 <_RBTree_Extract_unprotected+0xa8> 40009774: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 40009778: 7f ff ff 73 call 40009544 <_RBTree_Extract_validate_unprotected> 4000977c: 90 10 00 1d mov %i5, %o0 } victim_color = target->color; dir = target != target->parent->child[0]; 40009780: c4 07 40 00 ld [ %i5 ], %g2 leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; 40009784: c2 07 60 0c ld [ %i5 + 0xc ], %g1 dir = target != target->parent->child[0]; 40009788: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000978c: 86 1f 40 03 xor %i5, %g3, %g3 40009790: 80 a0 00 03 cmp %g0, %g3 40009794: 86 40 20 00 addx %g0, 0, %g3 target->parent->child[dir] = leaf; 40009798: 87 28 e0 02 sll %g3, 2, %g3 4000979c: 84 00 80 03 add %g2, %g3, %g2 400097a0: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 400097a4: c4 06 40 00 ld [ %i1 ], %g2 400097a8: c6 00 a0 04 ld [ %g2 + 4 ], %g3 400097ac: 86 1e 40 03 xor %i1, %g3, %g3 400097b0: 80 a0 00 03 cmp %g0, %g3 400097b4: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = target; 400097b8: 87 28 e0 02 sll %g3, 2, %g3 400097bc: 84 00 80 03 add %g2, %g3, %g2 400097c0: fa 20 a0 04 st %i5, [ %g2 + 4 ] /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 400097c4: c4 06 60 08 ld [ %i1 + 8 ], %g2 400097c8: c4 27 60 08 st %g2, [ %i5 + 8 ] if (the_node->child[RBT_RIGHT]) 400097cc: c4 06 60 08 ld [ %i1 + 8 ], %g2 400097d0: 80 a0 a0 00 cmp %g2, 0 400097d4: 32 80 00 02 bne,a 400097dc <_RBTree_Extract_unprotected+0x104><== ALWAYS TAKEN 400097d8: fa 20 80 00 st %i5, [ %g2 ] the_node->child[RBT_RIGHT]->parent = target; target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 400097dc: c4 06 60 04 ld [ %i1 + 4 ], %g2 400097e0: c4 27 60 04 st %g2, [ %i5 + 4 ] if (the_node->child[RBT_LEFT]) 400097e4: c4 06 60 04 ld [ %i1 + 4 ], %g2 400097e8: 80 a0 a0 00 cmp %g2, 0 400097ec: 32 80 00 02 bne,a 400097f4 <_RBTree_Extract_unprotected+0x11c> 400097f0: fa 20 80 00 st %i5, [ %g2 ] /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 400097f4: c4 06 40 00 ld [ %i1 ], %g2 400097f8: c4 27 40 00 st %g2, [ %i5 ] target->color = the_node->color; 400097fc: c4 06 60 0c ld [ %i1 + 0xc ], %g2 40009800: 10 80 00 14 b 40009850 <_RBTree_Extract_unprotected+0x178> 40009804: c4 27 60 0c st %g2, [ %i5 + 0xc ] * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { 40009808: 80 a7 20 00 cmp %i4, 0 4000980c: 32 80 00 04 bne,a 4000981c <_RBTree_Extract_unprotected+0x144> 40009810: c2 06 40 00 ld [ %i1 ], %g1 40009814: 30 80 00 04 b,a 40009824 <_RBTree_Extract_unprotected+0x14c> leaf->parent = the_node->parent; 40009818: c2 06 40 00 ld [ %i1 ], %g1 4000981c: 10 80 00 04 b 4000982c <_RBTree_Extract_unprotected+0x154> 40009820: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 40009824: 7f ff ff 48 call 40009544 <_RBTree_Extract_validate_unprotected> 40009828: 90 10 00 19 mov %i1, %o0 } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4000982c: c4 06 40 00 ld [ %i1 ], %g2 leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; 40009830: c2 06 60 0c ld [ %i1 + 0xc ], %g1 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 40009834: c6 00 a0 04 ld [ %g2 + 4 ], %g3 40009838: 86 1e 40 03 xor %i1, %g3, %g3 4000983c: 80 a0 00 03 cmp %g0, %g3 40009840: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = leaf; 40009844: 87 28 e0 02 sll %g3, 2, %g3 40009848: 84 00 80 03 add %g2, %g3, %g2 4000984c: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 40009850: 80 a0 60 00 cmp %g1, 0 40009854: 32 80 00 06 bne,a 4000986c <_RBTree_Extract_unprotected+0x194> 40009858: c2 06 20 04 ld [ %i0 + 4 ], %g1 if (leaf) { 4000985c: 80 a7 20 00 cmp %i4, 0 40009860: 32 80 00 02 bne,a 40009868 <_RBTree_Extract_unprotected+0x190> 40009864: c0 27 20 0c clr [ %i4 + 0xc ] /* Wipe the_node */ _RBTree_Set_off_rbtree(the_node); /* set root to black, if it exists */ if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK; 40009868: c2 06 20 04 ld [ %i0 + 4 ], %g1 */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 4000986c: c0 26 60 08 clr [ %i1 + 8 ] 40009870: c0 26 60 04 clr [ %i1 + 4 ] 40009874: 80 a0 60 00 cmp %g1, 0 40009878: 02 80 00 03 be 40009884 <_RBTree_Extract_unprotected+0x1ac> 4000987c: c0 26 40 00 clr [ %i1 ] 40009880: c0 20 60 0c clr [ %g1 + 0xc ] 40009884: 81 c7 e0 08 ret 40009888: 81 e8 00 00 restore =============================================================================== 4000a950 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 4000a950: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4000a954: 80 a6 20 00 cmp %i0, 0 4000a958: 02 80 00 10 be 4000a998 <_RBTree_Initialize+0x48> <== NEVER TAKEN 4000a95c: 01 00 00 00 nop RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4000a960: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 4000a964: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 4000a968: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 4000a96c: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 4000a970: f2 26 20 10 st %i1, [ %i0 + 0x10 ] /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4000a974: 10 80 00 06 b 4000a98c <_RBTree_Initialize+0x3c> 4000a978: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] _RBTree_Insert_unprotected(the_rbtree, next); 4000a97c: 90 10 00 18 mov %i0, %o0 4000a980: 7f ff ff 2e call 4000a638 <_RBTree_Insert_unprotected> 4000a984: b4 06 80 1c add %i2, %i4, %i2 4000a988: b6 06 ff ff add %i3, -1, %i3 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4000a98c: 80 a6 e0 00 cmp %i3, 0 4000a990: 12 bf ff fb bne 4000a97c <_RBTree_Initialize+0x2c> 4000a994: 92 10 00 1a mov %i2, %o1 4000a998: 81 c7 e0 08 ret 4000a99c: 81 e8 00 00 restore =============================================================================== 4000992c <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4000992c: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 40009930: 80 a6 60 00 cmp %i1, 0 40009934: 02 80 00 7c be 40009b24 <_RBTree_Insert_unprotected+0x1f8> 40009938: ba 10 00 18 mov %i0, %i5 RBTree_Node *iter_node = the_rbtree->root; 4000993c: f0 06 20 04 ld [ %i0 + 4 ], %i0 int compare_result; if (!iter_node) { /* special case: first node inserted */ 40009940: b6 96 20 00 orcc %i0, 0, %i3 40009944: 32 80 00 0c bne,a 40009974 <_RBTree_Insert_unprotected+0x48> 40009948: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 the_node->color = RBT_BLACK; 4000994c: c0 26 60 0c clr [ %i1 + 0xc ] the_rbtree->root = the_node; 40009950: f2 27 60 04 st %i1, [ %i5 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 40009954: f2 27 60 0c st %i1, [ %i5 + 0xc ] 40009958: f2 27 60 08 st %i1, [ %i5 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 4000995c: fa 26 40 00 st %i5, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 40009960: c0 26 60 08 clr [ %i1 + 8 ] 40009964: c0 26 60 04 clr [ %i1 + 4 ] 40009968: 81 c7 e0 08 ret 4000996c: 81 e8 00 00 restore } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 40009970: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 40009974: 90 10 00 19 mov %i1, %o0 40009978: 9f c0 40 00 call %g1 4000997c: 92 10 00 18 mov %i0, %o1 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 40009980: c2 0f 60 14 ldub [ %i5 + 0x14 ], %g1 40009984: 80 a0 60 00 cmp %g1, 0 40009988: 02 80 00 05 be 4000999c <_RBTree_Insert_unprotected+0x70> 4000998c: b8 38 00 08 xnor %g0, %o0, %i4 40009990: 80 a2 20 00 cmp %o0, 0 40009994: 02 80 00 65 be 40009b28 <_RBTree_Insert_unprotected+0x1fc> 40009998: 01 00 00 00 nop return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 4000999c: b9 37 20 1f srl %i4, 0x1f, %i4 if (!iter_node->child[dir]) { 400099a0: 83 2f 20 02 sll %i4, 2, %g1 400099a4: 82 06 00 01 add %i0, %g1, %g1 400099a8: f0 00 60 04 ld [ %g1 + 4 ], %i0 400099ac: 80 a6 20 00 cmp %i0, 0 400099b0: 32 bf ff f0 bne,a 40009970 <_RBTree_Insert_unprotected+0x44> 400099b4: b6 10 00 18 mov %i0, %i3 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 400099b8: c0 26 60 08 clr [ %i1 + 8 ] 400099bc: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; 400099c0: 84 10 20 01 mov 1, %g2 iter_node->child[dir] = the_node; 400099c4: f2 20 60 04 st %i1, [ %g1 + 4 ] if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 400099c8: c4 26 60 0c st %g2, [ %i1 + 0xc ] iter_node->child[dir] = the_node; the_node->parent = iter_node; 400099cc: f6 26 40 00 st %i3, [ %i1 ] /* update min/max */ compare_result = the_rbtree->compare_function( 400099d0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 400099d4: b6 07 20 02 add %i4, 2, %i3 400099d8: 85 2e e0 02 sll %i3, 2, %g2 400099dc: d2 07 40 02 ld [ %i5 + %g2 ], %o1 400099e0: 9f c0 40 00 call %g1 400099e4: 90 10 00 19 mov %i1, %o0 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 400099e8: 80 a7 20 00 cmp %i4, 0 400099ec: 12 80 00 06 bne 40009a04 <_RBTree_Insert_unprotected+0xd8> 400099f0: 80 a2 20 00 cmp %o0, 0 400099f4: 36 80 00 3c bge,a 40009ae4 <_RBTree_Insert_unprotected+0x1b8> 400099f8: d0 06 40 00 ld [ %i1 ], %o0 (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 400099fc: 10 80 00 04 b 40009a0c <_RBTree_Insert_unprotected+0xe0> 40009a00: b7 2e e0 02 sll %i3, 2, %i3 compare_result = the_rbtree->compare_function( the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || (dir && _RBTree_Is_greater(compare_result)) ) { 40009a04: 04 80 00 37 ble 40009ae0 <_RBTree_Insert_unprotected+0x1b4> 40009a08: b7 2e e0 02 sll %i3, 2, %i3 the_rbtree->first[dir] = the_node; 40009a0c: 10 80 00 35 b 40009ae0 <_RBTree_Insert_unprotected+0x1b4> 40009a10: f2 27 40 1b st %i1, [ %i5 + %i3 ] const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; 40009a14: 02 80 00 13 be 40009a60 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 40009a18: 82 10 20 00 clr %g1 if(!(the_node->parent->parent->parent)) return NULL; 40009a1c: c2 07 40 00 ld [ %i5 ], %g1 40009a20: 80 a0 60 00 cmp %g1, 0 40009a24: 02 80 00 0f be 40009a60 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 40009a28: 82 10 20 00 clr %g1 { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 40009a2c: c2 07 60 04 ld [ %i5 + 4 ], %g1 40009a30: 80 a2 00 01 cmp %o0, %g1 40009a34: 22 80 00 02 be,a 40009a3c <_RBTree_Insert_unprotected+0x110> 40009a38: c2 07 60 08 ld [ %i5 + 8 ], %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 40009a3c: 80 a0 60 00 cmp %g1, 0 40009a40: 02 80 00 09 be 40009a64 <_RBTree_Insert_unprotected+0x138> 40009a44: 84 10 20 00 clr %g2 40009a48: c4 00 60 0c ld [ %g1 + 0xc ], %g2 40009a4c: 80 a0 a0 01 cmp %g2, 1 40009a50: 32 80 00 05 bne,a 40009a64 <_RBTree_Insert_unprotected+0x138> 40009a54: 84 10 20 00 clr %g2 40009a58: 10 80 00 03 b 40009a64 <_RBTree_Insert_unprotected+0x138> 40009a5c: 84 10 20 01 mov 1, %g2 40009a60: 84 10 20 00 clr %g2 <== NOT EXECUTED while (_RBTree_Is_red(_RBTree_Parent(the_node))) { u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { 40009a64: 80 a0 a0 00 cmp %g2, 0 40009a68: 22 80 00 08 be,a 40009a88 <_RBTree_Insert_unprotected+0x15c> 40009a6c: c2 07 60 04 ld [ %i5 + 4 ], %g1 the_node->parent->color = RBT_BLACK; 40009a70: c0 22 20 0c clr [ %o0 + 0xc ] u->color = RBT_BLACK; 40009a74: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 40009a78: b2 10 00 1d mov %i5, %i1 40009a7c: 82 10 20 01 mov 1, %g1 40009a80: 10 80 00 18 b 40009ae0 <_RBTree_Insert_unprotected+0x1b4> 40009a84: c2 27 60 0c st %g1, [ %i5 + 0xc ] the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; 40009a88: 82 1a 00 01 xor %o0, %g1, %g1 40009a8c: 80 a0 00 01 cmp %g0, %g1 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 40009a90: c2 02 20 04 ld [ %o0 + 4 ], %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; 40009a94: b8 40 20 00 addx %g0, 0, %i4 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 40009a98: 82 1e 40 01 xor %i1, %g1, %g1 40009a9c: 80 a0 00 01 cmp %g0, %g1 40009aa0: 82 40 20 00 addx %g0, 0, %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 40009aa4: 80 a0 40 1c cmp %g1, %i4 40009aa8: 22 80 00 08 be,a 40009ac8 <_RBTree_Insert_unprotected+0x19c> 40009aac: c2 06 40 00 ld [ %i1 ], %g1 _RBTree_Rotate(the_node->parent, pdir); 40009ab0: 7f ff ff 80 call 400098b0 <_RBTree_Rotate> 40009ab4: 92 10 00 1c mov %i4, %o1 the_node = the_node->child[pdir]; 40009ab8: 83 2f 20 02 sll %i4, 2, %g1 40009abc: b2 06 40 01 add %i1, %g1, %i1 40009ac0: f2 06 60 04 ld [ %i1 + 4 ], %i1 } the_node->parent->color = RBT_BLACK; 40009ac4: c2 06 40 00 ld [ %i1 ], %g1 g->color = RBT_RED; 40009ac8: 92 10 20 01 mov 1, %o1 /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; } the_node->parent->color = RBT_BLACK; 40009acc: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 40009ad0: d2 27 60 0c st %o1, [ %i5 + 0xc ] /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 40009ad4: 90 10 00 1d mov %i5, %o0 40009ad8: 7f ff ff 76 call 400098b0 <_RBTree_Rotate> 40009adc: 92 22 40 1c sub %o1, %i4, %o1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 40009ae0: d0 06 40 00 ld [ %i1 ], %o0 40009ae4: fa 02 00 00 ld [ %o0 ], %i5 40009ae8: 80 a7 60 00 cmp %i5, 0 40009aec: 22 80 00 06 be,a 40009b04 <_RBTree_Insert_unprotected+0x1d8> 40009af0: 82 10 20 00 clr %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 40009af4: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40009af8: 82 18 60 01 xor %g1, 1, %g1 40009afc: 80 a0 00 01 cmp %g0, %g1 40009b00: 82 60 3f ff subx %g0, -1, %g1 RBTree_Node *u,*g; /* note: the insert root case is handled already */ /* if the parent is black, nothing needs to be done * otherwise may need to loop a few times */ while (_RBTree_Is_red(_RBTree_Parent(the_node))) { 40009b04: 80 a0 60 00 cmp %g1, 0 40009b08: 12 bf ff c3 bne 40009a14 <_RBTree_Insert_unprotected+0xe8> 40009b0c: 80 a7 60 00 cmp %i5, 0 /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 40009b10: 12 80 00 06 bne 40009b28 <_RBTree_Insert_unprotected+0x1fc> 40009b14: 01 00 00 00 nop 40009b18: c0 26 60 0c clr [ %i1 + 0xc ] 40009b1c: 81 c7 e0 08 ret 40009b20: 81 e8 00 00 restore RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 40009b24: b0 10 3f ff mov -1, %i0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 40009b28: 81 c7 e0 08 ret 40009b2c: 81 e8 00 00 restore =============================================================================== 40009b60 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 40009b60: 9d e3 bf a0 save %sp, -96, %sp RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; 40009b64: b8 10 20 00 clr %i4 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 40009b68: 80 a0 00 19 cmp %g0, %i1 40009b6c: 82 60 3f ff subx %g0, -1, %g1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 40009b70: 82 00 60 02 add %g1, 2, %g1 40009b74: 83 28 60 02 sll %g1, 2, %g1 while ( !stop && current != NULL ) { 40009b78: 10 80 00 0a b 40009ba0 <_RBTree_Iterate_unprotected+0x40> 40009b7c: fa 06 00 01 ld [ %i0 + %g1 ], %i5 stop = (*visitor)( current, dir, visitor_arg ); 40009b80: 92 10 00 19 mov %i1, %o1 40009b84: 9f c6 80 00 call %i2 40009b88: 94 10 00 1b mov %i3, %o2 current = _RBTree_Next_unprotected( current, dir ); 40009b8c: 92 10 00 19 mov %i1, %o1 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { stop = (*visitor)( current, dir, visitor_arg ); 40009b90: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next_unprotected( current, dir ); 40009b94: 40 00 00 0b call 40009bc0 <_RBTree_Next_unprotected> 40009b98: 90 10 00 1d mov %i5, %o0 40009b9c: ba 10 00 08 mov %o0, %i5 { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 40009ba0: 80 a7 60 00 cmp %i5, 0 40009ba4: 02 80 00 05 be 40009bb8 <_RBTree_Iterate_unprotected+0x58> 40009ba8: b8 1f 20 01 xor %i4, 1, %i4 40009bac: 80 8f 20 ff btst 0xff, %i4 40009bb0: 12 bf ff f4 bne 40009b80 <_RBTree_Iterate_unprotected+0x20><== ALWAYS TAKEN 40009bb4: 90 10 00 1d mov %i5, %o0 40009bb8: 81 c7 e0 08 ret 40009bbc: 81 e8 00 00 restore =============================================================================== 400094c8 <_RBTree_Rotate>: RBTree_Node *the_node, RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; 400094c8: 80 a2 20 00 cmp %o0, 0 400094cc: 02 80 00 1c be 4000953c <_RBTree_Rotate+0x74> <== NEVER TAKEN 400094d0: 80 a0 00 09 cmp %g0, %o1 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 400094d4: 86 60 3f ff subx %g0, -1, %g3 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 400094d8: 87 28 e0 02 sll %g3, 2, %g3 400094dc: 86 02 00 03 add %o0, %g3, %g3 400094e0: c2 00 e0 04 ld [ %g3 + 4 ], %g1 400094e4: 80 a0 60 00 cmp %g1, 0 400094e8: 02 80 00 15 be 4000953c <_RBTree_Rotate+0x74> <== NEVER TAKEN 400094ec: 93 2a 60 02 sll %o1, 2, %o1 c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 400094f0: 84 00 40 09 add %g1, %o1, %g2 400094f4: c8 00 a0 04 ld [ %g2 + 4 ], %g4 400094f8: c8 20 e0 04 st %g4, [ %g3 + 4 ] if (c->child[dir]) 400094fc: c4 00 a0 04 ld [ %g2 + 4 ], %g2 40009500: 80 a0 a0 00 cmp %g2, 0 40009504: 32 80 00 02 bne,a 4000950c <_RBTree_Rotate+0x44> 40009508: d0 20 80 00 st %o0, [ %g2 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000950c: c4 02 00 00 ld [ %o0 ], %g2 the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 40009510: 92 00 40 09 add %g1, %o1, %o1 40009514: d0 22 60 04 st %o0, [ %o1 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 40009518: c6 00 a0 04 ld [ %g2 + 4 ], %g3 c->parent = the_node->parent; 4000951c: c4 20 40 00 st %g2, [ %g1 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 40009520: 86 1a 00 03 xor %o0, %g3, %g3 c->parent = the_node->parent; the_node->parent = c; 40009524: c2 22 00 00 st %g1, [ %o0 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 40009528: 80 a0 00 03 cmp %g0, %g3 4000952c: 86 40 20 00 addx %g0, 0, %g3 40009530: 87 28 e0 02 sll %g3, 2, %g3 40009534: 86 00 80 03 add %g2, %g3, %g3 40009538: c2 20 e0 04 st %g1, [ %g3 + 4 ] 4000953c: 81 c3 e0 08 retl =============================================================================== 40009478 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 40009478: 80 a2 20 00 cmp %o0, 0 4000947c: 02 80 00 10 be 400094bc <_RBTree_Sibling+0x44> <== NEVER TAKEN 40009480: 82 10 20 00 clr %g1 if(!(the_node->parent)) return NULL; 40009484: c4 02 00 00 ld [ %o0 ], %g2 40009488: 80 a0 a0 00 cmp %g2, 0 4000948c: 22 80 00 0d be,a 400094c0 <_RBTree_Sibling+0x48> <== NEVER TAKEN 40009490: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED if(!(the_node->parent->parent)) return NULL; 40009494: c2 00 80 00 ld [ %g2 ], %g1 40009498: 80 a0 60 00 cmp %g1, 0 4000949c: 02 80 00 08 be 400094bc <_RBTree_Sibling+0x44> 400094a0: 82 10 20 00 clr %g1 if(the_node == the_node->parent->child[RBT_LEFT]) 400094a4: c2 00 a0 04 ld [ %g2 + 4 ], %g1 400094a8: 80 a2 00 01 cmp %o0, %g1 400094ac: 22 80 00 04 be,a 400094bc <_RBTree_Sibling+0x44> 400094b0: c2 00 a0 08 ld [ %g2 + 8 ], %g1 return the_node->parent->child[RBT_RIGHT]; 400094b4: 81 c3 e0 08 retl 400094b8: 90 10 00 01 mov %g1, %o0 else return the_node->parent->child[RBT_LEFT]; } 400094bc: 90 10 00 01 mov %g1, %o0 400094c0: 81 c3 e0 08 retl =============================================================================== 400080cc <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 400080cc: 9d e3 bf 98 save %sp, -104, %sp RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 400080d0: fa 06 21 4c ld [ %i0 + 0x14c ], %i5 if ( !api ) 400080d4: 80 a7 60 00 cmp %i5, 0 400080d8: 02 80 00 1c be 40008148 <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN 400080dc: 01 00 00 00 nop * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 400080e0: 7f ff eb d3 call 4000302c 400080e4: 01 00 00 00 nop signal_set = asr->signals_posted; 400080e8: f8 07 60 14 ld [ %i5 + 0x14 ], %i4 asr->signals_posted = 0; 400080ec: c0 27 60 14 clr [ %i5 + 0x14 ] _ISR_Enable( level ); 400080f0: 7f ff eb d3 call 4000303c 400080f4: 01 00 00 00 nop if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 400080f8: 80 a7 20 00 cmp %i4, 0 400080fc: 02 80 00 13 be 40008148 <_RTEMS_signal_Post_switch_hook+0x7c> 40008100: 94 07 bf fc add %fp, -4, %o2 return; asr->nest_level += 1; 40008104: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40008108: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 4000810c: 82 00 60 01 inc %g1 40008110: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40008114: 37 00 00 3f sethi %hi(0xfc00), %i3 40008118: 40 00 01 03 call 40008524 4000811c: 92 16 e3 ff or %i3, 0x3ff, %o1 ! ffff (*asr->handler)( signal_set ); 40008120: c2 07 60 0c ld [ %i5 + 0xc ], %g1 40008124: 9f c0 40 00 call %g1 40008128: 90 10 00 1c mov %i4, %o0 asr->nest_level -= 1; 4000812c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40008130: d0 07 bf fc ld [ %fp + -4 ], %o0 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 40008134: 82 00 7f ff add %g1, -1, %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40008138: 92 16 e3 ff or %i3, 0x3ff, %o1 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 4000813c: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40008140: 40 00 00 f9 call 40008524 40008144: 94 07 bf fc add %fp, -4, %o2 40008148: 81 c7 e0 08 ret 4000814c: 81 e8 00 00 restore =============================================================================== 40032610 <_Rate_monotonic_Get_status>: bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 40032610: 9d e3 bf 98 save %sp, -104, %sp */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 40032614: 13 10 01 8c sethi %hi(0x40063000), %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 40032618: f6 06 20 40 ld [ %i0 + 0x40 ], %i3 4003261c: 90 07 bf f8 add %fp, -8, %o0 40032620: 7f ff 54 a7 call 400078bc <_TOD_Get_with_nanoseconds> 40032624: 92 12 61 10 or %o1, 0x110, %o1 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40032628: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 4003262c: f8 1e 20 50 ldd [ %i0 + 0x50 ], %i4 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 40032630: 09 10 01 8d sethi %hi(0x40063400), %g4 40032634: ba a0 c0 1d subcc %g3, %i5, %i5 40032638: 88 11 22 d0 or %g4, 0x2d0, %g4 4003263c: b8 60 80 1c subx %g2, %i4, %i4 40032640: f8 3e 40 00 std %i4, [ %i1 ] 40032644: fa 01 20 10 ld [ %g4 + 0x10 ], %i5 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 40032648: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 4003264c: 80 a6 c0 1d cmp %i3, %i5 40032650: 12 80 00 15 bne 400326a4 <_Rate_monotonic_Get_status+0x94> 40032654: 82 10 20 01 mov 1, %g1 40032658: f8 19 20 20 ldd [ %g4 + 0x20 ], %i4 4003265c: 86 a0 c0 1d subcc %g3, %i5, %g3 40032660: 84 60 80 1c subx %g2, %i4, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40032664: ba 83 40 03 addcc %o5, %g3, %i5 40032668: b8 43 00 02 addx %o4, %g2, %i4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4003266c: c4 1e 20 48 ldd [ %i0 + 0x48 ], %g2 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 40032670: 80 a0 80 1c cmp %g2, %i4 40032674: 34 80 00 0c bg,a 400326a4 <_Rate_monotonic_Get_status+0x94><== NEVER TAKEN 40032678: 82 10 20 00 clr %g1 <== NOT EXECUTED 4003267c: 32 80 00 06 bne,a 40032694 <_Rate_monotonic_Get_status+0x84> 40032680: 86 a7 40 03 subcc %i5, %g3, %g3 40032684: 80 a0 c0 1d cmp %g3, %i5 40032688: 18 80 00 06 bgu 400326a0 <_Rate_monotonic_Get_status+0x90> 4003268c: 86 a7 40 03 subcc %i5, %g3, %g3 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 40032690: 82 10 20 01 mov 1, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 40032694: 84 67 00 02 subx %i4, %g2, %g2 40032698: 10 80 00 03 b 400326a4 <_Rate_monotonic_Get_status+0x94> 4003269c: c4 3e 80 00 std %g2, [ %i2 ] /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; 400326a0: 82 10 20 00 clr %g1 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 400326a4: b0 08 60 01 and %g1, 1, %i0 400326a8: 81 c7 e0 08 ret 400326ac: 81 e8 00 00 restore =============================================================================== 40032a18 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 40032a18: 9d e3 bf 98 save %sp, -104, %sp 40032a1c: 11 10 01 8f sethi %hi(0x40063c00), %o0 40032a20: 92 10 00 18 mov %i0, %o1 40032a24: 90 12 20 98 or %o0, 0x98, %o0 40032a28: 7f ff 56 4c call 40008358 <_Objects_Get> 40032a2c: 94 07 bf fc add %fp, -4, %o2 /* * 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 ) { 40032a30: c2 07 bf fc ld [ %fp + -4 ], %g1 40032a34: 80 a0 60 00 cmp %g1, 0 40032a38: 12 80 00 24 bne 40032ac8 <_Rate_monotonic_Timeout+0xb0> <== NEVER TAKEN 40032a3c: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 40032a40: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 40032a44: 03 00 00 10 sethi %hi(0x4000), %g1 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 40032a48: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 40032a4c: 80 88 80 01 btst %g2, %g1 40032a50: 22 80 00 0b be,a 40032a7c <_Rate_monotonic_Timeout+0x64> 40032a54: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40032a58: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 40032a5c: c2 07 60 08 ld [ %i5 + 8 ], %g1 40032a60: 80 a0 80 01 cmp %g2, %g1 40032a64: 32 80 00 06 bne,a 40032a7c <_Rate_monotonic_Timeout+0x64> 40032a68: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40032a6c: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40032a70: 7f ff 58 e5 call 40008e04 <_Thread_Clear_state> 40032a74: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 40032a78: 30 80 00 06 b,a 40032a90 <_Rate_monotonic_Timeout+0x78> _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 ) { 40032a7c: 80 a0 60 01 cmp %g1, 1 40032a80: 12 80 00 0d bne 40032ab4 <_Rate_monotonic_Timeout+0x9c> 40032a84: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 40032a88: 82 10 20 03 mov 3, %g1 40032a8c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 40032a90: 7f ff ff 51 call 400327d4 <_Rate_monotonic_Initiate_statistics> 40032a94: 90 10 00 1d mov %i5, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40032a98: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40032a9c: 11 10 01 8c sethi %hi(0x40063000), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40032aa0: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40032aa4: 90 12 22 58 or %o0, 0x258, %o0 40032aa8: 7f ff 5c bc call 40009d98 <_Watchdog_Insert> 40032aac: 92 07 60 10 add %i5, 0x10, %o1 40032ab0: 30 80 00 02 b,a 40032ab8 <_Rate_monotonic_Timeout+0xa0> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 40032ab4: c2 27 60 38 st %g1, [ %i5 + 0x38 ] * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40032ab8: 03 10 01 8c sethi %hi(0x40063000), %g1 40032abc: c4 00 61 c0 ld [ %g1 + 0x1c0 ], %g2 ! 400631c0 <_Thread_Dispatch_disable_level> --level; 40032ac0: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40032ac4: c4 20 61 c0 st %g2, [ %g1 + 0x1c0 ] 40032ac8: 81 c7 e0 08 ret 40032acc: 81 e8 00 00 restore =============================================================================== 400326b0 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 400326b0: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 400326b4: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 400326b8: 82 00 60 01 inc %g1 400326bc: c2 26 20 58 st %g1, [ %i0 + 0x58 ] if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 400326c0: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 400326c4: 80 a0 60 04 cmp %g1, 4 400326c8: 12 80 00 05 bne 400326dc <_Rate_monotonic_Update_statistics+0x2c> 400326cc: 90 10 00 18 mov %i0, %o0 stats->missed_count++; 400326d0: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 400326d4: 82 00 60 01 inc %g1 400326d8: c2 26 20 5c st %g1, [ %i0 + 0x5c ] /* * Grab status for time statistics. */ valid_status = 400326dc: 92 07 bf f8 add %fp, -8, %o1 400326e0: 7f ff ff cc call 40032610 <_Rate_monotonic_Get_status> 400326e4: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 400326e8: 80 8a 20 ff btst 0xff, %o0 400326ec: 02 80 00 38 be 400327cc <_Rate_monotonic_Update_statistics+0x11c> 400326f0: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 400326f4: f8 1e 20 70 ldd [ %i0 + 0x70 ], %i4 * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 400326f8: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 400326fc: b6 87 40 03 addcc %i5, %g3, %i3 40032700: b4 47 00 02 addx %i4, %g2, %i2 40032704: 80 a0 40 02 cmp %g1, %g2 40032708: 14 80 00 09 bg 4003272c <_Rate_monotonic_Update_statistics+0x7c> 4003270c: f4 3e 20 70 std %i2, [ %i0 + 0x70 ] 40032710: 80 a0 40 02 cmp %g1, %g2 40032714: 32 80 00 08 bne,a 40032734 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 40032718: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 4003271c: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 40032720: 80 a0 40 03 cmp %g1, %g3 40032724: 28 80 00 04 bleu,a 40032734 <_Rate_monotonic_Update_statistics+0x84> 40032728: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 4003272c: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 40032730: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 40032734: 80 a0 40 02 cmp %g1, %g2 40032738: 26 80 00 0a bl,a 40032760 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 4003273c: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 40032740: 80 a0 40 02 cmp %g1, %g2 40032744: 32 80 00 08 bne,a 40032764 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 40032748: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED 4003274c: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 40032750: 80 a0 40 03 cmp %g1, %g3 40032754: 3a 80 00 04 bcc,a 40032764 <_Rate_monotonic_Update_statistics+0xb4> 40032758: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 4003275c: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 40032760: c4 1f bf f8 ldd [ %fp + -8 ], %g2 40032764: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 40032768: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 4003276c: b6 87 40 03 addcc %i5, %g3, %i3 40032770: b4 47 00 02 addx %i4, %g2, %i2 40032774: 80 a0 40 02 cmp %g1, %g2 40032778: 14 80 00 09 bg 4003279c <_Rate_monotonic_Update_statistics+0xec> 4003277c: f4 3e 20 88 std %i2, [ %i0 + 0x88 ] 40032780: 80 a0 40 02 cmp %g1, %g2 40032784: 32 80 00 08 bne,a 400327a4 <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN 40032788: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 4003278c: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 40032790: 80 a0 40 03 cmp %g1, %g3 40032794: 28 80 00 04 bleu,a 400327a4 <_Rate_monotonic_Update_statistics+0xf4> 40032798: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; 4003279c: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 400327a0: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 400327a4: 80 a0 40 02 cmp %g1, %g2 400327a8: 26 80 00 09 bl,a 400327cc <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 400327ac: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 400327b0: 80 a0 40 02 cmp %g1, %g2 400327b4: 12 80 00 06 bne 400327cc <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 400327b8: 01 00 00 00 nop 400327bc: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 400327c0: 80 a0 40 03 cmp %g1, %g3 400327c4: 2a 80 00 02 bcs,a 400327cc <_Rate_monotonic_Update_statistics+0x11c> 400327c8: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 400327cc: 81 c7 e0 08 ret 400327d0: 81 e8 00 00 restore =============================================================================== 40009828 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 40009828: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 4000982c: 40 00 06 8d call 4000b260 <_Workspace_Allocate> 40009830: 90 10 20 1c mov 0x1c, %o0 if ( sched ) { 40009834: 80 a2 20 00 cmp %o0, 0 40009838: 02 80 00 06 be 40009850 <_Scheduler_CBS_Allocate+0x28> <== NEVER TAKEN 4000983c: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 40009840: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 40009844: f0 22 00 00 st %i0, [ %o0 ] schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 40009848: c2 22 20 14 st %g1, [ %o0 + 0x14 ] schinfo->cbs_server = NULL; 4000984c: c0 22 20 18 clr [ %o0 + 0x18 ] } return sched; } 40009850: 81 c7 e0 08 ret 40009854: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000ab68 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4000ab68: 9d e3 bf 98 save %sp, -104, %sp Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server_id server_id; /* Put violating task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000ab6c: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000ab70: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000ab74: 80 a0 40 09 cmp %g1, %o1 4000ab78: 32 80 00 02 bne,a 4000ab80 <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 4000ab7c: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000ab80: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000ab84: 80 a0 40 09 cmp %g1, %o1 4000ab88: 02 80 00 04 be 4000ab98 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 4000ab8c: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000ab90: 40 00 01 83 call 4000b19c <_Thread_Change_priority> 4000ab94: 94 10 20 01 mov 1, %o2 /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 4000ab98: fa 06 20 88 ld [ %i0 + 0x88 ], %i5 if ( sched_info->cbs_server->cbs_budget_overrun ) { 4000ab9c: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000aba0: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000aba4: 80 a0 a0 00 cmp %g2, 0 4000aba8: 02 80 00 09 be 4000abcc <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 4000abac: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 4000abb0: d0 00 40 00 ld [ %g1 ], %o0 4000abb4: 7f ff ff d7 call 4000ab10 <_Scheduler_CBS_Get_server_id> 4000abb8: 92 07 bf fc add %fp, -4, %o1 sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 4000abbc: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000abc0: c2 00 60 0c ld [ %g1 + 0xc ], %g1 4000abc4: 9f c0 40 00 call %g1 4000abc8: d0 07 bf fc ld [ %fp + -4 ], %o0 4000abcc: 81 c7 e0 08 ret 4000abd0: 81 e8 00 00 restore =============================================================================== 4000a770 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 4000a770: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 4000a774: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000a778: 80 a0 60 00 cmp %g1, 0 4000a77c: 04 80 00 1d ble 4000a7f0 <_Scheduler_CBS_Create_server+0x80> 4000a780: 01 00 00 00 nop 4000a784: c2 06 00 00 ld [ %i0 ], %g1 4000a788: 80 a0 60 00 cmp %g1, 0 4000a78c: 04 80 00 19 ble 4000a7f0 <_Scheduler_CBS_Create_server+0x80> 4000a790: 03 10 00 83 sethi %hi(0x40020c00), %g1 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4000a794: c4 00 61 70 ld [ %g1 + 0x170 ], %g2 ! 40020d70 <_Scheduler_CBS_Maximum_servers> if ( !_Scheduler_CBS_Server_list[i] ) 4000a798: 03 10 00 87 sethi %hi(0x40021c00), %g1 4000a79c: c6 00 62 88 ld [ %g1 + 0x288 ], %g3 ! 40021e88 <_Scheduler_CBS_Server_list> 4000a7a0: 10 80 00 07 b 4000a7bc <_Scheduler_CBS_Create_server+0x4c> 4000a7a4: 82 10 20 00 clr %g1 4000a7a8: c8 00 c0 1c ld [ %g3 + %i4 ], %g4 4000a7ac: 80 a1 20 00 cmp %g4, 0 4000a7b0: 02 80 00 14 be 4000a800 <_Scheduler_CBS_Create_server+0x90> 4000a7b4: 3b 10 00 87 sethi %hi(0x40021c00), %i5 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4000a7b8: 82 00 60 01 inc %g1 4000a7bc: 80 a0 40 02 cmp %g1, %g2 4000a7c0: 12 bf ff fa bne 4000a7a8 <_Scheduler_CBS_Create_server+0x38> 4000a7c4: b9 28 60 02 sll %g1, 2, %i4 if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 4000a7c8: 81 c7 e0 08 ret 4000a7cc: 91 e8 3f e6 restore %g0, -26, %o0 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 4000a7d0: c4 20 60 04 st %g2, [ %g1 + 4 ] 4000a7d4: c4 06 20 04 ld [ %i0 + 4 ], %g2 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 4000a7d8: f2 20 60 0c st %i1, [ %g1 + 0xc ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 4000a7dc: c4 20 60 08 st %g2, [ %g1 + 8 ] the_server->task_id = -1; 4000a7e0: 84 10 3f ff mov -1, %g2 4000a7e4: c4 20 40 00 st %g2, [ %g1 ] the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 4000a7e8: 81 c7 e0 08 ret 4000a7ec: 91 e8 20 00 restore %g0, 0, %o0 if ( params->budget <= 0 || params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 4000a7f0: 81 c7 e0 08 ret 4000a7f4: 91 e8 3f ee restore %g0, -18, %o0 *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 4000a7f8: 81 c7 e0 08 ret <== NOT EXECUTED 4000a7fc: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 4000a800: f6 07 62 88 ld [ %i5 + 0x288 ], %i3 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 4000a804: c2 26 80 00 st %g1, [ %i2 ] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4000a808: 40 00 07 7f call 4000c604 <_Workspace_Allocate> 4000a80c: 90 10 20 10 mov 0x10, %o0 the_server = _Scheduler_CBS_Server_list[*server_id]; 4000a810: c2 06 80 00 ld [ %i2 ], %g1 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 4000a814: d0 26 c0 1c st %o0, [ %i3 + %i4 ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 4000a818: c4 07 62 88 ld [ %i5 + 0x288 ], %g2 4000a81c: 83 28 60 02 sll %g1, 2, %g1 4000a820: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( !the_server ) 4000a824: 80 a0 60 00 cmp %g1, 0 4000a828: 32 bf ff ea bne,a 4000a7d0 <_Scheduler_CBS_Create_server+0x60><== ALWAYS TAKEN 4000a82c: c4 06 00 00 ld [ %i0 ], %g2 4000a830: 30 bf ff f2 b,a 4000a7f8 <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED =============================================================================== 4000a8a8 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4000a8a8: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 4000a8ac: 90 10 00 19 mov %i1, %o0 4000a8b0: 40 00 03 61 call 4000b634 <_Thread_Get> 4000a8b4: 92 07 bf fc add %fp, -4, %o1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4000a8b8: ba 92 20 00 orcc %o0, 0, %i5 4000a8bc: 02 80 00 05 be 4000a8d0 <_Scheduler_CBS_Detach_thread+0x28> 4000a8c0: 03 10 00 83 sethi %hi(0x40020c00), %g1 _Thread_Enable_dispatch(); 4000a8c4: 40 00 03 50 call 4000b604 <_Thread_Enable_dispatch> 4000a8c8: 01 00 00 00 nop } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 4000a8cc: 03 10 00 83 sethi %hi(0x40020c00), %g1 4000a8d0: c2 00 61 70 ld [ %g1 + 0x170 ], %g1 ! 40020d70 <_Scheduler_CBS_Maximum_servers> 4000a8d4: 80 a6 00 01 cmp %i0, %g1 4000a8d8: 1a 80 00 1b bcc 4000a944 <_Scheduler_CBS_Detach_thread+0x9c> 4000a8dc: 80 a7 60 00 cmp %i5, 0 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 4000a8e0: 02 80 00 19 be 4000a944 <_Scheduler_CBS_Detach_thread+0x9c> 4000a8e4: 03 10 00 87 sethi %hi(0x40021c00), %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 4000a8e8: c2 00 62 88 ld [ %g1 + 0x288 ], %g1 ! 40021e88 <_Scheduler_CBS_Server_list> 4000a8ec: b1 2e 20 02 sll %i0, 2, %i0 4000a8f0: c2 00 40 18 ld [ %g1 + %i0 ], %g1 4000a8f4: 80 a0 60 00 cmp %g1, 0 4000a8f8: 02 80 00 11 be 4000a93c <_Scheduler_CBS_Detach_thread+0x94> 4000a8fc: 01 00 00 00 nop return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 4000a900: c4 00 40 00 ld [ %g1 ], %g2 4000a904: 80 a0 80 19 cmp %g2, %i1 4000a908: 12 80 00 0f bne 4000a944 <_Scheduler_CBS_Detach_thread+0x9c><== NEVER TAKEN 4000a90c: 84 10 3f ff mov -1, %g2 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 4000a910: c4 20 40 00 st %g2, [ %g1 ] sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 4000a914: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 4000a918: c0 20 60 18 clr [ %g1 + 0x18 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4000a91c: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 4000a920: c2 27 60 78 st %g1, [ %i5 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 4000a924: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 4000a928: c2 27 60 7c st %g1, [ %i5 + 0x7c ] the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000a92c: c2 0f 60 9c ldub [ %i5 + 0x9c ], %g1 4000a930: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] return SCHEDULER_CBS_OK; 4000a934: 81 c7 e0 08 ret 4000a938: 91 e8 20 00 restore %g0, 0, %o0 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) return SCHEDULER_CBS_ERROR_NOSERVER; 4000a93c: 81 c7 e0 08 ret 4000a940: 91 e8 3f e7 restore %g0, -25, %o0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; } 4000a944: 81 c7 e0 08 ret 4000a948: 91 e8 3f ee restore %g0, -18, %o0 =============================================================================== 4000abd4 <_Scheduler_CBS_Initialize>: } } int _Scheduler_CBS_Initialize(void) { 4000abd4: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); 4000abd8: 3b 10 00 83 sethi %hi(0x40020c00), %i5 4000abdc: d0 07 61 70 ld [ %i5 + 0x170 ], %o0 ! 40020d70 <_Scheduler_CBS_Maximum_servers> } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 4000abe0: 40 00 06 89 call 4000c604 <_Workspace_Allocate> 4000abe4: 91 2a 20 02 sll %o0, 2, %o0 4000abe8: 05 10 00 87 sethi %hi(0x40021c00), %g2 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 4000abec: 80 a2 20 00 cmp %o0, 0 4000abf0: 02 80 00 0d be 4000ac24 <_Scheduler_CBS_Initialize+0x50> <== NEVER TAKEN 4000abf4: d0 20 a2 88 st %o0, [ %g2 + 0x288 ] return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000abf8: c6 07 61 70 ld [ %i5 + 0x170 ], %g3 4000abfc: 10 80 00 05 b 4000ac10 <_Scheduler_CBS_Initialize+0x3c> 4000ac00: 82 10 20 00 clr %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000ac04: 89 28 60 02 sll %g1, 2, %g4 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000ac08: 82 00 60 01 inc %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000ac0c: c0 27 40 04 clr [ %i5 + %g4 ] unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000ac10: 80 a0 40 03 cmp %g1, %g3 4000ac14: 12 bf ff fc bne 4000ac04 <_Scheduler_CBS_Initialize+0x30> 4000ac18: fa 00 a2 88 ld [ %g2 + 0x288 ], %i5 _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 4000ac1c: 81 c7 e0 08 ret 4000ac20: 91 e8 20 00 restore %g0, 0, %o0 } 4000ac24: 81 c7 e0 08 ret <== NOT EXECUTED 4000ac28: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED =============================================================================== 40009858 <_Scheduler_CBS_Release_job>: { Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 40009858: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 if (deadline) { 4000985c: 80 a2 60 00 cmp %o1, 0 40009860: 02 80 00 10 be 400098a0 <_Scheduler_CBS_Release_job+0x48> 40009864: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 /* Initializing or shifting deadline. */ if (serv_info) 40009868: 80 a0 60 00 cmp %g1, 0 4000986c: 02 80 00 08 be 4000988c <_Scheduler_CBS_Release_job+0x34> 40009870: 05 10 00 7f sethi %hi(0x4001fc00), %g2 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 40009874: d2 00 a2 e8 ld [ %g2 + 0x2e8 ], %o1 ! 4001fee8 <_Watchdog_Ticks_since_boot> 40009878: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000987c: 92 02 40 02 add %o1, %g2, %o1 40009880: 05 20 00 00 sethi %hi(0x80000000), %g2 40009884: 10 80 00 0a b 400098ac <_Scheduler_CBS_Release_job+0x54> 40009888: 92 2a 40 02 andn %o1, %g2, %o1 & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 4000988c: c2 00 a2 e8 ld [ %g2 + 0x2e8 ], %g1 40009890: 92 02 40 01 add %o1, %g1, %o1 40009894: 03 20 00 00 sethi %hi(0x80000000), %g1 40009898: 10 80 00 07 b 400098b4 <_Scheduler_CBS_Release_job+0x5c> 4000989c: 92 2a 40 01 andn %o1, %g1, %o1 /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) 400098a0: 80 a0 60 00 cmp %g1, 0 400098a4: 02 80 00 04 be 400098b4 <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN 400098a8: d2 02 20 ac ld [ %o0 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; 400098ac: c2 00 60 08 ld [ %g1 + 8 ], %g1 400098b0: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 400098b4: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 400098b8: 94 10 20 01 mov 1, %o2 400098bc: 82 13 c0 00 mov %o7, %g1 400098c0: 40 00 01 26 call 40009d58 <_Thread_Change_priority> 400098c4: 9e 10 40 00 mov %g1, %o7 =============================================================================== 400098c8 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 400098c8: 9d e3 bf a0 save %sp, -96, %sp Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 400098cc: 40 00 00 4c call 400099fc <_Scheduler_EDF_Enqueue> 400098d0: 90 10 00 18 mov %i0, %o0 /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 400098d4: c2 06 20 88 ld [ %i0 + 0x88 ], %g1 400098d8: fa 00 60 18 ld [ %g1 + 0x18 ], %i5 * Late unblock rule for deadline-driven tasks. The remaining time to * deadline must be sufficient to serve the remaining computation time * without increased utilization of this task. It might cause a deadline * miss of another task. */ if (serv_info) { 400098dc: 80 a7 60 00 cmp %i5, 0 400098e0: 02 80 00 18 be 40009940 <_Scheduler_CBS_Unblock+0x78> 400098e4: 03 10 00 7f sethi %hi(0x4001fc00), %g1 time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 400098e8: d2 07 60 04 ld [ %i5 + 4 ], %o1 */ if (serv_info) { time_t deadline = serv_info->parameters.deadline; time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - 400098ec: d0 00 62 e8 ld [ %g1 + 0x2e8 ], %o0 400098f0: f8 06 20 18 ld [ %i0 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 400098f4: 40 00 3e fa call 400194dc <.umul> 400098f8: 90 27 00 08 sub %i4, %o0, %o0 400098fc: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 40009900: b6 10 00 08 mov %o0, %i3 40009904: 40 00 3e f6 call 400194dc <.umul> 40009908: d0 07 60 08 ld [ %i5 + 8 ], %o0 4000990c: 80 a6 c0 08 cmp %i3, %o0 40009910: 24 80 00 0d ble,a 40009944 <_Scheduler_CBS_Unblock+0x7c> 40009914: 3b 10 00 80 sethi %hi(0x40020000), %i5 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 40009918: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000991c: 80 a7 00 09 cmp %i4, %o1 40009920: 32 80 00 02 bne,a 40009928 <_Scheduler_CBS_Unblock+0x60> 40009924: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 40009928: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000992c: 80 a0 40 09 cmp %g1, %o1 40009930: 02 80 00 04 be 40009940 <_Scheduler_CBS_Unblock+0x78> 40009934: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 40009938: 40 00 01 08 call 40009d58 <_Thread_Change_priority> 4000993c: 94 10 20 01 mov 1, %o2 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, 40009940: 3b 10 00 80 sethi %hi(0x40020000), %i5 40009944: ba 17 63 10 or %i5, 0x310, %i5 ! 40020310 <_Per_CPU_Information> 40009948: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 4000994c: 03 10 00 7c sethi %hi(0x4001f000), %g1 40009950: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 40009954: c2 00 62 54 ld [ %g1 + 0x254 ], %g1 40009958: 9f c0 40 00 call %g1 4000995c: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1 40009960: 80 a2 20 00 cmp %o0, 0 40009964: 04 80 00 0f ble 400099a0 <_Scheduler_CBS_Unblock+0xd8> 40009968: 01 00 00 00 nop _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000996c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; 40009970: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 40009974: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 40009978: 80 a0 60 00 cmp %g1, 0 4000997c: 12 80 00 06 bne 40009994 <_Scheduler_CBS_Unblock+0xcc> 40009980: 84 10 20 01 mov 1, %g2 40009984: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40009988: 80 a0 60 00 cmp %g1, 0 4000998c: 12 80 00 05 bne 400099a0 <_Scheduler_CBS_Unblock+0xd8> <== ALWAYS TAKEN 40009990: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 40009994: 03 10 00 80 sethi %hi(0x40020000), %g1 40009998: 82 10 63 10 or %g1, 0x310, %g1 ! 40020310 <_Per_CPU_Information> 4000999c: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 400099a0: 81 c7 e0 08 ret 400099a4: 81 e8 00 00 restore =============================================================================== 40009828 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 40009828: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 4000982c: 40 00 06 62 call 4000b1b4 <_Workspace_Allocate> 40009830: 90 10 20 18 mov 0x18, %o0 if ( sched ) { 40009834: 80 a2 20 00 cmp %o0, 0 40009838: 02 80 00 05 be 4000984c <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN 4000983c: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 40009840: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 40009844: f0 22 00 00 st %i0, [ %o0 ] schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 40009848: c2 22 20 14 st %g1, [ %o0 + 0x14 ] } return sched; } 4000984c: 81 c7 e0 08 ret 40009850: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400099f0 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 400099f0: 9d e3 bf a0 save %sp, -96, %sp _Scheduler_EDF_Enqueue(the_thread); 400099f4: 7f ff ff ad call 400098a8 <_Scheduler_EDF_Enqueue> 400099f8: 90 10 00 18 mov %i0, %o0 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 400099fc: 3b 10 00 80 sethi %hi(0x40020000), %i5 40009a00: ba 17 62 60 or %i5, 0x260, %i5 ! 40020260 <_Per_CPU_Information> 40009a04: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 40009a08: 03 10 00 7c sethi %hi(0x4001f000), %g1 40009a0c: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0 40009a10: c2 00 61 a4 ld [ %g1 + 0x1a4 ], %g1 40009a14: 9f c0 40 00 call %g1 40009a18: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 40009a1c: 80 a2 20 00 cmp %o0, 0 40009a20: 16 80 00 0f bge 40009a5c <_Scheduler_EDF_Unblock+0x6c> 40009a24: 01 00 00 00 nop _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 40009a28: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 40009a2c: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 40009a30: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 40009a34: 80 a0 60 00 cmp %g1, 0 40009a38: 12 80 00 06 bne 40009a50 <_Scheduler_EDF_Unblock+0x60> 40009a3c: 84 10 20 01 mov 1, %g2 40009a40: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40009a44: 80 a0 60 00 cmp %g1, 0 40009a48: 12 80 00 05 bne 40009a5c <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN 40009a4c: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 40009a50: 03 10 00 80 sethi %hi(0x40020000), %g1 40009a54: 82 10 62 60 or %g1, 0x260, %g1 ! 40020260 <_Per_CPU_Information> 40009a58: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 40009a5c: 81 c7 e0 08 ret 40009a60: 81 e8 00 00 restore =============================================================================== 400090fc <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 400090fc: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *executing; executing = _Thread_Executing; 40009100: 03 10 00 79 sethi %hi(0x4001e400), %g1 40009104: fa 00 63 20 ld [ %g1 + 0x320 ], %i5 ! 4001e720 <_Per_CPU_Information+0x10> /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 40009108: c2 0f 60 70 ldub [ %i5 + 0x70 ], %g1 4000910c: 80 a0 60 00 cmp %g1, 0 40009110: 02 80 00 25 be 400091a4 <_Scheduler_priority_Tick+0xa8> 40009114: 01 00 00 00 nop return; if ( !_States_Is_ready( executing->current_state ) ) 40009118: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000911c: 80 a0 60 00 cmp %g1, 0 40009120: 12 80 00 21 bne 400091a4 <_Scheduler_priority_Tick+0xa8> 40009124: 01 00 00 00 nop /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 40009128: c2 07 60 78 ld [ %i5 + 0x78 ], %g1 4000912c: 80 a0 60 01 cmp %g1, 1 40009130: 0a 80 00 14 bcs 40009180 <_Scheduler_priority_Tick+0x84> 40009134: 80 a0 60 02 cmp %g1, 2 40009138: 28 80 00 07 bleu,a 40009154 <_Scheduler_priority_Tick+0x58> 4000913c: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 40009140: 80 a0 60 03 cmp %g1, 3 40009144: 12 80 00 18 bne 400091a4 <_Scheduler_priority_Tick+0xa8> <== NEVER TAKEN 40009148: 01 00 00 00 nop } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 4000914c: 10 80 00 0f b 40009188 <_Scheduler_priority_Tick+0x8c> 40009150: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 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 ) { 40009154: 82 00 7f ff add %g1, -1, %g1 40009158: 80 a0 60 00 cmp %g1, 0 4000915c: 14 80 00 09 bg 40009180 <_Scheduler_priority_Tick+0x84> 40009160: c2 27 60 74 st %g1, [ %i5 + 0x74 ] * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 40009164: 03 10 00 75 sethi %hi(0x4001d400), %g1 40009168: c2 00 62 b0 ld [ %g1 + 0x2b0 ], %g1 ! 4001d6b0 <_Scheduler+0xc> 4000916c: 9f c0 40 00 call %g1 40009170: 01 00 00 00 nop * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield(); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 40009174: 03 10 00 78 sethi %hi(0x4001e000), %g1 40009178: c2 00 61 60 ld [ %g1 + 0x160 ], %g1 ! 4001e160 <_Thread_Ticks_per_timeslice> 4000917c: c2 27 60 74 st %g1, [ %i5 + 0x74 ] 40009180: 81 c7 e0 08 ret 40009184: 81 e8 00 00 restore } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 40009188: 82 00 7f ff add %g1, -1, %g1 4000918c: 80 a0 60 00 cmp %g1, 0 40009190: 12 bf ff fc bne 40009180 <_Scheduler_priority_Tick+0x84> 40009194: c2 27 60 74 st %g1, [ %i5 + 0x74 ] (*executing->budget_callout)( executing ); 40009198: c2 07 60 7c ld [ %i5 + 0x7c ], %g1 4000919c: 9f c0 40 00 call %g1 400091a0: 90 10 00 1d mov %i5, %o0 400091a4: 81 c7 e0 08 ret 400091a8: 81 e8 00 00 restore =============================================================================== 40007d3c <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 40007d3c: 9d e3 bf a0 save %sp, -96, %sp uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 40007d40: 03 10 00 76 sethi %hi(0x4001d800), %g1 40007d44: d2 00 61 dc ld [ %g1 + 0x1dc ], %o1 ! 4001d9dc 40007d48: 11 00 03 d0 sethi %hi(0xf4000), %o0 40007d4c: 40 00 48 2b call 40019df8 <.udiv> 40007d50: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 40007d54: 80 a6 20 00 cmp %i0, 0 40007d58: 02 80 00 28 be 40007df8 <_TOD_Validate+0xbc> <== NEVER TAKEN 40007d5c: 84 10 20 00 clr %g2 40007d60: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40007d64: 80 a0 40 08 cmp %g1, %o0 40007d68: 3a 80 00 25 bcc,a 40007dfc <_TOD_Validate+0xc0> 40007d6c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->ticks >= ticks_per_second) || 40007d70: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40007d74: 80 a0 60 3b cmp %g1, 0x3b 40007d78: 38 80 00 21 bgu,a 40007dfc <_TOD_Validate+0xc0> 40007d7c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 40007d80: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40007d84: 80 a0 60 3b cmp %g1, 0x3b 40007d88: 38 80 00 1d bgu,a 40007dfc <_TOD_Validate+0xc0> 40007d8c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 40007d90: c2 06 20 0c ld [ %i0 + 0xc ], %g1 40007d94: 80 a0 60 17 cmp %g1, 0x17 40007d98: 38 80 00 19 bgu,a 40007dfc <_TOD_Validate+0xc0> 40007d9c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 40007da0: c2 06 20 04 ld [ %i0 + 4 ], %g1 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 40007da4: 80 a0 60 00 cmp %g1, 0 40007da8: 02 80 00 14 be 40007df8 <_TOD_Validate+0xbc> <== NEVER TAKEN 40007dac: 80 a0 60 0c cmp %g1, 0xc (the_tod->month == 0) || 40007db0: 38 80 00 13 bgu,a 40007dfc <_TOD_Validate+0xc0> 40007db4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 40007db8: c8 06 00 00 ld [ %i0 ], %g4 (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 40007dbc: 80 a1 27 c3 cmp %g4, 0x7c3 40007dc0: 28 80 00 0f bleu,a 40007dfc <_TOD_Validate+0xc0> 40007dc4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 40007dc8: c6 06 20 08 ld [ %i0 + 8 ], %g3 (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) || 40007dcc: 80 a0 e0 00 cmp %g3, 0 40007dd0: 02 80 00 0a be 40007df8 <_TOD_Validate+0xbc> <== NEVER TAKEN 40007dd4: 80 89 20 03 btst 3, %g4 40007dd8: 05 10 00 7a sethi %hi(0x4001e800), %g2 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 40007ddc: 12 80 00 03 bne 40007de8 <_TOD_Validate+0xac> 40007de0: 84 10 a2 d0 or %g2, 0x2d0, %g2 ! 4001ead0 <_TOD_Days_per_month> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 40007de4: 82 00 60 0d add %g1, 0xd, %g1 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 40007de8: 83 28 60 02 sll %g1, 2, %g1 40007dec: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( the_tod->day > days_in_month ) 40007df0: 80 a0 40 03 cmp %g1, %g3 40007df4: 84 60 3f ff subx %g0, -1, %g2 return false; return true; } 40007df8: b0 08 a0 01 and %g2, 1, %i0 40007dfc: 81 c7 e0 08 ret 40007e00: 81 e8 00 00 restore =============================================================================== 400093b8 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 400093b8: 9d e3 bf a0 save %sp, -96, %sp 400093bc: ba 10 00 18 mov %i0, %i5 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 400093c0: f0 06 20 10 ld [ %i0 + 0x10 ], %i0 /* * 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 ); 400093c4: 40 00 03 51 call 4000a108 <_Thread_Set_transient> 400093c8: 90 10 00 1d mov %i5, %o0 /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 400093cc: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400093d0: 80 a0 40 19 cmp %g1, %i1 400093d4: 02 80 00 04 be 400093e4 <_Thread_Change_priority+0x2c> 400093d8: 90 10 00 1d mov %i5, %o0 _Thread_Set_priority( the_thread, new_priority ); 400093dc: 40 00 03 32 call 4000a0a4 <_Thread_Set_priority> 400093e0: 92 10 00 19 mov %i1, %o1 _ISR_Disable( level ); 400093e4: 7f ff e3 31 call 400020a8 400093e8: 01 00 00 00 nop 400093ec: b6 10 00 08 mov %o0, %i3 /* * 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; 400093f0: f8 07 60 10 ld [ %i5 + 0x10 ], %i4 if ( state != STATES_TRANSIENT ) { 400093f4: 80 a7 20 04 cmp %i4, 4 400093f8: 02 80 00 10 be 40009438 <_Thread_Change_priority+0x80> 400093fc: 82 0e 20 04 and %i0, 4, %g1 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 40009400: 80 a0 60 00 cmp %g1, 0 40009404: 12 80 00 03 bne 40009410 <_Thread_Change_priority+0x58> <== NEVER TAKEN 40009408: 82 0f 3f fb and %i4, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 4000940c: c2 27 60 10 st %g1, [ %i5 + 0x10 ] _ISR_Enable( level ); 40009410: 7f ff e3 2a call 400020b8 40009414: 90 10 00 1b mov %i3, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 40009418: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000941c: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 40009420: 80 8f 00 01 btst %i4, %g1 40009424: 02 80 00 27 be 400094c0 <_Thread_Change_priority+0x108> 40009428: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4000942c: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 40009430: 40 00 02 f0 call 40009ff0 <_Thread_queue_Requeue> 40009434: 93 e8 00 1d restore %g0, %i5, %o1 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 40009438: 80 a0 60 00 cmp %g1, 0 4000943c: 12 80 00 0b bne 40009468 <_Thread_Change_priority+0xb0> <== NEVER TAKEN 40009440: 03 10 00 75 sethi %hi(0x4001d400), %g1 * 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 ); 40009444: c0 27 60 10 clr [ %i5 + 0x10 ] if ( prepend_it ) 40009448: 80 a6 a0 00 cmp %i2, 0 4000944c: 02 80 00 04 be 4000945c <_Thread_Change_priority+0xa4> 40009450: 82 10 62 a4 or %g1, 0x2a4, %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 40009454: 10 80 00 03 b 40009460 <_Thread_Change_priority+0xa8> 40009458: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 4000945c: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 40009460: 9f c0 40 00 call %g1 40009464: 90 10 00 1d mov %i5, %o0 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 40009468: 7f ff e3 14 call 400020b8 4000946c: 90 10 00 1b mov %i3, %o0 40009470: 7f ff e3 0e call 400020a8 40009474: 01 00 00 00 nop 40009478: b0 10 00 08 mov %o0, %i0 * This kernel routine implements the scheduling decision logic for * the scheduler. It does NOT dispatch. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { _Scheduler.Operations.schedule(); 4000947c: 03 10 00 75 sethi %hi(0x4001d400), %g1 40009480: c2 00 62 ac ld [ %g1 + 0x2ac ], %g1 ! 4001d6ac <_Scheduler+0x8> 40009484: 9f c0 40 00 call %g1 40009488: 01 00 00 00 nop * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 4000948c: 03 10 00 79 sethi %hi(0x4001e400), %g1 40009490: 82 10 63 10 or %g1, 0x310, %g1 ! 4001e710 <_Per_CPU_Information> * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 40009494: c4 18 60 10 ldd [ %g1 + 0x10 ], %g2 40009498: 80 a0 80 03 cmp %g2, %g3 4000949c: 02 80 00 07 be 400094b8 <_Thread_Change_priority+0x100> 400094a0: 01 00 00 00 nop 400094a4: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 400094a8: 80 a0 a0 00 cmp %g2, 0 400094ac: 02 80 00 03 be 400094b8 <_Thread_Change_priority+0x100> 400094b0: 84 10 20 01 mov 1, %g2 _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 400094b4: c4 28 60 0c stb %g2, [ %g1 + 0xc ] _ISR_Enable( level ); 400094b8: 7f ff e3 00 call 400020b8 400094bc: 81 e8 00 00 restore 400094c0: 81 c7 e0 08 ret 400094c4: 81 e8 00 00 restore =============================================================================== 40009688 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 40009688: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000968c: 90 10 00 18 mov %i0, %o0 40009690: 40 00 00 70 call 40009850 <_Thread_Get> 40009694: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40009698: c2 07 bf fc ld [ %fp + -4 ], %g1 4000969c: 80 a0 60 00 cmp %g1, 0 400096a0: 12 80 00 08 bne 400096c0 <_Thread_Delay_ended+0x38> <== NEVER TAKEN 400096a4: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 400096a8: 7f ff ff 88 call 400094c8 <_Thread_Clear_state> 400096ac: 92 12 60 18 or %o1, 0x18, %o1 ! 10000018 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400096b0: 03 10 00 78 sethi %hi(0x4001e000), %g1 400096b4: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 4001e200 <_Thread_Dispatch_disable_level> --level; 400096b8: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 400096bc: c4 20 62 00 st %g2, [ %g1 + 0x200 ] 400096c0: 81 c7 e0 08 ret 400096c4: 81 e8 00 00 restore =============================================================================== 400096c8 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 400096c8: 9d e3 bf 98 save %sp, -104, %sp #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 400096cc: 35 10 00 79 sethi %hi(0x4001e400), %i2 400096d0: 82 16 a3 10 or %i2, 0x310, %g1 ! 4001e710 <_Per_CPU_Information> _ISR_Disable( level ); 400096d4: 7f ff e2 75 call 400020a8 400096d8: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 400096dc: 21 10 00 78 sethi %hi(0x4001e000), %l0 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 400096e0: 27 10 00 75 sethi %hi(0x4001d400), %l3 * This routine sets thread dispatch level to the * value passed in. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) { _Thread_Dispatch_disable_level = value; 400096e4: 33 10 00 78 sethi %hi(0x4001e000), %i1 #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; 400096e8: 31 10 00 78 sethi %hi(0x4001e000), %i0 400096ec: a0 14 21 50 or %l0, 0x150, %l0 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 400096f0: 23 10 00 78 sethi %hi(0x4001e000), %l1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400096f4: 25 10 00 75 sethi %hi(0x4001d400), %l2 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 400096f8: 10 80 00 3b b 400097e4 <_Thread_Dispatch+0x11c> 400096fc: a6 14 e3 d0 or %l3, 0x3d0, %l3 40009700: 84 10 20 01 mov 1, %g2 40009704: c4 26 62 00 st %g2, [ %i1 + 0x200 ] heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 40009708: c0 28 60 0c clrb [ %g1 + 0xc ] /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 4000970c: 80 a5 00 1b cmp %l4, %i3 40009710: 12 80 00 0a bne 40009738 <_Thread_Dispatch+0x70> 40009714: e8 20 60 10 st %l4, [ %g1 + 0x10 ] 40009718: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000971c: c0 20 62 00 clr [ %g1 + 0x200 ] ! 4001e200 <_Thread_Dispatch_disable_level> post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 40009720: 7f ff e2 66 call 400020b8 40009724: 39 10 00 78 sethi %hi(0x4001e000), %i4 40009728: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000972c: fa 00 62 70 ld [ %g1 + 0x270 ], %i5 ! 4001e270 <_API_extensions_Post_switch_list> { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 40009730: 10 80 00 37 b 4000980c <_Thread_Dispatch+0x144> 40009734: b8 17 22 74 or %i4, 0x274, %i4 */ #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 ) 40009738: c2 05 20 78 ld [ %l4 + 0x78 ], %g1 4000973c: 80 a0 60 01 cmp %g1, 1 40009740: 12 80 00 03 bne 4000974c <_Thread_Dispatch+0x84> 40009744: c2 06 21 60 ld [ %i0 + 0x160 ], %g1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 40009748: c2 25 20 74 st %g1, [ %l4 + 0x74 ] _ISR_Enable( level ); 4000974c: 7f ff e2 5b call 400020b8 40009750: 01 00 00 00 nop 40009754: 90 07 bf f8 add %fp, -8, %o0 40009758: 7f ff f9 e0 call 40007ed8 <_TOD_Get_with_nanoseconds> 4000975c: 92 10 00 10 mov %l0, %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40009760: c4 1f bf f8 ldd [ %fp + -8 ], %g2 40009764: 82 16 a3 10 or %i2, 0x310, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 40009768: f8 18 60 20 ldd [ %g1 + 0x20 ], %i4 4000976c: 96 a0 c0 1d subcc %g3, %i5, %o3 40009770: 94 60 80 1c subx %g2, %i4, %o2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40009774: f8 1e e0 80 ldd [ %i3 + 0x80 ], %i4 40009778: 9a 87 40 0b addcc %i5, %o3, %o5 4000977c: 98 47 00 0a addx %i4, %o2, %o4 40009780: d8 3e e0 80 std %o4, [ %i3 + 0x80 ] &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 40009784: c4 38 60 20 std %g2, [ %g1 + 0x20 ] #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 40009788: c2 04 62 6c ld [ %l1 + 0x26c ], %g1 4000978c: 80 a0 60 00 cmp %g1, 0 40009790: 22 80 00 0c be,a 400097c0 <_Thread_Dispatch+0xf8> <== NEVER TAKEN 40009794: fa 04 a3 cc ld [ %l2 + 0x3cc ], %i5 <== NOT EXECUTED executing->libc_reent = *_Thread_libc_reent; 40009798: c4 00 40 00 ld [ %g1 ], %g2 4000979c: c4 26 e1 48 st %g2, [ %i3 + 0x148 ] *_Thread_libc_reent = heir->libc_reent; 400097a0: c4 05 21 48 ld [ %l4 + 0x148 ], %g2 400097a4: c4 20 40 00 st %g2, [ %g1 ] 400097a8: 10 80 00 06 b 400097c0 <_Thread_Dispatch+0xf8> 400097ac: fa 04 a3 cc ld [ %l2 + 0x3cc ], %i5 const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 400097b0: 90 10 00 1b mov %i3, %o0 400097b4: 9f c0 40 00 call %g1 400097b8: 92 10 00 14 mov %l4, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next( const Chain_Node *the_node ) { return the_node->next; 400097bc: fa 07 40 00 ld [ %i5 ], %i5 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 400097c0: 80 a7 40 13 cmp %i5, %l3 400097c4: 32 bf ff fb bne,a 400097b0 <_Thread_Dispatch+0xe8> 400097c8: c2 07 60 08 ld [ %i5 + 8 ], %g1 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 400097cc: 90 06 e0 c0 add %i3, 0xc0, %o0 400097d0: 40 00 04 30 call 4000a890 <_CPU_Context_switch> 400097d4: 92 05 20 c0 add %l4, 0xc0, %o1 if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 400097d8: 82 16 a3 10 or %i2, 0x310, %g1 _ISR_Disable( level ); 400097dc: 7f ff e2 33 call 400020a8 400097e0: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 400097e4: 82 16 a3 10 or %i2, 0x310, %g1 400097e8: c4 08 60 0c ldub [ %g1 + 0xc ], %g2 400097ec: 80 a0 a0 00 cmp %g2, 0 400097f0: 32 bf ff c4 bne,a 40009700 <_Thread_Dispatch+0x38> 400097f4: e8 00 60 14 ld [ %g1 + 0x14 ], %l4 400097f8: 10 bf ff c9 b 4000971c <_Thread_Dispatch+0x54> 400097fc: 03 10 00 78 sethi %hi(0x4001e000), %g1 const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 40009800: 9f c0 40 00 call %g1 40009804: 90 10 00 1b mov %i3, %o0 40009808: fa 07 40 00 ld [ %i5 ], %i5 { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 4000980c: 80 a7 40 1c cmp %i5, %i4 40009810: 32 bf ff fc bne,a 40009800 <_Thread_Dispatch+0x138> 40009814: c2 07 60 08 ld [ %i5 + 8 ], %g1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 40009818: 81 c7 e0 08 ret 4000981c: 81 e8 00 00 restore =============================================================================== 4000e848 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4000e848: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4000e84c: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000e850: fa 00 63 20 ld [ %g1 + 0x320 ], %i5 ! 4001e720 <_Per_CPU_Information+0x10> /* * Some CPUs need to tinker with the call frame or registers when the * thread actually begins to execute for the first time. This is a * hook point where the port gets a shot at doing whatever it requires. */ _Context_Initialization_at_thread_begin(); 4000e854: 3f 10 00 3a sethi %hi(0x4000e800), %i7 4000e858: be 17 e0 48 or %i7, 0x48, %i7 ! 4000e848 <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4000e85c: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level(level); 4000e860: 7f ff ce 16 call 400020b8 4000e864: 91 2a 20 08 sll %o0, 8, %o0 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4000e868: 03 10 00 77 sethi %hi(0x4001dc00), %g1 doneConstructors = true; 4000e86c: 84 10 20 01 mov 1, %g2 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4000e870: f8 08 62 f8 ldub [ %g1 + 0x2f8 ], %i4 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4000e874: 90 10 00 1d mov %i5, %o0 4000e878: 13 10 00 28 sethi %hi(0x4000a000), %o1 4000e87c: 92 12 62 e8 or %o1, 0x2e8, %o1 ! 4000a2e8 <_User_extensions_Thread_begin_visitor> 4000e880: 7f ff ee b7 call 4000a35c <_User_extensions_Iterate> 4000e884: c4 28 62 f8 stb %g2, [ %g1 + 0x2f8 ] _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4000e888: 7f ff eb e6 call 40009820 <_Thread_Enable_dispatch> 4000e88c: 01 00 00 00 nop /* * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (doCons) /* && (volatile void *)_init) */ { 4000e890: 80 8f 20 ff btst 0xff, %i4 4000e894: 32 80 00 05 bne,a 4000e8a8 <_Thread_Handler+0x60> 4000e898: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 INIT_NAME (); 4000e89c: 40 00 3b 4f call 4001d5d8 <_init> 4000e8a0: 01 00 00 00 nop _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4000e8a4: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 4000e8a8: 80 a0 60 00 cmp %g1, 0 4000e8ac: 12 80 00 05 bne 4000e8c0 <_Thread_Handler+0x78> 4000e8b0: 80 a0 60 01 cmp %g1, 1 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4000e8b4: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000e8b8: 10 80 00 06 b 4000e8d0 <_Thread_Handler+0x88> 4000e8bc: d0 07 60 98 ld [ %i5 + 0x98 ], %o0 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4000e8c0: 12 80 00 08 bne 4000e8e0 <_Thread_Handler+0x98> <== NEVER TAKEN 4000e8c4: 90 10 00 1d mov %i5, %o0 executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4000e8c8: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000e8cc: d0 07 60 94 ld [ %i5 + 0x94 ], %o0 4000e8d0: 9f c0 40 00 call %g1 4000e8d4: 01 00 00 00 nop executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4000e8d8: d0 27 60 28 st %o0, [ %i5 + 0x28 ] } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4000e8dc: 90 10 00 1d mov %i5, %o0 4000e8e0: 13 10 00 28 sethi %hi(0x4000a000), %o1 4000e8e4: 7f ff ee 9e call 4000a35c <_User_extensions_Iterate> 4000e8e8: 92 12 63 0c or %o1, 0x30c, %o1 ! 4000a30c <_User_extensions_Thread_exitted_visitor> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 4000e8ec: 90 10 20 00 clr %o0 4000e8f0: 92 10 20 01 mov 1, %o1 4000e8f4: 7f ff e6 ad call 400083a8 <_Internal_error_Occurred> 4000e8f8: 94 10 20 05 mov 5, %o2 =============================================================================== 40009ad8 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 40009ad8: 9d e3 bf 98 save %sp, -104, %sp uint32_t ticks_per_timeslice = 40009adc: 03 10 00 6d sethi %hi(0x4001b400), %g1 40009ae0: 82 10 63 58 or %g1, 0x358, %g1 ! 4001b758 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 40009ae4: c6 00 60 28 ld [ %g1 + 0x28 ], %g3 #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 40009ae8: fa 00 60 14 ld [ %g1 + 0x14 ], %i5 rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 40009aec: f8 00 60 08 ld [ %g1 + 8 ], %i4 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 40009af0: 80 a0 e0 00 cmp %g3, 0 40009af4: 02 80 00 06 be 40009b0c <_Thread_Handler_initialization+0x34><== NEVER TAKEN 40009af8: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 40009afc: c6 00 60 2c ld [ %g1 + 0x2c ], %g3 40009b00: 80 a0 e0 00 cmp %g3, 0 40009b04: 12 80 00 06 bne 40009b1c <_Thread_Handler_initialization+0x44> 40009b08: 80 a0 a0 00 cmp %g2, 0 rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 40009b0c: 90 10 20 00 clr %o0 40009b10: 92 10 20 01 mov 1, %o1 40009b14: 7f ff fa 25 call 400083a8 <_Internal_error_Occurred> 40009b18: 94 10 20 0e mov 0xe, %o2 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 40009b1c: 22 80 00 05 be,a 40009b30 <_Thread_Handler_initialization+0x58> 40009b20: 03 10 00 79 sethi %hi(0x4001e400), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 40009b24: 9f c0 80 00 call %g2 40009b28: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 4001e404 <_POSIX_Threads_Information> _Thread_Dispatch_necessary = false; 40009b2c: 03 10 00 79 sethi %hi(0x4001e400), %g1 40009b30: 82 10 63 10 or %g1, 0x310, %g1 ! 4001e710 <_Per_CPU_Information> 40009b34: c0 28 60 0c clrb [ %g1 + 0xc ] _Thread_Executing = NULL; 40009b38: c0 20 60 10 clr [ %g1 + 0x10 ] _Thread_Heir = NULL; 40009b3c: c0 20 60 14 clr [ %g1 + 0x14 ] #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 40009b40: 03 10 00 78 sethi %hi(0x4001e000), %g1 40009b44: f8 20 62 7c st %i4, [ %g1 + 0x27c ] ! 4001e27c <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 40009b48: 03 10 00 78 sethi %hi(0x4001e000), %g1 40009b4c: fa 20 61 60 st %i5, [ %g1 + 0x160 ] ! 4001e160 <_Thread_Ticks_per_timeslice> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 40009b50: 82 10 20 08 mov 8, %g1 40009b54: 11 10 00 78 sethi %hi(0x4001e000), %o0 40009b58: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40009b5c: 90 12 22 f0 or %o0, 0x2f0, %o0 40009b60: 92 10 20 01 mov 1, %o1 40009b64: 94 10 20 01 mov 1, %o2 40009b68: 96 10 20 01 mov 1, %o3 40009b6c: 98 10 21 60 mov 0x160, %o4 40009b70: 7f ff fb 9e call 400089e8 <_Objects_Initialize_information> 40009b74: 9a 10 20 00 clr %o5 40009b78: 81 c7 e0 08 ret 40009b7c: 81 e8 00 00 restore =============================================================================== 40009900 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 40009900: 9d e3 bf 98 save %sp, -104, %sp 40009904: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 40009908: c0 26 61 4c clr [ %i1 + 0x14c ] 4000990c: c0 26 61 50 clr [ %i1 + 0x150 ] extensions_area = NULL; the_thread->libc_reent = NULL; 40009910: c0 26 61 48 clr [ %i1 + 0x148 ] Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 40009914: e0 07 a0 60 ld [ %fp + 0x60 ], %l0 40009918: e2 00 40 00 ld [ %g1 ], %l1 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 4000991c: 80 a6 a0 00 cmp %i2, 0 40009920: 12 80 00 0d bne 40009954 <_Thread_Initialize+0x54> 40009924: e4 0f a0 5f ldub [ %fp + 0x5f ], %l2 actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 40009928: 90 10 00 19 mov %i1, %o0 4000992c: 40 00 02 06 call 4000a144 <_Thread_Stack_Allocate> 40009930: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 40009934: 80 a2 00 1b cmp %o0, %i3 40009938: 0a 80 00 64 bcs 40009ac8 <_Thread_Initialize+0x1c8> 4000993c: 80 a2 20 00 cmp %o0, 0 40009940: 02 80 00 62 be 40009ac8 <_Thread_Initialize+0x1c8> <== NEVER TAKEN 40009944: 82 10 20 01 mov 1, %g1 return false; /* stack allocation failed */ stack = the_thread->Start.stack; 40009948: f4 06 60 bc ld [ %i1 + 0xbc ], %i2 the_thread->Start.core_allocated_stack = true; 4000994c: 10 80 00 04 b 4000995c <_Thread_Initialize+0x5c> 40009950: c2 2e 60 b0 stb %g1, [ %i1 + 0xb0 ] } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 40009954: c0 2e 60 b0 clrb [ %i1 + 0xb0 ] 40009958: 90 10 00 1b mov %i3, %o0 void *starting_address, size_t size ) { the_stack->area = starting_address; the_stack->size = size; 4000995c: d0 26 60 b4 st %o0, [ %i1 + 0xb4 ] #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 40009960: 03 10 00 78 sethi %hi(0x4001e000), %g1 40009964: d0 00 62 7c ld [ %g1 + 0x27c ], %o0 ! 4001e27c <_Thread_Maximum_extensions> Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 40009968: f4 26 60 b8 st %i2, [ %i1 + 0xb8 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4000996c: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 40009970: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 40009974: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 40009978: c0 26 60 6c clr [ %i1 + 0x6c ] 4000997c: 80 a2 20 00 cmp %o0, 0 40009980: 02 80 00 08 be 400099a0 <_Thread_Initialize+0xa0> 40009984: b8 10 20 00 clr %i4 extensions_area = _Workspace_Allocate( 40009988: 90 02 20 01 inc %o0 4000998c: 40 00 03 a5 call 4000a820 <_Workspace_Allocate> 40009990: 91 2a 20 02 sll %o0, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 40009994: b8 92 20 00 orcc %o0, 0, %i4 40009998: 02 80 00 40 be 40009a98 <_Thread_Initialize+0x198> 4000999c: b6 10 20 00 clr %i3 * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 400099a0: 80 a7 20 00 cmp %i4, 0 400099a4: 12 80 00 0a bne 400099cc <_Thread_Initialize+0xcc> 400099a8: f8 26 61 54 st %i4, [ %i1 + 0x154 ] * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 400099ac: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 400099b0: e4 2e 60 9c stb %l2, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 400099b4: e0 26 60 a0 st %l0, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 400099b8: 80 a4 20 02 cmp %l0, 2 400099bc: 12 80 00 12 bne 40009a04 <_Thread_Initialize+0x104> 400099c0: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ] case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 400099c4: 10 80 00 0e b 400099fc <_Thread_Initialize+0xfc> 400099c8: 03 10 00 78 sethi %hi(0x4001e000), %g1 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 400099cc: 03 10 00 78 sethi %hi(0x4001e000), %g1 400099d0: c4 00 62 7c ld [ %g1 + 0x27c ], %g2 ! 4001e27c <_Thread_Maximum_extensions> 400099d4: 10 80 00 05 b 400099e8 <_Thread_Initialize+0xe8> 400099d8: 82 10 20 00 clr %g1 the_thread->extensions[i] = NULL; 400099dc: 87 28 60 02 sll %g1, 2, %g3 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 400099e0: 82 00 60 01 inc %g1 the_thread->extensions[i] = NULL; 400099e4: c0 21 00 03 clr [ %g4 + %g3 ] * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 400099e8: 80 a0 40 02 cmp %g1, %g2 400099ec: 28 bf ff fc bleu,a 400099dc <_Thread_Initialize+0xdc> 400099f0: c8 06 61 54 ld [ %i1 + 0x154 ], %g4 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 400099f4: 10 bf ff ef b 400099b0 <_Thread_Initialize+0xb0> 400099f8: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 400099fc: c2 00 61 60 ld [ %g1 + 0x160 ], %g1 40009a00: c2 26 60 74 st %g1, [ %i1 + 0x74 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 40009a04: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 the_thread->current_state = STATES_DORMANT; 40009a08: b4 10 20 01 mov 1, %i2 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 40009a0c: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 40009a10: 03 10 00 75 sethi %hi(0x4001d400), %g1 40009a14: c2 00 62 bc ld [ %g1 + 0x2bc ], %g1 ! 4001d6bc <_Scheduler+0x18> the_thread->current_state = STATES_DORMANT; 40009a18: f4 26 60 10 st %i2, [ %i1 + 0x10 ] the_thread->Wait.queue = NULL; 40009a1c: c0 26 60 44 clr [ %i1 + 0x44 ] the_thread->resource_count = 0; 40009a20: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 40009a24: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; 40009a28: fa 26 60 ac st %i5, [ %i1 + 0xac ] 40009a2c: 9f c0 40 00 call %g1 40009a30: 90 10 00 19 mov %i1, %o0 sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 40009a34: b6 92 20 00 orcc %o0, 0, %i3 40009a38: 02 80 00 18 be 40009a98 <_Thread_Initialize+0x198> 40009a3c: 90 10 00 19 mov %i1, %o0 goto failed; _Thread_Set_priority( the_thread, priority ); 40009a40: 40 00 01 99 call 4000a0a4 <_Thread_Set_priority> 40009a44: 92 10 00 1d mov %i5, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009a48: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 40009a4c: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 40009a50: c0 26 60 80 clr [ %i1 + 0x80 ] 40009a54: c0 26 60 84 clr [ %i1 + 0x84 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009a58: 83 28 60 02 sll %g1, 2, %g1 40009a5c: f2 20 80 01 st %i1, [ %g2 + %g1 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 40009a60: e2 26 60 0c st %l1, [ %i1 + 0xc ] * @{ */ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; 40009a64: f2 27 bf f8 st %i1, [ %fp + -8 ] 40009a68: f4 2f bf fc stb %i2, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); 40009a6c: 90 07 bf f8 add %fp, -8, %o0 40009a70: 13 10 00 28 sethi %hi(0x4000a000), %o1 40009a74: 40 00 02 3a call 4000a35c <_User_extensions_Iterate> 40009a78: 92 12 62 38 or %o1, 0x238, %o1 ! 4000a238 <_User_extensions_Thread_create_visitor> * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) 40009a7c: c2 0f bf fc ldub [ %fp + -4 ], %g1 40009a80: 80 a0 60 00 cmp %g1, 0 40009a84: 02 80 00 05 be 40009a98 <_Thread_Initialize+0x198> 40009a88: b0 10 20 01 mov 1, %i0 40009a8c: b0 0e 20 01 and %i0, 1, %i0 40009a90: 81 c7 e0 08 ret 40009a94: 81 e8 00 00 restore return true; failed: _Workspace_Free( the_thread->libc_reent ); 40009a98: 40 00 03 6a call 4000a840 <_Workspace_Free> 40009a9c: d0 06 61 48 ld [ %i1 + 0x148 ], %o0 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 40009aa0: 40 00 03 68 call 4000a840 <_Workspace_Free> 40009aa4: d0 06 61 4c ld [ %i1 + 0x14c ], %o0 40009aa8: 40 00 03 66 call 4000a840 <_Workspace_Free> 40009aac: d0 06 61 50 ld [ %i1 + 0x150 ], %o0 _Workspace_Free( extensions_area ); 40009ab0: 40 00 03 64 call 4000a840 <_Workspace_Free> 40009ab4: 90 10 00 1c mov %i4, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); #endif _Workspace_Free( sched ); 40009ab8: 40 00 03 62 call 4000a840 <_Workspace_Free> 40009abc: 90 10 00 1b mov %i3, %o0 _Thread_Stack_Free( the_thread ); 40009ac0: 40 00 01 b1 call 4000a184 <_Thread_Stack_Free> 40009ac4: 90 10 00 19 mov %i1, %o0 stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 40009ac8: b0 10 20 00 clr %i0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 40009acc: b0 0e 20 01 and %i0, 1, %i0 40009ad0: 81 c7 e0 08 ret 40009ad4: 81 e8 00 00 restore =============================================================================== 4000a184 <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 4000a184: 9d e3 bf a0 save %sp, -96, %sp #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 4000a188: c4 0e 20 b0 ldub [ %i0 + 0xb0 ], %g2 void _Thread_Stack_Free( Thread_Control *the_thread ) { rtems_stack_free_hook stack_free_hook = 4000a18c: 03 10 00 6d sethi %hi(0x4001b400), %g1 #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 4000a190: 80 a0 a0 00 cmp %g2, 0 4000a194: 02 80 00 04 be 4000a1a4 <_Thread_Stack_Free+0x20> <== NEVER TAKEN 4000a198: c2 00 63 84 ld [ %g1 + 0x384 ], %g1 * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ (*stack_free_hook)( the_thread->Start.Initial_stack.area ); 4000a19c: 9f c0 40 00 call %g1 4000a1a0: d0 06 20 b8 ld [ %i0 + 0xb8 ], %o0 4000a1a4: 81 c7 e0 08 ret 4000a1a8: 81 e8 00 00 restore =============================================================================== 4000e900 <_Thread_queue_Extract_fifo>: void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4000e900: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED ISR_Level level; _ISR_Disable( level ); 4000e904: 7f ff cd e9 call 400020a8 <== NOT EXECUTED 4000e908: 01 00 00 00 nop <== NOT EXECUTED 4000e90c: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED 4000e910: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 <== NOT EXECUTED if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000e914: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 4000e918: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED 4000e91c: 80 88 80 01 btst %g2, %g1 <== NOT EXECUTED 4000e920: 32 80 00 04 bne,a 4000e930 <_Thread_queue_Extract_fifo+0x30><== NOT EXECUTED 4000e924: c2 06 60 04 ld [ %i1 + 4 ], %g1 <== NOT EXECUTED _ISR_Enable( level ); 4000e928: 7f ff cd e4 call 400020b8 <== NOT EXECUTED 4000e92c: 81 e8 00 00 restore <== NOT EXECUTED ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000e930: c4 06 40 00 ld [ %i1 ], %g2 <== NOT EXECUTED previous = the_node->previous; next->previous = previous; 4000e934: c2 20 a0 04 st %g1, [ %g2 + 4 ] <== NOT EXECUTED previous->next = next; 4000e938: c4 20 40 00 st %g2, [ %g1 ] <== NOT EXECUTED _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4000e93c: c2 06 60 50 ld [ %i1 + 0x50 ], %g1 <== NOT EXECUTED 4000e940: 80 a0 60 02 cmp %g1, 2 <== NOT EXECUTED 4000e944: 02 80 00 06 be 4000e95c <_Thread_queue_Extract_fifo+0x5c> <== NOT EXECUTED 4000e948: c0 26 60 44 clr [ %i1 + 0x44 ] <== NOT EXECUTED _ISR_Enable( level ); 4000e94c: 7f ff cd db call 400020b8 <== NOT EXECUTED 4000e950: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED 4000e954: 10 80 00 09 b 4000e978 <_Thread_queue_Extract_fifo+0x78> <== NOT EXECUTED 4000e958: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000e95c: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED 4000e960: c2 26 60 50 st %g1, [ %i1 + 0x50 ] <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4000e964: 7f ff cd d5 call 400020b8 <== NOT EXECUTED 4000e968: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4000e96c: 7f ff ef 14 call 4000a5bc <_Watchdog_Remove> <== NOT EXECUTED 4000e970: 90 06 60 48 add %i1, 0x48, %o0 <== NOT EXECUTED 4000e974: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000e978: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 <== NOT EXECUTED 4000e97c: 7f ff ea d3 call 400094c8 <_Thread_Clear_state> <== NOT EXECUTED 4000e980: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40009ff0 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 40009ff0: 9d e3 bf 98 save %sp, -104, %sp /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 40009ff4: 80 a6 20 00 cmp %i0, 0 40009ff8: 02 80 00 19 be 4000a05c <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 40009ffc: 01 00 00 00 nop /* * 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 ) { 4000a000: fa 06 20 34 ld [ %i0 + 0x34 ], %i5 4000a004: 80 a7 60 01 cmp %i5, 1 4000a008: 12 80 00 15 bne 4000a05c <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 4000a00c: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 4000a010: 7f ff e0 26 call 400020a8 4000a014: 01 00 00 00 nop 4000a018: b8 10 00 08 mov %o0, %i4 4000a01c: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000a020: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000a024: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 4000a028: 80 88 80 01 btst %g2, %g1 4000a02c: 02 80 00 0a be 4000a054 <_Thread_queue_Requeue+0x64> <== NEVER TAKEN 4000a030: 90 10 00 18 mov %i0, %o0 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 4000a034: 92 10 00 19 mov %i1, %o1 4000a038: 94 10 20 01 mov 1, %o2 4000a03c: 40 00 0b b6 call 4000cf14 <_Thread_queue_Extract_priority_helper> 4000a040: fa 26 20 30 st %i5, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 4000a044: 90 10 00 18 mov %i0, %o0 4000a048: 92 10 00 19 mov %i1, %o1 4000a04c: 7f ff ff 50 call 40009d8c <_Thread_queue_Enqueue_priority> 4000a050: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 4000a054: 7f ff e0 19 call 400020b8 4000a058: 90 10 00 1c mov %i4, %o0 4000a05c: 81 c7 e0 08 ret 4000a060: 81 e8 00 00 restore =============================================================================== 4000a064 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000a064: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000a068: 90 10 00 18 mov %i0, %o0 4000a06c: 7f ff fd f9 call 40009850 <_Thread_Get> 4000a070: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000a074: c2 07 bf fc ld [ %fp + -4 ], %g1 4000a078: 80 a0 60 00 cmp %g1, 0 4000a07c: 12 80 00 08 bne 4000a09c <_Thread_queue_Timeout+0x38> <== NEVER TAKEN 4000a080: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000a084: 40 00 0b db call 4000cff0 <_Thread_queue_Process_timeout> 4000a088: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000a08c: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000a090: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 4001e200 <_Thread_Dispatch_disable_level> --level; 4000a094: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000a098: c4 20 62 00 st %g2, [ %g1 + 0x200 ] 4000a09c: 81 c7 e0 08 ret 4000a0a0: 81 e8 00 00 restore =============================================================================== 40018288 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40018288: 9d e3 bf 88 save %sp, -120, %sp static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 4001828c: 27 10 00 f5 sethi %hi(0x4003d400), %l3 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40018290: a4 07 bf e8 add %fp, -24, %l2 40018294: aa 07 bf ec add %fp, -20, %l5 40018298: b8 07 bf f4 add %fp, -12, %i4 4001829c: b2 07 bf f8 add %fp, -8, %i1 400182a0: ea 27 bf e8 st %l5, [ %fp + -24 ] head->previous = NULL; 400182a4: c0 27 bf ec clr [ %fp + -20 ] tail->previous = head; 400182a8: e4 27 bf f0 st %l2, [ %fp + -16 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 400182ac: f2 27 bf f4 st %i1, [ %fp + -12 ] head->previous = NULL; 400182b0: c0 27 bf f8 clr [ %fp + -8 ] tail->previous = head; 400182b4: f8 27 bf fc st %i4, [ %fp + -4 ] */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 400182b8: b4 06 20 30 add %i0, 0x30, %i2 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 400182bc: 29 10 00 f5 sethi %hi(0x4003d400), %l4 /* * 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 ); 400182c0: b6 06 20 68 add %i0, 0x68, %i3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 400182c4: a2 06 20 08 add %i0, 8, %l1 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 400182c8: a0 06 20 40 add %i0, 0x40, %l0 { /* * 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; 400182cc: e4 26 20 78 st %l2, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 400182d0: c2 04 e2 78 ld [ %l3 + 0x278 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 400182d4: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 400182d8: 90 10 00 1a mov %i2, %o0 400182dc: 92 20 40 09 sub %g1, %o1, %o1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 400182e0: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 400182e4: 40 00 11 79 call 4001c8c8 <_Watchdog_Adjust_to_chain> 400182e8: 94 10 00 1c mov %i4, %o2 400182ec: d0 1d 20 d8 ldd [ %l4 + 0xd8 ], %o0 400182f0: 94 10 20 00 clr %o2 400182f4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400182f8: 40 00 4f 75 call 4002c0cc <__divdi3> 400182fc: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 40018300: d4 06 20 74 ld [ %i0 + 0x74 ], %o2 /* * 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 ) { 40018304: 80 a2 40 0a cmp %o1, %o2 40018308: 08 80 00 07 bleu 40018324 <_Timer_server_Body+0x9c> 4001830c: ba 10 00 09 mov %o1, %i5 /* * 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 ); 40018310: 92 22 40 0a sub %o1, %o2, %o1 40018314: 90 10 00 1b mov %i3, %o0 40018318: 40 00 11 6c call 4001c8c8 <_Watchdog_Adjust_to_chain> 4001831c: 94 10 00 1c mov %i4, %o2 40018320: 30 80 00 06 b,a 40018338 <_Timer_server_Body+0xb0> } else if ( snapshot < last_snapshot ) { 40018324: 1a 80 00 05 bcc 40018338 <_Timer_server_Body+0xb0> 40018328: 90 10 00 1b mov %i3, %o0 /* * 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 ); 4001832c: 92 10 20 01 mov 1, %o1 40018330: 40 00 11 3e call 4001c828 <_Watchdog_Adjust> 40018334: 94 22 80 1d sub %o2, %i5, %o2 } watchdogs->last_snapshot = snapshot; 40018338: fa 26 20 74 st %i5, [ %i0 + 0x74 ] } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 4001833c: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40018340: 40 00 02 f4 call 40018f10 <_Chain_Get> 40018344: 01 00 00 00 nop if ( timer == NULL ) { 40018348: 92 92 20 00 orcc %o0, 0, %o1 4001834c: 02 80 00 0c be 4001837c <_Timer_server_Body+0xf4> 40018350: 01 00 00 00 nop static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 40018354: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 40018358: 80 a0 60 01 cmp %g1, 1 4001835c: 02 80 00 05 be 40018370 <_Timer_server_Body+0xe8> 40018360: 90 10 00 1a mov %i2, %o0 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40018364: 80 a0 60 03 cmp %g1, 3 40018368: 12 bf ff f5 bne 4001833c <_Timer_server_Body+0xb4> <== NEVER TAKEN 4001836c: 90 10 00 1b mov %i3, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40018370: 40 00 11 80 call 4001c970 <_Watchdog_Insert> 40018374: 92 02 60 10 add %o1, 0x10, %o1 40018378: 30 bf ff f1 b,a 4001833c <_Timer_server_Body+0xb4> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 4001837c: 7f ff df a6 call 40010214 40018380: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 40018384: c2 07 bf e8 ld [ %fp + -24 ], %g1 40018388: 80 a0 40 15 cmp %g1, %l5 4001838c: 12 80 00 0a bne 400183b4 <_Timer_server_Body+0x12c> <== NEVER TAKEN 40018390: 01 00 00 00 nop ts->insert_chain = NULL; 40018394: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 40018398: 7f ff df a3 call 40010224 4001839c: 01 00 00 00 nop _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 ) ) { 400183a0: c2 07 bf f4 ld [ %fp + -12 ], %g1 400183a4: 80 a0 40 19 cmp %g1, %i1 400183a8: 12 80 00 06 bne 400183c0 <_Timer_server_Body+0x138> 400183ac: 01 00 00 00 nop 400183b0: 30 80 00 18 b,a 40018410 <_Timer_server_Body+0x188> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 400183b4: 7f ff df 9c call 40010224 <== NOT EXECUTED 400183b8: 01 00 00 00 nop <== NOT EXECUTED 400183bc: 30 bf ff c5 b,a 400182d0 <_Timer_server_Body+0x48> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 400183c0: 7f ff df 95 call 40010214 400183c4: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400183c8: fa 07 bf f4 ld [ %fp + -12 ], %i5 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 400183cc: 80 a7 40 19 cmp %i5, %i1 400183d0: 02 80 00 0d be 40018404 <_Timer_server_Body+0x17c> 400183d4: 01 00 00 00 nop Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 400183d8: c2 07 40 00 ld [ %i5 ], %g1 head->next = new_first; new_first->previous = head; 400183dc: f8 20 60 04 st %i4, [ %g1 + 4 ] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 400183e0: c2 27 bf f4 st %g1, [ %fp + -12 ] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 400183e4: c0 27 60 08 clr [ %i5 + 8 ] _ISR_Enable( level ); 400183e8: 7f ff df 8f call 40010224 400183ec: 01 00 00 00 nop /* * 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 ); 400183f0: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 400183f4: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 400183f8: 9f c0 40 00 call %g1 400183fc: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 } 40018400: 30 bf ff f0 b,a 400183c0 <_Timer_server_Body+0x138> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 40018404: 7f ff df 88 call 40010224 40018408: 01 00 00 00 nop 4001840c: 30 bf ff b0 b,a 400182cc <_Timer_server_Body+0x44> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 40018410: c0 2e 20 7c clrb [ %i0 + 0x7c ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40018414: 03 10 00 f5 sethi %hi(0x4003d400), %g1 40018418: c4 00 61 90 ld [ %g1 + 0x190 ], %g2 ! 4003d590 <_Thread_Dispatch_disable_level> ++level; 4001841c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40018420: c4 20 61 90 st %g2, [ %g1 + 0x190 ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 40018424: d0 06 00 00 ld [ %i0 ], %o0 40018428: 40 00 10 1a call 4001c490 <_Thread_Set_state> 4001842c: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 40018430: 7f ff ff 6e call 400181e8 <_Timer_server_Reset_interval_system_watchdog> 40018434: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 40018438: 7f ff ff 80 call 40018238 <_Timer_server_Reset_tod_system_watchdog> 4001843c: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 40018440: 40 00 0d ce call 4001bb78 <_Thread_Enable_dispatch> 40018444: 01 00 00 00 nop ts->active = true; 40018448: 82 10 20 01 mov 1, %g1 ! 1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 4001844c: 90 10 00 11 mov %l1, %o0 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 40018450: c2 2e 20 7c stb %g1, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40018454: 40 00 11 9f call 4001cad0 <_Watchdog_Remove> 40018458: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 4001845c: 40 00 11 9d call 4001cad0 <_Watchdog_Remove> 40018460: 90 10 00 10 mov %l0, %o0 40018464: 30 bf ff 9a b,a 400182cc <_Timer_server_Body+0x44> =============================================================================== 40018468 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 40018468: 9d e3 bf a0 save %sp, -96, %sp if ( ts->insert_chain == NULL ) { 4001846c: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 40018470: 80 a0 60 00 cmp %g1, 0 40018474: 12 80 00 51 bne 400185b8 <_Timer_server_Schedule_operation_method+0x150> 40018478: ba 10 00 19 mov %i1, %i5 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4001847c: 03 10 00 f5 sethi %hi(0x4003d400), %g1 40018480: c4 00 61 90 ld [ %g1 + 0x190 ], %g2 ! 4003d590 <_Thread_Dispatch_disable_level> ++level; 40018484: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40018488: c4 20 61 90 st %g2, [ %g1 + 0x190 ] * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 4001848c: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 40018490: 80 a0 60 01 cmp %g1, 1 40018494: 12 80 00 1f bne 40018510 <_Timer_server_Schedule_operation_method+0xa8> 40018498: 80 a0 60 03 cmp %g1, 3 /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 4001849c: 7f ff df 5e call 40010214 400184a0: 01 00 00 00 nop snapshot = _Watchdog_Ticks_since_boot; 400184a4: 03 10 00 f5 sethi %hi(0x4003d400), %g1 400184a8: c4 00 62 78 ld [ %g1 + 0x278 ], %g2 ! 4003d678 <_Watchdog_Ticks_since_boot> */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400184ac: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 400184b0: c8 06 20 3c ld [ %i0 + 0x3c ], %g4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 400184b4: 86 06 20 34 add %i0, 0x34, %g3 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 400184b8: 80 a0 40 03 cmp %g1, %g3 400184bc: 02 80 00 08 be 400184dc <_Timer_server_Schedule_operation_method+0x74> 400184c0: 88 20 80 04 sub %g2, %g4, %g4 /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 400184c4: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 if (delta_interval > delta) { 400184c8: 80 a7 00 04 cmp %i4, %g4 400184cc: 08 80 00 03 bleu 400184d8 <_Timer_server_Schedule_operation_method+0x70> 400184d0: 86 10 20 00 clr %g3 delta_interval -= delta; 400184d4: 86 27 00 04 sub %i4, %g4, %g3 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 400184d8: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->Interval_watchdogs.last_snapshot = snapshot; 400184dc: c4 26 20 3c st %g2, [ %i0 + 0x3c ] _ISR_Enable( level ); 400184e0: 7f ff df 51 call 40010224 400184e4: 01 00 00 00 nop _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 400184e8: 90 06 20 30 add %i0, 0x30, %o0 400184ec: 40 00 11 21 call 4001c970 <_Watchdog_Insert> 400184f0: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 400184f4: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 400184f8: 80 a0 60 00 cmp %g1, 0 400184fc: 12 80 00 2d bne 400185b0 <_Timer_server_Schedule_operation_method+0x148> 40018500: 01 00 00 00 nop _Timer_server_Reset_interval_system_watchdog( ts ); 40018504: 7f ff ff 39 call 400181e8 <_Timer_server_Reset_interval_system_watchdog> 40018508: 90 10 00 18 mov %i0, %o0 4001850c: 30 80 00 29 b,a 400185b0 <_Timer_server_Schedule_operation_method+0x148> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40018510: 12 80 00 28 bne 400185b0 <_Timer_server_Schedule_operation_method+0x148> 40018514: 01 00 00 00 nop /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 40018518: 7f ff df 3f call 40010214 4001851c: 01 00 00 00 nop 40018520: b8 10 00 08 mov %o0, %i4 40018524: 03 10 00 f5 sethi %hi(0x4003d400), %g1 40018528: d0 18 60 d8 ldd [ %g1 + 0xd8 ], %o0 ! 4003d4d8 <_TOD> 4001852c: 94 10 20 00 clr %o2 40018530: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40018534: 40 00 4e e6 call 4002c0cc <__divdi3> 40018538: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4001853c: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 40018540: c4 06 20 74 ld [ %i0 + 0x74 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40018544: 86 06 20 6c add %i0, 0x6c, %g3 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 40018548: 80 a0 40 03 cmp %g1, %g3 4001854c: 02 80 00 0d be 40018580 <_Timer_server_Schedule_operation_method+0x118> 40018550: 80 a2 40 02 cmp %o1, %g2 first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 40018554: 08 80 00 08 bleu 40018574 <_Timer_server_Schedule_operation_method+0x10c> 40018558: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 /* * We advanced in time. */ delta = snapshot - last_snapshot; 4001855c: 88 22 40 02 sub %o1, %g2, %g4 if (delta_interval > delta) { 40018560: 80 a0 c0 04 cmp %g3, %g4 40018564: 08 80 00 06 bleu 4001857c <_Timer_server_Schedule_operation_method+0x114><== NEVER TAKEN 40018568: 84 10 20 00 clr %g2 delta_interval -= delta; 4001856c: 10 80 00 04 b 4001857c <_Timer_server_Schedule_operation_method+0x114> 40018570: 84 20 c0 04 sub %g3, %g4, %g2 } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 40018574: 84 00 c0 02 add %g3, %g2, %g2 delta_interval += delta; 40018578: 84 20 80 09 sub %g2, %o1, %g2 } first_watchdog->delta_interval = delta_interval; 4001857c: c4 20 60 10 st %g2, [ %g1 + 0x10 ] } ts->TOD_watchdogs.last_snapshot = snapshot; 40018580: d2 26 20 74 st %o1, [ %i0 + 0x74 ] _ISR_Enable( level ); 40018584: 7f ff df 28 call 40010224 40018588: 90 10 00 1c mov %i4, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 4001858c: 90 06 20 68 add %i0, 0x68, %o0 40018590: 40 00 10 f8 call 4001c970 <_Watchdog_Insert> 40018594: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 40018598: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 4001859c: 80 a0 60 00 cmp %g1, 0 400185a0: 12 80 00 04 bne 400185b0 <_Timer_server_Schedule_operation_method+0x148> 400185a4: 01 00 00 00 nop _Timer_server_Reset_tod_system_watchdog( ts ); 400185a8: 7f ff ff 24 call 40018238 <_Timer_server_Reset_tod_system_watchdog> 400185ac: 90 10 00 18 mov %i0, %o0 } } _Thread_Enable_dispatch(); 400185b0: 40 00 0d 72 call 4001bb78 <_Thread_Enable_dispatch> 400185b4: 81 e8 00 00 restore * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 400185b8: f0 06 20 78 ld [ %i0 + 0x78 ], %i0 400185bc: 40 00 02 49 call 40018ee0 <_Chain_Append> 400185c0: 81 e8 00 00 restore =============================================================================== 4000bb2c <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4000bb2c: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 4000bb30: d4 1e 40 00 ldd [ %i1 ], %o2 4000bb34: 80 92 80 0b orcc %o2, %o3, %g0 4000bb38: 32 80 00 06 bne,a 4000bb50 <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN 4000bb3c: d8 1e 00 00 ldd [ %i0 ], %o4 *_ival_percentage = 0; 4000bb40: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED *_fval_percentage = 0; 4000bb44: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 4000bb48: 81 c7 e0 08 ret <== NOT EXECUTED 4000bb4c: 81 e8 00 00 restore <== NOT EXECUTED * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4000bb50: 83 2b 20 02 sll %o4, 2, %g1 4000bb54: 87 2b 60 02 sll %o5, 2, %g3 4000bb58: 89 33 60 1e srl %o5, 0x1e, %g4 4000bb5c: bb 28 e0 05 sll %g3, 5, %i5 4000bb60: 84 11 00 01 or %g4, %g1, %g2 4000bb64: 83 30 e0 1b srl %g3, 0x1b, %g1 4000bb68: b9 28 a0 05 sll %g2, 5, %i4 4000bb6c: 86 a7 40 03 subcc %i5, %g3, %g3 4000bb70: b8 10 40 1c or %g1, %i4, %i4 4000bb74: 84 67 00 02 subx %i4, %g2, %g2 4000bb78: b2 80 c0 0d addcc %g3, %o5, %i1 4000bb7c: b0 40 80 0c addx %g2, %o4, %i0 4000bb80: 83 36 60 1e srl %i1, 0x1e, %g1 4000bb84: 87 2e 60 02 sll %i1, 2, %g3 4000bb88: 85 2e 20 02 sll %i0, 2, %g2 4000bb8c: 84 10 40 02 or %g1, %g2, %g2 4000bb90: ba 86 40 03 addcc %i1, %g3, %i5 4000bb94: b8 46 00 02 addx %i0, %g2, %i4 4000bb98: 83 37 60 1e srl %i5, 0x1e, %g1 4000bb9c: 87 2f 60 02 sll %i5, 2, %g3 4000bba0: 85 2f 20 02 sll %i4, 2, %g2 4000bba4: 84 10 40 02 or %g1, %g2, %g2 4000bba8: 92 87 40 03 addcc %i5, %g3, %o1 4000bbac: 90 47 00 02 addx %i4, %g2, %o0 4000bbb0: 87 32 60 1b srl %o1, 0x1b, %g3 4000bbb4: 85 2a 20 05 sll %o0, 5, %g2 4000bbb8: 83 2a 60 05 sll %o1, 5, %g1 4000bbbc: 90 10 c0 02 or %g3, %g2, %o0 4000bbc0: 40 00 39 e6 call 4001a358 <__divdi3> 4000bbc4: 92 10 00 01 mov %g1, %o1 *_ival_percentage = answer / 1000; 4000bbc8: 94 10 20 00 clr %o2 * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4000bbcc: b8 10 00 08 mov %o0, %i4 4000bbd0: ba 10 00 09 mov %o1, %i5 *_ival_percentage = answer / 1000; 4000bbd4: 40 00 39 e1 call 4001a358 <__divdi3> 4000bbd8: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 4000bbdc: 90 10 00 1c mov %i4, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4000bbe0: d2 26 80 00 st %o1, [ %i2 ] *_fval_percentage = answer % 1000; 4000bbe4: 94 10 20 00 clr %o2 4000bbe8: 92 10 00 1d mov %i5, %o1 4000bbec: 40 00 3a c6 call 4001a704 <__moddi3> 4000bbf0: 96 10 23 e8 mov 0x3e8, %o3 4000bbf4: d2 26 c0 00 st %o1, [ %i3 ] 4000bbf8: 81 c7 e0 08 ret 4000bbfc: 81 e8 00 00 restore =============================================================================== 4000a41c <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 4000a41c: 9d e3 bf 98 save %sp, -104, %sp uint32_t number_of_initial_extensions = 4000a420: 03 10 00 6d sethi %hi(0x4001b400), %g1 4000a424: c2 00 63 98 ld [ %g1 + 0x398 ], %g1 ! 4001b798 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 4000a428: 80 a0 60 00 cmp %g1, 0 4000a42c: 02 80 00 0a be 4000a454 <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN 4000a430: 91 28 60 02 sll %g1, 2, %o0 User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) 4000a434: 83 28 60 04 sll %g1, 4, %g1 { uint32_t number_of_initial_extensions = rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { User_extensions_Switch_control *initial_extension_switch_controls = 4000a438: 40 00 01 08 call 4000a858 <_Workspace_Allocate_or_fatal_error> 4000a43c: 90 20 40 08 sub %g1, %o0, %o0 number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000a440: 13 10 00 28 sethi %hi(0x4000a000), %o1 User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; 4000a444: d0 27 bf fc st %o0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000a448: 92 12 63 d8 or %o1, 0x3d8, %o1 4000a44c: 7f ff ff c4 call 4000a35c <_User_extensions_Iterate> 4000a450: 90 07 bf fc add %fp, -4, %o0 4000a454: 81 c7 e0 08 ret 4000a458: 81 e8 00 00 restore =============================================================================== 4000be64 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000be64: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000be68: 7f ff dc 22 call 40002ef0 4000be6c: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000be70: c2 06 00 00 ld [ %i0 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000be74: b8 06 20 04 add %i0, 4, %i4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 4000be78: 80 a0 40 1c cmp %g1, %i4 4000be7c: 02 80 00 20 be 4000befc <_Watchdog_Adjust+0x98> 4000be80: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000be84: 02 80 00 1b be 4000bef0 <_Watchdog_Adjust+0x8c> 4000be88: b6 10 20 01 mov 1, %i3 4000be8c: 80 a6 60 01 cmp %i1, 1 4000be90: 12 80 00 1b bne 4000befc <_Watchdog_Adjust+0x98> <== NEVER TAKEN 4000be94: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000be98: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000be9c: 10 80 00 07 b 4000beb8 <_Watchdog_Adjust+0x54> 4000bea0: b4 00 80 1a add %g2, %i2, %i2 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 4000bea4: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000bea8: 80 a6 80 02 cmp %i2, %g2 4000beac: 3a 80 00 05 bcc,a 4000bec0 <_Watchdog_Adjust+0x5c> 4000beb0: f6 20 60 10 st %i3, [ %g1 + 0x10 ] _Watchdog_First( header )->delta_interval -= units; 4000beb4: b4 20 80 1a sub %g2, %i2, %i2 break; 4000beb8: 10 80 00 11 b 4000befc <_Watchdog_Adjust+0x98> 4000bebc: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } else { units -= _Watchdog_First( header )->delta_interval; 4000bec0: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); 4000bec4: 7f ff dc 0f call 40002f00 4000bec8: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000becc: 40 00 00 90 call 4000c10c <_Watchdog_Tickle> 4000bed0: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 4000bed4: 7f ff dc 07 call 40002ef0 4000bed8: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 4000bedc: c2 06 00 00 ld [ %i0 ], %g1 4000bee0: 80 a0 40 1c cmp %g1, %i4 4000bee4: 12 80 00 04 bne 4000bef4 <_Watchdog_Adjust+0x90> 4000bee8: 80 a6 a0 00 cmp %i2, 0 4000beec: 30 80 00 04 b,a 4000befc <_Watchdog_Adjust+0x98> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000bef0: 80 a6 a0 00 cmp %i2, 0 4000bef4: 32 bf ff ec bne,a 4000bea4 <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN 4000bef8: c2 06 00 00 ld [ %i0 ], %g1 } break; } } _ISR_Enable( level ); 4000befc: 7f ff dc 01 call 40002f00 4000bf00: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000a5bc <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4000a5bc: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4000a5c0: 7f ff de ba call 400020a8 4000a5c4: ba 10 00 18 mov %i0, %i5 previous_state = the_watchdog->state; 4000a5c8: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 4000a5cc: 80 a6 20 01 cmp %i0, 1 4000a5d0: 22 80 00 1e be,a 4000a648 <_Watchdog_Remove+0x8c> 4000a5d4: c0 27 60 08 clr [ %i5 + 8 ] 4000a5d8: 0a 80 00 1d bcs 4000a64c <_Watchdog_Remove+0x90> 4000a5dc: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000a5e0: 80 a6 20 03 cmp %i0, 3 4000a5e4: 18 80 00 1a bgu 4000a64c <_Watchdog_Remove+0x90> <== NEVER TAKEN 4000a5e8: 01 00 00 00 nop RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 4000a5ec: 10 80 00 02 b 4000a5f4 <_Watchdog_Remove+0x38> 4000a5f0: c2 07 40 00 ld [ %i5 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4000a5f4: c0 27 60 08 clr [ %i5 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4000a5f8: c4 00 40 00 ld [ %g1 ], %g2 4000a5fc: 80 a0 a0 00 cmp %g2, 0 4000a600: 02 80 00 07 be 4000a61c <_Watchdog_Remove+0x60> 4000a604: 05 10 00 78 sethi %hi(0x4001e000), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 4000a608: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000a60c: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 4000a610: 84 00 c0 02 add %g3, %g2, %g2 4000a614: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 4000a618: 05 10 00 78 sethi %hi(0x4001e000), %g2 4000a61c: c4 00 a2 e4 ld [ %g2 + 0x2e4 ], %g2 ! 4001e2e4 <_Watchdog_Sync_count> 4000a620: 80 a0 a0 00 cmp %g2, 0 4000a624: 22 80 00 07 be,a 4000a640 <_Watchdog_Remove+0x84> 4000a628: c4 07 60 04 ld [ %i5 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 4000a62c: 05 10 00 79 sethi %hi(0x4001e400), %g2 4000a630: c6 00 a3 18 ld [ %g2 + 0x318 ], %g3 ! 4001e718 <_Per_CPU_Information+0x8> 4000a634: 05 10 00 78 sethi %hi(0x4001e000), %g2 4000a638: c6 20 a2 84 st %g3, [ %g2 + 0x284 ] ! 4001e284 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000a63c: c4 07 60 04 ld [ %i5 + 4 ], %g2 next->previous = previous; 4000a640: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 4000a644: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000a648: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000a64c: c2 00 62 e8 ld [ %g1 + 0x2e8 ], %g1 ! 4001e2e8 <_Watchdog_Ticks_since_boot> 4000a650: c2 27 60 18 st %g1, [ %i5 + 0x18 ] _ISR_Enable( level ); 4000a654: 7f ff de 99 call 400020b8 4000a658: 01 00 00 00 nop return( previous_state ); } 4000a65c: 81 c7 e0 08 ret 4000a660: 81 e8 00 00 restore =============================================================================== 4000b810 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4000b810: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4000b814: 7f ff dc 94 call 40002a64 4000b818: b8 10 00 18 mov %i0, %i4 4000b81c: b0 10 00 08 mov %o0, %i0 printk( "Watchdog Chain: %s %p\n", name, header ); 4000b820: 11 10 00 78 sethi %hi(0x4001e000), %o0 4000b824: 94 10 00 19 mov %i1, %o2 4000b828: 90 12 23 50 or %o0, 0x350, %o0 4000b82c: 7f ff e3 e5 call 400047c0 4000b830: 92 10 00 1c mov %i4, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000b834: fa 06 40 00 ld [ %i1 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000b838: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 4000b83c: 80 a7 40 19 cmp %i5, %i1 4000b840: 12 80 00 04 bne 4000b850 <_Watchdog_Report_chain+0x40> 4000b844: 92 10 00 1d mov %i5, %o1 _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4000b848: 10 80 00 0d b 4000b87c <_Watchdog_Report_chain+0x6c> 4000b84c: 11 10 00 78 sethi %hi(0x4001e000), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4000b850: 40 00 00 0f call 4000b88c <_Watchdog_Report> 4000b854: 90 10 20 00 clr %o0 _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; node != _Chain_Tail(header) ; node = node->next ) 4000b858: fa 07 40 00 ld [ %i5 ], %i5 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 4000b85c: 80 a7 40 19 cmp %i5, %i1 4000b860: 12 bf ff fc bne 4000b850 <_Watchdog_Report_chain+0x40> <== NEVER TAKEN 4000b864: 92 10 00 1d mov %i5, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4000b868: 11 10 00 78 sethi %hi(0x4001e000), %o0 4000b86c: 92 10 00 1c mov %i4, %o1 4000b870: 7f ff e3 d4 call 400047c0 4000b874: 90 12 23 68 or %o0, 0x368, %o0 4000b878: 30 80 00 03 b,a 4000b884 <_Watchdog_Report_chain+0x74> } else { printk( "Chain is empty\n" ); 4000b87c: 7f ff e3 d1 call 400047c0 4000b880: 90 12 23 78 or %o0, 0x378, %o0 } _ISR_Enable( level ); 4000b884: 7f ff dc 7c call 40002a74 4000b888: 81 e8 00 00 restore =============================================================================== 4000a664 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 4000a664: 9d e3 bf a0 save %sp, -96, %sp * 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 ); 4000a668: 7f ff de 90 call 400020a8 4000a66c: b8 10 00 18 mov %i0, %i4 4000a670: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000a674: fa 07 00 00 ld [ %i4 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000a678: b6 07 20 04 add %i4, 4, %i3 if ( _Chain_Is_empty( header ) ) 4000a67c: 80 a7 40 1b cmp %i5, %i3 4000a680: 02 80 00 1f be 4000a6fc <_Watchdog_Tickle+0x98> 4000a684: 01 00 00 00 nop * 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) { 4000a688: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000a68c: 80 a0 60 00 cmp %g1, 0 4000a690: 02 80 00 06 be 4000a6a8 <_Watchdog_Tickle+0x44> <== NEVER TAKEN 4000a694: 82 00 7f ff add %g1, -1, %g1 the_watchdog->delta_interval--; 4000a698: c2 27 60 10 st %g1, [ %i5 + 0x10 ] if ( the_watchdog->delta_interval != 0 ) 4000a69c: 80 a0 60 00 cmp %g1, 0 4000a6a0: 12 80 00 17 bne 4000a6fc <_Watchdog_Tickle+0x98> 4000a6a4: 01 00 00 00 nop goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4000a6a8: 7f ff ff c5 call 4000a5bc <_Watchdog_Remove> 4000a6ac: 90 10 00 1d mov %i5, %o0 4000a6b0: b4 10 00 08 mov %o0, %i2 _ISR_Enable( level ); 4000a6b4: 7f ff de 81 call 400020b8 4000a6b8: 90 10 00 18 mov %i0, %o0 switch( watchdog_state ) { 4000a6bc: 80 a6 a0 02 cmp %i2, 2 4000a6c0: 12 80 00 06 bne 4000a6d8 <_Watchdog_Tickle+0x74> 4000a6c4: 01 00 00 00 nop case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4000a6c8: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4000a6cc: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 4000a6d0: 9f c0 40 00 call %g1 4000a6d4: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4000a6d8: 7f ff de 74 call 400020a8 4000a6dc: 01 00 00 00 nop 4000a6e0: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a6e4: fa 07 00 00 ld [ %i4 ], %i5 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4000a6e8: 80 a7 40 1b cmp %i5, %i3 4000a6ec: 02 80 00 04 be 4000a6fc <_Watchdog_Tickle+0x98> 4000a6f0: 01 00 00 00 nop } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4000a6f4: 10 bf ff ea b 4000a69c <_Watchdog_Tickle+0x38> 4000a6f8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4000a6fc: 7f ff de 6f call 400020b8 4000a700: 81 e8 00 00 restore =============================================================================== 4000a704 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 4000a704: 9d e3 bf a0 save %sp, -96, %sp Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 4000a708: 05 10 00 6d sethi %hi(0x4001b400), %g2 4000a70c: 82 10 a3 58 or %g2, 0x358, %g1 ! 4001b758 4000a710: c6 08 60 32 ldub [ %g1 + 0x32 ], %g3 4000a714: fa 00 a3 58 ld [ %g2 + 0x358 ], %i5 4000a718: 80 a0 e0 00 cmp %g3, 0 4000a71c: 12 80 00 03 bne 4000a728 <_Workspace_Handler_initialization+0x24> 4000a720: 84 10 20 00 clr %g2 4000a724: c4 00 60 04 ld [ %g1 + 4 ], %g2 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 4000a728: 21 10 00 20 sethi %hi(0x40008000), %l0 } else { size = 0; } } space_available = (*init_or_extend)( 4000a72c: 27 10 00 78 sethi %hi(0x4001e000), %l3 size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 4000a730: ba 00 80 1d add %g2, %i5, %i5 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000a734: b6 10 20 00 clr %i3 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 4000a738: a0 14 21 5c or %l0, 0x15c, %l0 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 4000a73c: e2 08 60 30 ldub [ %g1 + 0x30 ], %l1 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { 4000a740: e4 08 60 31 ldub [ %g1 + 0x31 ], %l2 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000a744: 10 80 00 2c b 4000a7f4 <_Workspace_Handler_initialization+0xf0> 4000a748: a6 14 e2 10 or %l3, 0x210, %l3 Heap_Area *area = &areas [i]; if ( do_zero ) { 4000a74c: 22 80 00 07 be,a 4000a768 <_Workspace_Handler_initialization+0x64> 4000a750: f8 06 20 04 ld [ %i0 + 4 ], %i4 memset( area->begin, 0, area->size ); 4000a754: d0 06 00 00 ld [ %i0 ], %o0 4000a758: d4 06 20 04 ld [ %i0 + 4 ], %o2 4000a75c: 40 00 13 52 call 4000f4a4 4000a760: 92 10 20 00 clr %o1 } if ( area->size > overhead ) { 4000a764: f8 06 20 04 ld [ %i0 + 4 ], %i4 4000a768: 80 a7 20 16 cmp %i4, 0x16 4000a76c: 28 80 00 21 bleu,a 4000a7f0 <_Workspace_Handler_initialization+0xec> 4000a770: b6 06 e0 01 inc %i3 uintptr_t space_available; uintptr_t size; if ( unified ) { 4000a774: 80 a4 a0 00 cmp %l2, 0 4000a778: 32 80 00 0c bne,a 4000a7a8 <_Workspace_Handler_initialization+0xa4> 4000a77c: d2 06 00 00 ld [ %i0 ], %o1 size = area->size; } else { if ( remaining > 0 ) { 4000a780: 80 a7 60 00 cmp %i5, 0 4000a784: 22 80 00 08 be,a 4000a7a4 <_Workspace_Handler_initialization+0xa0><== NEVER TAKEN 4000a788: b8 10 20 00 clr %i4 <== NOT EXECUTED size = remaining < area->size - overhead ? 4000a78c: 82 07 3f ea add %i4, -22, %g1 remaining + overhead : area->size; 4000a790: 80 a7 40 01 cmp %i5, %g1 4000a794: 2a 80 00 04 bcs,a 4000a7a4 <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN 4000a798: b8 07 60 16 add %i5, 0x16, %i4 } else { size = 0; } } space_available = (*init_or_extend)( 4000a79c: 10 80 00 03 b 4000a7a8 <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED 4000a7a0: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED 4000a7a4: d2 06 00 00 ld [ %i0 ], %o1 4000a7a8: 94 10 00 1c mov %i4, %o2 4000a7ac: 90 10 00 13 mov %l3, %o0 4000a7b0: 9f c4 00 00 call %l0 4000a7b4: 96 10 20 08 mov 8, %o3 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000a7b8: c2 06 00 00 ld [ %i0 ], %g1 area->size -= size; if ( space_available < remaining ) { 4000a7bc: 80 a2 00 1d cmp %o0, %i5 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000a7c0: 82 00 40 1c add %g1, %i4, %g1 4000a7c4: c2 26 00 00 st %g1, [ %i0 ] area->size -= size; 4000a7c8: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000a7cc: b8 20 40 1c sub %g1, %i4, %i4 if ( space_available < remaining ) { 4000a7d0: 1a 80 00 05 bcc 4000a7e4 <_Workspace_Handler_initialization+0xe0><== ALWAYS TAKEN 4000a7d4: f8 26 20 04 st %i4, [ %i0 + 4 ] remaining -= space_available; 4000a7d8: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 4000a7dc: 10 80 00 04 b 4000a7ec <_Workspace_Handler_initialization+0xe8><== NOT EXECUTED 4000a7e0: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED 4000a7e4: a0 10 00 1a mov %i2, %l0 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4000a7e8: ba 10 20 00 clr %i5 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000a7ec: b6 06 e0 01 inc %i3 4000a7f0: b0 06 20 08 add %i0, 8, %i0 4000a7f4: 80 a6 c0 19 cmp %i3, %i1 4000a7f8: 12 bf ff d5 bne 4000a74c <_Workspace_Handler_initialization+0x48> 4000a7fc: 80 a4 60 00 cmp %l1, 0 init_or_extend = extend; } } if ( remaining > 0 ) { 4000a800: 80 a7 60 00 cmp %i5, 0 4000a804: 02 80 00 05 be 4000a818 <_Workspace_Handler_initialization+0x114> 4000a808: 90 10 20 00 clr %o0 _Internal_error_Occurred( 4000a80c: 92 10 20 01 mov 1, %o1 4000a810: 7f ff f6 e6 call 400083a8 <_Internal_error_Occurred> 4000a814: 94 10 20 02 mov 2, %o2 4000a818: 81 c7 e0 08 ret 4000a81c: 81 e8 00 00 restore =============================================================================== 40006cfc : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 40006cfc: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 40006d00: 3b 10 00 60 sethi %hi(0x40018000), %i5 40006d04: 40 00 04 68 call 40007ea4 40006d08: 90 17 62 74 or %i5, 0x274, %o0 ! 40018274 if (fcntl (fildes, F_GETFD) < 0) { 40006d0c: 90 10 00 18 mov %i0, %o0 40006d10: 40 00 1a 1d call 4000d584 40006d14: 92 10 20 01 mov 1, %o1 40006d18: 80 a2 20 00 cmp %o0, 0 40006d1c: 16 80 00 08 bge 40006d3c 40006d20: 80 a6 60 00 cmp %i1, 0 pthread_mutex_unlock(&aio_request_queue.mutex); 40006d24: 40 00 04 81 call 40007f28 40006d28: 90 17 62 74 or %i5, 0x274, %o0 rtems_set_errno_and_return_minus_one (EBADF); 40006d2c: 40 00 27 4d call 40010a60 <__errno> 40006d30: 01 00 00 00 nop 40006d34: 10 80 00 54 b 40006e84 40006d38: 82 10 20 09 mov 9, %g1 ! 9 } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 40006d3c: 32 80 00 35 bne,a 40006e10 40006d40: f8 06 40 00 ld [ %i1 ], %i4 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 40006d44: 11 10 00 60 sethi %hi(0x40018000), %o0 40006d48: 92 10 00 18 mov %i0, %o1 40006d4c: 90 12 22 bc or %o0, 0x2bc, %o0 40006d50: 40 00 01 71 call 40007314 40006d54: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40006d58: b8 92 20 00 orcc %o0, 0, %i4 40006d5c: 12 80 00 20 bne 40006ddc 40006d60: b6 07 20 1c add %i4, 0x1c, %i3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40006d64: ba 17 62 74 or %i5, 0x274, %i5 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40006d68: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 40006d6c: 82 07 60 58 add %i5, 0x58, %g1 40006d70: 80 a0 80 01 cmp %g2, %g1 40006d74: 02 80 00 08 be 40006d94 <== NEVER TAKEN 40006d78: 92 10 00 18 mov %i0, %o1 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 40006d7c: 90 07 60 54 add %i5, 0x54, %o0 40006d80: 40 00 01 65 call 40007314 40006d84: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40006d88: b8 92 20 00 orcc %o0, 0, %i4 40006d8c: 12 80 00 08 bne 40006dac 40006d90: 01 00 00 00 nop pthread_mutex_unlock(&aio_request_queue.mutex); 40006d94: 11 10 00 60 sethi %hi(0x40018000), %o0 return AIO_ALLDONE; 40006d98: b0 10 20 02 mov 2, %i0 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock(&aio_request_queue.mutex); 40006d9c: 40 00 04 63 call 40007f28 40006da0: 90 12 22 74 or %o0, 0x274, %o0 return AIO_ALLDONE; 40006da4: 81 c7 e0 08 ret 40006da8: 81 e8 00 00 restore */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40006dac: 40 00 0a cf call 400098e8 <_Chain_Extract> 40006db0: b6 07 20 1c add %i4, 0x1c, %i3 } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 40006db4: 40 00 01 80 call 400073b4 40006db8: 90 10 00 1c mov %i4, %o0 pthread_mutex_destroy (&r_chain->mutex); 40006dbc: 40 00 03 8d call 40007bf0 40006dc0: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->mutex); 40006dc4: 40 00 02 ae call 4000787c 40006dc8: 90 10 00 1b mov %i3, %o0 free (r_chain); 40006dcc: 7f ff f1 45 call 400032e0 40006dd0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40006dd4: 10 80 00 0b b 40006e00 40006dd8: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 40006ddc: 40 00 04 32 call 40007ea4 40006de0: 90 10 00 1b mov %i3, %o0 40006de4: 40 00 0a c1 call 400098e8 <_Chain_Extract> 40006de8: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 40006dec: 40 00 01 72 call 400073b4 40006df0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&r_chain->mutex); 40006df4: 40 00 04 4d call 40007f28 40006df8: 90 10 00 1b mov %i3, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40006dfc: 90 17 62 74 or %i5, 0x274, %o0 40006e00: 40 00 04 4a call 40007f28 40006e04: b0 10 20 00 clr %i0 return AIO_CANCELED; 40006e08: 81 c7 e0 08 ret 40006e0c: 81 e8 00 00 restore } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 40006e10: 80 a7 00 18 cmp %i4, %i0 40006e14: 12 80 00 17 bne 40006e70 40006e18: 90 17 62 74 or %i5, 0x274, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 40006e1c: 11 10 00 60 sethi %hi(0x40018000), %o0 40006e20: 92 10 00 1c mov %i4, %o1 40006e24: 90 12 22 bc or %o0, 0x2bc, %o0 40006e28: 40 00 01 3b call 40007314 40006e2c: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40006e30: b6 92 20 00 orcc %o0, 0, %i3 40006e34: 32 80 00 1c bne,a 40006ea4 40006e38: b8 06 e0 1c add %i3, 0x1c, %i4 40006e3c: ba 17 62 74 or %i5, 0x274, %i5 if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40006e40: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 40006e44: 82 07 60 58 add %i5, 0x58, %g1 40006e48: 80 a0 80 01 cmp %g2, %g1 40006e4c: 02 bf ff d2 be 40006d94 <== NEVER TAKEN 40006e50: 92 10 00 1c mov %i4, %o1 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 40006e54: 90 07 60 54 add %i5, 0x54, %o0 40006e58: 40 00 01 2f call 40007314 40006e5c: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40006e60: 80 a2 20 00 cmp %o0, 0 40006e64: 12 80 00 0b bne 40006e90 40006e68: 90 02 20 08 add %o0, 8, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40006e6c: 90 10 00 1d mov %i5, %o0 40006e70: 40 00 04 2e call 40007f28 40006e74: 01 00 00 00 nop rtems_set_errno_and_return_minus_one (EINVAL); 40006e78: 40 00 26 fa call 40010a60 <__errno> 40006e7c: 01 00 00 00 nop 40006e80: 82 10 20 16 mov 0x16, %g1 ! 16 40006e84: c2 22 00 00 st %g1, [ %o0 ] 40006e88: 81 c7 e0 08 ret 40006e8c: 91 e8 3f ff restore %g0, -1, %o0 } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40006e90: 40 00 01 5d call 40007404 40006e94: 92 10 00 19 mov %i1, %o1 40006e98: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&aio_request_queue.mutex); 40006e9c: 10 80 00 0b b 40006ec8 40006ea0: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 40006ea4: 40 00 04 00 call 40007ea4 40006ea8: 90 10 00 1c mov %i4, %o0 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40006eac: 92 10 00 19 mov %i1, %o1 40006eb0: 40 00 01 55 call 40007404 40006eb4: 90 06 e0 08 add %i3, 8, %o0 40006eb8: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&r_chain->mutex); 40006ebc: 40 00 04 1b call 40007f28 40006ec0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40006ec4: 90 17 62 74 or %i5, 0x274, %o0 40006ec8: 40 00 04 18 call 40007f28 40006ecc: 01 00 00 00 nop return result; } return AIO_ALLDONE; } 40006ed0: 81 c7 e0 08 ret 40006ed4: 81 e8 00 00 restore =============================================================================== 40006ee0 : int aio_fsync( int op, struct aiocb *aiocbp ) { 40006ee0: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; if (op != O_SYNC) 40006ee4: 03 00 00 08 sethi %hi(0x2000), %g1 40006ee8: 80 a6 00 01 cmp %i0, %g1 40006eec: 12 80 00 10 bne 40006f2c 40006ef0: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40006ef4: d0 06 40 00 ld [ %i1 ], %o0 40006ef8: 40 00 19 a3 call 4000d584 40006efc: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40006f00: 90 0a 20 03 and %o0, 3, %o0 40006f04: 90 02 3f ff add %o0, -1, %o0 40006f08: 80 a2 20 01 cmp %o0, 1 40006f0c: 18 80 00 08 bgu 40006f2c 40006f10: ba 10 20 09 mov 9, %i5 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 40006f14: 7f ff f2 13 call 40003760 40006f18: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40006f1c: b0 92 20 00 orcc %o0, 0, %i0 40006f20: 32 80 00 09 bne,a 40006f44 <== ALWAYS TAKEN 40006f24: f2 26 20 14 st %i1, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40006f28: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED 40006f2c: 82 10 3f ff mov -1, %g1 40006f30: fa 26 60 34 st %i5, [ %i1 + 0x34 ] 40006f34: 40 00 26 cb call 40010a60 <__errno> 40006f38: c2 26 60 38 st %g1, [ %i1 + 0x38 ] 40006f3c: 10 80 00 06 b 40006f54 40006f40: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; 40006f44: 82 10 20 03 mov 3, %g1 40006f48: c2 26 60 30 st %g1, [ %i1 + 0x30 ] return rtems_aio_enqueue (req); 40006f4c: 40 00 01 4e call 40007484 40006f50: 81 e8 00 00 restore } 40006f54: 81 c7 e0 08 ret 40006f58: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4000769c : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 4000769c: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 400076a0: d0 06 00 00 ld [ %i0 ], %o0 400076a4: 92 10 20 03 mov 3, %o1 400076a8: 40 00 17 b7 call 4000d584 400076ac: ba 10 00 18 mov %i0, %i5 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 400076b0: 80 8a 20 01 btst 1, %o0 400076b4: 12 80 00 11 bne 400076f8 400076b8: b8 10 20 09 mov 9, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 400076bc: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 400076c0: 80 a0 60 00 cmp %g1, 0 400076c4: 22 80 00 04 be,a 400076d4 400076c8: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 400076cc: 10 80 00 0b b 400076f8 400076d0: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 400076d4: 80 a0 60 00 cmp %g1, 0 400076d8: 06 80 00 08 bl 400076f8 400076dc: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 400076e0: 7f ff f0 20 call 40003760 400076e4: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 400076e8: b0 92 20 00 orcc %o0, 0, %i0 400076ec: 32 80 00 09 bne,a 40007710 <== ALWAYS TAKEN 400076f0: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 400076f4: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 400076f8: 82 10 3f ff mov -1, %g1 400076fc: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 40007700: 40 00 24 d8 call 40010a60 <__errno> 40007704: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 40007708: 10 80 00 06 b 40007720 4000770c: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; 40007710: 82 10 20 01 mov 1, %g1 40007714: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 40007718: 7f ff ff 5b call 40007484 4000771c: 81 e8 00 00 restore } 40007720: 81 c7 e0 08 ret 40007724: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40007730 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 40007730: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40007734: d0 06 00 00 ld [ %i0 ], %o0 40007738: 40 00 17 93 call 4000d584 4000773c: 92 10 20 03 mov 3, %o1 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 40007740: ba 10 00 18 mov %i0, %i5 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40007744: 90 0a 20 03 and %o0, 3, %o0 40007748: 90 02 3f ff add %o0, -1, %o0 4000774c: 80 a2 20 01 cmp %o0, 1 40007750: 18 80 00 11 bgu 40007794 40007754: b8 10 20 09 mov 9, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 40007758: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000775c: 80 a0 60 00 cmp %g1, 0 40007760: 22 80 00 04 be,a 40007770 40007764: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 40007768: 10 80 00 0b b 40007794 4000776c: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 40007770: 80 a0 60 00 cmp %g1, 0 40007774: 06 80 00 08 bl 40007794 40007778: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 4000777c: 7f ff ef f9 call 40003760 40007780: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40007784: b0 92 20 00 orcc %o0, 0, %i0 40007788: 32 80 00 09 bne,a 400077ac <== ALWAYS TAKEN 4000778c: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40007790: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 40007794: 82 10 3f ff mov -1, %g1 40007798: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 4000779c: 40 00 24 b1 call 40010a60 <__errno> 400077a0: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 400077a4: 10 80 00 06 b 400077bc 400077a8: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; 400077ac: 82 10 20 02 mov 2, %g1 400077b0: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 400077b4: 7f ff ff 34 call 40007484 400077b8: 81 e8 00 00 restore } 400077bc: 81 c7 e0 08 ret 400077c0: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40006918 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 40006918: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 4000691c: 80 a6 60 00 cmp %i1, 0 40006920: 02 80 00 26 be 400069b8 40006924: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 40006928: 12 80 00 16 bne 40006980 4000692c: 80 a6 20 04 cmp %i0, 4 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 40006930: 90 07 bf f8 add %fp, -8, %o0 40006934: 13 10 00 65 sethi %hi(0x40019400), %o1 40006938: 40 00 08 1d call 400089ac <_TOD_Get_with_nanoseconds> 4000693c: 92 12 61 c8 or %o1, 0x1c8, %o1 ! 400195c8 <_TOD> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 40006940: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006944: 94 10 20 00 clr %o2 40006948: 90 10 00 1c mov %i4, %o0 4000694c: 92 10 00 1d mov %i5, %o1 40006950: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006954: 40 00 3c 14 call 400159a4 <__divdi3> 40006958: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 4000695c: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006960: d2 26 40 00 st %o1, [ %i1 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006964: 94 10 20 00 clr %o2 40006968: 92 10 00 1d mov %i5, %o1 4000696c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006970: 40 00 3c f8 call 40015d50 <__moddi3> 40006974: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 40006978: 10 80 00 06 b 40006990 4000697c: d2 26 60 04 st %o1, [ %i1 + 4 ] if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 40006980: 12 80 00 06 bne 40006998 <== ALWAYS TAKEN 40006984: 80 a6 20 02 cmp %i0, 2 _TOD_Get_uptime_as_timespec( tp ); 40006988: 40 00 08 1a call 400089f0 <_TOD_Get_uptime_as_timespec> 4000698c: 90 10 00 19 mov %i1, %o0 return 0; 40006990: 81 c7 e0 08 ret 40006994: 91 e8 20 00 restore %g0, 0, %o0 } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 40006998: 02 bf ff fc be 40006988 4000699c: 80 a6 20 03 cmp %i0, 3 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 400069a0: 12 80 00 06 bne 400069b8 400069a4: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 400069a8: 40 00 23 6d call 4000f75c <__errno> 400069ac: 01 00 00 00 nop 400069b0: 10 80 00 05 b 400069c4 400069b4: 82 10 20 58 mov 0x58, %g1 ! 58 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 400069b8: 40 00 23 69 call 4000f75c <__errno> 400069bc: 01 00 00 00 nop 400069c0: 82 10 20 16 mov 0x16, %g1 ! 16 400069c4: c2 22 00 00 st %g1, [ %o0 ] return 0; } 400069c8: 81 c7 e0 08 ret 400069cc: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40024e7c : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 40024e7c: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 40024e80: 82 96 60 00 orcc %i1, 0, %g1 40024e84: 02 80 00 4b be 40024fb0 <== NEVER TAKEN 40024e88: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 40024e8c: 12 80 00 41 bne 40024f90 40024e90: 80 a6 20 02 cmp %i0, 2 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 40024e94: c6 00 40 00 ld [ %g1 ], %g3 40024e98: 05 08 76 b9 sethi %hi(0x21dae400), %g2 40024e9c: 84 10 a0 ff or %g2, 0xff, %g2 ! 21dae4ff 40024ea0: 80 a0 c0 02 cmp %g3, %g2 40024ea4: 08 80 00 43 bleu 40024fb0 40024ea8: 05 10 01 8c sethi %hi(0x40063000), %g2 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40024eac: c6 00 a1 c0 ld [ %g2 + 0x1c0 ], %g3 ! 400631c0 <_Thread_Dispatch_disable_level> ++level; 40024eb0: 86 00 e0 01 inc %g3 _Thread_Dispatch_disable_level = level; 40024eb4: c6 20 a1 c0 st %g3, [ %g2 + 0x1c0 ] const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40024eb8: c6 00 40 00 ld [ %g1 ], %g3 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 40024ebc: 90 07 bf f8 add %fp, -8, %o0 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40024ec0: 85 38 e0 1f sra %g3, 0x1f, %g2 Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 40024ec4: 89 28 a0 03 sll %g2, 3, %g4 40024ec8: bb 28 e0 03 sll %g3, 3, %i5 40024ecc: b7 30 e0 1d srl %g3, 0x1d, %i3 40024ed0: b8 16 c0 04 or %i3, %g4, %i4 40024ed4: 89 37 60 1b srl %i5, 0x1b, %g4 40024ed8: b5 2f 20 05 sll %i4, 5, %i2 40024edc: b7 2f 60 05 sll %i5, 5, %i3 40024ee0: b4 11 00 1a or %g4, %i2, %i2 40024ee4: ba a6 c0 1d subcc %i3, %i5, %i5 40024ee8: 89 37 60 1a srl %i5, 0x1a, %g4 40024eec: b8 66 80 1c subx %i2, %i4, %i4 40024ef0: b7 2f 60 06 sll %i5, 6, %i3 40024ef4: b5 2f 20 06 sll %i4, 6, %i2 40024ef8: b6 a6 c0 1d subcc %i3, %i5, %i3 40024efc: b4 11 00 1a or %g4, %i2, %i2 40024f00: b4 66 80 1c subx %i2, %i4, %i2 40024f04: b2 86 c0 03 addcc %i3, %g3, %i1 40024f08: b0 46 80 02 addx %i2, %g2, %i0 40024f0c: 89 36 60 1e srl %i1, 0x1e, %g4 40024f10: 85 2e 20 02 sll %i0, 2, %g2 40024f14: 84 11 00 02 or %g4, %g2, %g2 40024f18: 87 2e 60 02 sll %i1, 2, %g3 40024f1c: ba 86 40 03 addcc %i1, %g3, %i5 40024f20: b8 46 00 02 addx %i0, %g2, %i4 40024f24: 89 37 60 1e srl %i5, 0x1e, %g4 40024f28: 85 2f 20 02 sll %i4, 2, %g2 40024f2c: 84 11 00 02 or %g4, %g2, %g2 40024f30: 87 2f 60 02 sll %i5, 2, %g3 40024f34: b6 87 40 03 addcc %i5, %g3, %i3 40024f38: b4 47 00 02 addx %i4, %g2, %i2 40024f3c: bb 2e e0 02 sll %i3, 2, %i5 40024f40: 85 36 e0 1e srl %i3, 0x1e, %g2 40024f44: 86 86 c0 1d addcc %i3, %i5, %g3 40024f48: b9 2e a0 02 sll %i2, 2, %i4 40024f4c: b8 10 80 1c or %g2, %i4, %i4 40024f50: 84 46 80 1c addx %i2, %i4, %g2 40024f54: bb 28 a0 09 sll %g2, 9, %i5 40024f58: b9 30 e0 17 srl %g3, 0x17, %i4 40024f5c: 84 17 00 1d or %i4, %i5, %g2 40024f60: fa 00 60 04 ld [ %g1 + 4 ], %i5 40024f64: 89 28 e0 09 sll %g3, 9, %g4 40024f68: b6 81 00 1d addcc %g4, %i5, %i3 40024f6c: b9 3f 60 1f sra %i5, 0x1f, %i4 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 40024f70: b0 10 20 00 clr %i0 40024f74: b4 40 80 1c addx %g2, %i4, %i2 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 40024f78: 40 00 04 4d call 400260ac <_TOD_Set_with_timestamp> 40024f7c: f4 3f bf f8 std %i2, [ %fp + -8 ] if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 40024f80: 7f ff 90 77 call 4000915c <_Thread_Enable_dispatch> 40024f84: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 40024f88: 81 c7 e0 08 ret 40024f8c: 81 e8 00 00 restore _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) 40024f90: 02 80 00 04 be 40024fa0 40024f94: 80 a6 20 03 cmp %i0, 3 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 40024f98: 12 80 00 06 bne 40024fb0 40024f9c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40024fa0: 40 00 44 a0 call 40036220 <__errno> 40024fa4: 01 00 00 00 nop 40024fa8: 10 80 00 05 b 40024fbc 40024fac: 82 10 20 58 mov 0x58, %g1 ! 58 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 40024fb0: 40 00 44 9c call 40036220 <__errno> 40024fb4: 01 00 00 00 nop 40024fb8: 82 10 20 16 mov 0x16, %g1 ! 16 40024fbc: c2 22 00 00 st %g1, [ %o0 ] return 0; } 40024fc0: 81 c7 e0 08 ret 40024fc4: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4001ad34 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4001ad34: 9d e3 bf 90 save %sp, -112, %sp POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4001ad38: 7f ff ff 1b call 4001a9a4 4001ad3c: 01 00 00 00 nop 4001ad40: 80 a6 00 08 cmp %i0, %o0 4001ad44: 02 80 00 06 be 4001ad5c 4001ad48: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 4001ad4c: 7f ff cf 48 call 4000ea6c <__errno> 4001ad50: 01 00 00 00 nop 4001ad54: 10 80 00 a6 b 4001afec 4001ad58: 82 10 20 03 mov 3, %g1 ! 3 /* * Validate the signal passed. */ if ( !sig ) 4001ad5c: 32 80 00 03 bne,a 4001ad68 4001ad60: ba 06 7f ff add %i1, -1, %i5 4001ad64: 30 80 00 04 b,a 4001ad74 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4001ad68: 80 a7 60 1f cmp %i5, 0x1f 4001ad6c: 28 80 00 06 bleu,a 4001ad84 4001ad70: 83 2e 60 02 sll %i1, 2, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 4001ad74: 7f ff cf 3e call 4000ea6c <__errno> 4001ad78: 01 00 00 00 nop 4001ad7c: 10 80 00 9c b 4001afec 4001ad80: 82 10 20 16 mov 0x16, %g1 ! 16 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 4001ad84: 85 2e 60 04 sll %i1, 4, %g2 4001ad88: 84 20 80 01 sub %g2, %g1, %g2 4001ad8c: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001ad90: 82 10 63 70 or %g1, 0x370, %g1 ! 4001e770 <_POSIX_signals_Vectors> 4001ad94: 82 00 40 02 add %g1, %g2, %g1 4001ad98: c2 00 60 08 ld [ %g1 + 8 ], %g1 4001ad9c: 80 a0 60 01 cmp %g1, 1 4001ada0: 02 80 00 9f be 4001b01c 4001ada4: 80 a6 60 04 cmp %i1, 4 /* * 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 ) ) 4001ada8: 02 80 00 06 be 4001adc0 4001adac: 80 a6 60 08 cmp %i1, 8 4001adb0: 02 80 00 04 be 4001adc0 4001adb4: 80 a6 60 0b cmp %i1, 0xb 4001adb8: 12 80 00 08 bne 4001add8 4001adbc: 82 10 20 01 mov 1, %g1 return pthread_kill( pthread_self(), sig ); 4001adc0: 40 00 01 33 call 4001b28c 4001adc4: 01 00 00 00 nop 4001adc8: 40 00 00 f4 call 4001b198 4001adcc: 92 10 00 19 mov %i1, %o1 4001add0: 81 c7 e0 08 ret 4001add4: 91 e8 00 08 restore %g0, %o0, %o0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4001add8: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 4001addc: c2 27 bf f8 st %g1, [ %fp + -8 ] if ( !value ) { 4001ade0: 80 a6 a0 00 cmp %i2, 0 4001ade4: 12 80 00 04 bne 4001adf4 4001ade8: bb 28 40 1d sll %g1, %i5, %i5 siginfo->si_value.sival_int = 0; 4001adec: 10 80 00 04 b 4001adfc 4001adf0: c0 27 bf fc clr [ %fp + -4 ] } else { siginfo->si_value = *value; 4001adf4: c2 06 80 00 ld [ %i2 ], %g1 4001adf8: c2 27 bf fc st %g1, [ %fp + -4 ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4001adfc: 03 10 00 78 sethi %hi(0x4001e000), %g1 4001ae00: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 4001e200 <_Thread_Dispatch_disable_level> ++level; 4001ae04: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4001ae08: c4 20 62 00 st %g2, [ %g1 + 0x200 ] */ void _POSIX_signals_Manager_Initialization(void); static inline void _POSIX_signals_Add_post_switch_extension(void) { _API_extensions_Add_post_switch( &_POSIX_signals_Post_switch ); 4001ae0c: 11 10 00 75 sethi %hi(0x4001d400), %o0 4001ae10: 7f ff b2 bb call 400078fc <_API_extensions_Add_post_switch> 4001ae14: 90 12 23 e8 or %o0, 0x3e8, %o0 ! 4001d7e8 <_POSIX_signals_Post_switch> /* * 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; 4001ae18: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001ae1c: d0 00 63 20 ld [ %g1 + 0x320 ], %o0 ! 4001e720 <_Per_CPU_Information+0x10> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 4001ae20: c4 02 21 50 ld [ %o0 + 0x150 ], %g2 4001ae24: c4 00 a0 d0 ld [ %g2 + 0xd0 ], %g2 4001ae28: 80 af 40 02 andncc %i5, %g2, %g0 4001ae2c: 12 80 00 52 bne 4001af74 4001ae30: 03 10 00 7a sethi %hi(0x4001e800), %g1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 4001ae34: 05 10 00 7a sethi %hi(0x4001e800), %g2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4001ae38: c2 00 60 fc ld [ %g1 + 0xfc ], %g1 4001ae3c: 10 80 00 0a b 4001ae64 4001ae40: 84 10 a1 00 or %g2, 0x100, %g2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4001ae44: 80 8f 40 04 btst %i5, %g4 4001ae48: 12 80 00 4a bne 4001af70 4001ae4c: c6 00 61 50 ld [ %g1 + 0x150 ], %g3 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4001ae50: c6 00 e0 d0 ld [ %g3 + 0xd0 ], %g3 4001ae54: 80 af 40 03 andncc %i5, %g3, %g0 4001ae58: 12 80 00 47 bne 4001af74 4001ae5c: 90 10 00 01 mov %g1, %o0 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 4001ae60: c2 00 40 00 ld [ %g1 ], %g1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 4001ae64: 80 a0 40 02 cmp %g1, %g2 4001ae68: 32 bf ff f7 bne,a 4001ae44 4001ae6c: c8 00 60 30 ld [ %g1 + 0x30 ], %g4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4001ae70: 03 10 00 75 sethi %hi(0x4001d400), %g1 4001ae74: c6 08 62 1c ldub [ %g1 + 0x21c ], %g3 ! 4001d61c for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 4001ae78: b8 10 20 02 mov 2, %i4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4001ae7c: 86 00 e0 01 inc %g3 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 4001ae80: 82 10 20 00 clr %g1 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4001ae84: 1b 10 00 78 sethi %hi(0x4001e000), %o5 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 4001ae88: 35 04 00 00 sethi %hi(0x10000000), %i2 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4001ae8c: 85 2f 20 02 sll %i4, 2, %g2 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4001ae90: 88 13 61 64 or %o5, 0x164, %g4 4001ae94: c4 01 00 02 ld [ %g4 + %g2 ], %g2 4001ae98: 80 a0 a0 00 cmp %g2, 0 4001ae9c: 22 80 00 2f be,a 4001af58 <== NEVER TAKEN 4001aea0: b8 07 20 01 inc %i4 <== NOT EXECUTED continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4001aea4: c4 00 a0 04 ld [ %g2 + 4 ], %g2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001aea8: b6 10 20 01 mov 1, %i3 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4001aeac: d8 10 a0 10 lduh [ %g2 + 0x10 ], %o4 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001aeb0: 10 80 00 26 b 4001af48 4001aeb4: d6 00 a0 1c ld [ %g2 + 0x1c ], %o3 the_thread = (Thread_Control *) object_table[ index ]; 4001aeb8: c4 02 c0 02 ld [ %o3 + %g2 ], %g2 if ( !the_thread ) 4001aebc: 80 a0 a0 00 cmp %g2, 0 4001aec0: 22 80 00 22 be,a 4001af48 4001aec4: b6 06 e0 01 inc %i3 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4001aec8: c8 00 a0 14 ld [ %g2 + 0x14 ], %g4 4001aecc: 80 a1 00 03 cmp %g4, %g3 4001aed0: 38 80 00 1e bgu,a 4001af48 4001aed4: b6 06 e0 01 inc %i3 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 4001aed8: f0 00 a1 50 ld [ %g2 + 0x150 ], %i0 4001aedc: f0 06 20 d0 ld [ %i0 + 0xd0 ], %i0 4001aee0: 80 af 40 18 andncc %i5, %i0, %g0 4001aee4: 22 80 00 19 be,a 4001af48 4001aee8: b6 06 e0 01 inc %i3 * * 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 ) { 4001aeec: 80 a1 00 03 cmp %g4, %g3 4001aef0: 2a 80 00 14 bcs,a 4001af40 4001aef4: 86 10 00 04 mov %g4, %g3 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 4001aef8: 80 a0 60 00 cmp %g1, 0 4001aefc: 22 80 00 13 be,a 4001af48 <== NEVER TAKEN 4001af00: b6 06 e0 01 inc %i3 <== NOT EXECUTED 4001af04: de 00 60 10 ld [ %g1 + 0x10 ], %o7 4001af08: 80 a3 e0 00 cmp %o7, 0 4001af0c: 22 80 00 0f be,a 4001af48 <== NEVER TAKEN 4001af10: b6 06 e0 01 inc %i3 <== NOT EXECUTED /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4001af14: f0 00 a0 10 ld [ %g2 + 0x10 ], %i0 4001af18: 80 a6 20 00 cmp %i0, 0 4001af1c: 22 80 00 09 be,a 4001af40 4001af20: 86 10 00 04 mov %g4, %g3 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4001af24: 80 8b c0 1a btst %o7, %i2 4001af28: 32 80 00 08 bne,a 4001af48 4001af2c: b6 06 e0 01 inc %i3 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4001af30: 80 8e 00 1a btst %i0, %i2 4001af34: 22 80 00 05 be,a 4001af48 4001af38: b6 06 e0 01 inc %i3 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4001af3c: 86 10 00 04 mov %g4, %g3 4001af40: 82 10 00 02 mov %g2, %g1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001af44: b6 06 e0 01 inc %i3 4001af48: 80 a6 c0 0c cmp %i3, %o4 4001af4c: 08 bf ff db bleu 4001aeb8 4001af50: 85 2e e0 02 sll %i3, 2, %g2 * + 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++) { 4001af54: b8 07 20 01 inc %i4 4001af58: 80 a7 20 04 cmp %i4, 4 4001af5c: 12 bf ff cd bne 4001ae90 4001af60: 85 2f 20 02 sll %i4, 2, %g2 } } } } if ( interested ) { 4001af64: 80 a0 60 00 cmp %g1, 0 4001af68: 02 80 00 0c be 4001af98 4001af6c: 01 00 00 00 nop /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4001af70: 90 10 00 01 mov %g1, %o0 /* * 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 ) ) { 4001af74: 92 10 00 19 mov %i1, %o1 4001af78: 40 00 00 36 call 4001b050 <_POSIX_signals_Unblock_thread> 4001af7c: 94 07 bf f4 add %fp, -12, %o2 4001af80: 80 8a 20 ff btst 0xff, %o0 4001af84: 02 80 00 05 be 4001af98 4001af88: 01 00 00 00 nop _Thread_Enable_dispatch(); 4001af8c: 7f ff ba 25 call 40009820 <_Thread_Enable_dispatch> 4001af90: b0 10 20 00 clr %i0 ! 0 4001af94: 30 80 00 23 b,a 4001b020 /* * 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 ); 4001af98: 40 00 00 24 call 4001b028 <_POSIX_signals_Set_process_signals> 4001af9c: 90 10 00 1d mov %i5, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4001afa0: 83 2e 60 02 sll %i1, 2, %g1 4001afa4: b3 2e 60 04 sll %i1, 4, %i1 4001afa8: b2 26 40 01 sub %i1, %g1, %i1 4001afac: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001afb0: 82 10 63 70 or %g1, 0x370, %g1 ! 4001e770 <_POSIX_signals_Vectors> 4001afb4: c2 00 40 19 ld [ %g1 + %i1 ], %g1 4001afb8: 80 a0 60 02 cmp %g1, 2 4001afbc: 12 bf ff f4 bne 4001af8c 4001afc0: 11 10 00 7a sethi %hi(0x4001e800), %o0 psiginfo = (POSIX_signals_Siginfo_node *) 4001afc4: 7f ff b2 b3 call 40007a90 <_Chain_Get> 4001afc8: 90 12 20 f0 or %o0, 0xf0, %o0 ! 4001e8f0 <_POSIX_signals_Inactive_siginfo> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4001afcc: ba 92 20 00 orcc %o0, 0, %i5 4001afd0: 12 80 00 0a bne 4001aff8 4001afd4: 92 07 bf f4 add %fp, -12, %o1 _Thread_Enable_dispatch(); 4001afd8: 7f ff ba 12 call 40009820 <_Thread_Enable_dispatch> 4001afdc: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 4001afe0: 7f ff ce a3 call 4000ea6c <__errno> 4001afe4: 01 00 00 00 nop 4001afe8: 82 10 20 0b mov 0xb, %g1 ! b 4001afec: c2 22 00 00 st %g1, [ %o0 ] 4001aff0: 81 c7 e0 08 ret 4001aff4: 91 e8 3f ff restore %g0, -1, %o0 } psiginfo->Info = *siginfo; 4001aff8: 90 07 60 08 add %i5, 8, %o0 4001affc: 7f ff d0 ed call 4000f3b0 4001b000: 94 10 20 0c mov 0xc, %o2 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4001b004: 11 10 00 7a sethi %hi(0x4001e800), %o0 4001b008: 92 10 00 1d mov %i5, %o1 4001b00c: 90 12 21 68 or %o0, 0x168, %o0 4001b010: 7f ff b2 94 call 40007a60 <_Chain_Append> 4001b014: 90 02 00 19 add %o0, %i1, %o0 4001b018: 30 bf ff dd b,a 4001af8c /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 4001b01c: b0 10 20 00 clr %i0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4001b020: 81 c7 e0 08 ret 4001b024: 81 e8 00 00 restore =============================================================================== 4000ba94 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 4000ba94: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 4000ba98: 80 a0 60 00 cmp %g1, 0 4000ba9c: 02 80 00 0f be 4000bad8 4000baa0: 90 10 20 16 mov 0x16, %o0 4000baa4: c4 00 40 00 ld [ %g1 ], %g2 4000baa8: 80 a0 a0 00 cmp %g2, 0 4000baac: 02 80 00 0b be 4000bad8 4000bab0: 80 a2 60 04 cmp %o1, 4 return EINVAL; switch ( policy ) { 4000bab4: 38 80 00 09 bgu,a 4000bad8 4000bab8: 90 10 20 86 mov 0x86, %o0 4000babc: 84 10 20 01 mov 1, %g2 4000bac0: 85 28 80 09 sll %g2, %o1, %g2 4000bac4: 80 88 a0 17 btst 0x17, %g2 4000bac8: 22 80 00 04 be,a 4000bad8 <== NEVER TAKEN 4000bacc: 90 10 20 86 mov 0x86, %o0 <== NOT EXECUTED case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 4000bad0: d2 20 60 14 st %o1, [ %g1 + 0x14 ] 4000bad4: 90 10 20 00 clr %o0 return 0; default: return ENOTSUP; } } 4000bad8: 81 c3 e0 08 retl =============================================================================== 40006eec : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 40006eec: 9d e3 bf 90 save %sp, -112, %sp const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 40006ef0: 80 a6 20 00 cmp %i0, 0 40006ef4: 12 80 00 04 bne 40006f04 40006ef8: 80 a6 a0 00 cmp %i2, 0 switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 40006efc: 81 c7 e0 08 ret 40006f00: 91 e8 20 16 restore %g0, 0x16, %o0 * Error check parameters */ if ( !barrier ) return EINVAL; if ( count == 0 ) 40006f04: 22 80 00 1e be,a 40006f7c 40006f08: b0 10 20 16 mov 0x16, %i0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 40006f0c: 80 a6 60 00 cmp %i1, 0 40006f10: 32 80 00 06 bne,a 40006f28 40006f14: c2 06 40 00 ld [ %i1 ], %g1 the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 40006f18: 90 07 bf f8 add %fp, -8, %o0 40006f1c: 7f ff ff bc call 40006e0c 40006f20: b2 07 bf f8 add %fp, -8, %i1 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 40006f24: c2 06 40 00 ld [ %i1 ], %g1 40006f28: 80 a0 60 00 cmp %g1, 0 40006f2c: 22 80 00 14 be,a 40006f7c 40006f30: b0 10 20 16 mov 0x16, %i0 return EINVAL; switch ( the_attr->process_shared ) { 40006f34: c2 06 60 04 ld [ %i1 + 4 ], %g1 40006f38: 80 a0 60 00 cmp %g1, 0 40006f3c: 32 80 00 10 bne,a 40006f7c <== NEVER TAKEN 40006f40: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40006f44: 03 10 00 5d sethi %hi(0x40017400), %g1 40006f48: c4 00 60 60 ld [ %g1 + 0x60 ], %g2 ! 40017460 <_Thread_Dispatch_disable_level> } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 40006f4c: c0 27 bf f0 clr [ %fp + -16 ] the_attributes.maximum_count = count; 40006f50: f4 27 bf f4 st %i2, [ %fp + -12 ] ++level; 40006f54: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40006f58: c4 20 60 60 st %g2, [ %g1 + 0x60 ] * 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 *) 40006f5c: 39 10 00 5d sethi %hi(0x40017400), %i4 40006f60: 40 00 08 68 call 40009100 <_Objects_Allocate> 40006f64: 90 17 23 e4 or %i4, 0x3e4, %o0 ! 400177e4 <_POSIX_Barrier_Information> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 40006f68: ba 92 20 00 orcc %o0, 0, %i5 40006f6c: 12 80 00 06 bne 40006f84 40006f70: 90 07 60 10 add %i5, 0x10, %o0 _Thread_Enable_dispatch(); 40006f74: 40 00 0d 2a call 4000a41c <_Thread_Enable_dispatch> 40006f78: b0 10 20 0b mov 0xb, %i0 40006f7c: 81 c7 e0 08 ret 40006f80: 81 e8 00 00 restore return EAGAIN; } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 40006f84: 40 00 05 dc call 400086f4 <_CORE_barrier_Initialize> 40006f88: 92 07 bf f0 add %fp, -16, %o1 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40006f8c: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40006f90: b8 17 23 e4 or %i4, 0x3e4, %i4 40006f94: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40006f98: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40006f9c: 85 28 a0 02 sll %g2, 2, %g2 40006fa0: fa 20 c0 02 st %i5, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40006fa4: c0 27 60 0c clr [ %i5 + 0xc ] ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 40006fa8: c2 26 00 00 st %g1, [ %i0 ] _Thread_Enable_dispatch(); 40006fac: 40 00 0d 1c call 4000a41c <_Thread_Enable_dispatch> 40006fb0: b0 10 20 00 clr %i0 40006fb4: 81 c7 e0 08 ret 40006fb8: 81 e8 00 00 restore =============================================================================== 400067dc : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 400067dc: 9d e3 bf a0 save %sp, -96, %sp /* * 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 ) 400067e0: 80 a6 20 00 cmp %i0, 0 400067e4: 02 80 00 12 be 4000682c 400067e8: 03 10 00 5e sethi %hi(0x40017800), %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400067ec: c4 00 61 c0 ld [ %g1 + 0x1c0 ], %g2 ! 400179c0 <_Thread_Dispatch_disable_level> ++level; 400067f0: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 400067f4: c4 20 61 c0 st %g2, [ %g1 + 0x1c0 ] return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 400067f8: 40 00 11 99 call 4000ae5c <_Workspace_Allocate> 400067fc: 90 10 20 10 mov 0x10, %o0 if ( handler ) { 40006800: 92 92 20 00 orcc %o0, 0, %o1 40006804: 02 80 00 08 be 40006824 <== NEVER TAKEN 40006808: 03 10 00 5f sethi %hi(0x40017c00), %g1 thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 4000680c: c2 00 62 e0 ld [ %g1 + 0x2e0 ], %g1 ! 40017ee0 <_Per_CPU_Information+0x10> handler_stack = &thread_support->Cancellation_Handlers; 40006810: d0 00 61 50 ld [ %g1 + 0x150 ], %o0 handler->routine = routine; 40006814: f0 22 60 08 st %i0, [ %o1 + 8 ] handler->arg = arg; 40006818: f2 22 60 0c st %i1, [ %o1 + 0xc ] _Chain_Append( handler_stack, &handler->Node ); 4000681c: 40 00 06 1e call 40008094 <_Chain_Append> 40006820: 90 02 20 e4 add %o0, 0xe4, %o0 } _Thread_Enable_dispatch(); 40006824: 40 00 0d 62 call 40009dac <_Thread_Enable_dispatch> 40006828: 81 e8 00 00 restore 4000682c: 81 c7 e0 08 ret 40006830: 81 e8 00 00 restore =============================================================================== 400077bc : */ int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 400077bc: 9d e3 bf a0 save %sp, -96, %sp POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 400077c0: 80 a6 60 00 cmp %i1, 0 400077c4: 32 80 00 05 bne,a 400077d8 400077c8: c4 06 60 04 ld [ %i1 + 4 ], %g2 else the_attr = &_POSIX_Condition_variables_Default_attributes; 400077cc: 33 10 00 5c sethi %hi(0x40017000), %i1 400077d0: b2 16 60 b4 or %i1, 0xb4, %i1 ! 400170b4 <_POSIX_Condition_variables_Default_attributes> /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 400077d4: c4 06 60 04 ld [ %i1 + 4 ], %g2 400077d8: 80 a0 a0 01 cmp %g2, 1 400077dc: 02 80 00 25 be 40007870 <== NEVER TAKEN 400077e0: 82 10 20 16 mov 0x16, %g1 return EINVAL; if ( !the_attr->is_initialized ) 400077e4: c4 06 40 00 ld [ %i1 ], %g2 400077e8: 80 a0 a0 00 cmp %g2, 0 400077ec: 02 80 00 21 be 40007870 400077f0: 01 00 00 00 nop * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400077f4: 03 10 00 61 sethi %hi(0x40018400), %g1 400077f8: c4 00 63 00 ld [ %g1 + 0x300 ], %g2 ! 40018700 <_Thread_Dispatch_disable_level> ++level; 400077fc: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40007800: c4 20 63 00 st %g2, [ %g1 + 0x300 ] */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 40007804: 39 10 00 62 sethi %hi(0x40018800), %i4 40007808: 40 00 0a 11 call 4000a04c <_Objects_Allocate> 4000780c: 90 17 23 1c or %i4, 0x31c, %o0 ! 40018b1c <_POSIX_Condition_variables_Information> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 40007810: ba 92 20 00 orcc %o0, 0, %i5 40007814: 32 80 00 06 bne,a 4000782c 40007818: c2 06 60 04 ld [ %i1 + 4 ], %g1 _Thread_Enable_dispatch(); 4000781c: 40 00 0e d3 call 4000b368 <_Thread_Enable_dispatch> 40007820: 01 00 00 00 nop return ENOMEM; 40007824: 10 80 00 13 b 40007870 40007828: 82 10 20 0c mov 0xc, %g1 ! c the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 4000782c: 90 07 60 18 add %i5, 0x18, %o0 if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 40007830: c2 27 60 10 st %g1, [ %i5 + 0x10 ] the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 40007834: 92 10 20 00 clr %o1 40007838: 15 04 00 02 sethi %hi(0x10000800), %o2 4000783c: 96 10 20 74 mov 0x74, %o3 40007840: 40 00 10 c1 call 4000bb44 <_Thread_queue_Initialize> 40007844: c0 27 60 14 clr [ %i5 + 0x14 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40007848: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000784c: b8 17 23 1c or %i4, 0x31c, %i4 40007850: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40007854: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40007858: 85 28 a0 02 sll %g2, 2, %g2 4000785c: fa 20 c0 02 st %i5, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40007860: c0 27 60 0c clr [ %i5 + 0xc ] 0 ); *cond = the_cond->Object.id; _Thread_Enable_dispatch(); 40007864: 40 00 0e c1 call 4000b368 <_Thread_Enable_dispatch> 40007868: c2 26 00 00 st %g1, [ %i0 ] return 0; 4000786c: 82 10 20 00 clr %g1 } 40007870: 81 c7 e0 08 ret 40007874: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000761c : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 4000761c: 82 10 00 08 mov %o0, %g1 if ( !attr || attr->is_initialized == false ) 40007620: 80 a0 60 00 cmp %g1, 0 40007624: 02 80 00 08 be 40007644 40007628: 90 10 20 16 mov 0x16, %o0 4000762c: c4 00 40 00 ld [ %g1 ], %g2 40007630: 80 a0 a0 00 cmp %g2, 0 40007634: 02 80 00 04 be 40007644 <== NEVER TAKEN 40007638: 01 00 00 00 nop return EINVAL; attr->is_initialized = false; 4000763c: c0 20 40 00 clr [ %g1 ] return 0; 40007640: 90 10 20 00 clr %o0 } 40007644: 81 c3 e0 08 retl =============================================================================== 40006bb4 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 40006bb4: 9d e3 bf 58 save %sp, -168, %sp int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 40006bb8: 80 a6 a0 00 cmp %i2, 0 40006bbc: 02 80 00 8c be 40006dec 40006bc0: ba 10 20 0e mov 0xe, %i5 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 40006bc4: 80 a6 60 00 cmp %i1, 0 40006bc8: 32 80 00 05 bne,a 40006bdc 40006bcc: c2 06 40 00 ld [ %i1 ], %g1 40006bd0: 33 10 00 75 sethi %hi(0x4001d400), %i1 40006bd4: b2 16 60 8c or %i1, 0x8c, %i1 ! 4001d48c <_POSIX_Threads_Default_attributes> if ( !the_attr->is_initialized ) 40006bd8: c2 06 40 00 ld [ %i1 ], %g1 40006bdc: 80 a0 60 00 cmp %g1, 0 40006be0: 02 80 00 83 be 40006dec 40006be4: ba 10 20 16 mov 0x16, %i5 * 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) ) 40006be8: c2 06 60 04 ld [ %i1 + 4 ], %g1 40006bec: 80 a0 60 00 cmp %g1, 0 40006bf0: 02 80 00 07 be 40006c0c 40006bf4: 03 10 00 78 sethi %hi(0x4001e000), %g1 40006bf8: c4 06 60 08 ld [ %i1 + 8 ], %g2 40006bfc: c2 00 60 b0 ld [ %g1 + 0xb0 ], %g1 40006c00: 80 a0 80 01 cmp %g2, %g1 40006c04: 2a 80 00 7b bcs,a 40006df0 40006c08: b0 10 00 1d mov %i5, %i0 * 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 ) { 40006c0c: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40006c10: 80 a0 60 01 cmp %g1, 1 40006c14: 02 80 00 06 be 40006c2c 40006c18: 80 a0 60 02 cmp %g1, 2 40006c1c: 32 80 00 74 bne,a 40006dec 40006c20: ba 10 20 16 mov 0x16, %i5 schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 40006c24: 10 80 00 09 b 40006c48 40006c28: e2 06 60 14 ld [ %i1 + 0x14 ], %l1 * 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 ]; 40006c2c: 03 10 00 7c sethi %hi(0x4001f000), %g1 40006c30: c2 00 61 80 ld [ %g1 + 0x180 ], %g1 ! 4001f180 <_Per_CPU_Information+0x10> schedpolicy = api->schedpolicy; schedparam = api->schedparam; 40006c34: 90 07 bf e4 add %fp, -28, %o0 * 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 ]; 40006c38: d2 00 61 50 ld [ %g1 + 0x150 ], %o1 schedpolicy = api->schedpolicy; 40006c3c: e2 02 60 84 ld [ %o1 + 0x84 ], %l1 schedparam = api->schedparam; 40006c40: 10 80 00 04 b 40006c50 40006c44: 92 02 60 88 add %o1, 0x88, %o1 break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 40006c48: 90 07 bf e4 add %fp, -28, %o0 40006c4c: 92 06 60 18 add %i1, 0x18, %o1 40006c50: 40 00 23 ed call 4000fc04 40006c54: 94 10 20 1c mov 0x1c, %o2 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 40006c58: c2 06 60 0c ld [ %i1 + 0xc ], %g1 40006c5c: 80 a0 60 00 cmp %g1, 0 40006c60: 12 80 00 63 bne 40006dec 40006c64: ba 10 20 86 mov 0x86, %i5 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 40006c68: 40 00 18 3c call 4000cd58 <_POSIX_Priority_Is_valid> 40006c6c: d0 07 bf e4 ld [ %fp + -28 ], %o0 40006c70: 80 8a 20 ff btst 0xff, %o0 40006c74: 02 80 00 5e be 40006dec <== NEVER TAKEN 40006c78: ba 10 20 16 mov 0x16, %i5 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 40006c7c: 03 10 00 78 sethi %hi(0x4001e000), %g1 return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 40006c80: e4 07 bf e4 ld [ %fp + -28 ], %l2 40006c84: e6 08 60 ac ldub [ %g1 + 0xac ], %l3 /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 40006c88: 90 10 00 11 mov %l1, %o0 40006c8c: 92 07 bf e4 add %fp, -28, %o1 40006c90: 94 07 bf dc add %fp, -36, %o2 40006c94: 40 00 18 3c call 4000cd84 <_POSIX_Thread_Translate_sched_param> 40006c98: 96 07 bf e0 add %fp, -32, %o3 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 40006c9c: ba 92 20 00 orcc %o0, 0, %i5 40006ca0: 32 80 00 54 bne,a 40006df0 40006ca4: b0 10 00 1d mov %i5, %i0 #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 40006ca8: 39 10 00 7b sethi %hi(0x4001ec00), %i4 40006cac: 40 00 06 36 call 40008584 <_API_Mutex_Lock> 40006cb0: d0 07 20 e0 ld [ %i4 + 0xe0 ], %o0 ! 4001ece0 <_RTEMS_Allocator_Mutex> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 40006cb4: 11 10 00 7b sethi %hi(0x4001ec00), %o0 40006cb8: 40 00 08 d2 call 40009000 <_Objects_Allocate> 40006cbc: 90 12 22 64 or %o0, 0x264, %o0 ! 4001ee64 <_POSIX_Threads_Information> * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 40006cc0: a0 92 20 00 orcc %o0, 0, %l0 40006cc4: 32 80 00 04 bne,a 40006cd4 40006cc8: c2 06 60 08 ld [ %i1 + 8 ], %g1 _RTEMS_Unlock_allocator(); 40006ccc: 10 80 00 21 b 40006d50 40006cd0: d0 07 20 e0 ld [ %i4 + 0xe0 ], %o0 static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 40006cd4: 05 10 00 78 sethi %hi(0x4001e000), %g2 40006cd8: d6 00 a0 b0 ld [ %g2 + 0xb0 ], %o3 ! 4001e0b0 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 40006cdc: c0 27 bf d4 clr [ %fp + -44 ] 40006ce0: 97 2a e0 01 sll %o3, 1, %o3 40006ce4: 80 a2 c0 01 cmp %o3, %g1 40006ce8: 1a 80 00 03 bcc 40006cf4 40006cec: d4 06 60 04 ld [ %i1 + 4 ], %o2 40006cf0: 96 10 00 01 mov %g1, %o3 40006cf4: 82 10 20 01 mov 1, %g1 40006cf8: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40006cfc: c2 07 bf dc ld [ %fp + -36 ], %g1 40006d00: 9a 0c e0 ff and %l3, 0xff, %o5 40006d04: c2 23 a0 60 st %g1, [ %sp + 0x60 ] 40006d08: c2 07 bf e0 ld [ %fp + -32 ], %g1 40006d0c: c0 23 a0 68 clr [ %sp + 0x68 ] 40006d10: c2 23 a0 64 st %g1, [ %sp + 0x64 ] 40006d14: 82 07 bf d4 add %fp, -44, %g1 40006d18: 39 10 00 7b sethi %hi(0x4001ec00), %i4 40006d1c: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 40006d20: 90 17 22 64 or %i4, 0x264, %o0 40006d24: 92 10 00 10 mov %l0, %o1 40006d28: 98 10 20 00 clr %o4 40006d2c: 40 00 0d b4 call 4000a3fc <_Thread_Initialize> 40006d30: 9a 23 40 12 sub %o5, %l2, %o5 budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 40006d34: 80 8a 20 ff btst 0xff, %o0 40006d38: 12 80 00 0a bne 40006d60 40006d3c: 90 17 22 64 or %i4, 0x264, %o0 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 40006d40: 40 00 09 8f call 4000937c <_Objects_Free> 40006d44: 92 10 00 10 mov %l0, %o1 _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 40006d48: 03 10 00 7b sethi %hi(0x4001ec00), %g1 40006d4c: d0 00 60 e0 ld [ %g1 + 0xe0 ], %o0 ! 4001ece0 <_RTEMS_Allocator_Mutex> 40006d50: 40 00 06 22 call 400085d8 <_API_Mutex_Unlock> 40006d54: ba 10 20 0b mov 0xb, %i5 */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 40006d58: 81 c7 e0 08 ret 40006d5c: 91 e8 00 1d restore %g0, %i5, %o0 } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 40006d60: f8 04 21 50 ld [ %l0 + 0x150 ], %i4 api->Attributes = *the_attr; 40006d64: 92 10 00 19 mov %i1, %o1 40006d68: 94 10 20 40 mov 0x40, %o2 40006d6c: 40 00 23 a6 call 4000fc04 40006d70: 90 10 00 1c mov %i4, %o0 api->detachstate = the_attr->detachstate; 40006d74: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 api->schedpolicy = schedpolicy; api->schedparam = schedparam; 40006d78: 92 07 bf e4 add %fp, -28, %o1 * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; 40006d7c: c2 27 20 40 st %g1, [ %i4 + 0x40 ] api->schedpolicy = schedpolicy; api->schedparam = schedparam; 40006d80: 94 10 20 1c mov 0x1c, %o2 */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; 40006d84: e2 27 20 84 st %l1, [ %i4 + 0x84 ] api->schedparam = schedparam; 40006d88: 40 00 23 9f call 4000fc04 40006d8c: 90 07 20 88 add %i4, 0x88, %o0 /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 40006d90: 90 10 00 10 mov %l0, %o0 40006d94: 92 10 20 01 mov 1, %o1 40006d98: 94 10 00 1a mov %i2, %o2 40006d9c: 96 10 00 1b mov %i3, %o3 40006da0: 40 00 0f d0 call 4000ace0 <_Thread_Start> 40006da4: 98 10 20 00 clr %o4 _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 40006da8: 80 a4 60 04 cmp %l1, 4 40006dac: 32 80 00 0a bne,a 40006dd4 40006db0: c2 04 20 08 ld [ %l0 + 8 ], %g1 _Watchdog_Insert_ticks( 40006db4: 40 00 0f f5 call 4000ad88 <_Timespec_To_ticks> 40006db8: 90 07 20 90 add %i4, 0x90, %o0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40006dbc: 92 07 20 a8 add %i4, 0xa8, %o1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40006dc0: d0 27 20 b4 st %o0, [ %i4 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40006dc4: 11 10 00 7b sethi %hi(0x4001ec00), %o0 40006dc8: 40 00 10 a5 call 4000b05c <_Watchdog_Insert> 40006dcc: 90 12 20 f8 or %o0, 0xf8, %o0 ! 4001ecf8 <_Watchdog_Ticks_chain> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 40006dd0: c2 04 20 08 ld [ %l0 + 8 ], %g1 40006dd4: c2 26 00 00 st %g1, [ %i0 ] _RTEMS_Unlock_allocator(); 40006dd8: 03 10 00 7b sethi %hi(0x4001ec00), %g1 40006ddc: 40 00 05 ff call 400085d8 <_API_Mutex_Unlock> 40006de0: d0 00 60 e0 ld [ %g1 + 0xe0 ], %o0 ! 4001ece0 <_RTEMS_Allocator_Mutex> return 0; } 40006de4: 81 c7 e0 08 ret 40006de8: 91 e8 00 1d restore %g0, %i5, %o0 40006dec: b0 10 00 1d mov %i5, %i0 40006df0: 81 c7 e0 08 ret 40006df4: 81 e8 00 00 restore =============================================================================== 4001b198 : int pthread_kill( pthread_t thread, int sig ) { 4001b198: 9d e3 bf 98 save %sp, -104, %sp POSIX_API_Control *api; Thread_Control *the_thread; Objects_Locations location; if ( !sig ) 4001b19c: 80 a6 60 00 cmp %i1, 0 4001b1a0: 32 80 00 03 bne,a 4001b1ac 4001b1a4: b8 06 7f ff add %i1, -1, %i4 4001b1a8: 30 80 00 04 b,a 4001b1b8 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4001b1ac: 80 a7 20 1f cmp %i4, 0x1f 4001b1b0: 28 80 00 06 bleu,a 4001b1c8 4001b1b4: 90 10 00 18 mov %i0, %o0 rtems_set_errno_and_return_minus_one( EINVAL ); 4001b1b8: 7f ff ce 2d call 4000ea6c <__errno> 4001b1bc: 01 00 00 00 nop 4001b1c0: 10 80 00 30 b 4001b280 4001b1c4: 82 10 20 16 mov 0x16, %g1 ! 16 the_thread = _Thread_Get( thread, &location ); 4001b1c8: 7f ff b9 a2 call 40009850 <_Thread_Get> 4001b1cc: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4001b1d0: c2 07 bf fc ld [ %fp + -4 ], %g1 4001b1d4: 80 a0 60 00 cmp %g1, 0 4001b1d8: 12 80 00 27 bne 4001b274 <== NEVER TAKEN 4001b1dc: ba 10 00 08 mov %o0, %i5 4001b1e0: 11 10 00 75 sethi %hi(0x4001d400), %o0 4001b1e4: 7f ff b1 c6 call 400078fc <_API_extensions_Add_post_switch> 4001b1e8: 90 12 23 e8 or %o0, 0x3e8, %o0 ! 4001d7e8 <_POSIX_signals_Post_switch> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 4001b1ec: 85 2e 60 02 sll %i1, 2, %g2 4001b1f0: 87 2e 60 04 sll %i1, 4, %g3 4001b1f4: 86 20 c0 02 sub %g3, %g2, %g3 4001b1f8: 05 10 00 79 sethi %hi(0x4001e400), %g2 4001b1fc: 84 10 a3 70 or %g2, 0x370, %g2 ! 4001e770 <_POSIX_signals_Vectors> 4001b200: 84 00 80 03 add %g2, %g3, %g2 4001b204: c4 00 a0 08 ld [ %g2 + 8 ], %g2 4001b208: 80 a0 a0 01 cmp %g2, 1 4001b20c: 12 80 00 06 bne 4001b224 4001b210: c2 07 61 50 ld [ %i5 + 0x150 ], %g1 _Thread_Enable_dispatch(); 4001b214: 7f ff b9 83 call 40009820 <_Thread_Enable_dispatch> 4001b218: b0 10 20 00 clr %i0 4001b21c: 81 c7 e0 08 ret 4001b220: 81 e8 00 00 restore return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 4001b224: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2 4001b228: b6 10 20 01 mov 1, %i3 (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 4001b22c: 90 10 00 1d mov %i5, %o0 4001b230: b9 2e c0 1c sll %i3, %i4, %i4 4001b234: 92 10 00 19 mov %i1, %o1 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 4001b238: b8 10 80 1c or %g2, %i4, %i4 (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 4001b23c: 94 10 20 00 clr %o2 4001b240: 7f ff ff 84 call 4001b050 <_POSIX_signals_Unblock_thread> 4001b244: f8 20 60 d4 st %i4, [ %g1 + 0xd4 ] if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4001b248: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001b24c: 82 10 63 10 or %g1, 0x310, %g1 ! 4001e710 <_Per_CPU_Information> 4001b250: c4 00 60 08 ld [ %g1 + 8 ], %g2 4001b254: 80 a0 a0 00 cmp %g2, 0 4001b258: 02 bf ff ef be 4001b214 4001b25c: 01 00 00 00 nop 4001b260: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4001b264: 80 a7 40 02 cmp %i5, %g2 4001b268: 22 bf ff eb be,a 4001b214 4001b26c: f6 28 60 0c stb %i3, [ %g1 + 0xc ] 4001b270: 30 bf ff e9 b,a 4001b214 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 4001b274: 7f ff cd fe call 4000ea6c <__errno> <== NOT EXECUTED 4001b278: 01 00 00 00 nop <== NOT EXECUTED 4001b27c: 82 10 20 03 mov 3, %g1 ! 3 <== NOT EXECUTED 4001b280: c2 22 00 00 st %g1, [ %o0 ] } 4001b284: 81 c7 e0 08 ret 4001b288: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40008d90 : */ int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime ) { 40008d90: 9d e3 bf 98 save %sp, -104, %sp * * 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 ); 40008d94: 92 07 bf fc add %fp, -4, %o1 40008d98: 40 00 00 37 call 40008e74 <_POSIX_Absolute_timeout_to_ticks> 40008d9c: 90 10 00 19 mov %i1, %o0 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 40008da0: d4 07 bf fc ld [ %fp + -4 ], %o2 * 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 ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40008da4: 82 1a 20 03 xor %o0, 3, %g1 40008da8: 80 a0 00 01 cmp %g0, %g1 * * 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 ); 40008dac: ba 10 00 08 mov %o0, %i5 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40008db0: b8 60 3f ff subx %g0, -1, %i4 do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 40008db4: 90 10 00 18 mov %i0, %o0 40008db8: 7f ff ff b7 call 40008c94 <_POSIX_Mutex_Lock_support> 40008dbc: 92 10 00 1c mov %i4, %o1 * This service only gives us the option to block. We used a polling * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { 40008dc0: 80 a7 20 00 cmp %i4, 0 40008dc4: 12 80 00 0c bne 40008df4 40008dc8: b0 10 00 08 mov %o0, %i0 40008dcc: 80 a2 20 10 cmp %o0, 0x10 40008dd0: 12 80 00 09 bne 40008df4 40008dd4: 80 a7 60 00 cmp %i5, 0 if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 40008dd8: 02 80 00 07 be 40008df4 <== NEVER TAKEN 40008ddc: b0 10 20 16 mov 0x16, %i0 return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40008de0: ba 07 7f ff add %i5, -1, %i5 40008de4: 80 a7 60 01 cmp %i5, 1 40008de8: 18 80 00 03 bgu 40008df4 <== NEVER TAKEN 40008dec: b0 10 20 10 mov 0x10, %i0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 40008df0: b0 10 20 74 mov 0x74, %i0 } return lock_status; } 40008df4: 81 c7 e0 08 ret 40008df8: 81 e8 00 00 restore =============================================================================== 4000651c : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 4000651c: 82 10 00 08 mov %o0, %g1 if ( !attr ) 40006520: 80 a0 60 00 cmp %g1, 0 40006524: 02 80 00 0b be 40006550 40006528: 90 10 20 16 mov 0x16, %o0 return EINVAL; if ( !attr->is_initialized ) 4000652c: c4 00 40 00 ld [ %g1 ], %g2 40006530: 80 a0 a0 00 cmp %g2, 0 40006534: 02 80 00 07 be 40006550 40006538: 80 a2 60 00 cmp %o1, 0 return EINVAL; if ( !type ) 4000653c: 02 80 00 05 be 40006550 <== NEVER TAKEN 40006540: 01 00 00 00 nop return EINVAL; *type = attr->type; 40006544: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 return 0; 40006548: 90 10 20 00 clr %o0 return EINVAL; if ( !type ) return EINVAL; *type = attr->type; 4000654c: c2 22 40 00 st %g1, [ %o1 ] return 0; } 40006550: 81 c3 e0 08 retl =============================================================================== 40008948 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 40008948: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 4000894c: 80 a0 60 00 cmp %g1, 0 40008950: 02 80 00 0a be 40008978 40008954: 90 10 20 16 mov 0x16, %o0 40008958: c4 00 40 00 ld [ %g1 ], %g2 4000895c: 80 a0 a0 00 cmp %g2, 0 40008960: 02 80 00 06 be 40008978 40008964: 80 a2 60 01 cmp %o1, 1 return EINVAL; switch ( pshared ) { 40008968: 18 80 00 04 bgu 40008978 <== NEVER TAKEN 4000896c: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 40008970: d2 20 60 04 st %o1, [ %g1 + 4 ] return 0; 40008974: 90 10 20 00 clr %o0 default: return EINVAL; } } 40008978: 81 c3 e0 08 retl =============================================================================== 40006588 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 40006588: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 4000658c: 80 a0 60 00 cmp %g1, 0 40006590: 02 80 00 0a be 400065b8 40006594: 90 10 20 16 mov 0x16, %o0 40006598: c4 00 40 00 ld [ %g1 ], %g2 4000659c: 80 a0 a0 00 cmp %g2, 0 400065a0: 02 80 00 06 be 400065b8 <== NEVER TAKEN 400065a4: 80 a2 60 03 cmp %o1, 3 return EINVAL; switch ( type ) { 400065a8: 18 80 00 04 bgu 400065b8 400065ac: 01 00 00 00 nop case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 400065b0: d2 20 60 10 st %o1, [ %g1 + 0x10 ] return 0; 400065b4: 90 10 20 00 clr %o0 default: return EINVAL; } } 400065b8: 81 c3 e0 08 retl =============================================================================== 4000723c : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 4000723c: 9d e3 bf 98 save %sp, -104, %sp if ( !once_control || !init_routine ) 40007240: 80 a6 60 00 cmp %i1, 0 40007244: 02 80 00 1c be 400072b4 40007248: ba 10 00 18 mov %i0, %i5 4000724c: 80 a6 20 00 cmp %i0, 0 40007250: 22 80 00 17 be,a 400072ac 40007254: b0 10 20 16 mov 0x16, %i0 return EINVAL; if ( !once_control->init_executed ) { 40007258: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000725c: 80 a0 60 00 cmp %g1, 0 40007260: 12 80 00 13 bne 400072ac 40007264: b0 10 20 00 clr %i0 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 40007268: 90 10 21 00 mov 0x100, %o0 4000726c: 92 10 21 00 mov 0x100, %o1 40007270: 40 00 03 0d call 40007ea4 40007274: 94 07 bf fc add %fp, -4, %o2 if ( !once_control->init_executed ) { 40007278: c2 07 60 04 ld [ %i5 + 4 ], %g1 4000727c: 80 a0 60 00 cmp %g1, 0 40007280: 12 80 00 07 bne 4000729c <== NEVER TAKEN 40007284: d0 07 bf fc ld [ %fp + -4 ], %o0 once_control->is_initialized = true; 40007288: 82 10 20 01 mov 1, %g1 4000728c: c2 27 40 00 st %g1, [ %i5 ] once_control->init_executed = true; (*init_routine)(); 40007290: 9f c6 40 00 call %i1 40007294: c2 27 60 04 st %g1, [ %i5 + 4 ] } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 40007298: d0 07 bf fc ld [ %fp + -4 ], %o0 4000729c: 92 10 21 00 mov 0x100, %o1 400072a0: 94 07 bf fc add %fp, -4, %o2 400072a4: 40 00 03 00 call 40007ea4 400072a8: b0 10 20 00 clr %i0 400072ac: 81 c7 e0 08 ret 400072b0: 81 e8 00 00 restore pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) return EINVAL; 400072b4: b0 10 20 16 mov 0x16, %i0 (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; } 400072b8: 81 c7 e0 08 ret 400072bc: 81 e8 00 00 restore =============================================================================== 4000765c : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 4000765c: 9d e3 bf 90 save %sp, -112, %sp const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 40007660: 80 a6 20 00 cmp %i0, 0 40007664: 12 80 00 04 bne 40007674 40007668: 80 a6 60 00 cmp %i1, 0 switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 4000766c: 81 c7 e0 08 ret 40007670: 91 e8 20 16 restore %g0, 0x16, %o0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 40007674: 32 80 00 06 bne,a 4000768c 40007678: c2 06 40 00 ld [ %i1 ], %g1 the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 4000767c: 90 07 bf f8 add %fp, -8, %o0 40007680: 40 00 01 b0 call 40007d40 40007684: b2 07 bf f8 add %fp, -8, %i1 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 40007688: c2 06 40 00 ld [ %i1 ], %g1 4000768c: 80 a0 60 00 cmp %g1, 0 40007690: 22 80 00 13 be,a 400076dc <== NEVER TAKEN 40007694: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED return EINVAL; switch ( the_attr->process_shared ) { 40007698: c2 06 60 04 ld [ %i1 + 4 ], %g1 4000769c: 80 a0 60 00 cmp %g1, 0 400076a0: 32 80 00 0f bne,a 400076dc <== NEVER TAKEN 400076a4: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400076a8: 03 10 00 8b sethi %hi(0x40022c00), %g1 400076ac: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ! 40022c10 <_Thread_Dispatch_disable_level> */ RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes( CORE_RWLock_Attributes *the_attributes ) { the_attributes->XXX = 0; 400076b0: c0 27 bf f4 clr [ %fp + -12 ] ++level; 400076b4: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 400076b8: c4 20 60 10 st %g2, [ %g1 + 0x10 ] * 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 *) 400076bc: 39 10 00 8b sethi %hi(0x40022c00), %i4 400076c0: 40 00 0a 7e call 4000a0b8 <_Objects_Allocate> 400076c4: 90 17 22 14 or %i4, 0x214, %o0 ! 40022e14 <_POSIX_RWLock_Information> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 400076c8: ba 92 20 00 orcc %o0, 0, %i5 400076cc: 12 80 00 06 bne 400076e4 400076d0: 90 07 60 10 add %i5, 0x10, %o0 _Thread_Enable_dispatch(); 400076d4: 40 00 0f 79 call 4000b4b8 <_Thread_Enable_dispatch> 400076d8: b0 10 20 0b mov 0xb, %i0 400076dc: 81 c7 e0 08 ret 400076e0: 81 e8 00 00 restore return EAGAIN; } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 400076e4: 40 00 08 dd call 40009a58 <_CORE_RWLock_Initialize> 400076e8: 92 07 bf f4 add %fp, -12, %o1 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 400076ec: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400076f0: b8 17 22 14 or %i4, 0x214, %i4 400076f4: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 400076f8: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400076fc: 85 28 a0 02 sll %g2, 2, %g2 40007700: fa 20 c0 02 st %i5, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40007704: c0 27 60 0c clr [ %i5 + 0xc ] &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 40007708: c2 26 00 00 st %g1, [ %i0 ] _Thread_Enable_dispatch(); 4000770c: 40 00 0f 6b call 4000b4b8 <_Thread_Enable_dispatch> 40007710: b0 10 20 00 clr %i0 40007714: 81 c7 e0 08 ret 40007718: 81 e8 00 00 restore =============================================================================== 40007d10 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 40007d10: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 40007d14: 80 a6 20 00 cmp %i0, 0 40007d18: 12 80 00 04 bne 40007d28 40007d1c: 92 07 bf fc add %fp, -4, %o1 #endif case OBJECTS_ERROR: break; } return EINVAL; 40007d20: 81 c7 e0 08 ret 40007d24: 91 e8 20 16 restore %g0, 0x16, %o0 * * 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 ); 40007d28: 40 00 18 ff call 4000e124 <_POSIX_Absolute_timeout_to_ticks> 40007d2c: 90 10 00 19 mov %i1, %o0 40007d30: d2 06 00 00 ld [ %i0 ], %o1 40007d34: ba 10 00 08 mov %o0, %i5 40007d38: 94 07 bf f8 add %fp, -8, %o2 40007d3c: 11 10 00 67 sethi %hi(0x40019c00), %o0 40007d40: 40 00 0b 1e call 4000a9b8 <_Objects_Get> 40007d44: 90 12 22 44 or %o0, 0x244, %o0 ! 40019e44 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 40007d48: c2 07 bf f8 ld [ %fp + -8 ], %g1 40007d4c: 80 a0 60 00 cmp %g1, 0 40007d50: 32 80 00 21 bne,a 40007dd4 40007d54: b0 10 20 16 mov 0x16, %i0 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 40007d58: d2 06 00 00 ld [ %i0 ], %o1 40007d5c: d6 07 bf fc ld [ %fp + -4 ], %o3 * 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 ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40007d60: 82 1f 60 03 xor %i5, 3, %g1 the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 40007d64: 90 02 20 10 add %o0, 0x10, %o0 40007d68: 80 a0 00 01 cmp %g0, %g1 40007d6c: 98 10 20 00 clr %o4 40007d70: b8 60 3f ff subx %g0, -1, %i4 40007d74: 40 00 07 8c call 40009ba4 <_CORE_RWLock_Obtain_for_reading> 40007d78: 94 10 00 1c mov %i4, %o2 do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 40007d7c: 40 00 0e 90 call 4000b7bc <_Thread_Enable_dispatch> 40007d80: 01 00 00 00 nop if ( !do_wait ) { 40007d84: 80 a7 20 00 cmp %i4, 0 40007d88: 12 80 00 0e bne 40007dc0 40007d8c: 03 10 00 68 sethi %hi(0x4001a000), %g1 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 40007d90: c2 00 61 a0 ld [ %g1 + 0x1a0 ], %g1 ! 4001a1a0 <_Per_CPU_Information+0x10> 40007d94: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 40007d98: 80 a0 60 02 cmp %g1, 2 40007d9c: 32 80 00 0a bne,a 40007dc4 40007da0: 03 10 00 68 sethi %hi(0x4001a000), %g1 if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 40007da4: 80 a7 60 00 cmp %i5, 0 40007da8: 22 80 00 0b be,a 40007dd4 <== NEVER TAKEN 40007dac: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40007db0: ba 07 7f ff add %i5, -1, %i5 40007db4: 80 a7 60 01 cmp %i5, 1 40007db8: 08 80 00 07 bleu 40007dd4 <== ALWAYS TAKEN 40007dbc: b0 10 20 74 mov 0x74, %i0 return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 40007dc0: 03 10 00 68 sethi %hi(0x4001a000), %g1 40007dc4: c2 00 61 a0 ld [ %g1 + 0x1a0 ], %g1 ! 4001a1a0 <_Per_CPU_Information+0x10> status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 40007dc8: 40 00 00 38 call 40007ea8 <_POSIX_RWLock_Translate_core_RWLock_return_code> 40007dcc: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 40007dd0: b0 10 00 08 mov %o0, %i0 case OBJECTS_ERROR: break; } return EINVAL; } 40007dd4: 81 c7 e0 08 ret 40007dd8: 81 e8 00 00 restore =============================================================================== 40007ddc : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 40007ddc: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 40007de0: 80 a6 20 00 cmp %i0, 0 40007de4: 12 80 00 04 bne 40007df4 40007de8: 92 07 bf fc add %fp, -4, %o1 #endif case OBJECTS_ERROR: break; } return EINVAL; 40007dec: 81 c7 e0 08 ret 40007df0: 91 e8 20 16 restore %g0, 0x16, %o0 * * 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 ); 40007df4: 40 00 18 cc call 4000e124 <_POSIX_Absolute_timeout_to_ticks> 40007df8: 90 10 00 19 mov %i1, %o0 40007dfc: d2 06 00 00 ld [ %i0 ], %o1 40007e00: ba 10 00 08 mov %o0, %i5 40007e04: 94 07 bf f8 add %fp, -8, %o2 40007e08: 11 10 00 67 sethi %hi(0x40019c00), %o0 40007e0c: 40 00 0a eb call 4000a9b8 <_Objects_Get> 40007e10: 90 12 22 44 or %o0, 0x244, %o0 ! 40019e44 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 40007e14: c2 07 bf f8 ld [ %fp + -8 ], %g1 40007e18: 80 a0 60 00 cmp %g1, 0 40007e1c: 32 80 00 21 bne,a 40007ea0 40007e20: b0 10 20 16 mov 0x16, %i0 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 40007e24: d2 06 00 00 ld [ %i0 ], %o1 40007e28: d6 07 bf fc ld [ %fp + -4 ], %o3 * 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 ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40007e2c: 82 1f 60 03 xor %i5, 3, %g1 the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 40007e30: 90 02 20 10 add %o0, 0x10, %o0 40007e34: 80 a0 00 01 cmp %g0, %g1 40007e38: 98 10 20 00 clr %o4 40007e3c: b8 60 3f ff subx %g0, -1, %i4 40007e40: 40 00 07 8c call 40009c70 <_CORE_RWLock_Obtain_for_writing> 40007e44: 94 10 00 1c mov %i4, %o2 do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 40007e48: 40 00 0e 5d call 4000b7bc <_Thread_Enable_dispatch> 40007e4c: 01 00 00 00 nop if ( !do_wait && 40007e50: 80 a7 20 00 cmp %i4, 0 40007e54: 12 80 00 0e bne 40007e8c 40007e58: 03 10 00 68 sethi %hi(0x4001a000), %g1 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 40007e5c: c2 00 61 a0 ld [ %g1 + 0x1a0 ], %g1 ! 4001a1a0 <_Per_CPU_Information+0x10> ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 40007e60: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 40007e64: 80 a0 60 02 cmp %g1, 2 40007e68: 32 80 00 0a bne,a 40007e90 40007e6c: 03 10 00 68 sethi %hi(0x4001a000), %g1 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 40007e70: 80 a7 60 00 cmp %i5, 0 40007e74: 22 80 00 0b be,a 40007ea0 <== NEVER TAKEN 40007e78: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40007e7c: ba 07 7f ff add %i5, -1, %i5 40007e80: 80 a7 60 01 cmp %i5, 1 40007e84: 08 80 00 07 bleu 40007ea0 <== ALWAYS TAKEN 40007e88: b0 10 20 74 mov 0x74, %i0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 40007e8c: 03 10 00 68 sethi %hi(0x4001a000), %g1 40007e90: c2 00 61 a0 ld [ %g1 + 0x1a0 ], %g1 ! 4001a1a0 <_Per_CPU_Information+0x10> if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( 40007e94: 40 00 00 05 call 40007ea8 <_POSIX_RWLock_Translate_core_RWLock_return_code> 40007e98: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 40007e9c: b0 10 00 08 mov %o0, %i0 case OBJECTS_ERROR: break; } return EINVAL; } 40007ea0: 81 c7 e0 08 ret 40007ea4: 81 e8 00 00 restore =============================================================================== 40008634 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 40008634: 82 10 00 08 mov %o0, %g1 if ( !attr ) 40008638: 80 a0 60 00 cmp %g1, 0 4000863c: 02 80 00 0a be 40008664 40008640: 90 10 20 16 mov 0x16, %o0 return EINVAL; if ( !attr->is_initialized ) 40008644: c4 00 40 00 ld [ %g1 ], %g2 40008648: 80 a0 a0 00 cmp %g2, 0 4000864c: 02 80 00 06 be 40008664 40008650: 80 a2 60 01 cmp %o1, 1 return EINVAL; switch ( pshared ) { 40008654: 18 80 00 04 bgu 40008664 <== NEVER TAKEN 40008658: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 4000865c: d2 20 60 04 st %o1, [ %g1 + 4 ] return 0; 40008660: 90 10 20 00 clr %o0 default: return EINVAL; } } 40008664: 81 c3 e0 08 retl =============================================================================== 4000965c : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 4000965c: 9d e3 bf 90 save %sp, -112, %sp int rc; /* * Check all the parameters */ if ( !param ) 40009660: 80 a6 a0 00 cmp %i2, 0 40009664: 02 80 00 40 be 40009764 40009668: b6 10 20 16 mov 0x16, %i3 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 4000966c: 90 10 00 19 mov %i1, %o0 40009670: 92 10 00 1a mov %i2, %o1 40009674: 94 07 bf f4 add %fp, -12, %o2 40009678: 40 00 16 c1 call 4000f17c <_POSIX_Thread_Translate_sched_param> 4000967c: 96 07 bf f8 add %fp, -8, %o3 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 40009680: b6 92 20 00 orcc %o0, 0, %i3 40009684: 32 80 00 39 bne,a 40009768 40009688: b0 10 00 1b mov %i3, %i0 return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 4000968c: 90 10 00 18 mov %i0, %o0 40009690: 40 00 0b f2 call 4000c658 <_Thread_Get> 40009694: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40009698: c2 07 bf fc ld [ %fp + -4 ], %g1 4000969c: 80 a0 60 00 cmp %g1, 0 400096a0: 12 80 00 30 bne 40009760 400096a4: b8 10 00 08 mov %o0, %i4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 400096a8: fa 02 21 50 ld [ %o0 + 0x150 ], %i5 if ( api->schedpolicy == SCHED_SPORADIC ) 400096ac: c2 07 60 84 ld [ %i5 + 0x84 ], %g1 400096b0: 80 a0 60 04 cmp %g1, 4 400096b4: 32 80 00 05 bne,a 400096c8 400096b8: f2 27 60 84 st %i1, [ %i5 + 0x84 ] (void) _Watchdog_Remove( &api->Sporadic_timer ); 400096bc: 40 00 0f c9 call 4000d5e0 <_Watchdog_Remove> 400096c0: 90 07 60 a8 add %i5, 0xa8, %o0 api->schedpolicy = policy; 400096c4: f2 27 60 84 st %i1, [ %i5 + 0x84 ] api->schedparam = *param; 400096c8: 90 07 60 88 add %i5, 0x88, %o0 400096cc: 92 10 00 1a mov %i2, %o1 400096d0: 40 00 22 4b call 40011ffc 400096d4: 94 10 20 1c mov 0x1c, %o2 the_thread->budget_algorithm = budget_algorithm; 400096d8: c2 07 bf f4 ld [ %fp + -12 ], %g1 the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 400096dc: 80 a6 60 00 cmp %i1, 0 if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; 400096e0: c2 27 20 78 st %g1, [ %i4 + 0x78 ] the_thread->budget_callout = budget_callout; 400096e4: c2 07 bf f8 ld [ %fp + -8 ], %g1 switch ( api->schedpolicy ) { 400096e8: 06 80 00 1b bl 40009754 <== NEVER TAKEN 400096ec: c2 27 20 7c st %g1, [ %i4 + 0x7c ] 400096f0: 80 a6 60 02 cmp %i1, 2 400096f4: 04 80 00 07 ble 40009710 400096f8: 03 10 00 6c sethi %hi(0x4001b000), %g1 400096fc: 80 a6 60 04 cmp %i1, 4 40009700: 12 80 00 15 bne 40009754 <== NEVER TAKEN 40009704: 01 00 00 00 nop true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 40009708: 10 80 00 0d b 4000973c 4000970c: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 40009710: c2 00 63 a0 ld [ %g1 + 0x3a0 ], %g1 the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 40009714: 90 10 00 1c mov %i4, %o0 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 40009718: c2 27 20 74 st %g1, [ %i4 + 0x74 ] 4000971c: 03 10 00 6a sethi %hi(0x4001a800), %g1 40009720: d2 08 60 2c ldub [ %g1 + 0x2c ], %o1 ! 4001a82c 40009724: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 40009728: 94 10 20 01 mov 1, %o2 4000972c: 92 22 40 01 sub %o1, %g1, %o1 40009730: 40 00 0a a4 call 4000c1c0 <_Thread_Change_priority> 40009734: d2 27 20 18 st %o1, [ %i4 + 0x18 ] the_thread, the_thread->real_priority, true ); break; 40009738: 30 80 00 07 b,a 40009754 case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; _Watchdog_Remove( &api->Sporadic_timer ); 4000973c: 90 07 60 a8 add %i5, 0xa8, %o0 40009740: 40 00 0f a8 call 4000d5e0 <_Watchdog_Remove> 40009744: c2 27 60 a4 st %g1, [ %i5 + 0xa4 ] _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 40009748: 90 10 20 00 clr %o0 4000974c: 7f ff ff 7e call 40009544 <_POSIX_Threads_Sporadic_budget_TSR> 40009750: 92 10 00 1c mov %i4, %o1 break; } _Thread_Enable_dispatch(); 40009754: 40 00 0b b5 call 4000c628 <_Thread_Enable_dispatch> 40009758: b0 10 00 1b mov %i3, %i0 4000975c: 30 80 00 03 b,a 40009768 #endif case OBJECTS_ERROR: break; } return ESRCH; 40009760: b6 10 20 03 mov 3, %i3 } 40009764: b0 10 00 1b mov %i3, %i0 40009768: 81 c7 e0 08 ret 4000976c: 81 e8 00 00 restore =============================================================================== 40006f80 : /* * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 40006f80: 9d e3 bf a0 save %sp, -96, %sp * 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() ) 40006f84: 03 10 00 5f sethi %hi(0x40017c00), %g1 40006f88: 82 10 62 d0 or %g1, 0x2d0, %g1 ! 40017ed0 <_Per_CPU_Information> 40006f8c: c4 00 60 08 ld [ %g1 + 8 ], %g2 40006f90: 80 a0 a0 00 cmp %g2, 0 40006f94: 12 80 00 16 bne 40006fec <== NEVER TAKEN 40006f98: 05 10 00 5e sethi %hi(0x40017800), %g2 return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 40006f9c: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40006fa0: c6 00 a1 c0 ld [ %g2 + 0x1c0 ], %g3 40006fa4: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 ++level; 40006fa8: 86 00 e0 01 inc %g3 _Thread_Dispatch_disable_level = level; 40006fac: c6 20 a1 c0 st %g3, [ %g2 + 0x1c0 ] _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 40006fb0: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2 40006fb4: 80 a0 a0 00 cmp %g2, 0 40006fb8: 12 80 00 05 bne 40006fcc <== NEVER TAKEN 40006fbc: ba 10 20 00 clr %i5 40006fc0: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 40006fc4: 80 a0 00 01 cmp %g0, %g1 40006fc8: ba 40 20 00 addx %g0, 0, %i5 thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 40006fcc: 40 00 0b 78 call 40009dac <_Thread_Enable_dispatch> 40006fd0: 01 00 00 00 nop if ( cancel ) 40006fd4: 80 8f 60 ff btst 0xff, %i5 40006fd8: 02 80 00 05 be 40006fec 40006fdc: 03 10 00 5f sethi %hi(0x40017c00), %g1 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 40006fe0: f0 00 62 e0 ld [ %g1 + 0x2e0 ], %i0 ! 40017ee0 <_Per_CPU_Information+0x10> 40006fe4: 40 00 16 76 call 4000c9bc <_POSIX_Thread_Exit> 40006fe8: 93 e8 3f ff restore %g0, -1, %o1 40006fec: 81 c7 e0 08 ret 40006ff0: 81 e8 00 00 restore =============================================================================== 40007484 : * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 40007484: 9d e3 bf 78 save %sp, -136, %sp struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 40007488: 37 10 00 60 sethi %hi(0x40018000), %i3 * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 4000748c: ba 10 00 18 mov %i0, %i5 struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 40007490: 40 00 02 85 call 40007ea4 40007494: 90 16 e2 74 or %i3, 0x274, %o0 if (result != 0) { 40007498: b0 92 20 00 orcc %o0, 0, %i0 4000749c: 02 80 00 06 be 400074b4 <== ALWAYS TAKEN 400074a0: 01 00 00 00 nop free (req); 400074a4: 7f ff ef 8f call 400032e0 <== NOT EXECUTED 400074a8: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 400074ac: 81 c7 e0 08 ret <== NOT EXECUTED 400074b0: 81 e8 00 00 restore <== NOT EXECUTED return result; } /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); 400074b4: 40 00 04 90 call 400086f4 400074b8: b6 16 e2 74 or %i3, 0x274, %i3 400074bc: 92 07 bf e0 add %fp, -32, %o1 400074c0: 40 00 03 9d call 40008334 400074c4: 94 07 bf e4 add %fp, -28, %o2 req->caller_thread = pthread_self (); 400074c8: 40 00 04 8b call 400086f4 400074cc: 01 00 00 00 nop req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 400074d0: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400074d4: c6 07 bf e4 ld [ %fp + -28 ], %g3 400074d8: c4 00 60 18 ld [ %g1 + 0x18 ], %g2 /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); 400074dc: d0 27 60 10 st %o0, [ %i5 + 0x10 ] req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 400074e0: 84 20 c0 02 sub %g3, %g2, %g2 400074e4: c4 27 60 0c st %g2, [ %i5 + 0xc ] req->policy = policy; 400074e8: c4 07 bf e0 ld [ %fp + -32 ], %g2 400074ec: c4 27 60 08 st %g2, [ %i5 + 8 ] req->aiocbp->error_code = EINPROGRESS; 400074f0: 84 10 20 77 mov 0x77, %g2 400074f4: c4 20 60 34 st %g2, [ %g1 + 0x34 ] req->aiocbp->return_value = 0; if ((aio_request_queue.idle_threads == 0) && 400074f8: c4 06 e0 68 ld [ %i3 + 0x68 ], %g2 req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; req->policy = policy; req->aiocbp->error_code = EINPROGRESS; req->aiocbp->return_value = 0; 400074fc: c0 20 60 38 clr [ %g1 + 0x38 ] if ((aio_request_queue.idle_threads == 0) && 40007500: 80 a0 a0 00 cmp %g2, 0 40007504: 12 80 00 2e bne 400075bc <== NEVER TAKEN 40007508: d2 00 40 00 ld [ %g1 ], %o1 4000750c: c2 06 e0 64 ld [ %i3 + 0x64 ], %g1 40007510: 80 a0 60 04 cmp %g1, 4 40007514: 14 80 00 2b bg 400075c0 40007518: 11 10 00 60 sethi %hi(0x40018000), %o0 aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 4000751c: 90 06 e0 48 add %i3, 0x48, %o0 40007520: 7f ff ff 7d call 40007314 40007524: 94 10 20 01 mov 1, %o2 if (r_chain->new_fd == 1) { 40007528: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 if ((aio_request_queue.idle_threads == 0) && aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 4000752c: b8 10 00 08 mov %o0, %i4 if (r_chain->new_fd == 1) { 40007530: 80 a0 60 01 cmp %g1, 1 40007534: 12 80 00 1d bne 400075a8 40007538: b4 02 20 08 add %o0, 8, %i2 RTEMS_INLINE_ROUTINE void _Chain_Prepend( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert(_Chain_Head(the_chain), the_node); 4000753c: 92 10 00 1d mov %i5, %o1 40007540: 40 00 09 03 call 4000994c <_Chain_Insert> 40007544: 90 10 00 1a mov %i2, %o0 rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 40007548: 92 10 20 00 clr %o1 chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); if (r_chain->new_fd == 1) { rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 4000754c: c0 27 20 18 clr [ %i4 + 0x18 ] pthread_mutex_init (&r_chain->mutex, NULL); 40007550: 40 00 01 fd call 40007d44 40007554: 90 07 20 1c add %i4, 0x1c, %o0 pthread_cond_init (&r_chain->cond, NULL); 40007558: 92 10 20 00 clr %o1 4000755c: 40 00 00 ff call 40007958 40007560: 90 07 20 20 add %i4, 0x20, %o0 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 40007564: 90 07 bf dc add %fp, -36, %o0 40007568: 92 06 e0 08 add %i3, 8, %o1 4000756c: 15 10 00 1b sethi %hi(0x40006c00), %o2 40007570: 96 10 00 1c mov %i4, %o3 40007574: 40 00 02 df call 400080f0 40007578: 94 12 a3 5c or %o2, 0x35c, %o2 rtems_aio_handle, (void *) r_chain); if (result != 0) { 4000757c: ba 92 20 00 orcc %o0, 0, %i5 40007580: 22 80 00 07 be,a 4000759c <== ALWAYS TAKEN 40007584: c2 06 e0 64 ld [ %i3 + 0x64 ], %g1 pthread_mutex_unlock (&aio_request_queue.mutex); 40007588: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 4000758c: 40 00 02 67 call 40007f28 <== NOT EXECUTED 40007590: b0 10 00 1d mov %i5, %i0 <== NOT EXECUTED 40007594: 81 c7 e0 08 ret <== NOT EXECUTED 40007598: 81 e8 00 00 restore <== NOT EXECUTED return result; } ++aio_request_queue.active_threads; 4000759c: 82 00 60 01 inc %g1 400075a0: 10 80 00 3a b 40007688 400075a4: c2 26 e0 64 st %g1, [ %i3 + 0x64 ] } else { /* put request in the fd chain it belongs to */ pthread_mutex_lock (&r_chain->mutex); 400075a8: b6 02 20 1c add %o0, 0x1c, %i3 400075ac: 40 00 02 3e call 40007ea4 400075b0: 90 10 00 1b mov %i3, %o0 rtems_aio_insert_prio (&r_chain->perfd, req); 400075b4: 10 80 00 0c b 400075e4 400075b8: 90 10 00 1a mov %i2, %o0 else { /* the maximum number of threads has been already created even though some of them might be idle. The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 400075bc: 11 10 00 60 sethi %hi(0x40018000), %o0 <== NOT EXECUTED 400075c0: 94 10 20 00 clr %o2 400075c4: 7f ff ff 54 call 40007314 400075c8: 90 12 22 bc or %o0, 0x2bc, %o0 req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 400075cc: b8 92 20 00 orcc %o0, 0, %i4 400075d0: 02 80 00 0d be 40007604 400075d4: b6 07 20 1c add %i4, 0x1c, %i3 { pthread_mutex_lock (&r_chain->mutex); 400075d8: 40 00 02 33 call 40007ea4 400075dc: 90 10 00 1b mov %i3, %o0 rtems_aio_insert_prio (&r_chain->perfd, req); 400075e0: 90 07 20 08 add %i4, 8, %o0 400075e4: 7f ff fe fc call 400071d4 400075e8: 92 10 00 1d mov %i5, %o1 pthread_cond_signal (&r_chain->cond); 400075ec: 40 00 01 0a call 40007a14 400075f0: 90 07 20 20 add %i4, 0x20, %o0 pthread_mutex_unlock (&r_chain->mutex); 400075f4: 40 00 02 4d call 40007f28 400075f8: 90 10 00 1b mov %i3, %o0 if (aio_request_queue.idle_threads > 0) pthread_cond_signal (&aio_request_queue.new_req); } } pthread_mutex_unlock (&aio_request_queue.mutex); 400075fc: 10 80 00 24 b 4000768c 40007600: 11 10 00 60 sethi %hi(0x40018000), %o0 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 40007604: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40007608: 11 10 00 60 sethi %hi(0x40018000), %o0 4000760c: d2 00 40 00 ld [ %g1 ], %o1 40007610: 90 12 22 c8 or %o0, 0x2c8, %o0 40007614: 7f ff ff 40 call 40007314 40007618: 94 10 20 01 mov 1, %o2 if (r_chain->new_fd == 1) { 4000761c: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 40007620: b8 10 00 08 mov %o0, %i4 40007624: 92 10 00 1d mov %i5, %o1 if (r_chain->new_fd == 1) { 40007628: 80 a0 60 01 cmp %g1, 1 4000762c: 12 80 00 0d bne 40007660 40007630: 90 02 20 08 add %o0, 8, %o0 40007634: 40 00 08 c6 call 4000994c <_Chain_Insert> 40007638: 01 00 00 00 nop /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 4000763c: 90 07 20 1c add %i4, 0x1c, %o0 if (r_chain->new_fd == 1) { /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 40007640: c0 27 20 18 clr [ %i4 + 0x18 ] pthread_mutex_init (&r_chain->mutex, NULL); 40007644: 40 00 01 c0 call 40007d44 40007648: 92 10 20 00 clr %o1 pthread_cond_init (&r_chain->cond, NULL); 4000764c: 90 07 20 20 add %i4, 0x20, %o0 40007650: 40 00 00 c2 call 40007958 40007654: 92 10 20 00 clr %o1 } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); if (aio_request_queue.idle_threads > 0) 40007658: 10 80 00 05 b 4000766c 4000765c: 11 10 00 60 sethi %hi(0x40018000), %o0 r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); pthread_cond_init (&r_chain->cond, NULL); } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); 40007660: 7f ff fe dd call 400071d4 40007664: 01 00 00 00 nop if (aio_request_queue.idle_threads > 0) 40007668: 11 10 00 60 sethi %hi(0x40018000), %o0 4000766c: 90 12 22 74 or %o0, 0x274, %o0 ! 40018274 40007670: c2 02 20 68 ld [ %o0 + 0x68 ], %g1 40007674: 80 a0 60 00 cmp %g1, 0 40007678: 24 80 00 05 ble,a 4000768c <== ALWAYS TAKEN 4000767c: 11 10 00 60 sethi %hi(0x40018000), %o0 pthread_cond_signal (&aio_request_queue.new_req); 40007680: 40 00 00 e5 call 40007a14 <== NOT EXECUTED 40007684: 90 02 20 04 add %o0, 4, %o0 ! 40018004 <== NOT EXECUTED } } pthread_mutex_unlock (&aio_request_queue.mutex); 40007688: 11 10 00 60 sethi %hi(0x40018000), %o0 4000768c: 40 00 02 27 call 40007f28 40007690: 90 12 22 74 or %o0, 0x274, %o0 ! 40018274 return 0; } 40007694: 81 c7 e0 08 ret 40007698: 81 e8 00 00 restore =============================================================================== 40006f5c : * NULL - if error */ static void * rtems_aio_handle (void *arg) { 40006f5c: 9d e3 bf 78 save %sp, -136, %sp struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); 40006f60: 3b 10 00 60 sethi %hi(0x40018000), %i5 40006f64: ba 17 62 74 or %i5, 0x274, %i5 ! 40018274 pthread_cond_destroy (&r_chain->cond); free (r_chain); /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40006f68: b4 07 60 58 add %i5, 0x58, %i2 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 40006f6c: b2 07 60 4c add %i5, 0x4c, %i1 --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 40006f70: a0 07 60 04 add %i5, 4, %l0 /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 40006f74: b6 06 20 1c add %i0, 0x1c, %i3 40006f78: 40 00 03 cb call 40007ea4 40006f7c: 90 10 00 1b mov %i3, %o0 if (result != 0) 40006f80: 80 a2 20 00 cmp %o0, 0 40006f84: 12 80 00 91 bne 400071c8 <== NEVER TAKEN 40006f88: 82 06 20 0c add %i0, 0xc, %g1 40006f8c: f8 06 20 08 ld [ %i0 + 8 ], %i4 /* If the locked chain is not empty, take the first request extract it, unlock the chain and process the request, in this way the user can supply more requests to this fd chain */ if (!rtems_chain_is_empty (chain)) { 40006f90: 80 a7 00 01 cmp %i4, %g1 40006f94: 02 80 00 3b be 40007080 40006f98: 01 00 00 00 nop node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 40006f9c: 40 00 05 d6 call 400086f4 40006fa0: 01 00 00 00 nop 40006fa4: 92 07 bf d8 add %fp, -40, %o1 40006fa8: 40 00 04 e3 call 40008334 40006fac: 94 07 bf e4 add %fp, -28, %o2 param.sched_priority = req->priority; 40006fb0: c2 07 20 0c ld [ %i4 + 0xc ], %g1 pthread_setschedparam (pthread_self(), req->policy, ¶m); 40006fb4: 40 00 05 d0 call 400086f4 40006fb8: c2 27 bf e4 st %g1, [ %fp + -28 ] 40006fbc: d2 07 20 08 ld [ %i4 + 8 ], %o1 40006fc0: 40 00 05 d1 call 40008704 40006fc4: 94 07 bf e4 add %fp, -28, %o2 40006fc8: 40 00 0a 48 call 400098e8 <_Chain_Extract> 40006fcc: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); 40006fd0: 40 00 03 d6 call 40007f28 40006fd4: 90 10 00 1b mov %i3, %o0 switch (req->aiocbp->aio_lio_opcode) { 40006fd8: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 40006fdc: c4 00 60 30 ld [ %g1 + 0x30 ], %g2 40006fe0: 80 a0 a0 02 cmp %g2, 2 40006fe4: 22 80 00 10 be,a 40007024 40006fe8: c4 18 60 08 ldd [ %g1 + 8 ], %g2 40006fec: 80 a0 a0 03 cmp %g2, 3 40006ff0: 02 80 00 15 be 40007044 <== NEVER TAKEN 40006ff4: 80 a0 a0 01 cmp %g2, 1 40006ff8: 32 80 00 19 bne,a 4000705c <== NEVER TAKEN 40006ffc: f8 07 20 14 ld [ %i4 + 0x14 ], %i4 <== NOT EXECUTED case LIO_READ: AIO_printf ("read\n"); result = pread (req->aiocbp->aio_fildes, 40007000: c4 18 60 08 ldd [ %g1 + 8 ], %g2 40007004: d0 00 40 00 ld [ %g1 ], %o0 40007008: d2 00 60 10 ld [ %g1 + 0x10 ], %o1 4000700c: d4 00 60 14 ld [ %g1 + 0x14 ], %o2 40007010: 96 10 00 02 mov %g2, %o3 40007014: 40 00 29 7f call 40011610 40007018: 98 10 00 03 mov %g3, %o4 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 4000701c: 10 80 00 0d b 40007050 40007020: 80 a2 3f ff cmp %o0, -1 case LIO_WRITE: AIO_printf ("write\n"); result = pwrite (req->aiocbp->aio_fildes, 40007024: d0 00 40 00 ld [ %g1 ], %o0 40007028: d2 00 60 10 ld [ %g1 + 0x10 ], %o1 4000702c: d4 00 60 14 ld [ %g1 + 0x14 ], %o2 40007030: 96 10 00 02 mov %g2, %o3 40007034: 40 00 29 b5 call 40011708 40007038: 98 10 00 03 mov %g3, %o4 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 4000703c: 10 80 00 05 b 40007050 40007040: 80 a2 3f ff cmp %o0, -1 case LIO_SYNC: AIO_printf ("sync\n"); result = fsync (req->aiocbp->aio_fildes); 40007044: 40 00 19 ef call 4000d800 <== NOT EXECUTED 40007048: d0 00 40 00 ld [ %g1 ], %o0 <== NOT EXECUTED break; default: result = -1; } if (result == -1) { 4000704c: 80 a2 3f ff cmp %o0, -1 <== NOT EXECUTED 40007050: 32 80 00 09 bne,a 40007074 <== ALWAYS TAKEN 40007054: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 req->aiocbp->return_value = -1; 40007058: f8 07 20 14 ld [ %i4 + 0x14 ], %i4 <== NOT EXECUTED 4000705c: 82 10 3f ff mov -1, %g1 <== NOT EXECUTED req->aiocbp->error_code = errno; 40007060: 40 00 26 80 call 40010a60 <__errno> <== NOT EXECUTED 40007064: c2 27 20 38 st %g1, [ %i4 + 0x38 ] <== NOT EXECUTED 40007068: c2 02 00 00 ld [ %o0 ], %g1 <== NOT EXECUTED 4000706c: 10 bf ff c2 b 40006f74 <== NOT EXECUTED 40007070: c2 27 20 34 st %g1, [ %i4 + 0x34 ] <== NOT EXECUTED } else { req->aiocbp->return_value = result; 40007074: d0 20 60 38 st %o0, [ %g1 + 0x38 ] req->aiocbp->error_code = 0; 40007078: 10 bf ff bf b 40006f74 4000707c: c0 20 60 34 clr [ %g1 + 0x34 ] struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); 40007080: 40 00 03 aa call 40007f28 40007084: 90 10 00 1b mov %i3, %o0 pthread_mutex_lock (&aio_request_queue.mutex); 40007088: 40 00 03 87 call 40007ea4 4000708c: 90 10 00 1d mov %i5, %o0 if (rtems_chain_is_empty (chain)) 40007090: c2 06 20 08 ld [ %i0 + 8 ], %g1 40007094: 80 a0 40 1c cmp %g1, %i4 40007098: 12 80 00 48 bne 400071b8 <== NEVER TAKEN 4000709c: 92 07 bf dc add %fp, -36, %o1 { clock_gettime (CLOCK_REALTIME, &timeout); 400070a0: 40 00 01 c9 call 400077c4 400070a4: 90 10 20 01 mov 1, %o0 timeout.tv_sec += 3; 400070a8: c2 07 bf dc ld [ %fp + -36 ], %g1 timeout.tv_nsec = 0; 400070ac: c0 27 bf e0 clr [ %fp + -32 ] pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 400070b0: 82 00 60 03 add %g1, 3, %g1 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 400070b4: b8 06 20 20 add %i0, 0x20, %i4 pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 400070b8: c2 27 bf dc st %g1, [ %fp + -36 ] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 400070bc: 90 10 00 1c mov %i4, %o0 400070c0: 92 10 00 1d mov %i5, %o1 400070c4: 40 00 02 71 call 40007a88 400070c8: 94 07 bf dc add %fp, -36, %o2 &aio_request_queue.mutex, &timeout); /* If no requests were added to the chain we delete the fd chain from the queue and start working with idle fd chains */ if (result == ETIMEDOUT) { 400070cc: 80 a2 20 74 cmp %o0, 0x74 400070d0: 12 80 00 3a bne 400071b8 <== NEVER TAKEN 400070d4: 01 00 00 00 nop 400070d8: 40 00 0a 04 call 400098e8 <_Chain_Extract> 400070dc: 90 10 00 18 mov %i0, %o0 rtems_chain_extract (&r_chain->next_fd); pthread_mutex_destroy (&r_chain->mutex); 400070e0: 40 00 02 c4 call 40007bf0 400070e4: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->cond); 400070e8: 40 00 01 e5 call 4000787c 400070ec: 90 10 00 1c mov %i4, %o0 free (r_chain); 400070f0: 7f ff f0 7c call 400032e0 400070f4: 90 10 00 18 mov %i0, %o0 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 400070f8: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 400070fc: 80 a0 40 1a cmp %g1, %i2 40007100: 12 80 00 1b bne 4000716c 40007104: c2 07 60 68 ld [ %i5 + 0x68 ], %g1 AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); 40007108: 92 07 bf dc add %fp, -36, %o1 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; 4000710c: 82 00 60 01 inc %g1 40007110: c2 27 60 68 st %g1, [ %i5 + 0x68 ] --aio_request_queue.active_threads; 40007114: c2 07 60 64 ld [ %i5 + 0x64 ], %g1 clock_gettime (CLOCK_REALTIME, &timeout); 40007118: 90 10 20 01 mov 1, %o0 signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; 4000711c: 82 00 7f ff add %g1, -1, %g1 clock_gettime (CLOCK_REALTIME, &timeout); 40007120: 40 00 01 a9 call 400077c4 40007124: c2 27 60 64 st %g1, [ %i5 + 0x64 ] timeout.tv_sec += 3; 40007128: c2 07 bf dc ld [ %fp + -36 ], %g1 timeout.tv_nsec = 0; 4000712c: c0 27 bf e0 clr [ %fp + -32 ] AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 40007130: 82 00 60 03 add %g1, 3, %g1 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 40007134: 90 10 00 10 mov %l0, %o0 AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 40007138: c2 27 bf dc st %g1, [ %fp + -36 ] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 4000713c: 92 10 00 1d mov %i5, %o1 40007140: 40 00 02 52 call 40007a88 40007144: 94 07 bf dc add %fp, -36, %o2 &aio_request_queue.mutex, &timeout); /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { 40007148: 80 a2 20 74 cmp %o0, 0x74 4000714c: 12 80 00 08 bne 4000716c <== NEVER TAKEN 40007150: c2 07 60 68 ld [ %i5 + 0x68 ], %g1 AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; pthread_mutex_unlock (&aio_request_queue.mutex); 40007154: 90 10 00 1d mov %i5, %o0 /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; 40007158: 82 00 7f ff add %g1, -1, %g1 pthread_mutex_unlock (&aio_request_queue.mutex); 4000715c: 40 00 03 73 call 40007f28 40007160: c2 27 60 68 st %g1, [ %i5 + 0x68 ] } } AIO_printf ("Thread finished\n"); return NULL; } 40007164: 81 c7 e0 08 ret 40007168: 91 e8 20 00 restore %g0, 0, %o0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000716c: f0 07 60 54 ld [ %i5 + 0x54 ], %i0 } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 40007170: 82 00 7f ff add %g1, -1, %g1 40007174: c2 27 60 68 st %g1, [ %i5 + 0x68 ] ++aio_request_queue.active_threads; 40007178: c2 07 60 64 ld [ %i5 + 0x64 ], %g1 4000717c: 90 10 00 18 mov %i0, %o0 40007180: 82 00 60 01 inc %g1 40007184: 40 00 09 d9 call 400098e8 <_Chain_Extract> 40007188: c2 27 60 64 st %g1, [ %i5 + 0x64 ] 4000718c: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40007190: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 40007194: c6 00 60 14 ld [ %g1 + 0x14 ], %g3 40007198: 80 a0 c0 02 cmp %g3, %g2 4000719c: 16 80 00 04 bge 400071ac 400071a0: 80 a0 40 19 cmp %g1, %i1 400071a4: 32 bf ff fc bne,a 40007194 <== ALWAYS TAKEN 400071a8: c2 00 40 00 ld [ %g1 ], %g1 RTEMS_INLINE_ROUTINE void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ) { _Chain_Insert( after_node, the_node ); 400071ac: d0 00 60 04 ld [ %g1 + 4 ], %o0 400071b0: 40 00 09 e7 call 4000994c <_Chain_Insert> 400071b4: 92 10 00 18 mov %i0, %o1 } } /* If there was a request added in the initial fd chain then release the mutex and process it */ pthread_mutex_unlock (&aio_request_queue.mutex); 400071b8: 40 00 03 5c call 40007f28 400071bc: 90 10 00 1d mov %i5, %o0 /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 400071c0: 10 bf ff 6e b 40006f78 400071c4: b6 06 20 1c add %i0, 0x1c, %i3 } } AIO_printf ("Thread finished\n"); return NULL; } 400071c8: b0 10 20 00 clr %i0 <== NOT EXECUTED 400071cc: 81 c7 e0 08 ret <== NOT EXECUTED 400071d0: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40007234 : * 0 - if initialization succeeded */ int rtems_aio_init (void) { 40007234: 9d e3 bf a0 save %sp, -96, %sp int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 40007238: 3b 10 00 60 sethi %hi(0x40018000), %i5 4000723c: 40 00 03 93 call 40008088 40007240: 90 17 62 7c or %i5, 0x27c, %o0 ! 4001827c if (result != 0) 40007244: b0 92 20 00 orcc %o0, 0, %i0 40007248: 12 80 00 31 bne 4000730c <== NEVER TAKEN 4000724c: 90 17 62 7c or %i5, 0x27c, %o0 return result; result = 40007250: 40 00 03 9a call 400080b8 40007254: 92 10 20 00 clr %o1 pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) 40007258: 80 a2 20 00 cmp %o0, 0 4000725c: 22 80 00 05 be,a 40007270 <== ALWAYS TAKEN 40007260: 11 10 00 60 sethi %hi(0x40018000), %o0 pthread_attr_destroy (&aio_request_queue.attr); 40007264: 40 00 03 7d call 40008058 <== NOT EXECUTED 40007268: 90 17 62 7c or %i5, 0x27c, %o0 <== NOT EXECUTED result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 4000726c: 11 10 00 60 sethi %hi(0x40018000), %o0 <== NOT EXECUTED 40007270: 92 10 20 00 clr %o1 40007274: 40 00 02 b4 call 40007d44 40007278: 90 12 22 74 or %o0, 0x274, %o0 if (result != 0) 4000727c: 80 a2 20 00 cmp %o0, 0 40007280: 22 80 00 06 be,a 40007298 <== ALWAYS TAKEN 40007284: 11 10 00 60 sethi %hi(0x40018000), %o0 pthread_attr_destroy (&aio_request_queue.attr); 40007288: 11 10 00 60 sethi %hi(0x40018000), %o0 <== NOT EXECUTED 4000728c: 40 00 03 73 call 40008058 <== NOT EXECUTED 40007290: 90 12 22 7c or %o0, 0x27c, %o0 ! 4001827c <== NOT EXECUTED result = pthread_cond_init (&aio_request_queue.new_req, NULL); 40007294: 11 10 00 60 sethi %hi(0x40018000), %o0 <== NOT EXECUTED 40007298: 92 10 20 00 clr %o1 4000729c: 40 00 01 af call 40007958 400072a0: 90 12 22 78 or %o0, 0x278, %o0 if (result != 0) { 400072a4: b0 92 20 00 orcc %o0, 0, %i0 400072a8: 02 80 00 09 be 400072cc <== ALWAYS TAKEN 400072ac: 03 10 00 60 sethi %hi(0x40018000), %g1 pthread_mutex_destroy (&aio_request_queue.mutex); 400072b0: 11 10 00 60 sethi %hi(0x40018000), %o0 <== NOT EXECUTED 400072b4: 40 00 02 4f call 40007bf0 <== NOT EXECUTED 400072b8: 90 12 22 74 or %o0, 0x274, %o0 ! 40018274 <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 400072bc: 11 10 00 60 sethi %hi(0x40018000), %o0 <== NOT EXECUTED 400072c0: 40 00 03 66 call 40008058 <== NOT EXECUTED 400072c4: 90 12 22 7c or %o0, 0x27c, %o0 ! 4001827c <== NOT EXECUTED ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 400072c8: 03 10 00 60 sethi %hi(0x40018000), %g1 <== NOT EXECUTED 400072cc: 82 10 62 74 or %g1, 0x274, %g1 ! 40018274 400072d0: 84 00 60 4c add %g1, 0x4c, %g2 400072d4: c4 20 60 48 st %g2, [ %g1 + 0x48 ] head->previous = NULL; tail->previous = head; 400072d8: 84 00 60 48 add %g1, 0x48, %g2 400072dc: c4 20 60 50 st %g2, [ %g1 + 0x50 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 400072e0: 84 00 60 58 add %g1, 0x58, %g2 400072e4: c4 20 60 54 st %g2, [ %g1 + 0x54 ] head->previous = NULL; tail->previous = head; 400072e8: 84 00 60 54 add %g1, 0x54, %g2 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 400072ec: c0 20 60 4c clr [ %g1 + 0x4c ] tail->previous = head; 400072f0: c4 20 60 5c st %g2, [ %g1 + 0x5c ] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 400072f4: c0 20 60 58 clr [ %g1 + 0x58 ] rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; aio_request_queue.idle_threads = 0; aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 400072f8: 05 00 00 2c sethi %hi(0xb000), %g2 } rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; 400072fc: c0 20 60 64 clr [ %g1 + 0x64 ] aio_request_queue.idle_threads = 0; aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 40007300: 84 10 a0 0b or %g2, 0xb, %g2 rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; aio_request_queue.idle_threads = 0; 40007304: c0 20 60 68 clr [ %g1 + 0x68 ] aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 40007308: c4 20 60 60 st %g2, [ %g1 + 0x60 ] return result; } 4000730c: 81 c7 e0 08 ret 40007310: 81 e8 00 00 restore =============================================================================== 400071d4 : 400071d4: c2 02 00 00 ld [ %o0 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 400071d8: 86 02 20 04 add %o0, 4, %g3 rtems_chain_node *node; AIO_printf ("FD exists \n"); node = rtems_chain_first (chain); if (rtems_chain_is_empty (chain)) { 400071dc: 80 a0 40 03 cmp %g1, %g3 400071e0: 02 80 00 0e be 40007218 <== NEVER TAKEN 400071e4: 84 10 00 09 mov %o1, %g2 AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 400071e8: c8 00 60 14 ld [ %g1 + 0x14 ], %g4 while (req->aiocbp->aio_reqprio > prio && 400071ec: da 02 60 14 ld [ %o1 + 0x14 ], %o5 if (rtems_chain_is_empty (chain)) { AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 400071f0: c8 01 20 18 ld [ %g4 + 0x18 ], %g4 while (req->aiocbp->aio_reqprio > prio && 400071f4: 10 80 00 04 b 40007204 400071f8: da 03 60 18 ld [ %o5 + 0x18 ], %o5 !rtems_chain_is_tail (chain, node)) { node = rtems_chain_next (node); prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 400071fc: c8 00 60 14 ld [ %g1 + 0x14 ], %g4 <== NOT EXECUTED 40007200: c8 01 20 18 ld [ %g4 + 0x18 ], %g4 <== NOT EXECUTED rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && 40007204: 80 a3 40 04 cmp %o5, %g4 40007208: 14 80 00 07 bg 40007224 <== NEVER TAKEN 4000720c: 80 a0 40 03 cmp %g1, %g3 40007210: d0 00 60 04 ld [ %g1 + 4 ], %o0 40007214: 92 10 00 02 mov %g2, %o1 40007218: 82 13 c0 00 mov %o7, %g1 4000721c: 40 00 09 cc call 4000994c <_Chain_Insert> 40007220: 9e 10 40 00 mov %g1, %o7 40007224: 32 bf ff f6 bne,a 400071fc <== NOT EXECUTED 40007228: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED 4000722c: 10 bf ff fa b 40007214 <== NOT EXECUTED 40007230: d0 00 60 04 ld [ %g1 + 4 ], %o0 <== NOT EXECUTED =============================================================================== 40007404 : * AIO_NOTCANCELED - if request was not canceled * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { 40007404: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40007408: fa 06 00 00 ld [ %i0 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000740c: 82 06 20 04 add %i0, 4, %g1 if (rtems_chain_is_empty (chain)) 40007410: 80 a7 40 01 cmp %i5, %g1 40007414: 12 80 00 09 bne 40007438 40007418: b0 10 20 02 mov 2, %i0 4000741c: 81 c7 e0 08 ret 40007420: 81 e8 00 00 restore rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 40007424: 80 a7 40 01 cmp %i5, %g1 <== NOT EXECUTED 40007428: 32 80 00 05 bne,a 4000743c <== NOT EXECUTED 4000742c: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 <== NOT EXECUTED node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; 40007430: 81 c7 e0 08 ret <== NOT EXECUTED 40007434: 91 e8 20 01 restore %g0, 1, %o0 <== NOT EXECUTED rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 40007438: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 4000743c: 80 a0 80 19 cmp %g2, %i1 40007440: 32 bf ff f9 bne,a 40007424 <== NEVER TAKEN 40007444: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) 40007448: 80 a7 40 01 cmp %i5, %g1 4000744c: 02 bf ff f4 be 4000741c <== NEVER TAKEN 40007450: b0 10 20 01 mov 1, %i0 40007454: 40 00 09 25 call 400098e8 <_Chain_Extract> 40007458: 90 10 00 1d mov %i5, %o0 return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; 4000745c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40007460: 84 10 20 8c mov 0x8c, %g2 40007464: c4 20 60 34 st %g2, [ %g1 + 0x34 ] current->aiocbp->return_value = -1; 40007468: 84 10 3f ff mov -1, %g2 free (current); 4000746c: 90 10 00 1d mov %i5, %o0 return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; current->aiocbp->return_value = -1; 40007470: c4 20 60 38 st %g2, [ %g1 + 0x38 ] free (current); 40007474: 7f ff ef 9b call 400032e0 40007478: b0 10 20 00 clr %i0 } return AIO_CANCELED; } 4000747c: 81 c7 e0 08 ret 40007480: 81 e8 00 00 restore =============================================================================== 400078e4 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 400078e4: 9d e3 bf 98 save %sp, -104, %sp 400078e8: 30 80 00 08 b,a 40007908 while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 400078ec: 92 10 20 00 clr %o1 400078f0: 94 10 00 1a mov %i2, %o2 400078f4: 7f ff fc fb call 40006ce0 400078f8: 96 07 bf fc add %fp, -4, %o3 ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 400078fc: 80 a2 20 00 cmp %o0, 0 40007900: 32 80 00 09 bne,a 40007924 <== ALWAYS TAKEN 40007904: fa 26 c0 00 st %i5, [ %i3 ] */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 40007908: 40 00 01 83 call 40007f14 <_Chain_Get> 4000790c: 90 10 00 18 mov %i0, %o0 sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 40007910: ba 92 20 00 orcc %o0, 0, %i5 40007914: 02 bf ff f6 be 400078ec 40007918: 90 10 00 19 mov %i1, %o0 4000791c: 90 10 20 00 clr %o0 timeout, &out ); } *node_ptr = node; 40007920: fa 26 c0 00 st %i5, [ %i3 ] return sc; } 40007924: 81 c7 e0 08 ret 40007928: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40010560 : rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 40010560: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc; if ( event_out != NULL ) { 40010564: 80 a6 e0 00 cmp %i3, 0 40010568: 02 80 00 1e be 400105e0 <== NEVER TAKEN 4001056c: 82 10 20 09 mov 9, %g1 Thread_Control *executing = _Thread_Executing; 40010570: 03 10 00 6a sethi %hi(0x4001a800), %g1 40010574: fa 00 60 30 ld [ %g1 + 0x30 ], %i5 ! 4001a830 <_Per_CPU_Information+0x10> RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ]; Event_Control *event = &api->System_event; if ( !_Event_sets_Is_empty( event_in ) ) { 40010578: 80 a6 20 00 cmp %i0, 0 4001057c: 02 80 00 16 be 400105d4 <== NEVER TAKEN 40010580: da 07 61 4c ld [ %i5 + 0x14c ], %o5 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40010584: 03 10 00 68 sethi %hi(0x4001a000), %g1 40010588: c4 00 63 10 ld [ %g1 + 0x310 ], %g2 ! 4001a310 <_Thread_Dispatch_disable_level> ++level; 4001058c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40010590: c4 20 63 10 st %g2, [ %g1 + 0x310 ] _Thread_Disable_dispatch(); _Event_Seize( 40010594: 03 10 00 6b sethi %hi(0x4001ac00), %g1 40010598: 82 10 60 20 or %g1, 0x20, %g1 ! 4001ac20 <_System_event_Sync_state> 4001059c: 90 10 00 18 mov %i0, %o0 400105a0: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 400105a4: 92 10 00 19 mov %i1, %o1 400105a8: 03 00 01 00 sethi %hi(0x40000), %g1 400105ac: 94 10 00 1a mov %i2, %o2 400105b0: 96 10 00 1b mov %i3, %o3 400105b4: 98 10 00 1d mov %i5, %o4 400105b8: 9a 03 60 04 add %o5, 4, %o5 400105bc: 7f ff dd ba call 40007ca4 <_Event_Seize> 400105c0: c2 23 a0 60 st %g1, [ %sp + 0x60 ] executing, event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 400105c4: 7f ff e9 21 call 4000aa48 <_Thread_Enable_dispatch> 400105c8: 01 00 00 00 nop sc = executing->Wait.return_code; 400105cc: 10 80 00 05 b 400105e0 400105d0: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 } else { *event_out = event->pending_events; 400105d4: c2 03 60 04 ld [ %o5 + 4 ], %g1 <== NOT EXECUTED 400105d8: c2 26 c0 00 st %g1, [ %i3 ] <== NOT EXECUTED sc = RTEMS_SUCCESSFUL; 400105dc: 82 10 20 00 clr %g1 <== NOT EXECUTED } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 400105e0: 81 c7 e0 08 ret 400105e4: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40007148 : rtems_status_code rtems_event_system_send( rtems_id id, rtems_event_set event_in ) { 40007148: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc; Thread_Control *thread; Objects_Locations location; RTEMS_API_Control *api; thread = _Thread_Get( id, &location ); 4000714c: 90 10 00 18 mov %i0, %o0 40007150: 40 00 09 c0 call 40009850 <_Thread_Get> 40007154: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40007158: c4 07 bf fc ld [ %fp + -4 ], %g2 4000715c: 80 a0 a0 00 cmp %g2, 0 40007160: 12 80 00 0d bne 40007194 <== NEVER TAKEN 40007164: 92 10 00 19 mov %i1, %o1 case OBJECTS_LOCAL: api = thread->API_Extensions[ THREAD_API_RTEMS ]; _Event_Surrender( 40007168: d4 02 21 4c ld [ %o0 + 0x14c ], %o2 4000716c: 94 02 a0 04 add %o2, 4, %o2 40007170: 19 00 01 00 sethi %hi(0x40000), %o4 40007174: 17 10 00 7a sethi %hi(0x4001e800), %o3 40007178: 96 12 e3 10 or %o3, 0x310, %o3 ! 4001eb10 <_System_event_Sync_state> 4000717c: 7f ff fe 64 call 40006b0c <_Event_Surrender> 40007180: b0 10 20 00 clr %i0 event_in, &api->System_event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 40007184: 40 00 09 a7 call 40009820 <_Thread_Enable_dispatch> 40007188: 01 00 00 00 nop sc = RTEMS_SUCCESSFUL; break; 4000718c: 81 c7 e0 08 ret 40007190: 81 e8 00 00 restore sc = RTEMS_INVALID_ID; break; } return sc; } 40007194: 81 c7 e0 08 ret <== NOT EXECUTED 40007198: 91 e8 20 04 restore %g0, 4, %o0 <== NOT EXECUTED =============================================================================== 40009c64 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 40009c64: 9d e3 bf a0 save %sp, -96, %sp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 40009c68: ba 10 20 01 mov 1, %i5 40009c6c: 80 a6 20 00 cmp %i0, 0 40009c70: 02 80 00 0d be 40009ca4 <== NEVER TAKEN 40009c74: 35 10 00 83 sethi %hi(0x40020c00), %i2 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 40009c78: 83 2f 60 02 sll %i5, 2, %g1 #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 40009c7c: 84 16 a1 b4 or %i2, 0x1b4, %g2 40009c80: c2 00 80 01 ld [ %g2 + %g1 ], %g1 40009c84: f6 00 60 04 ld [ %g1 + 4 ], %i3 if ( !information ) 40009c88: 80 a6 e0 00 cmp %i3, 0 40009c8c: 12 80 00 0f bne 40009cc8 40009c90: b8 10 20 01 mov 1, %i4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 40009c94: ba 07 60 01 inc %i5 40009c98: 80 a7 60 04 cmp %i5, 4 40009c9c: 12 bf ff f8 bne 40009c7c 40009ca0: 83 2f 60 02 sll %i5, 2, %g1 40009ca4: 81 c7 e0 08 ret 40009ca8: 81 e8 00 00 restore information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 40009cac: 83 2f 20 02 sll %i4, 2, %g1 40009cb0: d0 00 80 01 ld [ %g2 + %g1 ], %o0 if ( !the_thread ) 40009cb4: 80 a2 20 00 cmp %o0, 0 40009cb8: 02 80 00 04 be 40009cc8 <== NEVER TAKEN 40009cbc: b8 07 20 01 inc %i4 continue; (*routine)(the_thread); 40009cc0: 9f c6 00 00 call %i0 40009cc4: 01 00 00 00 nop information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 40009cc8: c2 16 e0 10 lduh [ %i3 + 0x10 ], %g1 40009ccc: 80 a7 00 01 cmp %i4, %g1 40009cd0: 28 bf ff f7 bleu,a 40009cac 40009cd4: c4 06 e0 1c ld [ %i3 + 0x1c ], %g2 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 40009cd8: 10 bf ff f0 b 40009c98 40009cdc: ba 07 60 01 inc %i5 =============================================================================== 40008430 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 40008430: 9d e3 bf a0 save %sp, -96, %sp register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 40008434: 80 a6 20 00 cmp %i0, 0 40008438: 02 80 00 38 be 40008518 4000843c: 82 10 20 03 mov 3, %g1 return RTEMS_INVALID_NAME; if ( !starting_address ) 40008440: 80 a6 60 00 cmp %i1, 0 40008444: 02 80 00 35 be 40008518 40008448: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !id ) 4000844c: 80 a7 60 00 cmp %i5, 0 40008450: 02 80 00 32 be 40008518 <== NEVER TAKEN 40008454: 80 a6 e0 00 cmp %i3, 0 return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 40008458: 02 80 00 30 be 40008518 4000845c: 82 10 20 08 mov 8, %g1 40008460: 80 a6 a0 00 cmp %i2, 0 40008464: 02 80 00 2d be 40008518 40008468: 80 a6 80 1b cmp %i2, %i3 4000846c: 0a 80 00 2b bcs 40008518 40008470: 80 8e e0 07 btst 7, %i3 40008474: 12 80 00 29 bne 40008518 40008478: 80 8e 60 07 btst 7, %i1 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 4000847c: 12 80 00 27 bne 40008518 40008480: 82 10 20 09 mov 9, %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40008484: 03 10 00 8b sethi %hi(0x40022c00), %g1 40008488: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ! 40022c10 <_Thread_Dispatch_disable_level> ++level; 4000848c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40008490: c4 20 60 10 st %g2, [ %g1 + 0x10 ] * 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 ); 40008494: 23 10 00 8a sethi %hi(0x40022800), %l1 40008498: 40 00 07 08 call 4000a0b8 <_Objects_Allocate> 4000849c: 90 14 62 0c or %l1, 0x20c, %o0 ! 40022a0c <_Partition_Information> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 400084a0: a0 92 20 00 orcc %o0, 0, %l0 400084a4: 32 80 00 06 bne,a 400084bc 400084a8: f8 24 20 1c st %i4, [ %l0 + 0x1c ] _Thread_Enable_dispatch(); 400084ac: 40 00 0c 03 call 4000b4b8 <_Thread_Enable_dispatch> 400084b0: 01 00 00 00 nop return RTEMS_TOO_MANY; 400084b4: 10 80 00 19 b 40008518 400084b8: 82 10 20 05 mov 5, %g1 ! 5 the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 400084bc: 92 10 00 1b mov %i3, %o1 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 400084c0: f2 24 20 10 st %i1, [ %l0 + 0x10 ] the_partition->length = length; 400084c4: f4 24 20 14 st %i2, [ %l0 + 0x14 ] the_partition->buffer_size = buffer_size; 400084c8: f6 24 20 18 st %i3, [ %l0 + 0x18 ] the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 400084cc: c0 24 20 20 clr [ %l0 + 0x20 ] _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 400084d0: 40 00 45 b3 call 40019b9c <.udiv> 400084d4: 90 10 00 1a mov %i2, %o0 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 400084d8: 92 10 00 19 mov %i1, %o1 length / buffer_size, buffer_size ); 400084dc: 94 10 00 08 mov %o0, %o2 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 400084e0: 96 10 00 1b mov %i3, %o3 400084e4: b8 04 20 24 add %l0, 0x24, %i4 400084e8: 40 00 04 74 call 400096b8 <_Chain_Initialize> 400084ec: 90 10 00 1c mov %i4, %o0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 400084f0: c4 14 20 0a lduh [ %l0 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400084f4: a2 14 62 0c or %l1, 0x20c, %l1 400084f8: c6 04 60 1c ld [ %l1 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 400084fc: c2 04 20 08 ld [ %l0 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008500: 85 28 a0 02 sll %g2, 2, %g2 40008504: e0 20 c0 02 st %l0, [ %g3 + %g2 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 40008508: f0 24 20 0c st %i0, [ %l0 + 0xc ] name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 4000850c: 40 00 0b eb call 4000b4b8 <_Thread_Enable_dispatch> 40008510: c2 27 40 00 st %g1, [ %i5 ] return RTEMS_SUCCESSFUL; 40008514: 82 10 20 00 clr %g1 } 40008518: 81 c7 e0 08 ret 4000851c: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40015c10 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 40015c10: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 40015c14: 11 10 00 f4 sethi %hi(0x4003d000), %o0 40015c18: 92 10 00 18 mov %i0, %o1 40015c1c: 90 12 23 84 or %o0, 0x384, %o0 40015c20: 40 00 14 2b call 4001accc <_Objects_Get> 40015c24: 94 07 bf fc add %fp, -4, %o2 register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 40015c28: c2 07 bf fc ld [ %fp + -4 ], %g1 40015c2c: 80 a0 60 00 cmp %g1, 0 40015c30: 12 80 00 21 bne 40015cb4 40015c34: ba 10 00 08 mov %o0, %i5 ) { void *starting; void *ending; starting = the_partition->starting_address; 40015c38: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 40015c3c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40015c40: 82 02 00 01 add %o0, %g1, %g1 ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 40015c44: 80 a6 40 01 cmp %i1, %g1 40015c48: 18 80 00 0b bgu 40015c74 <== NEVER TAKEN 40015c4c: 82 10 20 00 clr %g1 40015c50: 80 a6 40 08 cmp %i1, %o0 40015c54: 0a 80 00 09 bcs 40015c78 40015c58: 80 a0 60 00 cmp %g1, 0 offset = (uint32_t) _Addresses_Subtract( the_buffer, the_partition->starting_address ); return ((offset % the_partition->buffer_size) == 0); 40015c5c: d2 07 60 18 ld [ %i5 + 0x18 ], %o1 40015c60: 40 00 58 3d call 4002bd54 <.urem> 40015c64: 90 26 40 08 sub %i1, %o0, %o0 starting = the_partition->starting_address; ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 40015c68: 80 a0 00 08 cmp %g0, %o0 40015c6c: 10 80 00 02 b 40015c74 40015c70: 82 60 3f ff subx %g0, -1, %g1 case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { 40015c74: 80 a0 60 00 cmp %g1, 0 40015c78: 02 80 00 0b be 40015ca4 40015c7c: 90 07 60 24 add %i5, 0x24, %o0 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 40015c80: 40 00 0c 98 call 40018ee0 <_Chain_Append> 40015c84: 92 10 00 19 mov %i1, %o1 _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 40015c88: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 40015c8c: b0 10 20 00 clr %i0 switch ( location ) { case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 40015c90: 82 00 7f ff add %g1, -1, %g1 _Thread_Enable_dispatch(); 40015c94: 40 00 17 b9 call 4001bb78 <_Thread_Enable_dispatch> 40015c98: c2 27 60 20 st %g1, [ %i5 + 0x20 ] 40015c9c: 81 c7 e0 08 ret 40015ca0: 81 e8 00 00 restore return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 40015ca4: 40 00 17 b5 call 4001bb78 <_Thread_Enable_dispatch> 40015ca8: b0 10 20 09 mov 9, %i0 40015cac: 81 c7 e0 08 ret 40015cb0: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40015cb4: 81 c7 e0 08 ret 40015cb8: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 40032844 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 40032844: 9d e3 bf 98 save %sp, -104, %sp 40032848: 11 10 01 8f sethi %hi(0x40063c00), %o0 4003284c: 92 10 00 18 mov %i0, %o1 40032850: 90 12 20 98 or %o0, 0x98, %o0 40032854: 7f ff 56 c1 call 40008358 <_Objects_Get> 40032858: 94 07 bf fc add %fp, -4, %o2 rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 4003285c: c2 07 bf fc ld [ %fp + -4 ], %g1 40032860: 80 a0 60 00 cmp %g1, 0 40032864: 12 80 00 6a bne 40032a0c 40032868: ba 10 00 08 mov %o0, %i5 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 4003286c: 37 10 01 8d sethi %hi(0x40063400), %i3 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 40032870: c4 02 20 40 ld [ %o0 + 0x40 ], %g2 40032874: b6 16 e2 d0 or %i3, 0x2d0, %i3 40032878: c2 06 e0 10 ld [ %i3 + 0x10 ], %g1 4003287c: 80 a0 80 01 cmp %g2, %g1 40032880: 02 80 00 06 be 40032898 40032884: 80 a6 60 00 cmp %i1, 0 _Thread_Enable_dispatch(); 40032888: 7f ff 5a 35 call 4000915c <_Thread_Enable_dispatch> 4003288c: b0 10 20 17 mov 0x17, %i0 40032890: 81 c7 e0 08 ret 40032894: 81 e8 00 00 restore return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { 40032898: 12 80 00 0d bne 400328cc 4003289c: 01 00 00 00 nop switch ( the_period->state ) { 400328a0: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 400328a4: 80 a0 60 04 cmp %g1, 4 400328a8: 18 80 00 05 bgu 400328bc <== NEVER TAKEN 400328ac: b0 10 20 00 clr %i0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 400328b0: 05 10 01 74 sethi %hi(0x4005d000), %g2 400328b4: 84 10 a0 78 or %g2, 0x78, %g2 ! 4005d078 400328b8: f0 08 80 01 ldub [ %g2 + %g1 ], %i0 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 400328bc: 7f ff 5a 28 call 4000915c <_Thread_Enable_dispatch> 400328c0: 01 00 00 00 nop 400328c4: 81 c7 e0 08 ret 400328c8: 81 e8 00 00 restore return( return_value ); } _ISR_Disable( level ); 400328cc: 7f ff 3d 5a call 40001e34 400328d0: 01 00 00 00 nop 400328d4: b4 10 00 08 mov %o0, %i2 if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 400328d8: f8 07 60 38 ld [ %i5 + 0x38 ], %i4 400328dc: 80 a7 20 00 cmp %i4, 0 400328e0: 12 80 00 15 bne 40032934 400328e4: 80 a7 20 02 cmp %i4, 2 _ISR_Enable( level ); 400328e8: 7f ff 3d 57 call 40001e44 400328ec: 01 00 00 00 nop the_period->next_length = length; /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 400328f0: 90 10 00 1d mov %i5, %o0 400328f4: 7f ff ff b8 call 400327d4 <_Rate_monotonic_Initiate_statistics> 400328f8: f2 27 60 3c st %i1, [ %i5 + 0x3c ] the_period->state = RATE_MONOTONIC_ACTIVE; 400328fc: 82 10 20 02 mov 2, %g1 40032900: c2 27 60 38 st %g1, [ %i5 + 0x38 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40032904: 03 10 00 ca sethi %hi(0x40032800), %g1 40032908: 82 10 62 18 or %g1, 0x218, %g1 ! 40032a18 <_Rate_monotonic_Timeout> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4003290c: c0 27 60 18 clr [ %i5 + 0x18 ] the_watchdog->routine = routine; 40032910: c2 27 60 2c st %g1, [ %i5 + 0x2c ] the_watchdog->id = id; 40032914: f0 27 60 30 st %i0, [ %i5 + 0x30 ] the_watchdog->user_data = user_data; 40032918: c0 27 60 34 clr [ %i5 + 0x34 ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4003291c: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40032920: 11 10 01 8c sethi %hi(0x40063000), %o0 40032924: 92 07 60 10 add %i5, 0x10, %o1 40032928: 7f ff 5d 1c call 40009d98 <_Watchdog_Insert> 4003292c: 90 12 22 58 or %o0, 0x258, %o0 40032930: 30 80 00 1b b,a 4003299c _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 40032934: 12 80 00 1e bne 400329ac 40032938: 80 a7 20 04 cmp %i4, 4 /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 4003293c: 7f ff ff 5d call 400326b0 <_Rate_monotonic_Update_statistics> 40032940: 90 10 00 1d mov %i5, %o0 /* * 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; 40032944: 82 10 20 01 mov 1, %g1 the_period->next_length = length; 40032948: f2 27 60 3c st %i1, [ %i5 + 0x3c ] /* * 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; 4003294c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; _ISR_Enable( level ); 40032950: 7f ff 3d 3d call 40001e44 40032954: 90 10 00 1a mov %i2, %o0 _Thread_Executing->Wait.id = the_period->Object.id; 40032958: d0 06 e0 10 ld [ %i3 + 0x10 ], %o0 4003295c: c2 07 60 08 ld [ %i5 + 8 ], %g1 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 40032960: 13 00 00 10 sethi %hi(0x4000), %o1 40032964: 7f ff 5c 27 call 40009a00 <_Thread_Set_state> 40032968: c2 22 20 20 st %g1, [ %o0 + 0x20 ] /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 4003296c: 7f ff 3d 32 call 40001e34 40032970: 01 00 00 00 nop local_state = the_period->state; 40032974: f4 07 60 38 ld [ %i5 + 0x38 ], %i2 the_period->state = RATE_MONOTONIC_ACTIVE; 40032978: f8 27 60 38 st %i4, [ %i5 + 0x38 ] _ISR_Enable( level ); 4003297c: 7f ff 3d 32 call 40001e44 40032980: 01 00 00 00 nop /* * 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 ) 40032984: 80 a6 a0 03 cmp %i2, 3 40032988: 12 80 00 05 bne 4003299c 4003298c: 01 00 00 00 nop _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 40032990: d0 06 e0 10 ld [ %i3 + 0x10 ], %o0 40032994: 7f ff 59 1c call 40008e04 <_Thread_Clear_state> 40032998: 13 00 00 10 sethi %hi(0x4000), %o1 _Thread_Enable_dispatch(); 4003299c: 7f ff 59 f0 call 4000915c <_Thread_Enable_dispatch> 400329a0: b0 10 20 00 clr %i0 400329a4: 81 c7 e0 08 ret 400329a8: 81 e8 00 00 restore return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 400329ac: 12 bf ff b9 bne 40032890 <== NEVER TAKEN 400329b0: b0 10 20 04 mov 4, %i0 /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 400329b4: 7f ff ff 3f call 400326b0 <_Rate_monotonic_Update_statistics> 400329b8: 90 10 00 1d mov %i5, %o0 _ISR_Enable( level ); 400329bc: 7f ff 3d 22 call 40001e44 400329c0: 90 10 00 1a mov %i2, %o0 the_period->state = RATE_MONOTONIC_ACTIVE; 400329c4: 82 10 20 02 mov 2, %g1 400329c8: 92 07 60 10 add %i5, 0x10, %o1 400329cc: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; 400329d0: f2 27 60 3c st %i1, [ %i5 + 0x3c ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 400329d4: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 400329d8: 11 10 01 8c sethi %hi(0x40063000), %o0 400329dc: 7f ff 5c ef call 40009d98 <_Watchdog_Insert> 400329e0: 90 12 22 58 or %o0, 0x258, %o0 ! 40063258 <_Watchdog_Ticks_chain> 400329e4: d0 07 60 40 ld [ %i5 + 0x40 ], %o0 400329e8: d2 07 60 3c ld [ %i5 + 0x3c ], %o1 400329ec: 03 10 01 7b sethi %hi(0x4005ec00), %g1 400329f0: c2 00 63 34 ld [ %g1 + 0x334 ], %g1 ! 4005ef34 <_Scheduler+0x34> 400329f4: 9f c0 40 00 call %g1 400329f8: b0 10 20 06 mov 6, %i0 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); 400329fc: 7f ff 59 d8 call 4000915c <_Thread_Enable_dispatch> 40032a00: 01 00 00 00 nop 40032a04: 81 c7 e0 08 ret 40032a08: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 40032a0c: b0 10 20 04 mov 4, %i0 } 40032a10: 81 c7 e0 08 ret 40032a14: 81 e8 00 00 restore =============================================================================== 400258dc : void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 400258dc: 9d e3 bf 38 save %sp, -200, %sp rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 400258e0: 80 a6 60 00 cmp %i1, 0 400258e4: 02 80 00 75 be 40025ab8 <== NEVER TAKEN 400258e8: 90 10 00 18 mov %i0, %o0 return; (*print)( context, "Period information by period\n" ); 400258ec: 13 10 01 68 sethi %hi(0x4005a000), %o1 400258f0: 9f c6 40 00 call %i1 400258f4: 92 12 62 d0 or %o1, 0x2d0, %o1 ! 4005a2d0 <_TOD_Days_per_month+0x68> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 400258f8: 90 10 00 18 mov %i0, %o0 400258fc: 13 10 01 68 sethi %hi(0x4005a000), %o1 40025900: 9f c6 40 00 call %i1 40025904: 92 12 62 f0 or %o1, 0x2f0, %o1 ! 4005a2f0 <_TOD_Days_per_month+0x88> (*print)( context, "--- Wall times are in seconds ---\n" ); 40025908: 90 10 00 18 mov %i0, %o0 4002590c: 13 10 01 68 sethi %hi(0x4005a000), %o1 40025910: 9f c6 40 00 call %i1 40025914: 92 12 63 18 or %o1, 0x318, %o1 ! 4005a318 <_TOD_Days_per_month+0xb0> Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 40025918: 90 10 00 18 mov %i0, %o0 4002591c: 13 10 01 68 sethi %hi(0x4005a000), %o1 40025920: 9f c6 40 00 call %i1 40025924: 92 12 63 40 or %o1, 0x340, %o1 ! 4005a340 <_TOD_Days_per_month+0xd8> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 40025928: 90 10 00 18 mov %i0, %o0 4002592c: 13 10 01 68 sethi %hi(0x4005a000), %o1 40025930: 9f c6 40 00 call %i1 40025934: 92 12 63 90 or %o1, 0x390, %o1 ! 4005a390 <_TOD_Days_per_month+0x128> /* * 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 ; 40025938: 03 10 01 8f sethi %hi(0x40063c00), %g1 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 4002593c: 39 10 01 68 sethi %hi(0x4005a000), %i4 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 40025940: 37 10 01 68 sethi %hi(0x4005a000), %i3 struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 40025944: 35 10 01 69 sethi %hi(0x4005a400), %i2 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 40025948: 21 10 01 6e sethi %hi(0x4005b800), %l0 /* * 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 ; 4002594c: fa 00 60 a0 ld [ %g1 + 0xa0 ], %i5 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 40025950: b8 17 23 e0 or %i4, 0x3e0, %i4 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 40025954: b6 16 e3 f8 or %i3, 0x3f8, %i3 struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 40025958: b4 16 a0 18 or %i2, 0x18, %i2 /* * 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 ; 4002595c: 10 80 00 52 b 40025aa4 40025960: a0 14 20 a0 or %l0, 0xa0, %l0 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 40025964: 40 00 32 75 call 40032338 40025968: 92 07 bf c8 add %fp, -56, %o1 if ( status != RTEMS_SUCCESSFUL ) 4002596c: 80 a2 20 00 cmp %o0, 0 40025970: 32 80 00 4d bne,a 40025aa4 40025974: ba 07 60 01 inc %i5 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 40025978: 92 07 bf b0 add %fp, -80, %o1 4002597c: 40 00 32 e0 call 400324fc 40025980: 90 10 00 1d mov %i5, %o0 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 40025984: d0 07 bf b0 ld [ %fp + -80 ], %o0 40025988: 92 10 20 05 mov 5, %o1 4002598c: 7f ff a2 51 call 4000e2d0 40025990: 94 07 bf a0 add %fp, -96, %o2 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 40025994: d8 1f bf c8 ldd [ %fp + -56 ], %o4 40025998: 92 10 00 1c mov %i4, %o1 4002599c: 90 10 00 18 mov %i0, %o0 400259a0: 94 10 00 1d mov %i5, %o2 400259a4: 9f c6 40 00 call %i1 400259a8: 96 07 bf a0 add %fp, -96, %o3 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 400259ac: d2 07 bf c8 ld [ %fp + -56 ], %o1 400259b0: 80 a2 60 00 cmp %o1, 0 400259b4: 12 80 00 07 bne 400259d0 400259b8: 94 07 bf a8 add %fp, -88, %o2 (*print)( context, "\n" ); 400259bc: 90 10 00 18 mov %i0, %o0 400259c0: 9f c6 40 00 call %i1 400259c4: 92 10 00 10 mov %l0, %o1 continue; 400259c8: 10 80 00 37 b 40025aa4 400259cc: ba 07 60 01 inc %i5 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 ); 400259d0: 40 00 03 2b call 4002667c <_Timespec_Divide_by_integer> 400259d4: 90 07 bf e0 add %fp, -32, %o0 (*print)( context, 400259d8: d0 07 bf d4 ld [ %fp + -44 ], %o0 400259dc: 40 00 a8 c8 call 4004fcfc <.div> 400259e0: 92 10 23 e8 mov 0x3e8, %o1 400259e4: a6 10 00 08 mov %o0, %l3 400259e8: d0 07 bf dc ld [ %fp + -36 ], %o0 400259ec: 40 00 a8 c4 call 4004fcfc <.div> 400259f0: 92 10 23 e8 mov 0x3e8, %o1 400259f4: c2 07 bf a8 ld [ %fp + -88 ], %g1 400259f8: a2 10 00 08 mov %o0, %l1 400259fc: d0 07 bf ac ld [ %fp + -84 ], %o0 40025a00: e8 07 bf d0 ld [ %fp + -48 ], %l4 40025a04: e4 07 bf d8 ld [ %fp + -40 ], %l2 40025a08: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40025a0c: 40 00 a8 bc call 4004fcfc <.div> 40025a10: 92 10 23 e8 mov 0x3e8, %o1 40025a14: 96 10 00 13 mov %l3, %o3 40025a18: 98 10 00 12 mov %l2, %o4 40025a1c: 9a 10 00 11 mov %l1, %o5 40025a20: 94 10 00 14 mov %l4, %o2 40025a24: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 40025a28: 92 10 00 1b mov %i3, %o1 40025a2c: 9f c6 40 00 call %i1 40025a30: 90 10 00 18 mov %i0, %o0 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); 40025a34: d2 07 bf c8 ld [ %fp + -56 ], %o1 40025a38: 94 07 bf a8 add %fp, -88, %o2 40025a3c: 40 00 03 10 call 4002667c <_Timespec_Divide_by_integer> 40025a40: 90 07 bf f8 add %fp, -8, %o0 (*print)( context, 40025a44: d0 07 bf ec ld [ %fp + -20 ], %o0 40025a48: 40 00 a8 ad call 4004fcfc <.div> 40025a4c: 92 10 23 e8 mov 0x3e8, %o1 40025a50: a6 10 00 08 mov %o0, %l3 40025a54: d0 07 bf f4 ld [ %fp + -12 ], %o0 40025a58: 40 00 a8 a9 call 4004fcfc <.div> 40025a5c: 92 10 23 e8 mov 0x3e8, %o1 40025a60: c2 07 bf a8 ld [ %fp + -88 ], %g1 40025a64: a2 10 00 08 mov %o0, %l1 40025a68: d0 07 bf ac ld [ %fp + -84 ], %o0 40025a6c: e8 07 bf e8 ld [ %fp + -24 ], %l4 40025a70: e4 07 bf f0 ld [ %fp + -16 ], %l2 40025a74: 92 10 23 e8 mov 0x3e8, %o1 40025a78: 40 00 a8 a1 call 4004fcfc <.div> 40025a7c: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40025a80: 92 10 00 1a mov %i2, %o1 40025a84: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 40025a88: 94 10 00 14 mov %l4, %o2 40025a8c: 90 10 00 18 mov %i0, %o0 40025a90: 96 10 00 13 mov %l3, %o3 40025a94: 98 10 00 12 mov %l2, %o4 40025a98: 9f c6 40 00 call %i1 40025a9c: 9a 10 00 11 mov %l1, %o5 * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 40025aa0: ba 07 60 01 inc %i5 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; 40025aa4: 03 10 01 8f sethi %hi(0x40063c00), %g1 /* * 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 ; 40025aa8: c2 00 60 a4 ld [ %g1 + 0xa4 ], %g1 ! 40063ca4 <_Rate_monotonic_Information+0xc> 40025aac: 80 a7 40 01 cmp %i5, %g1 40025ab0: 08 bf ff ad bleu 40025964 40025ab4: 90 10 00 1d mov %i5, %o0 40025ab8: 81 c7 e0 08 ret 40025abc: 81 e8 00 00 restore =============================================================================== 40007e08 : return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { 40007e08: 9d e3 bf a0 save %sp, -96, %sp void *ptr = NULL; rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; 40007e0c: fa 06 20 30 ld [ %i0 + 0x30 ], %i5 #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 40007e10: 90 10 00 19 mov %i1, %o0 40007e14: 92 10 00 1d mov %i5, %o1 40007e18: 40 00 2d 6b call 400133c4 <.urem> 40007e1c: b6 10 00 19 mov %i1, %i3 if (excess > 0) { 40007e20: 80 a2 20 00 cmp %o0, 0 40007e24: 02 80 00 05 be 40007e38 <== ALWAYS TAKEN 40007e28: 80 a6 c0 19 cmp %i3, %i1 value += alignment - excess; 40007e2c: b6 06 40 1d add %i1, %i5, %i3 <== NOT EXECUTED 40007e30: b6 26 c0 08 sub %i3, %o0, %i3 <== NOT EXECUTED rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { 40007e34: 80 a6 c0 19 cmp %i3, %i1 <== NOT EXECUTED 40007e38: 0a 80 00 04 bcs 40007e48 <== NEVER TAKEN 40007e3c: 80 a6 60 00 cmp %i1, 0 40007e40: 32 80 00 04 bne,a 40007e50 40007e44: c2 06 00 00 ld [ %i0 ], %g1 return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 40007e48: 81 c7 e0 08 ret 40007e4c: 91 e8 20 00 restore %g0, 0, %o0 rtems_chain_control *free_chain, size_t size ) { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); 40007e50: 84 06 20 04 add %i0, 4, %g2 rtems_rbheap_chunk *big_enough = NULL; 40007e54: 10 80 00 06 b 40007e6c 40007e58: ba 10 20 00 clr %i5 while (current != tail && big_enough == NULL) { rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current; if (free_chunk->size >= size) { 40007e5c: 80 a0 c0 1b cmp %g3, %i3 40007e60: ba 40 3f ff addx %g0, -1, %i5 40007e64: ba 08 40 1d and %g1, %i5, %i5 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next( Chain_Node *the_node ) { return the_node->next; 40007e68: c2 00 40 00 ld [ %g1 ], %g1 { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_chunk *big_enough = NULL; while (current != tail && big_enough == NULL) { 40007e6c: 80 a7 60 00 cmp %i5, 0 40007e70: 12 80 00 04 bne 40007e80 40007e74: 80 a0 40 02 cmp %g1, %g2 40007e78: 32 bf ff f9 bne,a 40007e5c 40007e7c: c6 00 60 1c ld [ %g1 + 0x1c ], %g3 uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size); if (free_chunk != NULL) { 40007e80: 80 a7 60 00 cmp %i5, 0 40007e84: 02 bf ff f1 be 40007e48 40007e88: 01 00 00 00 nop uintptr_t free_size = free_chunk->size; 40007e8c: f4 07 60 1c ld [ %i5 + 0x1c ], %i2 if (free_size > aligned_size) { 40007e90: 80 a6 80 1b cmp %i2, %i3 40007e94: 28 80 00 14 bleu,a 40007ee4 40007e98: c4 07 40 00 ld [ %i5 ], %g2 rtems_rbheap_chunk *new_chunk = get_chunk(control); 40007e9c: 7f ff ff 80 call 40007c9c 40007ea0: 90 10 00 18 mov %i0, %o0 if (new_chunk != NULL) { 40007ea4: b8 92 20 00 orcc %o0, 0, %i4 40007ea8: 02 bf ff e8 be 40007e48 <== NEVER TAKEN 40007eac: b4 26 80 1b sub %i2, %i3, %i2 uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; 40007eb0: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 rtems_rbheap_chunk *new_chunk = get_chunk(control); if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; 40007eb4: f4 27 60 1c st %i2, [ %i5 + 0x1c ] new_chunk->begin = free_chunk->begin + new_free_size; new_chunk->size = aligned_size; 40007eb8: f6 27 20 1c st %i3, [ %i4 + 0x1c ] if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; 40007ebc: b4 06 80 01 add %i2, %g1, %i2 */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 40007ec0: c0 27 20 04 clr [ %i4 + 4 ] 40007ec4: f4 27 20 18 st %i2, [ %i4 + 0x18 ] 40007ec8: c0 27 00 00 clr [ %i4 ] static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 40007ecc: 90 06 20 18 add %i0, 0x18, %o0 40007ed0: 40 00 06 97 call 4000992c <_RBTree_Insert_unprotected> 40007ed4: 92 07 20 08 add %i4, 8, %o1 free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; new_chunk->size = aligned_size; rtems_chain_set_off_chain(&new_chunk->chain_node); insert_into_tree(chunk_tree, new_chunk); ptr = (void *) new_chunk->begin; 40007ed8: f0 07 20 18 ld [ %i4 + 0x18 ], %i0 40007edc: 81 c7 e0 08 ret 40007ee0: 81 e8 00 00 restore { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 40007ee4: c2 07 60 04 ld [ %i5 + 4 ], %g1 } } else { rtems_chain_extract_unprotected(&free_chunk->chain_node); rtems_chain_set_off_chain(&free_chunk->chain_node); ptr = (void *) free_chunk->begin; 40007ee8: f0 07 60 18 ld [ %i5 + 0x18 ], %i0 next->previous = previous; 40007eec: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 40007ef0: c4 20 40 00 st %g2, [ %g1 ] */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 40007ef4: c0 27 60 04 clr [ %i5 + 4 ] 40007ef8: c0 27 40 00 clr [ %i5 ] } } } return ptr; } 40007efc: 81 c7 e0 08 ret 40007f00: 81 e8 00 00 restore =============================================================================== 40008034 : /* Do nothing */ } void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control) { 40008034: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); 40008038: 7f ff ed ef call 400037f4 <== NOT EXECUTED 4000803c: 90 10 20 20 mov 0x20, %o0 <== NOT EXECUTED if (chunk != NULL) { 40008040: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40008044: 02 80 00 07 be 40008060 <== NOT EXECUTED 40008048: 82 06 20 0c add %i0, 0xc, %g1 <== NOT EXECUTED Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 4000804c: c2 22 20 04 st %g1, [ %o0 + 4 ] <== NOT EXECUTED before_node = after_node->next; 40008050: c2 06 20 0c ld [ %i0 + 0xc ], %g1 <== NOT EXECUTED after_node->next = the_node; 40008054: d0 26 20 0c st %o0, [ %i0 + 0xc ] <== NOT EXECUTED the_node->next = before_node; 40008058: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED before_node->previous = the_node; 4000805c: d0 20 60 04 st %o0, [ %g1 + 4 ] <== NOT EXECUTED 40008060: 81 c7 e0 08 ret <== NOT EXECUTED 40008064: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40007f04 : _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { 40007f04: 9d e3 bf 80 save %sp, -128, %sp 40007f08: b6 10 00 18 mov %i0, %i3 rtems_status_code sc = RTEMS_SUCCESSFUL; if (ptr != NULL) { 40007f0c: 80 a6 60 00 cmp %i1, 0 40007f10: 02 80 00 45 be 40008024 40007f14: b0 10 20 00 clr %i0 #define NULL_PAGE rtems_rbheap_chunk_of_node(NULL) static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key) { rtems_rbheap_chunk chunk = { .begin = key }; 40007f18: 90 07 bf e0 add %fp, -32, %o0 40007f1c: 92 10 20 00 clr %o1 40007f20: 94 10 20 20 mov 0x20, %o2 40007f24: 40 00 21 0b call 40010350 40007f28: b4 06 e0 18 add %i3, 0x18, %i2 RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; 40007f2c: ba 10 20 00 clr %i5 40007f30: f2 27 bf f8 st %i1, [ %fp + -8 ] RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 40007f34: 10 80 00 12 b 40007f7c 40007f38: f8 06 e0 1c ld [ %i3 + 0x1c ], %i4 RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 40007f3c: 90 07 bf e8 add %fp, -24, %o0 40007f40: 9f c0 40 00 call %g1 40007f44: 92 10 00 1c mov %i4, %o1 if ( _RBTree_Is_equal( compare_result ) ) { 40007f48: 80 a2 20 00 cmp %o0, 0 40007f4c: 12 80 00 07 bne 40007f68 40007f50: 83 3a 20 1f sra %o0, 0x1f, %g1 found = iter_node; if ( the_rbtree->is_unique ) 40007f54: c2 0e a0 14 ldub [ %i2 + 0x14 ], %g1 40007f58: 80 a0 60 00 cmp %g1, 0 40007f5c: 12 80 00 0c bne 40007f8c <== ALWAYS TAKEN 40007f60: ba 10 00 1c mov %i4, %i5 RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 40007f64: 83 3a 20 1f sra %o0, 0x1f, %g1 <== NOT EXECUTED 40007f68: 90 20 40 08 sub %g1, %o0, %o0 40007f6c: 91 32 20 1f srl %o0, 0x1f, %o0 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 40007f70: 91 2a 20 02 sll %o0, 2, %o0 40007f74: b8 07 00 08 add %i4, %o0, %i4 40007f78: f8 07 20 04 ld [ %i4 + 4 ], %i4 ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 40007f7c: 80 a7 20 00 cmp %i4, 0 40007f80: 32 bf ff ef bne,a 40007f3c 40007f84: c2 06 a0 10 ld [ %i2 + 0x10 ], %g1 40007f88: b8 10 00 1d mov %i5, %i4 return rtems_rbheap_chunk_of_node( 40007f8c: ba 07 3f f8 add %i4, -8, %i5 if (ptr != NULL) { rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr); if (chunk != NULL_PAGE) { 40007f90: 80 a7 7f f8 cmp %i5, -8 40007f94: 02 80 00 24 be 40008024 40007f98: b0 10 20 04 mov 4, %i0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 40007f9c: c4 07 3f f8 ld [ %i4 + -8 ], %g2 40007fa0: 80 a0 a0 00 cmp %g2, 0 40007fa4: 12 80 00 05 bne 40007fb8 40007fa8: 82 10 20 00 clr %g1 40007fac: c2 07 60 04 ld [ %i5 + 4 ], %g1 40007fb0: 80 a0 00 01 cmp %g0, %g1 40007fb4: 82 60 3f ff subx %g0, -1, %g1 if (!rtems_rbheap_is_chunk_free(chunk)) { 40007fb8: 80 a0 60 00 cmp %g1, 0 40007fbc: 02 80 00 1a be 40008024 40007fc0: b0 10 20 0e mov 0xe, %i0 static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 40007fc4: b8 07 60 08 add %i5, 8, %i4 40007fc8: 92 10 20 00 clr %o1 40007fcc: 40 00 06 fd call 40009bc0 <_RBTree_Next_unprotected> 40007fd0: 90 10 00 1c mov %i4, %o0 40007fd4: 92 10 20 01 mov 1, %o1 40007fd8: b2 10 00 08 mov %o0, %i1 40007fdc: 40 00 06 f9 call 40009bc0 <_RBTree_Next_unprotected> 40007fe0: 90 10 00 1c mov %i4, %o0 if (chunk != NULL_PAGE) { if (!rtems_rbheap_is_chunk_free(chunk)) { rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT); rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT); check_and_merge(free_chain, chunk_tree, chunk, succ); 40007fe4: 92 10 00 1a mov %i2, %o1 static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 40007fe8: 96 02 3f f8 add %o0, -8, %o3 if (chunk != NULL_PAGE) { if (!rtems_rbheap_is_chunk_free(chunk)) { rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT); rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT); check_and_merge(free_chain, chunk_tree, chunk, succ); 40007fec: 94 10 00 1d mov %i5, %o2 40007ff0: 7f ff ff 02 call 40007bf8 40007ff4: 90 10 00 1b mov %i3, %o0 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 40007ff8: c2 06 c0 00 ld [ %i3 ], %g1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 40007ffc: f6 27 60 04 st %i3, [ %i5 + 4 ] before_node = after_node->next; after_node->next = the_node; 40008000: fa 26 c0 00 st %i5, [ %i3 ] the_node->next = before_node; 40008004: c2 27 40 00 st %g1, [ %i5 ] before_node->previous = the_node; 40008008: fa 20 60 04 st %i5, [ %g1 + 4 ] add_to_chain(free_chain, chunk); check_and_merge(free_chain, chunk_tree, chunk, pred); 4000800c: 90 10 00 1b mov %i3, %o0 40008010: 92 10 00 1a mov %i2, %o1 40008014: 94 10 00 1d mov %i5, %o2 40008018: 96 06 7f f8 add %i1, -8, %o3 4000801c: 7f ff fe f7 call 40007bf8 40008020: b0 10 20 00 clr %i0 sc = RTEMS_INVALID_ID; } } return sc; } 40008024: 81 c7 e0 08 ret 40008028: 81 e8 00 00 restore =============================================================================== 40017148 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 40017148: 9d e3 bf 98 save %sp, -104, %sp register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 4001714c: 80 a6 60 00 cmp %i1, 0 40017150: 02 80 00 35 be 40017224 40017154: 82 10 20 0a mov 0xa, %g1 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 40017158: 90 10 00 18 mov %i0, %o0 4001715c: 40 00 12 93 call 4001bba8 <_Thread_Get> 40017160: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40017164: c2 07 bf fc ld [ %fp + -4 ], %g1 40017168: 80 a0 60 00 cmp %g1, 0 4001716c: 12 80 00 2d bne 40017220 40017170: b8 10 00 08 mov %o0, %i4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 40017174: fa 02 21 4c ld [ %o0 + 0x14c ], %i5 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 40017178: c2 07 60 0c ld [ %i5 + 0xc ], %g1 4001717c: 80 a0 60 00 cmp %g1, 0 40017180: 02 80 00 24 be 40017210 40017184: 01 00 00 00 nop if ( asr->is_enabled ) { 40017188: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 4001718c: 80 a0 60 00 cmp %g1, 0 40017190: 02 80 00 15 be 400171e4 40017194: 01 00 00 00 nop rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 40017198: 7f ff e4 1f call 40010214 4001719c: 01 00 00 00 nop *signal_set |= signals; 400171a0: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400171a4: b2 10 40 19 or %g1, %i1, %i1 400171a8: f2 27 60 14 st %i1, [ %i5 + 0x14 ] _ISR_Enable( _level ); 400171ac: 7f ff e4 1e call 40010224 400171b0: 01 00 00 00 nop _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 400171b4: 03 10 00 f6 sethi %hi(0x4003d800), %g1 400171b8: 82 10 62 b0 or %g1, 0x2b0, %g1 ! 4003dab0 <_Per_CPU_Information> 400171bc: c4 00 60 08 ld [ %g1 + 8 ], %g2 400171c0: 80 a0 a0 00 cmp %g2, 0 400171c4: 02 80 00 0f be 40017200 400171c8: 01 00 00 00 nop 400171cc: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 400171d0: 80 a7 00 02 cmp %i4, %g2 400171d4: 12 80 00 0b bne 40017200 <== NEVER TAKEN 400171d8: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 400171dc: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 400171e0: 30 80 00 08 b,a 40017200 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 400171e4: 7f ff e4 0c call 40010214 400171e8: 01 00 00 00 nop *signal_set |= signals; 400171ec: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 400171f0: b2 10 40 19 or %g1, %i1, %i1 400171f4: f2 27 60 18 st %i1, [ %i5 + 0x18 ] _ISR_Enable( _level ); 400171f8: 7f ff e4 0b call 40010224 400171fc: 01 00 00 00 nop } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 40017200: 40 00 12 5e call 4001bb78 <_Thread_Enable_dispatch> 40017204: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 40017208: 10 80 00 07 b 40017224 4001720c: 82 10 20 00 clr %g1 ! 0 } _Thread_Enable_dispatch(); 40017210: 40 00 12 5a call 4001bb78 <_Thread_Enable_dispatch> 40017214: 01 00 00 00 nop return RTEMS_NOT_DEFINED; 40017218: 10 80 00 03 b 40017224 4001721c: 82 10 20 0b mov 0xb, %g1 ! b case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 40017220: 82 10 20 04 mov 4, %g1 } 40017224: 81 c7 e0 08 ret 40017228: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 400105e8 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 400105e8: 9d e3 bf a0 save %sp, -96, %sp ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 400105ec: 80 a6 a0 00 cmp %i2, 0 400105f0: 02 80 00 5a be 40010758 400105f4: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 400105f8: 03 10 00 6a sethi %hi(0x4001a800), %g1 400105fc: f8 00 60 30 ld [ %g1 + 0x30 ], %i4 ! 4001a830 <_Per_CPU_Information+0x10> api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 40010600: c2 0f 20 70 ldub [ %i4 + 0x70 ], %g1 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 40010604: fa 07 21 4c ld [ %i4 + 0x14c ], %i5 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 40010608: 80 a0 00 01 cmp %g0, %g1 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4001060c: c2 07 20 78 ld [ %i4 + 0x78 ], %g1 executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 40010610: b6 60 3f ff subx %g0, -1, %i3 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 40010614: 80 a0 60 00 cmp %g1, 0 40010618: 02 80 00 03 be 40010624 4001061c: b7 2e e0 08 sll %i3, 8, %i3 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 40010620: b6 16 e2 00 or %i3, 0x200, %i3 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 40010624: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 40010628: 80 a0 00 01 cmp %g0, %g1 old_mode |= _ISR_Get_level(); 4001062c: 7f ff ed 50 call 4000bb6c <_CPU_ISR_Get_level> 40010630: a0 60 3f ff subx %g0, -1, %l0 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; 40010634: a1 2c 20 0a sll %l0, 0xa, %l0 40010638: 90 14 00 08 or %l0, %o0, %o0 old_mode |= _ISR_Get_level(); 4001063c: b6 12 00 1b or %o0, %i3, %i3 *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 40010640: 80 8e 61 00 btst 0x100, %i1 40010644: 02 80 00 06 be 4001065c 40010648: f6 26 80 00 st %i3, [ %i2 ] */ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt ( Modes_Control mode_set ) { return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT; 4001064c: 83 36 20 08 srl %i0, 8, %g1 40010650: 82 18 60 01 xor %g1, 1, %g1 40010654: 82 08 60 01 and %g1, 1, %g1 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 40010658: c2 2f 20 70 stb %g1, [ %i4 + 0x70 ] if ( mask & RTEMS_TIMESLICE_MASK ) { 4001065c: 80 8e 62 00 btst 0x200, %i1 40010660: 02 80 00 0b be 4001068c 40010664: 80 8e 60 0f btst 0xf, %i1 if ( _Modes_Is_timeslice(mode_set) ) { 40010668: 80 8e 22 00 btst 0x200, %i0 4001066c: 22 80 00 07 be,a 40010688 40010670: c0 27 20 78 clr [ %i4 + 0x78 ] executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 40010674: 82 10 20 01 mov 1, %g1 40010678: c2 27 20 78 st %g1, [ %i4 + 0x78 ] executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4001067c: 03 10 00 68 sethi %hi(0x4001a000), %g1 40010680: c2 00 62 70 ld [ %g1 + 0x270 ], %g1 ! 4001a270 <_Thread_Ticks_per_timeslice> 40010684: c2 27 20 74 st %g1, [ %i4 + 0x74 ] } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 40010688: 80 8e 60 0f btst 0xf, %i1 4001068c: 02 80 00 06 be 400106a4 40010690: 80 8e 64 00 btst 0x400, %i1 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 40010694: 90 0e 20 0f and %i0, 0xf, %o0 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 40010698: 7f ff c8 bb call 40002984 4001069c: 91 2a 20 08 sll %o0, 8, %o0 * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 400106a0: 80 8e 64 00 btst 0x400, %i1 400106a4: 02 80 00 14 be 400106f4 400106a8: 88 10 20 00 clr %g4 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 400106ac: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; 400106b0: b1 36 20 0a srl %i0, 0xa, %i0 400106b4: b0 1e 20 01 xor %i0, 1, %i0 400106b8: b0 0e 20 01 and %i0, 1, %i0 if ( is_asr_enabled != asr->is_enabled ) { 400106bc: 80 a6 00 01 cmp %i0, %g1 400106c0: 22 80 00 0e be,a 400106f8 400106c4: 03 10 00 6a sethi %hi(0x4001a800), %g1 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 400106c8: 7f ff c8 ab call 40002974 400106cc: f0 2f 60 08 stb %i0, [ %i5 + 8 ] _signals = information->signals_pending; 400106d0: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 information->signals_pending = information->signals_posted; 400106d4: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 information->signals_posted = _signals; 400106d8: c2 27 60 14 st %g1, [ %i5 + 0x14 ] rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; 400106dc: c4 27 60 18 st %g2, [ %i5 + 0x18 ] information->signals_posted = _signals; _ISR_Enable( _level ); 400106e0: 7f ff c8 a9 call 40002984 400106e4: 01 00 00 00 nop asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 400106e8: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400106ec: 80 a0 00 01 cmp %g0, %g1 400106f0: 88 40 20 00 addx %g0, 0, %g4 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 400106f4: 03 10 00 6a sethi %hi(0x4001a800), %g1 400106f8: c4 00 60 18 ld [ %g1 + 0x18 ], %g2 ! 4001a818 <_System_state_Current> 400106fc: 80 a0 a0 03 cmp %g2, 3 40010700: 12 80 00 16 bne 40010758 40010704: 82 10 20 00 clr %g1 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 40010708: 07 10 00 6a sethi %hi(0x4001a800), %g3 if ( are_signals_pending || 4001070c: 80 89 20 ff btst 0xff, %g4 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 40010710: 86 10 e0 20 or %g3, 0x20, %g3 if ( are_signals_pending || 40010714: 12 80 00 0a bne 4001073c 40010718: c4 00 e0 10 ld [ %g3 + 0x10 ], %g2 4001071c: c6 00 e0 14 ld [ %g3 + 0x14 ], %g3 40010720: 80 a0 80 03 cmp %g2, %g3 40010724: 02 80 00 0d be 40010758 40010728: 01 00 00 00 nop (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 4001072c: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 40010730: 80 a0 a0 00 cmp %g2, 0 40010734: 02 80 00 09 be 40010758 <== NEVER TAKEN 40010738: 01 00 00 00 nop _Thread_Dispatch_necessary = true; 4001073c: 84 10 20 01 mov 1, %g2 ! 1 40010740: 03 10 00 6a sethi %hi(0x4001a800), %g1 40010744: 82 10 60 20 or %g1, 0x20, %g1 ! 4001a820 <_Per_CPU_Information> 40010748: c4 28 60 0c stb %g2, [ %g1 + 0xc ] if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 4001074c: 40 00 02 6b call 400110f8 <_Thread_Dispatch> 40010750: 01 00 00 00 nop } return RTEMS_SUCCESSFUL; 40010754: 82 10 20 00 clr %g1 ! 0 } 40010758: 81 c7 e0 08 ret 4001075c: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000b4d0 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4000b4d0: 9d e3 bf 98 save %sp, -104, %sp register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4000b4d4: 80 a6 60 00 cmp %i1, 0 4000b4d8: 02 80 00 08 be 4000b4f8 4000b4dc: 80 a6 a0 00 cmp %i2, 0 RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 4000b4e0: 03 10 00 66 sethi %hi(0x40019800), %g1 4000b4e4: c4 08 61 1c ldub [ %g1 + 0x11c ], %g2 ! 4001991c 4000b4e8: 80 a6 40 02 cmp %i1, %g2 4000b4ec: 18 80 00 1e bgu 4000b564 4000b4f0: 82 10 20 13 mov 0x13, %g1 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4000b4f4: 80 a6 a0 00 cmp %i2, 0 4000b4f8: 02 80 00 1b be 4000b564 4000b4fc: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4000b500: 90 10 00 18 mov %i0, %o0 4000b504: 40 00 09 7c call 4000daf4 <_Thread_Get> 4000b508: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000b50c: c2 07 bf fc ld [ %fp + -4 ], %g1 4000b510: 80 a0 60 00 cmp %g1, 0 4000b514: 12 80 00 14 bne 4000b564 4000b518: 82 10 20 04 mov 4, %g1 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 4000b51c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4000b520: 80 a6 60 00 cmp %i1, 0 4000b524: 02 80 00 0d be 4000b558 4000b528: c2 26 80 00 st %g1, [ %i2 ] the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 4000b52c: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4000b530: 80 a0 60 00 cmp %g1, 0 4000b534: 02 80 00 06 be 4000b54c 4000b538: f2 22 20 18 st %i1, [ %o0 + 0x18 ] 4000b53c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000b540: 80 a0 40 19 cmp %g1, %i1 4000b544: 08 80 00 05 bleu 4000b558 <== ALWAYS TAKEN 4000b548: 01 00 00 00 nop the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 4000b54c: 92 10 00 19 mov %i1, %o1 4000b550: 40 00 08 43 call 4000d65c <_Thread_Change_priority> 4000b554: 94 10 20 00 clr %o2 } _Thread_Enable_dispatch(); 4000b558: 40 00 09 5b call 4000dac4 <_Thread_Enable_dispatch> 4000b55c: 01 00 00 00 nop 4000b560: 82 10 20 00 clr %g1 ! 0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4000b564: 81 c7 e0 08 ret 4000b568: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40017bd0 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 40017bd0: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 40017bd4: 11 10 00 f7 sethi %hi(0x4003dc00), %o0 40017bd8: 92 10 00 18 mov %i0, %o1 40017bdc: 90 12 22 f8 or %o0, 0x2f8, %o0 40017be0: 40 00 0c 3b call 4001accc <_Objects_Get> 40017be4: 94 07 bf fc add %fp, -4, %o2 Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 40017be8: c2 07 bf fc ld [ %fp + -4 ], %g1 40017bec: 80 a0 60 00 cmp %g1, 0 40017bf0: 12 80 00 0c bne 40017c20 40017bf4: 01 00 00 00 nop case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 40017bf8: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 40017bfc: 80 a0 60 04 cmp %g1, 4 40017c00: 02 80 00 04 be 40017c10 <== NEVER TAKEN 40017c04: 01 00 00 00 nop (void) _Watchdog_Remove( &the_timer->Ticker ); 40017c08: 40 00 13 b2 call 4001cad0 <_Watchdog_Remove> 40017c0c: 90 02 20 10 add %o0, 0x10, %o0 _Thread_Enable_dispatch(); 40017c10: 40 00 0f da call 4001bb78 <_Thread_Enable_dispatch> 40017c14: b0 10 20 00 clr %i0 40017c18: 81 c7 e0 08 ret 40017c1c: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40017c20: 81 c7 e0 08 ret 40017c24: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 400180e0 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 400180e0: 9d e3 bf 98 save %sp, -104, %sp Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 400180e4: 03 10 00 f7 sethi %hi(0x4003dc00), %g1 400180e8: f8 00 63 38 ld [ %g1 + 0x338 ], %i4 ! 4003df38 <_Timer_server> if ( !timer_server ) 400180ec: 80 a7 20 00 cmp %i4, 0 400180f0: 02 80 00 3c be 400181e0 400180f4: 82 10 20 0e mov 0xe, %g1 return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) 400180f8: 21 10 00 f5 sethi %hi(0x4003d400), %l0 400180fc: 82 14 20 d8 or %l0, 0xd8, %g1 ! 4003d4d8 <_TOD> 40018100: c4 08 60 14 ldub [ %g1 + 0x14 ], %g2 40018104: 80 a0 a0 00 cmp %g2, 0 40018108: 02 80 00 36 be 400181e0 <== NEVER TAKEN 4001810c: 82 10 20 0b mov 0xb, %g1 return RTEMS_NOT_DEFINED; if ( !routine ) 40018110: 80 a6 a0 00 cmp %i2, 0 40018114: 02 80 00 33 be 400181e0 40018118: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 4001811c: 7f ff f3 7f call 40014f18 <_TOD_Validate> 40018120: 90 10 00 19 mov %i1, %o0 40018124: 80 8a 20 ff btst 0xff, %o0 40018128: 02 80 00 2e be 400181e0 4001812c: 82 10 20 14 mov 0x14, %g1 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 40018130: 7f ff f3 40 call 40014e30 <_TOD_To_seconds> 40018134: 90 10 00 19 mov %i1, %o0 40018138: b2 10 00 08 mov %o0, %i1 4001813c: d0 1c 20 d8 ldd [ %l0 + 0xd8 ], %o0 40018140: 94 10 20 00 clr %o2 40018144: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40018148: 40 00 4f e1 call 4002c0cc <__divdi3> 4001814c: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 if ( seconds <= _TOD_Seconds_since_epoch() ) 40018150: 80 a6 40 09 cmp %i1, %o1 40018154: 08 80 00 23 bleu 400181e0 40018158: 82 10 20 14 mov 0x14, %g1 4001815c: 11 10 00 f7 sethi %hi(0x4003dc00), %o0 40018160: 92 10 00 18 mov %i0, %o1 40018164: 90 12 22 f8 or %o0, 0x2f8, %o0 40018168: 40 00 0a d9 call 4001accc <_Objects_Get> 4001816c: 94 07 bf fc add %fp, -4, %o2 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 40018170: c2 07 bf fc ld [ %fp + -4 ], %g1 40018174: 80 a0 60 00 cmp %g1, 0 40018178: 12 80 00 19 bne 400181dc 4001817c: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 40018180: 40 00 12 54 call 4001cad0 <_Watchdog_Remove> 40018184: 90 02 20 10 add %o0, 0x10, %o0 40018188: d0 1c 20 d8 ldd [ %l0 + 0xd8 ], %o0 the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 4001818c: 82 10 20 03 mov 3, %g1 40018190: 94 10 20 00 clr %o2 40018194: c2 27 60 38 st %g1, [ %i5 + 0x38 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40018198: c0 27 60 18 clr [ %i5 + 0x18 ] the_watchdog->routine = routine; 4001819c: f4 27 60 2c st %i2, [ %i5 + 0x2c ] the_watchdog->id = id; 400181a0: f0 27 60 30 st %i0, [ %i5 + 0x30 ] the_watchdog->user_data = user_data; 400181a4: f6 27 60 34 st %i3, [ %i5 + 0x34 ] 400181a8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400181ac: 40 00 4f c8 call 4002c0cc <__divdi3> 400181b0: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _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 ); 400181b4: c2 07 20 04 ld [ %i4 + 4 ], %g1 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(); 400181b8: 92 26 40 09 sub %i1, %o1, %o1 (*timer_server->schedule_operation)( timer_server, the_timer ); 400181bc: 90 10 00 1c mov %i4, %o0 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(); 400181c0: d2 27 60 1c st %o1, [ %i5 + 0x1c ] (*timer_server->schedule_operation)( timer_server, the_timer ); 400181c4: 9f c0 40 00 call %g1 400181c8: 92 10 00 1d mov %i5, %o1 _Thread_Enable_dispatch(); 400181cc: 40 00 0e 6b call 4001bb78 <_Thread_Enable_dispatch> 400181d0: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 400181d4: 10 80 00 03 b 400181e0 400181d8: 82 10 20 00 clr %g1 ! 0 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 400181dc: 82 10 20 04 mov 4, %g1 } 400181e0: 81 c7 e0 08 ret 400181e4: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 400072d0 : #include int sched_get_priority_max( int policy ) { 400072d0: 9d e3 bf a0 save %sp, -96, %sp switch ( policy ) { 400072d4: 80 a6 20 04 cmp %i0, 4 400072d8: 18 80 00 06 bgu 400072f0 400072dc: 82 10 20 01 mov 1, %g1 400072e0: b1 28 40 18 sll %g1, %i0, %i0 400072e4: 80 8e 20 17 btst 0x17, %i0 400072e8: 12 80 00 08 bne 40007308 <== ALWAYS TAKEN 400072ec: 03 10 00 78 sethi %hi(0x4001e000), %g1 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 400072f0: 40 00 20 0e call 4000f328 <__errno> 400072f4: b0 10 3f ff mov -1, %i0 400072f8: 82 10 20 16 mov 0x16, %g1 400072fc: c2 22 00 00 st %g1, [ %o0 ] 40007300: 81 c7 e0 08 ret 40007304: 81 e8 00 00 restore } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 40007308: f0 08 60 ac ldub [ %g1 + 0xac ], %i0 } 4000730c: 81 c7 e0 08 ret 40007310: 91 ee 3f ff restore %i0, -1, %o0 =============================================================================== 40007314 : * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 */ int sched_get_priority_min( int policy ) { 40007314: 9d e3 bf a0 save %sp, -96, %sp switch ( policy ) { 40007318: 80 a6 20 04 cmp %i0, 4 4000731c: 18 80 00 06 bgu 40007334 40007320: 82 10 20 01 mov 1, %g1 40007324: 83 28 40 18 sll %g1, %i0, %g1 40007328: 80 88 60 17 btst 0x17, %g1 4000732c: 12 80 00 06 bne 40007344 <== ALWAYS TAKEN 40007330: b0 10 20 01 mov 1, %i0 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 40007334: 40 00 1f fd call 4000f328 <__errno> 40007338: b0 10 3f ff mov -1, %i0 4000733c: 82 10 20 16 mov 0x16, %g1 40007340: c2 22 00 00 st %g1, [ %o0 ] } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 40007344: 81 c7 e0 08 ret 40007348: 81 e8 00 00 restore =============================================================================== 4000734c : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 4000734c: 9d e3 bf a0 save %sp, -96, %sp /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 40007350: 80 a6 20 00 cmp %i0, 0 40007354: 02 80 00 0b be 40007380 <== NEVER TAKEN 40007358: 80 a6 60 00 cmp %i1, 0 4000735c: 7f ff f0 07 call 40003378 40007360: 01 00 00 00 nop 40007364: 80 a6 00 08 cmp %i0, %o0 40007368: 02 80 00 06 be 40007380 4000736c: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 40007370: 40 00 1f ee call 4000f328 <__errno> 40007374: 01 00 00 00 nop 40007378: 10 80 00 07 b 40007394 4000737c: 82 10 20 03 mov 3, %g1 ! 3 if ( !interval ) 40007380: 12 80 00 08 bne 400073a0 40007384: 03 10 00 7a sethi %hi(0x4001e800), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 40007388: 40 00 1f e8 call 4000f328 <__errno> 4000738c: 01 00 00 00 nop 40007390: 82 10 20 16 mov 0x16, %g1 ! 16 40007394: c2 22 00 00 st %g1, [ %o0 ] 40007398: 81 c7 e0 08 ret 4000739c: 91 e8 3f ff restore %g0, -1, %o0 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 400073a0: d0 00 63 c0 ld [ %g1 + 0x3c0 ], %o0 400073a4: 92 10 00 19 mov %i1, %o1 400073a8: 40 00 0e 63 call 4000ad34 <_Timespec_From_ticks> 400073ac: b0 10 20 00 clr %i0 return 0; } 400073b0: 81 c7 e0 08 ret 400073b4: 81 e8 00 00 restore =============================================================================== 40007d68 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 40007d68: 9d e3 bf 88 save %sp, -120, %sp * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40007d6c: 03 10 00 8b sethi %hi(0x40022c00), %g1 40007d70: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ! 40022c10 <_Thread_Dispatch_disable_level> size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 40007d74: f4 27 a0 4c st %i2, [ %fp + 0x4c ] ++level; 40007d78: 84 00 a0 01 inc %g2 40007d7c: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40007d80: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40007d84: fa 27 a0 58 st %i5, [ %fp + 0x58 ] _Thread_Dispatch_disable_level = level; 40007d88: c4 20 60 10 st %g2, [ %g1 + 0x10 ] Objects_Locations location; size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 40007d8c: b4 8e 62 00 andcc %i1, 0x200, %i2 40007d90: 02 80 00 05 be 40007da4 40007d94: b8 10 20 00 clr %i4 va_start(arg, oflag); mode = va_arg( arg, mode_t ); value = va_arg( arg, unsigned int ); 40007d98: f8 07 a0 50 ld [ %fp + 0x50 ], %i4 size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 40007d9c: 82 07 a0 4c add %fp, 0x4c, %g1 40007da0: c2 27 bf ec st %g1, [ %fp + -20 ] const char *name, Objects_Id *id, size_t *len ) { return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len ); 40007da4: 37 10 00 8b sethi %hi(0x40022c00), %i3 40007da8: 92 10 00 18 mov %i0, %o1 40007dac: 90 16 e2 d4 or %i3, 0x2d4, %o0 40007db0: 94 07 bf f0 add %fp, -16, %o2 40007db4: 7f ff fe 7e call 400077ac <_POSIX_Name_to_id> 40007db8: 96 07 bf fc add %fp, -4, %o3 * 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 ) { 40007dbc: ba 92 20 00 orcc %o0, 0, %i5 40007dc0: 22 80 00 0e be,a 40007df8 40007dc4: b2 0e 6a 00 and %i1, 0xa00, %i1 /* * 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) ) ) { 40007dc8: 80 a7 60 02 cmp %i5, 2 40007dcc: 12 80 00 04 bne 40007ddc 40007dd0: 80 a6 a0 00 cmp %i2, 0 40007dd4: 12 80 00 20 bne 40007e54 40007dd8: d2 07 bf fc ld [ %fp + -4 ], %o1 _Thread_Enable_dispatch(); 40007ddc: 40 00 0d b7 call 4000b4b8 <_Thread_Enable_dispatch> 40007de0: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 40007de4: 40 00 22 eb call 40010990 <__errno> 40007de8: 01 00 00 00 nop 40007dec: fa 22 00 00 st %i5, [ %o0 ] 40007df0: 81 c7 e0 08 ret 40007df4: 81 e8 00 00 restore /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 40007df8: 80 a6 6a 00 cmp %i1, 0xa00 40007dfc: 12 80 00 0a bne 40007e24 40007e00: d2 07 bf f0 ld [ %fp + -16 ], %o1 _Thread_Enable_dispatch(); 40007e04: 40 00 0d ad call 4000b4b8 <_Thread_Enable_dispatch> 40007e08: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 40007e0c: 40 00 22 e1 call 40010990 <__errno> 40007e10: 01 00 00 00 nop 40007e14: 82 10 20 11 mov 0x11, %g1 ! 11 40007e18: c2 22 00 00 st %g1, [ %o0 ] 40007e1c: 81 c7 e0 08 ret 40007e20: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( sem_t *id, Objects_Locations *location ) { return (POSIX_Semaphore_Control *) 40007e24: 94 07 bf f8 add %fp, -8, %o2 40007e28: 40 00 09 ea call 4000a5d0 <_Objects_Get> 40007e2c: 90 16 e2 d4 or %i3, 0x2d4, %o0 } the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location ); the_semaphore->open_count += 1; 40007e30: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 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( (sem_t *) &the_semaphore_id, &location ); 40007e34: d0 27 bf f4 st %o0, [ %fp + -12 ] the_semaphore->open_count += 1; 40007e38: 82 00 60 01 inc %g1 _Thread_Enable_dispatch(); 40007e3c: 40 00 0d 9f call 4000b4b8 <_Thread_Enable_dispatch> 40007e40: c2 22 20 18 st %g1, [ %o0 + 0x18 ] _Thread_Enable_dispatch(); 40007e44: 40 00 0d 9d call 4000b4b8 <_Thread_Enable_dispatch> 40007e48: 01 00 00 00 nop goto return_id; 40007e4c: 10 80 00 0d b 40007e80 40007e50: f0 07 bf f4 ld [ %fp + -12 ], %i0 /* * 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( 40007e54: 94 10 20 00 clr %o2 40007e58: 96 10 00 1c mov %i4, %o3 40007e5c: 98 07 bf f4 add %fp, -12, %o4 40007e60: 40 00 19 1b call 4000e2cc <_POSIX_Semaphore_Create_support> 40007e64: 90 10 00 18 mov %i0, %o0 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 40007e68: 40 00 0d 94 call 4000b4b8 <_Thread_Enable_dispatch> 40007e6c: ba 10 00 08 mov %o0, %i5 if ( status == -1 ) 40007e70: 80 a7 7f ff cmp %i5, -1 40007e74: 22 80 00 04 be,a 40007e84 <== NEVER TAKEN 40007e78: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; return &the_semaphore->Semaphore_id; #else return (sem_t *)&the_semaphore->Object.id; 40007e7c: f0 07 bf f4 ld [ %fp + -12 ], %i0 40007e80: b0 06 20 08 add %i0, 8, %i0 #endif } 40007e84: 81 c7 e0 08 ret 40007e88: 81 e8 00 00 restore =============================================================================== 400072c8 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 400072c8: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; if ( oact ) 400072cc: 80 a6 a0 00 cmp %i2, 0 400072d0: 02 80 00 0a be 400072f8 400072d4: 83 2e 20 02 sll %i0, 2, %g1 *oact = _POSIX_signals_Vectors[ sig ]; 400072d8: 85 2e 20 04 sll %i0, 4, %g2 400072dc: 82 20 80 01 sub %g2, %g1, %g1 400072e0: 13 10 00 66 sethi %hi(0x40019800), %o1 400072e4: 90 10 00 1a mov %i2, %o0 400072e8: 92 12 63 f0 or %o1, 0x3f0, %o1 400072ec: 94 10 20 0c mov 0xc, %o2 400072f0: 40 00 23 56 call 40010048 400072f4: 92 02 40 01 add %o1, %g1, %o1 if ( !sig ) 400072f8: 80 a6 20 00 cmp %i0, 0 400072fc: 32 80 00 03 bne,a 40007308 40007300: 82 06 3f ff add %i0, -1, %g1 40007304: 30 80 00 06 b,a 4000731c rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 40007308: 80 a0 60 1f cmp %g1, 0x1f 4000730c: 18 80 00 04 bgu 4000731c 40007310: 80 a6 20 09 cmp %i0, 9 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 40007314: 12 80 00 08 bne 40007334 40007318: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); 4000731c: 40 00 21 10 call 4000f75c <__errno> 40007320: 01 00 00 00 nop 40007324: 82 10 20 16 mov 0x16, %g1 ! 16 40007328: c2 22 00 00 st %g1, [ %o0 ] 4000732c: 10 80 00 20 b 400073ac 40007330: 82 10 3f ff mov -1, %g1 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 40007334: 02 80 00 1e be 400073ac <== NEVER TAKEN 40007338: 82 10 20 00 clr %g1 /* * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); 4000733c: 7f ff ec 3f call 40002438 40007340: 01 00 00 00 nop 40007344: b8 10 00 08 mov %o0, %i4 if ( act->sa_handler == SIG_DFL ) { 40007348: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000734c: 3b 10 00 66 sethi %hi(0x40019800), %i5 40007350: 80 a0 60 00 cmp %g1, 0 40007354: 12 80 00 0a bne 4000737c 40007358: ba 17 63 f0 or %i5, 0x3f0, %i5 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 4000735c: 83 2e 20 02 sll %i0, 2, %g1 40007360: 13 10 00 60 sethi %hi(0x40018000), %o1 40007364: b1 2e 20 04 sll %i0, 4, %i0 40007368: 92 12 62 d4 or %o1, 0x2d4, %o1 4000736c: b0 26 00 01 sub %i0, %g1, %i0 40007370: 90 07 40 18 add %i5, %i0, %o0 40007374: 10 80 00 09 b 40007398 40007378: 92 02 40 18 add %o1, %i0, %o1 } else { _POSIX_signals_Clear_process_signals( sig ); 4000737c: 40 00 16 3a call 4000cc64 <_POSIX_signals_Clear_process_signals> 40007380: 90 10 00 18 mov %i0, %o0 _POSIX_signals_Vectors[ sig ] = *act; 40007384: 83 2e 20 02 sll %i0, 2, %g1 40007388: 92 10 00 19 mov %i1, %o1 4000738c: b1 2e 20 04 sll %i0, 4, %i0 40007390: 90 26 00 01 sub %i0, %g1, %o0 40007394: 90 07 40 08 add %i5, %o0, %o0 40007398: 40 00 23 2c call 40010048 4000739c: 94 10 20 0c mov 0xc, %o2 } _ISR_Enable( level ); 400073a0: 7f ff ec 2a call 40002448 400073a4: 90 10 00 1c mov %i4, %o0 * now (signals not posted when SIG_IGN). * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; 400073a8: 82 10 20 00 clr %g1 } 400073ac: 81 c7 e0 08 ret 400073b0: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000780c : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 4000780c: 9d e3 bf 90 save %sp, -112, %sp ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 40007810: 80 a6 20 00 cmp %i0, 0 40007814: 02 80 00 0e be 4000784c 40007818: 80 a6 a0 00 cmp %i2, 0 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 4000781c: 02 80 00 10 be 4000785c 40007820: b6 10 20 00 clr %i3 if ( !_Timespec_Is_valid( timeout ) ) 40007824: 40 00 0e ac call 4000b2d4 <_Timespec_Is_valid> 40007828: 90 10 00 1a mov %i2, %o0 4000782c: 80 8a 20 ff btst 0xff, %o0 40007830: 02 80 00 07 be 4000784c 40007834: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 40007838: 40 00 0e b9 call 4000b31c <_Timespec_To_ticks> 4000783c: 90 10 00 1a mov %i2, %o0 if ( !interval ) 40007840: b6 92 20 00 orcc %o0, 0, %i3 40007844: 12 80 00 07 bne 40007860 <== ALWAYS TAKEN 40007848: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); 4000784c: 40 00 21 90 call 4000fe8c <__errno> 40007850: 01 00 00 00 nop 40007854: 10 80 00 63 b 400079e0 40007858: 82 10 20 16 mov 0x16, %g1 ! 16 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 4000785c: 80 a6 60 00 cmp %i1, 0 40007860: 22 80 00 02 be,a 40007868 40007864: b2 07 bf f4 add %fp, -12, %i1 the_thread = _Thread_Executing; 40007868: 21 10 00 68 sethi %hi(0x4001a000), %l0 4000786c: a0 14 23 a0 or %l0, 0x3a0, %l0 ! 4001a3a0 <_Per_CPU_Information> 40007870: fa 04 20 10 ld [ %l0 + 0x10 ], %i5 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 40007874: 7f ff eb ce call 400027ac 40007878: f8 07 61 50 ld [ %i5 + 0x150 ], %i4 4000787c: b4 10 00 08 mov %o0, %i2 if ( *set & api->signals_pending ) { 40007880: c4 06 00 00 ld [ %i0 ], %g2 40007884: c2 07 20 d4 ld [ %i4 + 0xd4 ], %g1 40007888: 80 88 80 01 btst %g2, %g1 4000788c: 22 80 00 12 be,a 400078d4 40007890: 03 10 00 69 sethi %hi(0x4001a400), %g1 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 40007894: 7f ff ff c6 call 400077ac <_POSIX_signals_Get_lowest> 40007898: 90 10 00 01 mov %g1, %o0 _POSIX_signals_Clear_signals( 4000789c: 94 10 00 19 mov %i1, %o2 /* API signals pending? */ _ISR_Disable( level ); if ( *set & api->signals_pending ) { /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 400078a0: 92 10 00 08 mov %o0, %o1 400078a4: d0 26 40 00 st %o0, [ %i1 ] _POSIX_signals_Clear_signals( 400078a8: 96 10 20 00 clr %o3 400078ac: 90 10 00 1c mov %i4, %o0 400078b0: 40 00 17 08 call 4000d4d0 <_POSIX_signals_Clear_signals> 400078b4: 98 10 20 00 clr %o4 the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 400078b8: 7f ff eb c1 call 400027bc 400078bc: 90 10 00 1a mov %i2, %o0 the_info->si_code = SI_USER; 400078c0: 82 10 20 01 mov 1, %g1 the_info->si_value.sival_int = 0; 400078c4: c0 26 60 08 clr [ %i1 + 8 ] false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; 400078c8: c2 26 60 04 st %g1, [ %i1 + 4 ] the_info->si_value.sival_int = 0; return the_info->si_signo; 400078cc: 10 80 00 47 b 400079e8 400078d0: fa 06 40 00 ld [ %i1 ], %i5 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 400078d4: c2 00 61 f4 ld [ %g1 + 0x1f4 ], %g1 400078d8: 80 88 80 01 btst %g2, %g1 400078dc: 22 80 00 12 be,a 40007924 400078e0: 82 10 3f ff mov -1, %g1 signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 400078e4: 7f ff ff b2 call 400077ac <_POSIX_signals_Get_lowest> 400078e8: 90 10 00 01 mov %g1, %o0 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 400078ec: 94 10 00 19 mov %i1, %o2 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 400078f0: ba 10 00 08 mov %o0, %i5 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 400078f4: 96 10 20 01 mov 1, %o3 400078f8: 90 10 00 1c mov %i4, %o0 400078fc: 92 10 00 1d mov %i5, %o1 40007900: 40 00 16 f4 call 4000d4d0 <_POSIX_signals_Clear_signals> 40007904: 98 10 20 00 clr %o4 _ISR_Enable( level ); 40007908: 7f ff eb ad call 400027bc 4000790c: 90 10 00 1a mov %i2, %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 40007910: 82 10 20 01 mov 1, %g1 if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 40007914: fa 26 40 00 st %i5, [ %i1 ] the_info->si_code = SI_USER; 40007918: c2 26 60 04 st %g1, [ %i1 + 4 ] the_info->si_value.sival_int = 0; 4000791c: 10 80 00 33 b 400079e8 40007920: c0 26 60 08 clr [ %i1 + 8 ] return signo; } the_info->si_signo = -1; 40007924: c2 26 40 00 st %g1, [ %i1 ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40007928: 03 10 00 67 sethi %hi(0x40019c00), %g1 4000792c: c4 00 62 90 ld [ %g1 + 0x290 ], %g2 ! 40019e90 <_Thread_Dispatch_disable_level> ++level; 40007930: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40007934: c4 20 62 90 st %g2, [ %g1 + 0x290 ] _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 40007938: 82 10 20 04 mov 4, %g1 4000793c: c2 27 60 34 st %g1, [ %i5 + 0x34 ] the_thread->Wait.option = *set; 40007940: c2 06 00 00 ld [ %i0 ], %g1 the_thread->Wait.return_argument = the_info; 40007944: f2 27 60 28 st %i1, [ %i5 + 0x28 ] the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; 40007948: c2 27 60 30 st %g1, [ %i5 + 0x30 ] 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; 4000794c: a2 10 20 01 mov 1, %l1 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 40007950: 35 10 00 69 sethi %hi(0x4001a400), %i2 40007954: b4 16 a1 8c or %i2, 0x18c, %i2 ! 4001a58c <_POSIX_signals_Wait_queue> 40007958: f4 27 60 44 st %i2, [ %i5 + 0x44 ] 4000795c: e2 26 a0 30 st %l1, [ %i2 + 0x30 ] 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 ); 40007960: 7f ff eb 97 call 400027bc 40007964: 01 00 00 00 nop _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 40007968: 90 10 00 1a mov %i2, %o0 4000796c: 92 10 00 1b mov %i3, %o1 40007970: 15 10 00 2c sethi %hi(0x4000b000), %o2 40007974: 40 00 0d 08 call 4000ad94 <_Thread_queue_Enqueue_with_handler> 40007978: 94 12 a1 00 or %o2, 0x100, %o2 ! 4000b100 <_Thread_queue_Timeout> _Thread_Enable_dispatch(); 4000797c: 40 00 0b d0 call 4000a8bc <_Thread_Enable_dispatch> 40007980: 01 00 00 00 nop /* * 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 ); 40007984: d2 06 40 00 ld [ %i1 ], %o1 40007988: 90 10 00 1c mov %i4, %o0 4000798c: 94 10 00 19 mov %i1, %o2 40007990: 96 10 20 00 clr %o3 40007994: 40 00 16 cf call 4000d4d0 <_POSIX_signals_Clear_signals> 40007998: 98 10 20 00 clr %o4 /* Set errno only if return code is not EINTR or * if EINTR was caused by a signal being caught, which * was not in our set. */ if ( (_Thread_Executing->Wait.return_code != EINTR) 4000799c: c2 04 20 10 ld [ %l0 + 0x10 ], %g1 400079a0: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 400079a4: 80 a0 60 04 cmp %g1, 4 400079a8: 12 80 00 09 bne 400079cc 400079ac: 01 00 00 00 nop || !(*set & signo_to_mask( the_info->si_signo )) ) { 400079b0: fa 06 40 00 ld [ %i1 ], %i5 400079b4: 82 07 7f ff add %i5, -1, %g1 400079b8: a3 2c 40 01 sll %l1, %g1, %l1 400079bc: c2 06 00 00 ld [ %i0 ], %g1 400079c0: 80 8c 40 01 btst %l1, %g1 400079c4: 12 80 00 09 bne 400079e8 400079c8: 01 00 00 00 nop errno = _Thread_Executing->Wait.return_code; 400079cc: 40 00 21 30 call 4000fe8c <__errno> 400079d0: 01 00 00 00 nop 400079d4: 03 10 00 68 sethi %hi(0x4001a000), %g1 400079d8: c2 00 63 b0 ld [ %g1 + 0x3b0 ], %g1 ! 4001a3b0 <_Per_CPU_Information+0x10> 400079dc: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 400079e0: c2 22 00 00 st %g1, [ %o0 ] return -1; 400079e4: ba 10 3f ff mov -1, %i5 } return the_info->si_signo; } 400079e8: 81 c7 e0 08 ret 400079ec: 91 e8 00 1d restore %g0, %i5, %o0 =============================================================================== 40009724 : int sigwait( const sigset_t *set, int *sig ) { 40009724: 9d e3 bf a0 save %sp, -96, %sp int status; status = sigtimedwait( set, NULL, NULL ); 40009728: 92 10 20 00 clr %o1 4000972c: 90 10 00 18 mov %i0, %o0 40009730: 7f ff ff 80 call 40009530 40009734: 94 10 20 00 clr %o2 if ( status != -1 ) { 40009738: 80 a2 3f ff cmp %o0, -1 4000973c: 02 80 00 06 be 40009754 40009740: 80 a6 60 00 cmp %i1, 0 if ( sig ) 40009744: 32 80 00 09 bne,a 40009768 <== ALWAYS TAKEN 40009748: d0 26 40 00 st %o0, [ %i1 ] *sig = status; return 0; 4000974c: 81 c7 e0 08 ret <== NOT EXECUTED 40009750: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED } return errno; 40009754: 40 00 20 60 call 400118d4 <__errno> 40009758: 01 00 00 00 nop 4000975c: f0 02 00 00 ld [ %o0 ], %i0 40009760: 81 c7 e0 08 ret 40009764: 81 e8 00 00 restore status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) *sig = status; return 0; 40009768: b0 10 20 00 clr %i0 } return errno; } 4000976c: 81 c7 e0 08 ret 40009770: 81 e8 00 00 restore =============================================================================== 400065a0 : */ long sysconf( int name ) { 400065a0: 9d e3 bf a0 save %sp, -96, %sp if ( name == _SC_CLK_TCK ) 400065a4: 80 a6 20 02 cmp %i0, 2 400065a8: 12 80 00 09 bne 400065cc 400065ac: 03 10 00 59 sethi %hi(0x40016400), %g1 return (TOD_MICROSECONDS_PER_SECOND / 400065b0: 03 10 00 52 sethi %hi(0x40014800), %g1 400065b4: d2 00 63 d4 ld [ %g1 + 0x3d4 ], %o1 ! 40014bd4 400065b8: 11 00 03 d0 sethi %hi(0xf4000), %o0 400065bc: 40 00 30 64 call 4001274c <.udiv> 400065c0: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 400065c4: 81 c7 e0 08 ret 400065c8: 91 e8 00 08 restore %g0, %o0, %o0 rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) 400065cc: 80 a6 20 04 cmp %i0, 4 400065d0: 02 80 00 13 be 4000661c 400065d4: d0 00 60 08 ld [ %g1 + 8 ], %o0 return rtems_libio_number_iops; if ( name == _SC_GETPW_R_SIZE_MAX ) 400065d8: 80 a6 20 33 cmp %i0, 0x33 400065dc: 02 80 00 10 be 4000661c 400065e0: 90 10 24 00 mov 0x400, %o0 return 1024; if ( name == _SC_PAGESIZE ) 400065e4: 80 a6 20 08 cmp %i0, 8 400065e8: 02 80 00 0d be 4000661c 400065ec: 11 00 00 04 sethi %hi(0x1000), %o0 return PAGE_SIZE; if ( name == _SC_SYMLOOP_MAX ) 400065f0: 80 a6 20 4f cmp %i0, 0x4f 400065f4: 02 80 00 0a be 4000661c <== NEVER TAKEN 400065f8: 90 10 20 20 mov 0x20, %o0 return RTEMS_FILESYSTEM_SYMLOOP_MAX; #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ 400065fc: 80 a6 22 03 cmp %i0, 0x203 40006600: 02 80 00 07 be 4000661c <== NEVER TAKEN 40006604: 90 10 20 00 clr %o0 return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); 40006608: 40 00 20 de call 4000e980 <__errno> 4000660c: 01 00 00 00 nop 40006610: 82 10 20 16 mov 0x16, %g1 ! 16 40006614: c2 22 00 00 st %g1, [ %o0 ] 40006618: 90 10 3f ff mov -1, %o0 } 4000661c: b0 10 00 08 mov %o0, %i0 40006620: 81 c7 e0 08 ret 40006624: 81 e8 00 00 restore =============================================================================== 40007e8c : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 40007e8c: 9d e3 bf a0 save %sp, -96, %sp POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 40007e90: 80 a6 20 01 cmp %i0, 1 40007e94: 12 80 00 13 bne 40007ee0 40007e98: 80 a6 a0 00 cmp %i2, 0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 40007e9c: 02 80 00 11 be 40007ee0 40007ea0: 80 a6 60 00 cmp %i1, 0 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 40007ea4: 02 80 00 13 be 40007ef0 40007ea8: 03 10 00 8b sethi %hi(0x40022c00), %g1 /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 40007eac: c2 06 40 00 ld [ %i1 ], %g1 40007eb0: 82 00 7f ff add %g1, -1, %g1 40007eb4: 80 a0 60 01 cmp %g1, 1 40007eb8: 28 80 00 03 bleu,a 40007ec4 <== ALWAYS TAKEN 40007ebc: c2 06 60 04 ld [ %i1 + 4 ], %g1 40007ec0: 30 80 00 08 b,a 40007ee0 <== NOT EXECUTED ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 40007ec4: 80 a0 60 00 cmp %g1, 0 40007ec8: 32 80 00 03 bne,a 40007ed4 <== ALWAYS TAKEN 40007ecc: 82 00 7f ff add %g1, -1, %g1 40007ed0: 30 80 00 04 b,a 40007ee0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 40007ed4: 80 a0 60 1f cmp %g1, 0x1f 40007ed8: 28 80 00 06 bleu,a 40007ef0 <== ALWAYS TAKEN 40007edc: 03 10 00 8b sethi %hi(0x40022c00), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 40007ee0: 40 00 22 ac call 40010990 <__errno> 40007ee4: 01 00 00 00 nop 40007ee8: 10 80 00 10 b 40007f28 40007eec: 82 10 20 16 mov 0x16, %g1 ! 16 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40007ef0: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ++level; 40007ef4: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40007ef8: c4 20 60 10 st %g2, [ %g1 + 0x10 ] * 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 ); 40007efc: 11 10 00 8b sethi %hi(0x40022c00), %o0 40007f00: 40 00 08 6e call 4000a0b8 <_Objects_Allocate> 40007f04: 90 12 23 14 or %o0, 0x314, %o0 ! 40022f14 <_POSIX_Timer_Information> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 40007f08: 80 a2 20 00 cmp %o0, 0 40007f0c: 12 80 00 0a bne 40007f34 40007f10: 82 10 20 02 mov 2, %g1 _Thread_Enable_dispatch(); 40007f14: 40 00 0d 69 call 4000b4b8 <_Thread_Enable_dispatch> 40007f18: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 40007f1c: 40 00 22 9d call 40010990 <__errno> 40007f20: 01 00 00 00 nop 40007f24: 82 10 20 0b mov 0xb, %g1 ! b 40007f28: c2 22 00 00 st %g1, [ %o0 ] 40007f2c: 81 c7 e0 08 ret 40007f30: 91 e8 3f ff restore %g0, -1, %o0 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 40007f34: c2 2a 20 3c stb %g1, [ %o0 + 0x3c ] ptimer->thread_id = _Thread_Executing->Object.id; 40007f38: 03 10 00 8c sethi %hi(0x40023000), %g1 40007f3c: c2 00 61 70 ld [ %g1 + 0x170 ], %g1 ! 40023170 <_Per_CPU_Information+0x10> if ( evp != NULL ) { 40007f40: 80 a6 60 00 cmp %i1, 0 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; 40007f44: c2 00 60 08 ld [ %g1 + 8 ], %g1 if ( evp != NULL ) { 40007f48: 02 80 00 08 be 40007f68 40007f4c: c2 22 20 38 st %g1, [ %o0 + 0x38 ] ptimer->inf.sigev_notify = evp->sigev_notify; 40007f50: c2 06 40 00 ld [ %i1 ], %g1 40007f54: c2 22 20 40 st %g1, [ %o0 + 0x40 ] ptimer->inf.sigev_signo = evp->sigev_signo; 40007f58: c2 06 60 04 ld [ %i1 + 4 ], %g1 40007f5c: c2 22 20 44 st %g1, [ %o0 + 0x44 ] ptimer->inf.sigev_value = evp->sigev_value; 40007f60: c2 06 60 08 ld [ %i1 + 8 ], %g1 40007f64: c2 22 20 48 st %g1, [ %o0 + 0x48 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40007f68: c4 12 20 0a lduh [ %o0 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40007f6c: 07 10 00 8b sethi %hi(0x40022c00), %g3 40007f70: c6 00 e3 30 ld [ %g3 + 0x330 ], %g3 ! 40022f30 <_POSIX_Timer_Information+0x1c> } ptimer->overrun = 0; 40007f74: c0 22 20 68 clr [ %o0 + 0x68 ] ptimer->timer_data.it_value.tv_sec = 0; 40007f78: c0 22 20 5c clr [ %o0 + 0x5c ] ptimer->timer_data.it_value.tv_nsec = 0; 40007f7c: c0 22 20 60 clr [ %o0 + 0x60 ] ptimer->timer_data.it_interval.tv_sec = 0; 40007f80: c0 22 20 54 clr [ %o0 + 0x54 ] ptimer->timer_data.it_interval.tv_nsec = 0; 40007f84: c0 22 20 58 clr [ %o0 + 0x58 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40007f88: c0 22 20 18 clr [ %o0 + 0x18 ] the_watchdog->routine = routine; 40007f8c: c0 22 20 2c clr [ %o0 + 0x2c ] the_watchdog->id = id; 40007f90: c0 22 20 30 clr [ %o0 + 0x30 ] the_watchdog->user_data = user_data; 40007f94: c0 22 20 34 clr [ %o0 + 0x34 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40007f98: c2 02 20 08 ld [ %o0 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40007f9c: 85 28 a0 02 sll %g2, 2, %g2 40007fa0: d0 20 c0 02 st %o0, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40007fa4: c0 22 20 0c clr [ %o0 + 0xc ] _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 40007fa8: c2 26 80 00 st %g1, [ %i2 ] _Thread_Enable_dispatch(); 40007fac: 40 00 0d 43 call 4000b4b8 <_Thread_Enable_dispatch> 40007fb0: b0 10 20 00 clr %i0 return 0; } 40007fb4: 81 c7 e0 08 ret 40007fb8: 81 e8 00 00 restore =============================================================================== 40006a94 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 40006a94: 9d e3 bf 78 save %sp, -136, %sp Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 40006a98: 80 a6 a0 00 cmp %i2, 0 40006a9c: 02 80 00 80 be 40006c9c <== NEVER TAKEN 40006aa0: 01 00 00 00 nop /* * First, it verifies if the structure "value" is correct * if the number of nanoseconds is not correct return EINVAL */ if ( !_Timespec_Is_valid( &(value->it_value) ) ) { 40006aa4: 40 00 0f 36 call 4000a77c <_Timespec_Is_valid> 40006aa8: 90 06 a0 08 add %i2, 8, %o0 40006aac: 80 8a 20 ff btst 0xff, %o0 40006ab0: 02 80 00 7b be 40006c9c 40006ab4: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !_Timespec_Is_valid( &(value->it_interval) ) ) { 40006ab8: 40 00 0f 31 call 4000a77c <_Timespec_Is_valid> 40006abc: 90 10 00 1a mov %i2, %o0 40006ac0: 80 8a 20 ff btst 0xff, %o0 40006ac4: 02 80 00 76 be 40006c9c <== NEVER TAKEN 40006ac8: 80 8e 7f fb btst -5, %i1 rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 40006acc: 12 80 00 74 bne 40006c9c 40006ad0: 90 07 bf f0 add %fp, -16, %o0 rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 40006ad4: 92 10 00 1a mov %i2, %o1 40006ad8: 40 00 24 66 call 4000fc70 40006adc: 94 10 20 10 mov 0x10, %o2 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 40006ae0: 80 a6 60 04 cmp %i1, 4 40006ae4: 12 80 00 1f bne 40006b60 40006ae8: 11 10 00 7b sethi %hi(0x4001ec00), %o0 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 40006aec: 90 07 bf e0 add %fp, -32, %o0 40006af0: 13 10 00 7a sethi %hi(0x4001e800), %o1 40006af4: 40 00 06 74 call 400084c4 <_TOD_Get_with_nanoseconds> 40006af8: 92 12 63 b8 or %o1, 0x3b8, %o1 ! 4001ebb8 <_TOD> case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 40006afc: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006b00: 94 10 20 00 clr %o2 40006b04: 90 10 00 1c mov %i4, %o0 40006b08: 92 10 00 1d mov %i5, %o1 40006b0c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006b10: 40 00 48 92 call 40018d58 <__divdi3> 40006b14: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006b18: 94 10 20 00 clr %o2 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006b1c: d2 27 bf e8 st %o1, [ %fp + -24 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006b20: 90 10 00 1c mov %i4, %o0 40006b24: 92 10 00 1d mov %i5, %o1 40006b28: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006b2c: 40 00 49 76 call 40019104 <__moddi3> 40006b30: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 40006b34: 90 07 bf f8 add %fp, -8, %o0 40006b38: d2 27 bf ec st %o1, [ %fp + -20 ] 40006b3c: 40 00 0f 22 call 4000a7c4 <_Timespec_Less_than> 40006b40: 92 07 bf e8 add %fp, -24, %o1 40006b44: 80 8a 20 ff btst 0xff, %o0 40006b48: 12 80 00 55 bne 40006c9c 40006b4c: 92 07 bf f8 add %fp, -8, %o1 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 40006b50: 90 07 bf e8 add %fp, -24, %o0 40006b54: 40 00 0f 2c call 4000a804 <_Timespec_Subtract> 40006b58: 94 10 00 09 mov %o1, %o2 RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 40006b5c: 11 10 00 7b sethi %hi(0x4001ec00), %o0 40006b60: 92 10 00 18 mov %i0, %o1 40006b64: 90 12 23 34 or %o0, 0x334, %o0 40006b68: 40 00 08 fe call 40008f60 <_Objects_Get> 40006b6c: 94 07 bf dc add %fp, -36, %o2 * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 40006b70: c2 07 bf dc ld [ %fp + -36 ], %g1 40006b74: 80 a0 60 00 cmp %g1, 0 40006b78: 12 80 00 49 bne 40006c9c 40006b7c: b2 10 00 08 mov %o0, %i1 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 ) { 40006b80: c2 07 bf f8 ld [ %fp + -8 ], %g1 40006b84: 80 a0 60 00 cmp %g1, 0 40006b88: 12 80 00 14 bne 40006bd8 40006b8c: c2 07 bf fc ld [ %fp + -4 ], %g1 40006b90: 80 a0 60 00 cmp %g1, 0 40006b94: 12 80 00 11 bne 40006bd8 40006b98: 01 00 00 00 nop /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 40006b9c: 40 00 10 28 call 4000ac3c <_Watchdog_Remove> 40006ba0: 90 02 20 10 add %o0, 0x10, %o0 /* The old data of the timer are returned */ if ( ovalue ) 40006ba4: 80 a6 e0 00 cmp %i3, 0 40006ba8: 02 80 00 05 be 40006bbc 40006bac: 90 10 00 1b mov %i3, %o0 *ovalue = ptimer->timer_data; 40006bb0: 92 06 60 54 add %i1, 0x54, %o1 40006bb4: 40 00 24 2f call 4000fc70 40006bb8: 94 10 20 10 mov 0x10, %o2 /* The new data are set */ ptimer->timer_data = normalize; 40006bbc: 90 06 60 54 add %i1, 0x54, %o0 40006bc0: 92 07 bf f0 add %fp, -16, %o1 40006bc4: 40 00 24 2b call 4000fc70 40006bc8: 94 10 20 10 mov 0x10, %o2 /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 40006bcc: 82 10 20 04 mov 4, %g1 40006bd0: 10 80 00 2f b 40006c8c 40006bd4: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 40006bd8: 40 00 0f 1c call 4000a848 <_Timespec_To_ticks> 40006bdc: 90 10 00 1a mov %i2, %o0 40006be0: d0 26 60 64 st %o0, [ %i1 + 0x64 ] initial_period = _Timespec_To_ticks( &normalize.it_value ); 40006be4: 40 00 0f 19 call 4000a848 <_Timespec_To_ticks> 40006be8: 90 07 bf f8 add %fp, -8, %o0 activated = _POSIX_Timer_Insert_helper( 40006bec: d4 06 60 08 ld [ %i1 + 8 ], %o2 return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); initial_period = _Timespec_To_ticks( &normalize.it_value ); 40006bf0: 92 10 00 08 mov %o0, %o1 activated = _POSIX_Timer_Insert_helper( 40006bf4: 17 10 00 1b sethi %hi(0x40006c00), %o3 40006bf8: 90 06 60 10 add %i1, 0x10, %o0 40006bfc: 96 12 e0 b4 or %o3, 0xb4, %o3 40006c00: 40 00 17 e3 call 4000cb8c <_POSIX_Timer_Insert_helper> 40006c04: 98 10 00 19 mov %i1, %o4 initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 40006c08: 80 8a 20 ff btst 0xff, %o0 40006c0c: 02 80 00 20 be 40006c8c 40006c10: 80 a6 e0 00 cmp %i3, 0 /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 40006c14: 02 80 00 05 be 40006c28 40006c18: 90 10 00 1b mov %i3, %o0 *ovalue = ptimer->timer_data; 40006c1c: 92 06 60 54 add %i1, 0x54, %o1 40006c20: 40 00 24 14 call 4000fc70 40006c24: 94 10 20 10 mov 0x10, %o2 ptimer->timer_data = normalize; 40006c28: 94 10 20 10 mov 0x10, %o2 40006c2c: 92 07 bf f0 add %fp, -16, %o1 40006c30: 40 00 24 10 call 4000fc70 40006c34: 90 06 60 54 add %i1, 0x54, %o0 /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 40006c38: 82 10 20 03 mov 3, %g1 40006c3c: 90 07 bf e0 add %fp, -32, %o0 40006c40: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] 40006c44: 13 10 00 7a sethi %hi(0x4001e800), %o1 40006c48: 40 00 06 1f call 400084c4 <_TOD_Get_with_nanoseconds> 40006c4c: 92 12 63 b8 or %o1, 0x3b8, %o1 ! 4001ebb8 <_TOD> case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 40006c50: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006c54: 94 10 20 00 clr %o2 40006c58: 90 10 00 1c mov %i4, %o0 40006c5c: 92 10 00 1d mov %i5, %o1 40006c60: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006c64: 40 00 48 3d call 40018d58 <__divdi3> 40006c68: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006c6c: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006c70: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006c74: 94 10 20 00 clr %o2 40006c78: 92 10 00 1d mov %i5, %o1 40006c7c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006c80: 40 00 49 21 call 40019104 <__moddi3> 40006c84: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 40006c88: d2 26 60 70 st %o1, [ %i1 + 0x70 ] ptimer->timer_data = normalize; /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); _Thread_Enable_dispatch(); 40006c8c: 40 00 0c 36 call 40009d64 <_Thread_Enable_dispatch> 40006c90: b0 10 20 00 clr %i0 40006c94: 81 c7 e0 08 ret 40006c98: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 40006c9c: 40 00 21 a4 call 4000f32c <__errno> 40006ca0: b0 10 3f ff mov -1, %i0 40006ca4: 82 10 20 16 mov 0x16, %g1 40006ca8: c2 22 00 00 st %g1, [ %o0 ] } 40006cac: 81 c7 e0 08 ret 40006cb0: 81 e8 00 00 restore =============================================================================== 40006964 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 40006964: 9d e3 bf 98 save %sp, -104, %sp /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 40006968: 3b 10 00 62 sethi %hi(0x40018800), %i5 4000696c: ba 17 60 88 or %i5, 0x88, %i5 ! 40018888 <_POSIX_signals_Ualarm_timer> 40006970: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 40006974: 80 a0 60 00 cmp %g1, 0 40006978: 12 80 00 0a bne 400069a0 4000697c: b8 10 00 18 mov %i0, %i4 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40006980: 03 10 00 1a sethi %hi(0x40006800), %g1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40006984: c0 27 60 08 clr [ %i5 + 8 ] the_watchdog->routine = routine; 40006988: 82 10 61 38 or %g1, 0x138, %g1 the_watchdog->id = id; 4000698c: c0 27 60 20 clr [ %i5 + 0x20 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40006990: c2 27 60 1c st %g1, [ %i5 + 0x1c ] the_watchdog->id = id; the_watchdog->user_data = user_data; 40006994: c0 27 60 24 clr [ %i5 + 0x24 ] useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 40006998: 10 80 00 1b b 40006a04 4000699c: b0 10 20 00 clr %i0 if ( !the_timer->routine ) { _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 400069a0: 40 00 0f 92 call 4000a7e8 <_Watchdog_Remove> 400069a4: 90 10 00 1d mov %i5, %o0 if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 400069a8: 90 02 3f fe add %o0, -2, %o0 400069ac: 80 a2 20 01 cmp %o0, 1 400069b0: 18 80 00 15 bgu 40006a04 <== NEVER TAKEN 400069b4: b0 10 20 00 clr %i0 * 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); 400069b8: c2 07 60 0c ld [ %i5 + 0xc ], %g1 400069bc: d0 07 60 14 ld [ %i5 + 0x14 ], %o0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 400069c0: 92 07 bf f8 add %fp, -8, %o1 * 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); 400069c4: 90 02 00 01 add %o0, %g1, %o0 400069c8: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 400069cc: 40 00 0e 4d call 4000a300 <_Timespec_From_ticks> 400069d0: 90 22 00 01 sub %o0, %g1, %o0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 400069d4: c2 07 bf f8 ld [ %fp + -8 ], %g1 remaining += tp.tv_nsec / 1000; 400069d8: d0 07 bf fc ld [ %fp + -4 ], %o0 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 400069dc: 85 28 60 03 sll %g1, 3, %g2 400069e0: 87 28 60 08 sll %g1, 8, %g3 400069e4: 84 20 c0 02 sub %g3, %g2, %g2 remaining += tp.tv_nsec / 1000; 400069e8: 92 10 23 e8 mov 0x3e8, %o1 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 400069ec: b1 28 a0 06 sll %g2, 6, %i0 400069f0: b0 26 00 02 sub %i0, %g2, %i0 remaining += tp.tv_nsec / 1000; 400069f4: 40 00 34 d5 call 40013d48 <.div> 400069f8: b0 06 00 01 add %i0, %g1, %i0 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 400069fc: b1 2e 20 06 sll %i0, 6, %i0 remaining += tp.tv_nsec / 1000; 40006a00: b0 02 00 18 add %o0, %i0, %i0 /* * 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 ) { 40006a04: 80 a7 20 00 cmp %i4, 0 40006a08: 02 80 00 19 be 40006a6c 40006a0c: 3b 00 03 d0 sethi %hi(0xf4000), %i5 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 40006a10: 90 10 00 1c mov %i4, %o0 40006a14: 40 00 34 cb call 40013d40 <.udiv> 40006a18: 92 17 62 40 or %i5, 0x240, %o1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 40006a1c: 92 17 62 40 or %i5, 0x240, %o1 * 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; 40006a20: d0 27 bf f8 st %o0, [ %fp + -8 ] tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 40006a24: 40 00 35 73 call 40013ff0 <.urem> 40006a28: 90 10 00 1c mov %i4, %o0 40006a2c: 85 2a 20 07 sll %o0, 7, %g2 40006a30: 83 2a 20 02 sll %o0, 2, %g1 40006a34: 82 20 80 01 sub %g2, %g1, %g1 40006a38: 90 00 40 08 add %g1, %o0, %o0 40006a3c: 91 2a 20 03 sll %o0, 3, %o0 40006a40: d0 27 bf fc st %o0, [ %fp + -4 ] ticks = _Timespec_To_ticks( &tp ); 40006a44: 40 00 0e 44 call 4000a354 <_Timespec_To_ticks> 40006a48: 90 07 bf f8 add %fp, -8, %o0 if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 40006a4c: 40 00 0e 42 call 4000a354 <_Timespec_To_ticks> 40006a50: 90 07 bf f8 add %fp, -8, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40006a54: 13 10 00 62 sethi %hi(0x40018800), %o1 40006a58: 92 12 60 88 or %o1, 0x88, %o1 ! 40018888 <_POSIX_signals_Ualarm_timer> 40006a5c: d0 22 60 0c st %o0, [ %o1 + 0xc ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40006a60: 11 10 00 60 sethi %hi(0x40018000), %o0 40006a64: 40 00 0f 09 call 4000a688 <_Watchdog_Insert> 40006a68: 90 12 20 38 or %o0, 0x38, %o0 ! 40018038 <_Watchdog_Ticks_chain> } return remaining; } 40006a6c: 81 c7 e0 08 ret 40006a70: 81 e8 00 00 restore